Skip to content

Commit

Permalink
cleanup prints, address checkpoint issues, switch to use physical add…
Browse files Browse the repository at this point in the history
…ress, not logical for addr
  • Loading branch information
renau committed Feb 5, 2024
1 parent c25a132 commit f7ccd41
Show file tree
Hide file tree
Showing 21 changed files with 245 additions and 362 deletions.
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ http_archive(
name = "dromajo",
build_file = "dromajo.BUILD",
patches = ["//external:dromajo.patch"],
sha256 = "0e4d5df7194628e7c542491f909f19fbf30b230b5579014d3fb83f3acdc06532",
strip_prefix = "dromajo-e1bd5e7d0dfb95d8c1a1a108075c1cb160c74f42",
sha256 = "07fcabaf6be0a1c2d1f62ccb6ad08c1d86c49887d08967bfcde8028fb206c506",
strip_prefix = "dromajo-34598190447d8339b79069277e0f9f1ce59483d7",
urls = [
"https://github.com/masc-ucsc/dromajo/archive/e1bd5e7d0dfb95d8c1a1a108075c1cb160c74f42.zip",
"https://github.com/masc-ucsc/dromajo/archive/34598190447d8339b79069277e0f9f1ce59483d7.zip",
],
)

Expand Down
4 changes: 2 additions & 2 deletions conf/desesc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ emul = ["drom_emu"]
[drom_emu]
type = "dromajo"
# Load a Checkpoint option
#load = "ck1"
#bench = "boot.cfg"
#load = "../benchmarks/gcc_fgcse/gcc_fgcse"
# Load a Binary
bench = "conf/dhrystone.riscv"
start_roi = false
Expand Down Expand Up @@ -120,6 +119,7 @@ frequency_mhz = 200
type = "ooo" # ooo or inorder or accel
frequency_mhz = 1000
bpred = ["bp0", "bp1"]
do_random_transients = false

# Fetch parameters
fetch_align = true
Expand Down
1 change: 0 additions & 1 deletion core/callback_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ typedef CallbackFunction0<&counter_fsm> counter2_fsmCB;
int total = 0;

void counter_fsm() {

if (total & 1) {
counter2_fsmCB::create()->schedule(1); // +1cycle
} else {
Expand Down
42 changes: 15 additions & 27 deletions core/fastqueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FastQueue {

protected:
public:
FastQueue(std::size_t size) {
explicit FastQueue(std::size_t size) {
// Find the closest power of two
I(size);
pipeMask = size;
Expand All @@ -41,22 +41,15 @@ class FastQueue {
void push(Data d) {
I(nElems <= pipeMask);

// pipe[(start+nElems) & pipeMask]=d;
pipe[end] = d;
I(end == ((start + nElems) & pipeMask));
end = (end + 1) & pipeMask;
nElems++;
}


void push_pipe_in_cluster(Data d) {
pipe_in_cluster.push_back(d);
}

void pop_pipe_in_cluster() {
pipe_in_cluster.pop_back();
}
void push_pipe_in_cluster(Data d) { pipe_in_cluster.push_back(d); }

void pop_pipe_in_cluster() { pipe_in_cluster.pop_back(); }

Data top() const {
// I(nElems);
Expand All @@ -67,33 +60,31 @@ class FastQueue {
// I(nElems);
return pipe_in_cluster.back();
}

Data end_data() const {
// I(nElems);
//end is the position where new data
//is added so need to pop existing data by (end-1) position
return pipe[end-1];
I(nElems);
return pipe[end ? end - 1 : pipeMask];
}

void pop() {
I(nElems);
nElems--;
start = (start + 1) & pipeMask;
}

void pop_from_back() {
I(nElems);
nElems--;
//start = (start + 1) & pipeMask;
end = (end - 1) & pipeMask;
}


uint32_t getIDFromTop(uint32_t i) const {
[[nodiscard]] uint32_t getIDFromTop(uint32_t i) const {
I(nElems > i);
return (start + i) & pipeMask;
}

uint32_t getNextId(uint32_t id) const { return (id + 1) & pipeMask; }
bool isEnd(uint32_t id) const { return id == end; }
[[nodiscard]] uint32_t getNextId(uint32_t id) const { return (id + 1) & pipeMask; }
[[nodiscard]] bool isEnd(uint32_t id) const { return id == end; }

Data getData(uint32_t id) const {
I(id <= pipeMask);
Expand All @@ -103,10 +94,7 @@ class FastQueue {

Data topNext() const { return getData(getIDFromTop(1)); }

std::size_t size() const { return nElems; }
bool empty() const { return nElems == 0; }
bool empty_pipe_in_cluster() const {
return pipe_in_cluster.empty();
}

[[nodiscard]] std::size_t size() const { return nElems; }
[[nodiscard]] bool empty() const { return nElems == 0; }
[[nodiscard]] bool empty_pipe_in_cluster() const { return pipe_in_cluster.empty(); }
};
2 changes: 1 addition & 1 deletion core/gcobject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SmartPtr {
ref->delRef();
}
}
operator T *() const { return ref; }
operator T *() const { return ref; }
T &operator*() const { return *ref; }
T *operator->() const { return ref; }
T *operator=(T *ptr) {
Expand Down
Loading

0 comments on commit f7ccd41

Please sign in to comment.