define test functions

This commit is contained in:
trmontgomery
2020-07-21 17:45:37 -04:00
parent 340dd683eb
commit 150fc4286a
2 changed files with 66 additions and 15 deletions

View File

@@ -58,6 +58,7 @@ void CacheSim::reset() {
}
void CacheSim::step() {
std::cout << timestamp << ": [sim] step()" << std::endl;
//toggle clock
cache_->clk = 0;
this->eval();
@@ -69,6 +70,7 @@ void CacheSim::step() {
this->eval_reqs();
this->eval_rsps();
this->eval_dram_bus();
timestamp++;
}
void CacheSim::eval() {
@@ -80,14 +82,15 @@ void CacheSim::eval() {
}
void CacheSim::run(){
#ifndef NDEBUG
std::cout << timestamp << ": [sim] run()" << std::endl;
#endif
//#ifndef NDEBUG
//#endif
this->step();
int valid = 300;
while (valid > -1) {
this->step();
if(!cache_->core_req_valid && !cache_->core_rsp_valid){
valid--;