Skip to content

Commit c1e1920

Browse files
authored
roll back ti using buffer instead of deque
1 parent 5711010 commit c1e1920

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

core/LSU.cpp

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ namespace olympia
2020
replay_buffer_("replay_buffer", p->replay_buffer_size, getClock()),
2121
replay_buffer_size_(p->replay_buffer_size),
2222
replay_issue_delay_(p->replay_issue_delay),
23-
// store_buffer_("store_buffer", p->ldst_inst_queue_size, getClock()), // Add this line
24-
// store_buffer_size_(p->ldst_inst_queue_size),
25-
store_buffer_(),
23+
store_buffer_("store_buffer", p->ldst_inst_queue_size, getClock()), // Add this line
24+
store_buffer_size_(p->ldst_inst_queue_size),
2625
ready_queue_(),
2726
load_store_info_allocator_(sparta::notNull(OlympiaAllocators::getOlympiaAllocators(node))
2827
->load_store_info_allocator),
@@ -52,7 +51,7 @@ namespace olympia
5251
ldst_pipeline_.enableCollection(node);
5352
ldst_inst_queue_.enableCollection(node);
5453
replay_buffer_.enableCollection(node);
55-
// store_buffer_.enableCollection(node);
54+
store_buffer_.enableCollection(node);
5655

5756
// Startup handler for sending initial credits
5857
sparta::StartupEvent(node, CREATE_SPARTA_HANDLER(LSU, sendInitialCredits_));
@@ -185,8 +184,6 @@ namespace olympia
185184
// allocate to Store buffer
186185
if (inst_ptr->isStoreInst())
187186
{
188-
std::cout << "Dispatch: Inst type: " << (inst_ptr->isStoreInst() ? "Store" : "Load")
189-
<< " Buffer size: " << store_buffer_.size() << "\n";
190187
allocateInstToStoreBuffer_(inst_ptr);
191188
}
192189

@@ -278,23 +275,16 @@ namespace olympia
278275
sparta_assert(inst_ptr->getStatus() == Inst::Status::RETIRED,
279276
"Get ROB Ack, but the store inst hasn't retired yet!");
280277

281-
if(inst_ptr->getStatus() != Inst::Status::RETIRED) {
282-
return;
283-
}
284-
285278
if (inst_ptr->isStoreInst())
286279
{
287-
// std::cout << "RETIRE: Buffer size before:" << store_buffer_.size()
288-
// << " UID:" << inst_ptr->getUniqueID() << "\n";
289280
auto oldest_store = getOldestStore_();
290281
sparta_assert(oldest_store && oldest_store->getInstPtr()->getUniqueID() == inst_ptr->getUniqueID(),
291282
"Attempting to retire store out of order! Expected: "
292283
<< (oldest_store ? oldest_store->getInstPtr()->getUniqueID() : 0)
293284
<< " Got: " << inst_ptr->getUniqueID());
294285

295286
// Remove from store buffer -> don't actually need to send cache request
296-
sparta_assert(store_buffer_.size() > 0, "Store buffer empty on retiring store");
297-
store_buffer_.pop_front();
287+
store_buffer_.erase(store_buffer_.begin());;
298288
++stores_retired_;
299289
}
300290

@@ -969,7 +959,7 @@ namespace olympia
969959
if(store_buffer_.empty()) {
970960
return nullptr;
971961
}
972-
return store_buffer_.front();
962+
return store_buffer_.read(0);
973963
}
974964

975965
bool LSU::allOlderStoresIssued_(const InstPtr & inst_ptr)
@@ -1448,7 +1438,6 @@ namespace olympia
14481438

14491439
void LSU::flushStoreBuffer_(const FlushCriteria & criteria)
14501440
{
1451-
// std::cout << "FLUSH: Store buffer size before:" << store_buffer_.size() << "\n";
14521441
auto sb_iter = store_buffer_.begin();
14531442
while(sb_iter != store_buffer_.end()) {
14541443
auto inst_ptr = (*sb_iter)->getInstPtr();
@@ -1461,7 +1450,6 @@ namespace olympia
14611450
++sb_iter;
14621451
}
14631452
}
1464-
// std::cout << "FLUSH: Store buffer size after:" << store_buffer_.size() << "\n";
14651453
}
14661454

14671455
} // namespace olympia

core/LSU.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,8 @@ namespace olympia
147147
const uint32_t replay_issue_delay_;
148148

149149
// Store Buffer
150-
std::deque<LoadStoreInstInfoPtr> store_buffer_;
151-
// sparta::Buffer<LoadStoreInstInfoPtr> store_buffer_;
152-
// const uint32_t store_buffer_size_;
150+
sparta::Buffer<LoadStoreInstInfoPtr> store_buffer_;
151+
const uint32_t store_buffer_size_;
153152

154153
sparta::PriorityQueue<LoadStoreInstInfoPtr> ready_queue_;
155154
// MMU unit

0 commit comments

Comments
 (0)