Commit 65570b1c by songxinkai

after isca 2020

parent 3700081a
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
speed = DDR4_2400R speed = DDR4_2400R
org = DDR4_4Gb_x8 org = DDR4_4Gb_x8
# record_cmd_trace: (default is off): on, off # record_cmd_trace: (default is off): on, off
record_cmd_trace = on record_cmd_trace = off
# print_cmd_trace: (default is off): on, off # print_cmd_trace: (default is off): on, off
print_cmd_trace = off print_cmd_trace = off
......
...@@ -7,7 +7,7 @@ cc_binary( ...@@ -7,7 +7,7 @@ cc_binary(
"ram", "ram",
], ],
copts=[ copts=[
"-O3", "-O0",
"-std=c++11", "-std=c++11",
"-g", "-g",
"-Wall", "-Wall",
......
...@@ -10,44 +10,50 @@ ...@@ -10,44 +10,50 @@
using namespace ramulator; using namespace ramulator;
using namespace std; using namespace std;
#define CHANNEL_NUM 6 // #define CHANNEL_NUM 1
int main(int argc, const char *argv[]){ int main(int argc, const char *argv[]){
if (argc < 3) { if (argc < 4) {
printf("Usage: %s <configs-file> <bin-edges-file>\n" printf("Usage: %s <configs-file> <bin-edges-file>\n"
"Example: %s ramulator-configs.cfg edges.bin\n", "Example: %s ramulator-configs.cfg edges.bin\n",
argv[0], argv[0]); argv[0], argv[0]);
return 0; return 0;
} }
vector<Ram<DDR4>* > ram; vector<Ram<DDR4>* > ram;
vector<double> last_clock_;
int CHANNEL_NUM = stoi(argv[3]);
for (int i = 0; i < CHANNEL_NUM; ++i){ for (int i = 0; i < CHANNEL_NUM; ++i){
ram.push_back(new Ram<DDR4>(argv[1])); ram.push_back(new Ram<DDR4>(argv[1]));
last_clock_.push_back(double(0.0));
} }
const int vertex_unit_len = 16; const int vertex_unit_len = 16;
ifstream fedge(argv[2], ios::in|ios::binary);
int request_num = 0; int request_num = 0;
int* buf = new int[4]; int* buf = new int[4];
ifstream fedge(argv[2], ios::in|ios::binary);
long i = 0;
long total_access = 0; long total_access = 0;
cout << "channel_num: " << CHANNEL_NUM << endl;
while(!fedge.eof()){ while(!fedge.eof()){
fedge.read((char*)buf, 4*sizeof(int)); fedge.read((char*)buf, 4*sizeof(int));
if (buf[2] == 0) { if (buf[2] == 0) {
continue; continue;
}else { }else {
++total_access; ++ total_access;
++ request_num;
} }
if (i % 1000000 == 0){ if (total_access % 1000000 == 0){
cout << "edge_id: " << i << ", request_num: " << request_num cout << "edge_id: " << total_access;
<< ", clk_ns: " << ram[i%CHANNEL_NUM]->GetClockNs() cout << ", clk_ms: ";
<< ", clk_us: " << ram[i%CHANNEL_NUM]->GetClockUs() double total_delta = 0;
<< ", clk_ms: " << ram[i%CHANNEL_NUM]->GetClockMs() for (int j = 0; j < CHANNEL_NUM; ++j){
<< ", clk_s: " << ram[i%CHANNEL_NUM]->GetClockS() cout << ram[j]->GetClockMs() << ", ";
<< endl; last_clock_[j] = ram[j]->GetClockMs();
total_delta += ram[j]->GetClockMs() - last_clock_[j];
}
cout << "total_delta: " << total_delta << endl;
//break;
} }
i ++;
request_num ++;
long addr = 0 + buf[1] * vertex_unit_len * 4; long addr = 0 + buf[1] * vertex_unit_len * 4;
while (!ram[(buf[1])%CHANNEL_NUM]->AccessCommand(addr, Request::Type::READ, while (!ram[total_access%CHANNEL_NUM]->AccessCommand(addr, Request::Type::READ,
[&request_num](Request& req){ [&request_num](Request& req){
request_num --; request_num --;
assert(request_num > 0); assert(request_num > 0);
...@@ -60,12 +66,12 @@ int main(int argc, const char *argv[]){ ...@@ -60,12 +66,12 @@ int main(int argc, const char *argv[]){
ram[i]->WaitFor(1); ram[i]->WaitFor(1);
} }
} }
cout << "total_data: " << total_access << endl; // cout << "total_data: " << total_access << endl;
for (int i = 0; i < CHANNEL_NUM; ++i){ // for (int i = 0; i < CHANNEL_NUM; ++i){
cout << "Ram[" << i << "]" // cout << "Ram[" << i << "]"
<< ", total time clk_ms: " << ram[i]->GetClockMs() // << ", total time clk_ms: " << ram[i]->GetClockMs()
<< endl; // << endl;
} // }
return 0; return 0;
} }
......
#!/bin/bash #!/bin/bash
#./bazel-bin/ramulator/testram ./configs/DDR4-config.cfg $1 #./bazel-bin/ramulator/testram ./configs/DDR4-config.cfg $1
#./bazel-bin/ramulator/main ./configs/DDR4-config.cfg $1 #./bazel-bin/ramulator/main ./configs/DDR4-config.cfg $1
./bazel-bin/ramulator/testram_break ./configs/DDR4-config.cfg $1 #./bazel-bin/ramulator/testram_break ./configs/DDR4-config.cfg $1
#./bazel-bin/ramulator/read_bin_edge ./configs/DDR4-config.cfg /home/songxinkai/bin_edges/edges.reddit.fea16.bin #./bazel-bin/ramulator/read_bin_edge ./configs/DDR4-config.cfg /home/songxinkai/bin_edges/edges.reddit.fea16.bin
#./bazel-bin/ramulator/read_bin_edge ./configs/HBM-config.cfg /home/songxinkai/bin_edges/edges.reddit.fea16.bin ./bazel-bin/ramulator/read_bin_edge ./configs/DDR4-config.cfg /home/songxinkai/bin_edges/edges.reddit.fea16.bin $1
#gdb --args ./bazel-bin/ramulator/read_bin_edge ./configs/DDR4-config.cfg /LOG/group_reddit/reddit_group4096.dat
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment