POOL32A 000000 |
00000 |
rs |
011 |
GINVI 00 |
00101 |
POOL32AXf 111100 |
6 |
5 |
5 |
3 |
2 |
5 |
6 |
GINVI rs |
microMIPS Release 6 |
Global Invalidate Instruction Cache |
Global Invalidate Instruction Cache
In a multi-processor system, fully invalidate all remote primary instruction-caches, or a specified single cache. The local primary instruction cache is also fully invalidated in the case where all the remote caches are to be invalidated.
Invalidate_All_Primary_Instruction_Caches(null or rs)
Fully invalidate all remote primary instruction caches, or a specified single cache, whether local or remote. The local primary instruction cache is also fully invalidated in the case where all remote caches are to be invalidated.
If rs field of the opcode is 0, then all caches are to be invalidated. 'rs' should be specified as 0 in the assembly syntax for this case. If rs field of the opcode is not 0, then a single cache that is specified by an implementation dependent number of lower bits of GPR[rs] is invalidated, which may be the local cache itself.
Software based invalidation of the primary instruction cache is required in a system if coherency of the cache is not maintained in hardware. While typically limited to the primary cache, the scope of the invalidation within a processor is however implementation dependent - it should apply to all instruction caches within the cache hierarchy that required software coherence maintenance.
In legacy systems, it is software's responsibility to keep the instruction cache state consistent through SYNCI instructions. This instruction provides a method for bulk invalidating the instruction caches in lieu of SYNCI.
The instruction's action is considered complete when the both the local and remote cache invalidations are complete,
that is, the data in the cache is no longer available to the related instruction stream. Whether these invalidations are complete can only be determined by the completion of a SYNC (stype=0x14) that follows the invalidate instruction(s). With the completion of the SYNC operation, all global invalidations preceding the SYNC in the program are
considered globally visible.
Whether the SYNC(stype=0x14) or the global invalidate itself cause synchronization of the instruction stream to new state/context is implementation dependent.
A processor may send a global invalidate instruction remotely only when any preceding global invalidate for the program has reached a global ordering point.
The GINVI has no instruction or execution hazard barrier semantics in itself.
If the implementation allows a cache line to be locked, i.e., not replaceable during a fill, GINVI will not invalidate the line. A cache line can be locked through the optional CACHE "Fetch and Lock" instruction.
See Programming Notes for programming constraints.
If an implementation does not support the instruction, a Reserved Instruction exception is caused.
If access to Coprocessor 0 is not enabled, a Coprocessor Unusable Exception is signaled.
In a single processor SOC, this instruction acts on the local instruction cache only.
Local: if (Config5GI != 2'b1x) SignalException(ReservedInstruction) // if not implemented break endif if IsCoprocessorEnabled(0) then // Fully invalidate local instruction cache, if selected. // Send invalidation message to other cores, if required. else SignalException(CoprocessorUnusable, 0) endif Remote: // Fully invalidate remote instruction cache.
Reserved Instruction, Coprocessor Unusable
For the local processor, the instruction stream is synchronized by an instruction hazard barrier such as JR.HB.
The instruction stream in the remote processor is synchronized with respect to the execution of GINVI once the
SYNC operation following GINVI completes.
The following sequence is recommended for use of GINVI.
ginvi /* fully-invalidate all caches*/ sync 0x14 /* Enforce completion - all instruction streams synchronized. */ jr.hb ra /* Clear instruction hazards*/
Implementation Notes:
None.