Skip to content

Commit

Permalink
Merge Pull Request #2411 from heyitsanthony/sst-elements/anthony/mira…
Browse files Browse the repository at this point in the history
…nda-dyncast

Automatically Merged using SST Pull Request AutoTester
PR Title: b'miranda: check request operation instead of using dynamic_cast'
PR Author: heyitsanthony
  • Loading branch information
sst-autotester authored Nov 4, 2024
2 parents 915e52c + a25a4b7 commit 48cbb8c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/sst/elements/miranda/mirandaCPU.cc
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,10 @@ bool RequestGenCPU::clockTick(SST::Cycle_t cycle) {
break;
}

MemoryOpRequest* memOpReq;
GeneratorRequest* nxtRq = pendingRequests.at(i);
ReqOperation op = nxtRq->getOperation();

if(nxtRq->getOperation() == REQ_FENCE) {
if(op == REQ_FENCE) {
if(0 == requestsInFlight.size()) {
out->verbose(CALL_INFO, 4, 0, "Fence operation completed, no pending requests, will be retired.\n");

Expand All @@ -483,7 +483,7 @@ bool RequestGenCPU::clockTick(SST::Cycle_t cycle) {

// Fence operations do now allow anything else to complete in this cycle
break;
} else if (nxtRq->getOperation() == CUSTOM) {
} else if (op == CUSTOM) {
if (requestsPending[CUSTOM] < maxRequestsPending[CUSTOM]) {
out->verbose(CALL_INFO, 4, 0, "Will attempt to issue as free slots in the load/store unit.\n");

Expand All @@ -501,9 +501,9 @@ bool RequestGenCPU::clockTick(SST::Cycle_t cycle) {
delete nxtRq;
}
}
} else if ( ( memOpReq = dynamic_cast<MemoryOpRequest*>(nxtRq) ) ) {

if( requestsPending[memOpReq->getOperation()] < maxRequestsPending[memOpReq->getOperation()] ) {
} else if (op == READ || op == WRITE) {
if( requestsPending[op] < maxRequestsPending[op] ) {
auto memOpReq = static_cast<MemoryOpRequest*>(nxtRq);
out->verbose(CALL_INFO, 4, 0, "Will attempt to issue as free slots in the load/store unit.\n");


Expand Down
5 changes: 3 additions & 2 deletions src/sst/elements/miranda/mirandaGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,13 @@ class MemoryOpRequest : public GeneratorRequest {
const uint64_t cLength,
const ReqOperation cOpType) :
GeneratorRequest(),
addr(cAddr), length(cLength), op(cOpType) {}
addr(cAddr), length(cLength), op(cOpType)
{ assert (op == READ || op == WRITE); }

~MemoryOpRequest() {}
ReqOperation getOperation() const { return op; }
bool isRead() const { return op == READ; }
bool isWrite() const { return op == WRITE; }
bool isCustom() const { return op == CUSTOM; }
uint64_t getAddress() const { return addr; }
uint64_t getLength() const { return length; }

Expand Down

0 comments on commit 48cbb8c

Please sign in to comment.