Skip to content

Commit

Permalink
Revert "Added stat-printing-period to ChampSim to configure frequency…
Browse files Browse the repository at this point in the history
… of stat updates."

This reverts commit a3ee19b.
  • Loading branch information
cmolder committed Oct 15, 2021
1 parent a3ee19b commit 3a2c2a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
12 changes: 6 additions & 6 deletions inc/ooo_cpu.h
Expand Up @@ -3,11 +3,11 @@

#include "cache.h"

// #ifdef CRC2_COMPILE
// #define STAT_PRINTING_PERIOD 1000000
// #else
// #define STAT_PRINTING_PERIOD 1000000 // formerly 10000000
// #endif
#ifdef CRC2_COMPILE
#define STAT_PRINTING_PERIOD 1000000
#else
#define STAT_PRINTING_PERIOD 10000000
#endif
#define DEADLOCK_CYCLE 1000000

using namespace std;
Expand Down Expand Up @@ -113,7 +113,7 @@ class O3_CPU {
instrs_to_read_this_cycle = 0;
instrs_to_fetch_this_cycle = 0;

next_print_instruction = 0; // Won't print until instruction # stat_printing_period.
next_print_instruction = STAT_PRINTING_PERIOD;
num_retired = 0;

inflight_reg_executions = 0;
Expand Down
16 changes: 3 additions & 13 deletions ml_prefetch_sim.py
Expand Up @@ -11,7 +11,6 @@
default_spec_instrs = 500
default_gap_instrs = 300
default_warmup_instrs = 10
default_printing_period_instrs = 10

default_seed_file = './scripts/seeds.txt'

Expand Down Expand Up @@ -88,17 +87,11 @@
on. By specifying this, these first instructions do not get included in
the metric computation.
--stat-printing-period <num-instructions>
Number of instructions to simulate between printing out statistics.
Defaults to {default_printing_period_instrs}M instructions.
--seed-file <seed-file>
Path to seed file to load for ChampSim evaluation. Defaults to {seed_file}.
'''.format(prog=sys.argv[0], default_results_dir=default_results_dir,
default_spec_instrs=default_spec_instrs, default_gap_instrs=default_gap_instrs,
default_warmup_instrs=default_warmup_instrs,
default_printing_period_instrs=default_printing_period_instrs,
seed_file=default_seed_file),
default_warmup_instrs=default_warmup_instrs, seed_file=default_seed_file),

'eval': '''usage: {prog} eval [--results-dir <results-dir>] [--output-file <output-file>]
Expand Down Expand Up @@ -194,7 +187,6 @@ def run_command():
parser.add_argument('--results-dir', default=default_results_dir)
parser.add_argument('--num-instructions', default=None) #default_spec_instrs if execution_trace[0].isdigit() else default_gap_instrs)
parser.add_argument('--num-prefetch-warmup-instructions', default=default_warmup_instrs)
parser.add_argument('--stat-printing-period', default=default_printing_period_instrs)
parser.add_argument('--seed-file', default=default_seed_file)
parser.add_argument('--name', default='from_file')

Expand Down Expand Up @@ -229,16 +221,14 @@ def run_command():
exit(-1)

if seed is not None:
cmd = '{binary} -stat_printing_period {period}000000 -prefetch_warmup_instructions {warm}000000 -simulation_instructions {sim}000000 -seed {seed} -traces {trace} > {results}/{base_trace}-{base_binary}.txt 2>&1'.format(
cmd = '{binary} -prefetch_warmup_instructions {warm}000000 -simulation_instructions {sim}000000 -seed {seed} -traces {trace} > {results}/{base_trace}-{base_binary}.txt 2>&1'.format(
binary=binary, warm=args.num_prefetch_warmup_instructions, sim=args.num_instructions,
trace=execution_trace, seed=seed, results=args.results_dir,
period=args.stat_printing_period,
base_trace=os.path.basename(execution_trace), base_binary=os.path.basename(binary))
else:
cmd = '{binary} -stat_printing_period {period}000000 -prefetch_warmup_instructions {warm}000000 -simulation_instructions {sim}000000 -traces {trace} > {results}/{base_trace}-{base_binary}.txt 2>&1'.format(
cmd = '{binary} -prefetch_warmup_instructions {warm}000000 -simulation_instructions {sim}000000 -traces {trace} > {results}/{base_trace}-{base_binary}.txt 2>&1'.format(
binary=binary, warm=args.num_prefetch_warmup_instructions, sim=args.num_instructions,
trace=execution_trace, results=args.results_dir, base_trace=os.path.basename(execution_trace),
period=args.stat_printing_period,
base_binary=os.path.basename(binary))

print('Running "' + cmd + '"')
Expand Down
10 changes: 2 additions & 8 deletions src/main.cc
Expand Up @@ -17,7 +17,6 @@ uint8_t prefetch_warmup_complete;
uint64_t warmup_instructions = 1000000,
simulation_instructions = 10000000,
champsim_seed;
uint64_t stat_printing_period = 10000000;
uint64_t prefetch_warmup_instructions = 10000000;
uint8_t all_prefetch_warmup_complete = 0;
time_t start_time;
Expand Down Expand Up @@ -535,7 +534,6 @@ int main(int argc, char** argv)
{"warmup_instructions", required_argument, 0, 'w'},
{"simulation_instructions", required_argument, 0, 'i'},
{"prefetch_warmup_instructions", required_argument, 0, 'p'},
{"stat_printing_period", required_argument, 0, 's'},
{"hide_heartbeat", no_argument, 0, 'h'},
{"cloudsuite", no_argument, 0, 'c'},
{"low_bandwidth", no_argument, 0, 'b'},
Expand Down Expand Up @@ -571,9 +569,6 @@ int main(int argc, char** argv)
if(prefetch_warmup_instructions < 10000000)
prefetch_warmup_instructions = 10000000;
break;
case 's':
stat_printing_period = atol(optarg);
break;
case 'h':
show_heartbeat = 0;
break;
Expand Down Expand Up @@ -602,7 +597,6 @@ int main(int argc, char** argv)
cout << "Warmup Instructions: " << warmup_instructions << endl;
cout << "Prefetch Warmup Instructions: " << prefetch_warmup_instructions << endl;
cout << "Simulation Instructions: " << simulation_instructions << endl;
cout << "Stat Printing Period: " << stat_printing_period << endl;
//cout << "Scramble Loads: " << (knob_scramble_loads ? "ture" : "false") << endl;
cout << "Number of CPUs: " << NUM_CPUS << endl;
cout << "LLC sets: " << LLC_SET << endl;
Expand Down Expand Up @@ -734,7 +728,6 @@ int main(int argc, char** argv)
ooo_cpu[i].cpu = i;
ooo_cpu[i].warmup_instructions = prefetch_warmup_instructions;
ooo_cpu[i].simulation_instructions = simulation_instructions;
ooo_cpu[i].next_print_instruction = stat_printing_period;
ooo_cpu[i].begin_sim_cycle = 0;
ooo_cpu[i].begin_sim_instr = prefetch_warmup_instructions;

Expand Down Expand Up @@ -887,6 +880,7 @@ int main(int argc, char** argv)
ooo_cpu[i].read_from_trace();
}
}

// heartbeat information
if (show_heartbeat && (ooo_cpu[i].num_retired >= ooo_cpu[i].next_print_instruction)) {
float cumulative_ipc;
Expand All @@ -899,7 +893,7 @@ int main(int argc, char** argv)
cout << "Heartbeat CPU " << i << " instructions: " << ooo_cpu[i].num_retired << " cycles: " << current_core_cycle[i];
cout << " heartbeat IPC: " << heartbeat_ipc << " cumulative IPC: " << cumulative_ipc;
cout << " (Simulation time: " << elapsed_hour << " hr " << elapsed_minute << " min " << elapsed_second << " sec) " << endl;
ooo_cpu[i].next_print_instruction += stat_printing_period;
ooo_cpu[i].next_print_instruction += STAT_PRINTING_PERIOD;

ooo_cpu[i].last_sim_instr = ooo_cpu[i].num_retired;
ooo_cpu[i].last_sim_cycle = current_core_cycle[i];
Expand Down

0 comments on commit 3a2c2a3

Please sign in to comment.