The LSQ built into Simics is based on the instruction tree. Store transactions are kept in the tree to make it possible to inspect the store queue state in the different speculation paths.
Inserting a store transaction in the queue takes no time and the LSQ has an infinite size. It is up to the user module to set delays and restrictions to limit the LSQ.
The LSQ enforces program-order consistency. The following rules apply:
If the load is not blocked, it is matched against speculative stores in the LSQ (in the corresponding execution path). If matches are found, the data is retrieved from the LSQ. If more data is needed, the load is sent to memory. The resulting data is merged with the LSQ data and the result is returned to the processor.
When the instruction enters the retire phase, the corresponding stores are sent to memory (in order if the instruction has performed several). The LSQ searches for potential conflicting stores and forces stores that would overlap each other to execute in-order.
The granularity can be set by an attribute in the processor object, <processor>.lock_granularity. If set to zero atomic instructions will not be blocked and it is up to the processor model to avoid deadlocks. If set to non-zero it should be set to the same granularity as set for the ram objects. The default granularity is 8 bytes which is the same as the default granularity for the ram object.
Some memory transactions bypass the LSQ:
The internal LSQ can be disabled by setting the attribute lsq_enabled to 0 in each CPU object. When the LSQ is disabled all memory transactions are sent to memory during the execution phase. The retire phase thus becomes superfluous and proceeding instructions through it will have no effect.
Note that when the LSQ is turned off program order consistency will not be maintained any longer by Simics. It is up to the timing model to ensure that memory operations does not complete in wrong order. It is therefore strongly recommended that the LSQ never disabled unless you are 100% sure of what you are doing.
The main reason for disabling the LSQ would be if a model of a memory system should be simulated that is more relaxed than what is allowed by the internal LSQ.