Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistent behavior between NEMU and XiangShan in rdtime inst, fix some type errors #207

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/checkpoint/path_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PathManager
std::string configName;
std::string workloadName;

int cptID;
uint64_t cptID;

std::string workloadPath;
fs::path outputPath;
Expand All @@ -43,7 +43,7 @@ class PathManager

void incCptID();

int getCptID() const {return cptID;}
uint64_t getCptID() const {return cptID;}

std::string getOutputPath() const;

Expand Down
2 changes: 1 addition & 1 deletion include/checkpoint/serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Serializer

uint64_t intervalSize{10 * 1000 * 1000};

int cptID;
uint64_t cptID;
std::string weightIndicator;

const uint32_t IntRegStartAddr;
Expand Down
6 changes: 3 additions & 3 deletions src/checkpoint/path_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void PathManager::init() {
// cptID = cpt_id;
// }

Log("Cpt id: %i", cptID);
Log("Cpt id: %li", cptID);

workloadPath = statsBaseDir + "/" + configName + "/" + workloadName + "/";

Expand All @@ -77,7 +77,7 @@ void PathManager::setSimpointProfilingOutputDir() {

void PathManager::setCheckpointingOutputDir() {
//set checkpoint id
cptID=serializer.next_index();
cptID = serializer.next_index();
if (checkpoint_state!=NoCheckpoint) {
std::string output_path = workloadPath;
output_path += to_string(cptID) + "/";
Expand All @@ -93,7 +93,7 @@ void PathManager::setCheckpointingOutputDir() {
}

void PathManager::incCptID() {
cptID=serializer.next_index();
cptID = serializer.next_index();
}

std::string PathManager::getOutputPath() const {
Expand Down
2 changes: 1 addition & 1 deletion src/checkpoint/serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void Serializer::serializePMem(uint64_t inst_count) {
if (!fp) {
xpanic("Cannot open restorer %s\n", restorer);
}
uint32_t restorer_size = 0x400;
uint32_t restorer_size = 0xf00;
fseek(fp, 0, SEEK_SET);
assert(restorer_size == fread(pmem, 1, restorer_size, fp));
fclose(fp);
Expand Down
11 changes: 9 additions & 2 deletions src/isa/riscv64/system/priv.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,15 @@ if (is_read(vsie)) { return (mie->val & (hideleg->val & (mideleg->val
#endif // CONFIG_FPU_NONE
}
#ifndef CONFIG_SHARE
else if (is_read(mtime)) { difftest_skip_ref(); return clint_uptime(); }
#endif
else if (is_read(mtime)) {
#ifdef CONFIG_USE_XS_ARCH_CSRS
longjmp_exception(EX_II);
#else // CONFIG_USE_XS_ARCH_CSRS
difftest_skip_ref();
return clint_uptime();
#endif // CONFIG_USE_XS_ARCH_CSRS
}
#endif // CONFIG_SHARE
#ifndef CONFIG_RVH
if (is_read(mip)) { difftest_skip_ref(); }
#endif
Expand Down
Loading