Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
h0lyalg0rithm committed Nov 1, 2023
1 parent eb58602 commit bd24775
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions core/LSU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,22 +550,15 @@ namespace olympia
sparta_assert(mem_access_info_ptr->getCacheState() == MemoryAccessInfo::CacheState::HIT,
"Load instruction cannot complete when cache is still a miss! " << mem_access_info_ptr);

// TODO: Investigate why the stage is called twice
if(load_store_info_ptr->isRetired() || inst_ptr->getStatus() == Inst::Status::COMPLETED){
ILOG("Inst was already completed or retired " << load_store_info_ptr);
if(!load_store_info_ptr->getIssueQueueIterator().isValid()){
ILOG("Load was removed previously " << load_store_info_ptr);
if(isReadyToIssueInsts_())
{
uev_issue_inst_.schedule(sparta::Clock::Cycle(0));
}
return;
}
}else{
// Update instruction status
inst_ptr->setStatus(Inst::Status::COMPLETED);
if (load_store_info_ptr->isRetired() || inst_ptr->getStatus() == Inst::Status::COMPLETED)
{
ILOG("Load was previously completed or retired " << load_store_info_ptr);
return;
}

// Mark instruction as completed
inst_ptr->setStatus(Inst::Status::COMPLETED);

// Remove completed instruction from queues
ILOG("Removed issue queue " << inst_ptr);
popIssueQueue_(load_store_info_ptr);
Expand Down Expand Up @@ -615,8 +608,7 @@ namespace olympia
sparta_assert(mem_access_info_ptr->getMMUState() == MemoryAccessInfo::MMUState::HIT,
"Store inst cannot finish when cache is still a miss! " << inst_ptr);

// TODO: Investigate why the stage is called twice
if(load_store_info_ptr->isRetired() && !load_store_info_ptr->getIssueQueueIterator().isValid()){
if(!load_store_info_ptr->getIssueQueueIterator().isValid()){
ILOG("Inst was already retired " << load_store_info_ptr);
return;
}
Expand Down

0 comments on commit bd24775

Please sign in to comment.