From 2fbdfc3cb77b15f129e1a2ea99ad67a7fb79899c Mon Sep 17 00:00:00 2001 From: Ting-Jun Wang Date: Sat, 22 Jan 2022 19:37:47 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E6=B8=85=E9=99=A4=20test=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 3 --- set.cpp | 26 -------------------------- simulator.cpp | 5 ----- 3 files changed, 34 deletions(-) diff --git a/main.cpp b/main.cpp index e373753..b24b84f 100644 --- a/main.cpp +++ b/main.cpp @@ -40,7 +40,6 @@ int main(int argc, char* argv[]){ bool status; std::vector> Result; while(std::cin >> action >> address){ - // std::cout << "action: "<< action << " address: " << address << std::endl; tuple status = Sim->read(address); Result.push_back( std::make_tuple( @@ -51,14 +50,12 @@ int main(int argc, char* argv[]){ std::get<2>(status) ) ); - // std::cout << std::endl << std::endl; } // FIFO int allCount = 0, hitCount = 0; // std::cout << argv[1] << " Replace Policy:" << std::endl; for(int i=0; i(Result[i])){ hitCount++; diff --git a/set.cpp b/set.cpp index 146ac8a..62ef4af 100644 --- a/set.cpp +++ b/set.cpp @@ -66,14 +66,6 @@ tuple Set::read(vector tag, short offset){ this->blocks[maxIndex].update(tag); this->blocks[maxIndex].access(); writeWay = maxIndex; - - // for(int i=0; iwaySize; i++){ - // vector t = this->blocks[i].getTag(); - // for(int j=0; jcountAccess(baseAccessTime); @@ -86,22 +78,4 @@ void Set::countAccess(short baseAccessTime){ this->blocks[i].countAccess(); } } - // for(int i=0; i<20; i++){ - // cout << "=" ; - // } - // cout << "way 狀態"; - // for(int i=0; i<20; i++){ - // cout << "="; - // } - // cout<waySize; i++){ - // cout << this->blocks[i].getAccessTime() << " "; - // } - // cout<getValue(addrBits, "index"); short offset = this->getValue(addrBits, "offset"); vector tag(addrBits.begin(), addrBits.begin()+this->tagSize); - // std::cout<<"更新 index: "< setResult = this->sets[index].read(tag, offset); return std::make_tuple(