Skip to content

Commit

Permalink
cpu-o3: non-blocking storebuffer
Browse files Browse the repository at this point in the history
Change-Id: Id72033c713686fdd631d9217b7385db4b9189811
  • Loading branch information
tastynoob committed Oct 12, 2024
1 parent 69f3fca commit ae149b9
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 199 deletions.
6 changes: 3 additions & 3 deletions src/cpu/o3/BaseO3CPU.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def support_take_over(cls):
SQEntries = Param.Unsigned(64, "Number of store queue entries")

SbufferEntries = Param.Unsigned(16, "Number of store buffer entries")
SbufferEvictThreshold = Param.Unsigned(12, "store buffer eviction threshold")
storeBufferInactiveThreshold = Param.Unsigned(100, "store buffer writeback timeout threshold")
SbufferEvictThreshold = Param.Unsigned(8, "store buffer eviction threshold")
storeBufferInactiveThreshold = Param.Unsigned(800, "store buffer writeback timeout threshold")

LSQDepCheckShift = Param.Unsigned(0,
"Number of places to shift addr before check")
Expand Down Expand Up @@ -191,7 +191,7 @@ def support_take_over(cls):
numPhysRMiscRegs = Param.Unsigned(40, "Number of physical renameable misc registers")

numDQEntries = Param.Unsigned(18, "Number of entries in the dispQue")
numROBEntries = Param.Unsigned(256, "Number of reorder buffer entries")
numROBEntries = Param.Unsigned(320, "Number of reorder buffer entries")

smtNumFetchingThreads = Param.Unsigned(1, "SMT Number of Fetching Threads")
smtFetchPolicy = Param.SMTFetchPolicy('RoundRobin', "SMT Fetch policy")
Expand Down
1 change: 0 additions & 1 deletion src/cpu/o3/issue_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ Scheduler::insert(const DynInstPtr& inst)
auto& iqs = dispTable[inst->opClass()];
bool inserted = false;

// std::round
std::random_shuffle(iqs.begin(), iqs.end());
for (auto iq : iqs) {
if (iq->ready()) {
Expand Down
3 changes: 1 addition & 2 deletions src/cpu/o3/issue_queue.hh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class IssueQue : public SimObject
public:
inline void clearBusy(uint32_t pi) { portBusy.at(pi) = 0; }


IssueQue(const IssueQueParams &params);
void setIQID(int id) { IQID = id; }
void setCPU(CPU* cpu);
Expand All @@ -147,7 +146,7 @@ class IssueQue : public SimObject
void tick();
bool full();
bool ready();
int emptyEntries() const { return instNum; }
int emptyEntries() const { return iqsize - instNum; }
void insert(const DynInstPtr& inst);
void insertNonSpec(const DynInstPtr& inst);

Expand Down
7 changes: 3 additions & 4 deletions src/cpu/o3/lsq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1318,8 +1318,8 @@ LSQ::SbufferRequest::recvTimingResp(PacketPtr pkt)
{
// Dump inst num, request addr, and packet addr
DPRINTF(StoreBuffer,
"Sbuffer Req::recvTimingResp: entry[%#x] sbuffer index: %lu\n",
_packets[0]->getAddr(), this->sbuffer_index);
"Sbuffer Req::recvTimingResp: entry[%#x]\n",
_packets[0]->getAddr());
assert(_numOutstandingPackets == 1);
flags.set(Flag::Complete);
assert(pkt == _packets.front());
Expand Down Expand Up @@ -1485,8 +1485,7 @@ LSQ::SbufferRequest::sendPacketToCache()
{
assert(_numOutstandingPackets == 0);
bool success = _port.sbufferSendPacket(_packets.at(0));
DPRINTF(StoreBuffer, "Sbuffer Req::sendPacketToCache: entry[%#x] sbuffer index: %lu\n", _packets[0]->getAddr(),
this->sbuffer_index);
DPRINTF(StoreBuffer, "Sbuffer Req::sendPacketToCache: entry[%#x]\n", _packets[0]->getAddr());
if (success) {
_numOutstandingPackets = 1;
}
Expand Down
3 changes: 2 additions & 1 deletion src/cpu/o3/lsq.hh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ namespace o3
class CPU;
class IEW;
class LSQUnit;
class StoreBufferEntry;

class LSQ
{
Expand Down Expand Up @@ -686,7 +687,7 @@ class LSQ
{
CPU* cpu;
public:
uint64_t sbuffer_index=-1;
StoreBufferEntry* sbuffer_entry=nullptr;
SbufferRequest(CPU* cpu, LSQUnit* port, Addr blockpaddr, uint8_t* data);

void addReq(Addr blockVaddr, Addr blockPaddr, const std::vector<bool> byteEnable);
Expand Down
Loading

0 comments on commit ae149b9

Please sign in to comment.