summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli/cli.cc3
-rw-r--r--src/storage/cache.cc4
-rw-r--r--src/utils/accessor.cc4
-rw-r--r--src/utils/response.cc2
-rw-r--r--src/utils/utils.cc10
5 files changed, 14 insertions, 9 deletions
diff --git a/src/cli/cli.cc b/src/cli/cli.cc
index 022b266..58575cb 100644
--- a/src/cli/cli.cc
+++ b/src/cli/cli.cc
@@ -3,6 +3,7 @@
#include "definitions.h"
#include "dram.h"
#include "response.h"
+#include "accessor.h"
#include "utils.h"
#include <iostream>
@@ -43,6 +44,7 @@ Cli::Cli()
};
commands['r'] = [this](std::vector<std::string> args) {
+ (void)args;
reset();
return;
};
@@ -61,6 +63,7 @@ Cli::Cli()
};
commands['h'] = [this](std::vector<std::string> args) {
+ (void)args;
help();
return;
};
diff --git a/src/storage/cache.cc b/src/storage/cache.cc
index dccab47..80f59ef 100644
--- a/src/storage/cache.cc
+++ b/src/storage/cache.cc
@@ -69,7 +69,7 @@ Response Cache::process(
Response r = this->is_access_cleared(accessor, address);
if (r == OK) {
int tag, index, offset;
- get_bit_fields(address, &tag, &index, &offset);
+ get_cache_fields(address, &tag, &index, &offset);
request_handler(index, offset);
}
return r;
@@ -104,7 +104,7 @@ void Cache::handle_miss(int expected)
std::array<signed int, LINE_SIZE> *actual;
std::array<int, 2> *meta;
- get_bit_fields(expected, &tag, &index, &offset);
+ get_cache_fields(expected, &tag, &index, &offset);
r = OK;
meta = &this->meta.at(index);
actual = &this->data->at(index);
diff --git a/src/utils/accessor.cc b/src/utils/accessor.cc
index 86484c5..99347ed 100644
--- a/src/utils/accessor.cc
+++ b/src/utils/accessor.cc
@@ -3,6 +3,8 @@
std::ostream &operator<<(std::ostream &os, Accessor a)
{
- const std::string nameA[] = {"IDLE", "MEM", "FETCH", "L1CACHE", "SIDE"};
+ const std::string nameA[] = {
+ "IDLE", "WRITE", "MEM", "EXEC", "DCDE", "FETCH", "L1CACHE", "SIDE",
+ };
return os << nameA[a];
}
diff --git a/src/utils/response.cc b/src/utils/response.cc
index def6578..3d6e439 100644
--- a/src/utils/response.cc
+++ b/src/utils/response.cc
@@ -3,6 +3,6 @@
std::ostream &operator<<(std::ostream &os, Response r)
{
- const std::string nameR[] = {"OK", "WAIT", "BLOCKED"};
+ const std::string nameR[] = {"OK", "WAIT", "BLOCKED", "STALLED"};
return os << nameR[r];
}
diff --git a/src/utils/utils.cc b/src/utils/utils.cc
index 3a11c2c..e12a0e0 100644
--- a/src/utils/utils.cc
+++ b/src/utils/utils.cc
@@ -4,10 +4,9 @@
#include <string>
#include <vector>
-void get_bit_fields(int address, int *tag, int *index, int *offset)
+void get_cache_fields(int address, int *tag, int *index, int *offset)
{
- *tag = GET_MID_BITS(
- address, L1_CACHE_LINE_SPEC + LINE_SPEC, MEM_WORD_SPEC);
+ *tag = GET_MID_BITS(address, L1_CACHE_LINE_SPEC + LINE_SPEC, MEM_WORD_SPEC);
*index = GET_MID_BITS(address, LINE_SPEC, L1_CACHE_LINE_SPEC + LINE_SPEC);
*offset = GET_LS_BITS(address, LINE_SPEC);
}
@@ -28,8 +27,9 @@ const std::string string_format(const char *const zcFormat, ...)
return std::string(zc.data(), iLen);
}
-int wrap_address(int address) {
- if (address < 0){
+int wrap_address(int address)
+{
+ if (address < 0) {
return ((address % MEM_WORDS) + MEM_WORDS) % MEM_WORDS;
}
return address % MEM_WORDS;