Commit 65570b1c by songxinkai

after isca 2020

parent 3700081a
......@@ -9,7 +9,7 @@
speed = DDR4_2400R
org = DDR4_4Gb_x8
# 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 = off
......
......@@ -7,7 +7,7 @@ cc_binary(
"ram",
],
copts=[
"-O3",
"-O0",
"-std=c++11",
"-g",
"-Wall",
......
......@@ -10,44 +10,50 @@
using namespace ramulator;
using namespace std;
#define CHANNEL_NUM 6
// #define CHANNEL_NUM 1
int main(int argc, const char *argv[]){
if (argc < 3) {
if (argc < 4) {
printf("Usage: %s <configs-file> <bin-edges-file>\n"
"Example: %s ramulator-configs.cfg edges.bin\n",
argv[0], argv[0]);
return 0;
}
vector<Ram<DDR4>* > ram;
vector<double> last_clock_;
int CHANNEL_NUM = stoi(argv[3]);
for (int i = 0; i < CHANNEL_NUM; ++i){
ram.push_back(new Ram<DDR4>(argv[1]));
last_clock_.push_back(double(0.0));
}
const int vertex_unit_len = 16;
ifstream fedge(argv[2], ios::in|ios::binary);
int request_num = 0;
int* buf = new int[4];
ifstream fedge(argv[2], ios::in|ios::binary);
long i = 0;
long total_access = 0;
cout << "channel_num: " << CHANNEL_NUM << endl;
while(!fedge.eof()){
fedge.read((char*)buf, 4*sizeof(int));
if (buf[2] == 0) {
continue;
}else {
++total_access;
++ total_access;
++ request_num;
}
if (i % 1000000 == 0){
cout << "edge_id: " << i << ", request_num: " << request_num
<< ", clk_ns: " << ram[i%CHANNEL_NUM]->GetClockNs()
<< ", clk_us: " << ram[i%CHANNEL_NUM]->GetClockUs()
<< ", clk_ms: " << ram[i%CHANNEL_NUM]->GetClockMs()
<< ", clk_s: " << ram[i%CHANNEL_NUM]->GetClockS()
<< endl;
if (total_access % 1000000 == 0){
cout << "edge_id: " << total_access;
cout << ", clk_ms: ";
double total_delta = 0;
for (int j = 0; j < CHANNEL_NUM; ++j){
cout << ram[j]->GetClockMs() << ", ";
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;
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 --;
assert(request_num > 0);
......@@ -60,12 +66,12 @@ int main(int argc, const char *argv[]){
ram[i]->WaitFor(1);
}
}
cout << "total_data: " << total_access << endl;
for (int i = 0; i < CHANNEL_NUM; ++i){
cout << "Ram[" << i << "]"
<< ", total time clk_ms: " << ram[i]->GetClockMs()
<< endl;
}
// cout << "total_data: " << total_access << endl;
// for (int i = 0; i < CHANNEL_NUM; ++i){
// cout << "Ram[" << i << "]"
// << ", total time clk_ms: " << ram[i]->GetClockMs()
// << endl;
// }
return 0;
}
......
#!/bin/bash
#./bazel-bin/ramulator/testram ./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/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