Skip to content

Commit

Permalink
new LDBP interface -> optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
akashsridhar authored and renau committed Apr 19, 2020
1 parent 1c891ec commit 575a0e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
7 changes: 3 additions & 4 deletions simu/libcore/FetchEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ void FetchEngine::realfetch(IBucket *bucket, EmulInterface *eint, FlowID fid, in
AddrType curr_addr = DL1->lor_vec[lor_idx].ld_start + q_idx * DL1->lor_vec[lor_idx].ld_delta;
int valid = DL1->lot_vec[lor_idx].valid[q_idx];
AddrType q_addr = DL1->lot_vec[lor_idx].tl_addr[q_idx];
MSG("LDBP@F clk=%d br_id=%d brpc=%llx curr_addr=%d q_addr=%d valid=%d", globalClock, dinst->getID(), dinst->getPC(), curr_addr, q_addr, valid);
//MSG("LDBP@F clk=%d br_id=%d brpc=%llx ldpc=%llx curr_addr=%d q_addr=%d q_id=%d valid=%d", globalClock, dinst->getID(), dinst->getPC(), ldpc, curr_addr, q_addr, q_idx, valid);
if(!DL1->lot_vec[lor_idx].valid[q_idx]) {
all_data_valid = false;
}
Expand Down Expand Up @@ -1059,16 +1059,15 @@ void FetchEngine::realfetch(IBucket *bucket, EmulInterface *eint, FlowID fid, in
int bot_idx = DL1->return_bot_index(dinst->getPC());
if(bot_idx != -1) {
//int q_idx = (DL1->bot_vec[bot_idx].outcome_ptr) % DL1->getLotQueueSize();
DL1->bot_vec[bot_idx].valid.clear();
DL1->bot_vec[bot_idx].reset_valid();
DL1->bot_vec[bot_idx].outcome_ptr = 1;
for(int i = 0; i < DL1->bot_vec[bot_idx].load_ptr.size(); i++) {
AddrType ldpc = DL1->bot_vec[bot_idx].load_ptr[i];
int lor_idx = DL1->return_lor_index(ldpc);
if(lor_idx != -1) {
//reset lor.data_pos
DL1->lor_vec[lor_idx].data_pos = 1;
DL1->lot_vec[lor_idx].valid.clear();
DL1->lot_vec[lor_idx].tl_addr.clear();
DL1->lot_vec[lor_idx].reset_valid();
}
}
}
Expand Down
15 changes: 14 additions & 1 deletion simu/libcore/MemObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ class MemObj {
std::vector<DataType> data = std::vector<DataType>(LOT_QUEUE_SIZE);
std::vector<AddrType> tl_addr = std::vector<AddrType>(LOT_QUEUE_SIZE);
std::vector<int> valid = std::vector<int>(LOT_QUEUE_SIZE);

void reset_valid() {
for(int i = 0; i < LOT_QUEUE_SIZE; i++) {
tl_addr[i] = 0;
valid[i] = 0;
}
}
};

std::vector<load_outcome_table> lot_vec = std::vector<load_outcome_table>(LOR_SIZE);
Expand All @@ -193,8 +200,14 @@ class MemObj {

AddrType brpc;
int outcome_ptr; //position in cir_queue to use for prediction
std::vector<AddrType> load_ptr = std::vector<AddrType>(4);
std::vector<AddrType> load_ptr = std::vector<AddrType>(16);
std::vector<int> valid = std::vector<int>(LOT_QUEUE_SIZE);

void reset_valid() {
for(int i = 0; i < LOT_QUEUE_SIZE; i++) {
valid[i] = 0;
}
}
};

std::vector<branch_outcome_table> bot_vec = std::vector<branch_outcome_table>(BOT_SIZE);
Expand Down

0 comments on commit 575a0e5

Please sign in to comment.