activity = Param.Unsigned(0, "Initial count")
cacheStorePorts = Param.Unsigned(200, "Cache Ports. "
- "Constrains stores only. Loads are constrained by load FUs.")
+ "Constrains stores only.")
+ cacheLoadPorts = Param.Unsigned(200, "Cache Ports. "
+ "Constrains loads only.")
decodeToFetchDelay = Param.Cycles(1, "Decode to fetch delay")
renameToFetchDelay = Param.Cycles(1 ,"Rename to fetch delay")
int entryAmount(ThreadID num_threads);
/** Ticks the LSQ. */
- void tick() { usedStorePorts = 0; }
+ void tick();
/** Inserts a load into the LSQ. */
void insertLoad(const DynInstPtr &load_inst);
/** Set D-cache blocked status */
void cacheBlocked(bool v);
/** Is any store port available to use? */
- bool storePortAvailable() const;
+ bool cachePortAvailable(bool is_load) const;
/** Another store port is in use */
- void storePortBusy();
+ void cachePortBusy(bool is_load);
protected:
/** D-cache is blocked */
int cacheStorePorts;
/** The number of used cache ports in this cycle by stores. */
int usedStorePorts;
+ /** The number of cache ports available each cycle (loads only). */
+ int cacheLoadPorts;
+ /** The number of used cache ports in this cycle by loads. */
+ int usedLoadPorts;
/** The LSQ policy for SMT mode. */
: cpu(cpu_ptr), iewStage(iew_ptr),
_cacheBlocked(false),
cacheStorePorts(params->cacheStorePorts), usedStorePorts(0),
+ cacheLoadPorts(params->cacheLoadPorts), usedLoadPorts(0),
lsqPolicy(params->smtLSQPolicy),
LQEntries(params->LQEntries),
SQEntries(params->SQEntries),
}
}
+template <class Impl>
+void
+LSQ<Impl>::tick()
+{
+ // Re-issue loads which got blocked on the per-cycle load ports limit.
+ if (usedLoadPorts == cacheLoadPorts && !_cacheBlocked)
+ iewStage->cacheUnblocked();
+
+ usedLoadPorts = 0;
+ usedStorePorts = 0;
+}
+
template<class Impl>
bool
LSQ<Impl>::cacheBlocked() const
template<class Impl>
bool
-LSQ<Impl>::storePortAvailable() const
+LSQ<Impl>::cachePortAvailable(bool is_load) const
{
- return usedStorePorts < cacheStorePorts;
+ bool ret;
+ if (is_load) {
+ ret = usedLoadPorts < cacheLoadPorts;
+ } else {
+ ret = usedStorePorts < cacheStorePorts;
+ }
+ return ret;
}
template<class Impl>
void
-LSQ<Impl>::storePortBusy()
+LSQ<Impl>::cachePortBusy(bool is_load)
{
- usedStorePorts++;
- assert(usedStorePorts <= cacheStorePorts);
+ assert(cachePortAvailable(is_load));
+ if (is_load) {
+ usedLoadPorts++;
+ } else {
+ usedStorePorts++;
+ }
}
template<class Impl>
storeWBIt->valid() &&
storeWBIt->canWB() &&
((!needsTSO) || (!storeInFlight)) &&
- lsq->storePortAvailable()) {
+ lsq->cachePortAvailable(false)) {
if (isStoreBlocked) {
DPRINTF(LSQUnit, "Unable to write back any more stores, cache"
auto state = dynamic_cast<LSQSenderState*>(data_pkt->senderState);
- if (!lsq->cacheBlocked() && (isLoad || lsq->storePortAvailable())) {
+ if (!lsq->cacheBlocked() &&
+ lsq->cachePortAvailable(isLoad)) {
if (!dcachePort->sendTimingReq(data_pkt)) {
ret = false;
cache_got_blocked = true;
if (ret) {
if (!isLoad) {
- lsq->storePortBusy();
isStoreBlocked = false;
}
+ lsq->cachePortBusy(isLoad);
state->outstanding++;
state->request()->packetSent();
} else {
}
state->request()->packetNotSent();
}
-
return ret;
}