Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Commit 00f002e

Browse files
committed
Update ccnuma_fs scripts.
1 parent 2a1be37 commit 00f002e

10 files changed

+117
-9
lines changed

compile_ALPHA.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22
#scons build/ALPHA/gem5.fast
3-
scons build/ALPHA_MESI_Two_Level/gem5.opt
3+
#scons build/ALPHA_MESI_Two_Level/gem5.opt
4+
scons build/ALPHA_MESI_Two_Level/gem5.opt TRACING_ON=1
45
#~ scons build/ARM/gem5.fast -j2
56
#scons build/ALPHA_MESI_CMP_directory/gem5.fast -j2

configs/common/Options.py

+2
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ def addCommonOptions(parser):
205205
help="switch from timing to Detailed CPU after warmup period of <N>")
206206
parser.add_option("-p", "--prog-interval", type="str",
207207
help="CPU Progress Interval")
208+
parser.add_option("--two-phase", action="store",
209+
help="switch from atomic to timing CPU after kernel boots")
208210

209211
# Fastforwarding and simpoint related materials
210212
parser.add_option("-W", "--warmup-insts", action="store", type="int",

configs/common/Simulation.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def setCPUClass(options):
7878
if options.restore_with_cpu != options.cpu_type:
7979
CPUClass = TmpClass
8080
TmpClass, test_mem_mode = getCPUClass(options.restore_with_cpu)
81-
elif options.fast_forward:
81+
elif options.fast_forward or options.two_phase:
8282
CPUClass = TmpClass
8383
TmpClass = AtomicSimpleCPU
8484
test_mem_mode = 'atomic'
@@ -633,6 +633,9 @@ def run(options, root, testsys, cpu_class):
633633
print "Switch at instruction count:%s" % \
634634
str(testsys.cpu[0].max_insts_any_thread)
635635
exit_event = m5.simulate()
636+
elif options.two_phase:
637+
print "Switch after kernel boots"
638+
exit_event = m5.simulate()
636639
else:
637640
print "Switch at curTick count:%s" % str(10000)
638641
exit_event = m5.simulate(10000)
@@ -682,7 +685,7 @@ def run(options, root, testsys, cpu_class):
682685
restoreSimpointCheckpoint()
683686

684687
else:
685-
if options.fast_forward:
688+
if options.fast_forward or options.two_phase:
686689
m5.stats.reset()
687690
print "**** REAL SIMULATION ****"
688691

configs/numa/ccnuma_FSConfig.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ def childImage(self, ci):
5454
self.image.child.image_file = ci
5555

5656
class MemBus(SystemXBar):
57+
# pass
58+
badaddr_responder = BadAddr()
59+
default = Self.badaddr_responder.pio
60+
61+
class CoherentSystemBus(SystemXBar):
62+
badaddr_responder = BadAddr()
63+
default = Self.badaddr_responder.pio
64+
65+
class NonCoherentSystemBus(IOXBar):
5766
badaddr_responder = BadAddr()
5867
default = Self.badaddr_responder.pio
5968

@@ -64,7 +73,7 @@ def fillInCmdline(mdesc, template, **kwargs):
6473
kwargs.setdefault('script', mdesc.script())
6574
return template % kwargs
6675

67-
def makeLinuxAlphaSystem(mem_mode, mdesc=None, ruby=False, cmdline=None):
76+
def makeLinuxAlphaSystem(mem_mode, options, mdesc=None, cmdline=None):
6877
class BaseTsunami(Tsunami):
6978
ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0)
7079
ide = IdeController(disks=[Parent.disk0, Parent.disk2],
@@ -88,7 +97,13 @@ class BaseTsunami(Tsunami):
8897
self.tsunami.ethernet.pio = self.iobus.master
8998
self.tsunami.ethernet.config = self.iobus.master
9099

91-
self.systembus = IOXBar()
100+
self.systembus = MemBus()
101+
# self.systembus = IOXBar()
102+
103+
# if options.caches or options.l2cache:
104+
# self.systembus = CoherentSystemBus()
105+
# else:
106+
# self.systembus = NonCoherentSystemBus()
92107

93108
# By default the bridge responds to all addresses above the I/O
94109
# base address (including the PCI config space)

configs/numa/ccnuma_fs.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ def cmd_line_template():
8181
return open(options.command_line_file).read().strip()
8282
return None
8383

84+
class NUMACache(Cache):
85+
assoc = 8
86+
hit_latency = 50
87+
response_latency = 50
88+
mshrs = 20
89+
size = '1kB'
90+
tgts_per_mshr = 12
91+
8492
class Domain:
8593
def __init__(self, id = -1):
8694
self.id = id
@@ -92,7 +100,7 @@ def __init__(self, id = -1):
92100
def build_test_system(np):
93101
cmdline = cmd_line_template()
94102
if buildEnv['TARGET_ISA'] == "alpha":
95-
test_sys = makeLinuxAlphaSystem(test_mem_mode, bm[0], options.ruby,
103+
test_sys = makeLinuxAlphaSystem(test_mem_mode, options, bm[0],
96104
cmdline=cmdline)
97105
else:
98106
fatal("Incapable of building %s full system!", buildEnv['TARGET_ISA'])
@@ -154,8 +162,10 @@ def build_test_system(np):
154162

155163
for domain in domains:
156164
if options.caches or options.l2cache:
157-
domain.numa_cache_downward = IOCache(addr_ranges = [])
165+
# domain.numa_cache_downward = IOCache(addr_ranges = [])
158166
domain.numa_cache_upward = IOCache(addr_ranges = [])
167+
domain.numa_cache_downward = NUMACache(addr_ranges = [])
168+
# domain.numa_cache_upward = NUMACache(addr_ranges = [])
159169

160170
for r in range(options.num_domains):
161171
addr_range = [AddrRange(Addr(str(r * 512) + 'MB'), size = options.mem_size_per_domain)] # TODO: 512 should not be hardcoded

run_all_experiments_ALPHA.py

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
else:
2929
dir = 'results/alpha/' + l2_tags + '/' + bench +'/' + str(num_thread) + 'c/'
3030

31+
os.system('rm -fr ' + dir)
3132
os.system('mkdir -p ' + dir)
3233

3334
cmd_first_run = 'build/ALPHA_MESI_Two_Level/gem5.opt -d ' + dir + ' configs/example/fs.py --num-cpus=' \

run_all_experiments_ALPHA_CCNUMA.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020
for num_thread in num_threads:
2121
dir = 'results/alpha_ccnuma/' + bench +'/' + str(num_thread) + 'c/'
2222

23+
os.system('rm -fr ' + dir)
2324
os.system('mkdir -p ' + dir)
2425

25-
cmd_first_run = 'build/ALPHA_MESI_Two_Level/gem5.opt -d ' + dir + ' configs/numa/ccnuma_fs.py --num-cpus=' \
26+
cmd_first_run = 'build/ALPHA_MESI_Two_Level/gem5.opt --debug-flags=AddrRanges -d ' + dir + ' configs/numa/ccnuma_fs.py --num-cpus=' \
2627
+ str(num_thread) + ' --script=ext/parsec/2.1/run_scripts/' \
2728
+ bench + '_' + str(num_thread) + 'c_simsmall_ckpts.rcS' \
2829
+ ' --num_domains=2 --num_cpus_per_domain=2 --mem_size_per_domain=512MB'
2930
print cmd_first_run
3031
os.system(cmd_first_run)
3132

32-
cmd_second_run = 'build/ALPHA_MESI_Two_Level/gem5.opt -d ' + dir + ' configs/numa/ccnuma_fs.py --cpu-type=timing --num-cpus=' \
33+
cmd_second_run = 'build/ALPHA_MESI_Two_Level/gem5.opt --debug-flags=AddrRanges -d ' + dir + ' configs/numa/ccnuma_fs.py --cpu-type=timing --num-cpus=' \
3334
+ str(num_thread) \
3435
+ ' --caches --l2cache --num-l2caches=1' \
3536
+ ' --l1d_size=32kB --l1i_size=32kB --l2_size=256kB --checkpoint-restore=1 --restore-with-cpu=timing' \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/python
2+
3+
#
4+
# A Python script to run all checkpoint-based experiments for PARSEC 2.1 benchmarks.
5+
#
6+
# Copyright (C) Min Cai 2015
7+
#
8+
9+
import os
10+
11+
# benches = ['blackscholes', 'bodytrack', 'canneal', 'dedup', 'facesim',
12+
# 'ferret', 'fluidanimate', 'freqmine', 'streamcluster',
13+
# 'swaptions', 'vips', 'x264']
14+
benches = ['blackscholes']
15+
16+
# num_threads = [1, 2, 4, 8, 16, 32]
17+
num_threads = [4]
18+
19+
for bench in benches:
20+
for num_thread in num_threads:
21+
dir = 'results/alpha_ccnuma_no_checkpoints/' + bench +'/' + str(num_thread) + 'c/'
22+
23+
os.system('rm -fr ' + dir)
24+
os.system('mkdir -p ' + dir)
25+
26+
cmd_run = 'build/ALPHA_MESI_Two_Level/gem5.opt -d ' + dir + ' configs/numa/ccnuma_fs.py --two-phase --cpu-type=timing --num-cpus=' \
27+
+ str(num_thread) + ' --script=ext/parsec/2.1/run_scripts/' \
28+
+ bench + '_' + str(num_thread) + 'c_simsmall.rcS' \
29+
+ ' --caches --l2cache --num-l2caches=1' \
30+
+ ' --l1d_size=32kB --l1i_size=32kB --l2_size=256kB' \
31+
+ ' --num_domains=2 --num_cpus_per_domain=2 --mem_size_per_domain=512MB'
32+
print cmd_run
33+
os.system(cmd_run)
34+
35+
# cmd_mcpat = './mcpat.py --config=' + dir + 'config.json --stats=' + dir + 'stats.txt --mcpat_in=' + dir + 'mcpat_in.xml --mcpat_out=' + dir + 'mcpat_out.txt'
36+
# print cmd_mcpat
37+
# os.system(cmd_mcpat)

run_all_experiments_ALPHA_RUBY_GARNET.py

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
for bench in benches:
2121
for num_thread in num_threads:
2222
dir = 'results/alpha_ruby_garnet/' + bench + '/' + str(num_thread) + 'c/'
23+
24+
os.system('rm -fr ' + dir)
2325
os.system('mkdir -p ' + dir)
2426

2527
num_dirs = 2 # TODO: should not be hardcoded!!!
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/python
2+
3+
#
4+
# A Python script to run all checkpoint-based experiments for PARSEC 2.1 benchmarks.
5+
#
6+
# Copyright (C) Min Cai 2015
7+
#
8+
9+
import os
10+
11+
# benches = ['blackscholes', 'bodytrack', 'canneal', 'dedup', 'facesim',
12+
# 'ferret', 'fluidanimate', 'freqmine', 'streamcluster',
13+
# 'swaptions', 'vips', 'x264']
14+
benches = ['blackscholes']
15+
16+
# num_threads = [1, 2, 4, 8, 16, 32]
17+
num_threads = [4]
18+
19+
for bench in benches:
20+
for num_thread in num_threads:
21+
dir = 'results/alpha_no_checkpoints/' + bench +'/' + str(num_thread) + 'c/'
22+
23+
os.system('rm -fr ' + dir)
24+
os.system('mkdir -p ' + dir)
25+
26+
cmd_run = 'build/ALPHA_MESI_Two_Level/gem5.opt -d ' + dir + ' configs/example/fs.py --two-phase --cpu-type=timing --num-cpus=' \
27+
+ str(num_thread) + ' --script=ext/parsec/2.1/run_scripts/' \
28+
+ bench + '_' + str(num_thread) + 'c_simsmall.rcS' \
29+
+ ' --caches --l2cache --num-l2caches=1' \
30+
+ ' --l1d_size=32kB --l1i_size=32kB --l2_size=256kB'
31+
print cmd_run
32+
os.system(cmd_run)
33+
34+
# cmd_mcpat = './mcpat.py --config=' + dir + 'config.json --stats=' + dir + 'stats.txt --mcpat_in=' + dir + 'mcpat_in.xml --mcpat_out=' + dir + 'mcpat_out.txt'
35+
# print cmd_mcpat
36+
# os.system(cmd_mcpat)

0 commit comments

Comments
 (0)