summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
Diffstat (limited to 'configs')
-rw-r--r--configs/boot/bn-app.rcS3
-rw-r--r--configs/boot/devtime.rcS3
-rw-r--r--configs/boot/iscsi-client.rcS8
-rw-r--r--configs/boot/iscsi-server.rcS4
-rw-r--r--configs/boot/micro_memlat.rcS3
-rw-r--r--configs/boot/micro_stream.rcS2
-rw-r--r--configs/boot/micro_tlblat.rcS2
-rw-r--r--configs/boot/nat-netperf-maerts-client.rcS4
-rw-r--r--configs/boot/nat-netperf-server.rcS4
-rw-r--r--configs/boot/nat-netperf-stream-client.rcS4
-rw-r--r--configs/boot/nat-spec-surge-client.rcS2
-rwxr-xr-xconfigs/boot/nat-spec-surge-server.rcS2
-rw-r--r--configs/boot/natbox-netperf.rcS4
-rw-r--r--configs/boot/natbox-spec-surge.rcS4
-rw-r--r--configs/boot/netperf-rr.rcS4
-rw-r--r--configs/boot/netperf-server.rcS4
-rw-r--r--configs/boot/netperf-stream-client.rcS4
-rw-r--r--configs/boot/netperf-stream-nt-client.rcS33
-rwxr-xr-xconfigs/boot/nfs-client-nhfsstone.rcS4
-rwxr-xr-xconfigs/boot/nfs-client-tcp-smallb.rcS4
-rwxr-xr-xconfigs/boot/nfs-client-tcp.rcS4
-rwxr-xr-xconfigs/boot/nfs-client.rcS4
-rwxr-xr-xconfigs/boot/nfs-server-nhfsstone.rcS2
-rwxr-xr-xconfigs/boot/nfs-server.rcS15
-rw-r--r--configs/boot/ping-client.rcS2
-rw-r--r--configs/boot/ping-server.rcS2
-rw-r--r--configs/boot/spec-surge-client.rcS4
-rwxr-xr-xconfigs/boot/spec-surge-server.rcS6
-rwxr-xr-xconfigs/boot/surge-client.rcS4
-rwxr-xr-xconfigs/boot/surge-server.rcS6
-rw-r--r--configs/common/Benchmarks.py106
-rw-r--r--configs/common/FSConfig.py93
-rw-r--r--configs/common/SysPaths.py68
-rw-r--r--configs/example/fs.py129
-rw-r--r--configs/example/se.py117
35 files changed, 592 insertions, 72 deletions
diff --git a/configs/boot/bn-app.rcS b/configs/boot/bn-app.rcS
new file mode 100644
index 000000000..6fe2800f4
--- /dev/null
+++ b/configs/boot/bn-app.rcS
@@ -0,0 +1,3 @@
+cd /benchmarks/bn
+./bottleneck-app
+m5 exit
diff --git a/configs/boot/devtime.rcS b/configs/boot/devtime.rcS
index 91fddc20d..22a5469b8 100644
--- a/configs/boot/devtime.rcS
+++ b/configs/boot/devtime.rcS
@@ -1,3 +1,6 @@
+echo "switching cpus"
+m5 switchcpu
+echo "done"
insmod /modules/devtime.ko dataAddr=0x9000004 count=100
rmmod devtime
insmod /modules/devtime.ko dataAddr=0x1a0000300 count=100
diff --git a/configs/boot/iscsi-client.rcS b/configs/boot/iscsi-client.rcS
index 51ed5a284..cfa87652e 100644
--- a/configs/boot/iscsi-client.rcS
+++ b/configs/boot/iscsi-client.rcS
@@ -59,7 +59,7 @@ node.cnx[0].iscsi.MaxRecvDataSegmentLength = 65536
#discovery.sendtargets.auth.password = aloha
EOF
-mount -t sysfs none /sys
+#mount -t sysfs none /sys
echo "" > /var/log/iscsi.log
chmod 0600 /var/log/iscsi.log
@@ -74,8 +74,10 @@ echo "/sbin/hotplug" > /proc/sys/kernel/hotplug
echo "Starting iscsid..."
/iscsi/iscsid -f &
+sleep 1
+
echo "Waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
echo "Attaching target..."
/iscsi/iscsiadm -m discovery -t st -p 192.168.0.1
@@ -92,7 +94,7 @@ sleep 5
#PARAMS="-n 16 -s 32 -r 1 -c 50" # stable ~1.5 Gbps
#PARAMS="-n 50 -s 32 -r 1 -c 50" # stable ~1.5 Gbps
PARAMS="-n 50 -s 8 -r .666 -c 50"
-COMMAND="/benchmarks/aio_bench/aio-bench $PARAMS -i 1000000 -C 50000 /dev/sda"
+COMMAND="/benchmarks/aio-bench $PARAMS -i 1000000 -C 50000 /dev/sda"
echo "Starting aio benchmark..."
echo $COMMAND
diff --git a/configs/boot/iscsi-server.rcS b/configs/boot/iscsi-server.rcS
index 904368a4b..210f4eaef 100644
--- a/configs/boot/iscsi-server.rcS
+++ b/configs/boot/iscsi-server.rcS
@@ -49,8 +49,10 @@ echo -n "start enterprise target..."
/iscsi/ietd -f &
echo "done."
+sleep 3
+
echo "notifying client..."
-echo "server ready" | /usr/bin/netcat -c 192.168.0.10 8000
+echo "server ready" | netcat -c 192.168.0.10 8000
echo "done"
echo "starting bash shell..."
diff --git a/configs/boot/micro_memlat.rcS b/configs/boot/micro_memlat.rcS
index 86ec01132..3bf6b6b2b 100644
--- a/configs/boot/micro_memlat.rcS
+++ b/configs/boot/micro_memlat.rcS
@@ -1,3 +1,4 @@
-/benchmarks/micros/lmbench/bin/alphaev6-linux-gnu/lat_mem_rd 450 64
+m5 checkpoint 1 999999999
+/benchmarks/micros/lmbench/bin/alphaev6-linux-gnu/lat_mem_rd 64
m5 exit
diff --git a/configs/boot/micro_stream.rcS b/configs/boot/micro_stream.rcS
index 7b4c445c6..1cf3a7dc3 100644
--- a/configs/boot/micro_stream.rcS
+++ b/configs/boot/micro_stream.rcS
@@ -1,3 +1,3 @@
-/benchmarks/micros/stream
+/benchmarks/micros/simstream
m5 exit
diff --git a/configs/boot/micro_tlblat.rcS b/configs/boot/micro_tlblat.rcS
index 6f713e580..fd5fd53c1 100644
--- a/configs/boot/micro_tlblat.rcS
+++ b/configs/boot/micro_tlblat.rcS
@@ -1,3 +1,3 @@
-/benchmarks/micros/lmbench/bin/alphaev6-linux-gnu/lat_tlb
+/benchmarks/micros/lmbench/bin/alphaev6-linux-gnu/lat_mem_rd_2MB 20 8192
m5 exit
diff --git a/configs/boot/nat-netperf-maerts-client.rcS b/configs/boot/nat-netperf-maerts-client.rcS
index ab66b7d4a..863766a6b 100644
--- a/configs/boot/nat-netperf-maerts-client.rcS
+++ b/configs/boot/nat-netperf-maerts-client.rcS
@@ -23,9 +23,9 @@ echo "262143" > /proc/sys/net/core/optmem_max
echo "100000" > /proc/sys/net/core/netdev_max_backlog
echo -n "waiting for natbox..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
-BINARY=/benchmarks/netperf/netperf
+BINARY=/benchmarks/netperf-bin/netperf
TEST="TCP_MAERTS"
SHORT_ARGS="-l -100k"
LONG_ARGS="-k16384,0 -K16384,0 -- -m 65536 -M 65536 -s 262144 -S 262144"
diff --git a/configs/boot/nat-netperf-server.rcS b/configs/boot/nat-netperf-server.rcS
index 61b4bea7a..23b99a13a 100644
--- a/configs/boot/nat-netperf-server.rcS
+++ b/configs/boot/nat-netperf-server.rcS
@@ -21,11 +21,11 @@ echo "262143" > /proc/sys/net/core/optmem_max
echo "100000" > /proc/sys/net/core/netdev_max_backlog
echo "running netserver..."
-/benchmarks/netperf/netserver
+/benchmarks/netperf-bin/netserver
echo -n "signal natbox to begin..."
sleep 5
-echo "server ready" | /usr/bin/netcat -c $NATBOX 8000
+echo "server ready" | netcat -c $NATBOX 8000
echo "done."
echo "starting bash..."
diff --git a/configs/boot/nat-netperf-stream-client.rcS b/configs/boot/nat-netperf-stream-client.rcS
index e37b8e565..f20e92c5c 100644
--- a/configs/boot/nat-netperf-stream-client.rcS
+++ b/configs/boot/nat-netperf-stream-client.rcS
@@ -24,9 +24,9 @@ echo "modifying route table"
route add default gw 10.0.0.1
echo -n "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
-BINARY=/benchmarks/netperf/netperf
+BINARY=/benchmarks/netperf-bin/netperf
TEST="TCP_STREAM"
SHORT_ARGS="-l -100k"
LONG_ARGS="-k16384,0 -K16384,0 -- -m 65536 -M 65536 -s 262144 -S 262144"
diff --git a/configs/boot/nat-spec-surge-client.rcS b/configs/boot/nat-spec-surge-client.rcS
index 67c831eb0..d26e38378 100644
--- a/configs/boot/nat-spec-surge-client.rcS
+++ b/configs/boot/nat-spec-surge-client.rcS
@@ -38,7 +38,7 @@ echo "changing route table..."
route add default gw 10.0.0.1
echo "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
echo -n "running surge client..."
/bin/bash -c "cd /benchmarks/surge && ./spec-m5 1 20 1 $SERVER 5 40000 1000000000 1000"
diff --git a/configs/boot/nat-spec-surge-server.rcS b/configs/boot/nat-spec-surge-server.rcS
index 279cd5652..0f462568c 100755
--- a/configs/boot/nat-spec-surge-server.rcS
+++ b/configs/boot/nat-spec-surge-server.rcS
@@ -49,7 +49,7 @@ echo "done."
echo "notifying natbox..."
sleep 5
-echo "server ready" | /usr/bin/netcat -c $NATBOX 8000
+echo "server ready" | netcat -c $NATBOX 8000
echo "done"
echo -n "starting bash shell..."
diff --git a/configs/boot/natbox-netperf.rcS b/configs/boot/natbox-netperf.rcS
index 32a7371a0..e6384757e 100644
--- a/configs/boot/natbox-netperf.rcS
+++ b/configs/boot/natbox-netperf.rcS
@@ -24,7 +24,7 @@ echo "100000" > /proc/sys/net/core/netdev_max_backlog
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "waiting for netserver..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
echo "setting up iptables..."
IPTABLES=/sbin/iptables
@@ -47,7 +47,7 @@ $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
echo "informing client..."
sleep 5
-echo "server ready" | /usr/bin/netcat -c $CLIENT 8000
+echo "server ready" | netcat -c $CLIENT 8000
echo "starting bash..."
exec /bin/bash
diff --git a/configs/boot/natbox-spec-surge.rcS b/configs/boot/natbox-spec-surge.rcS
index 8b84b1a35..4346a6229 100644
--- a/configs/boot/natbox-spec-surge.rcS
+++ b/configs/boot/natbox-spec-surge.rcS
@@ -27,7 +27,7 @@ echo "1" > /proc/sys/net/ipv4/ip_forward
echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max
echo "waiting for netserver..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
echo "setting up iptables..."
IPTABLES=/sbin/iptables
@@ -50,7 +50,7 @@ $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
echo "informing client..."
sleep 5
-echo "server ready" | /usr/bin/netcat -c $CLIENT 8000
+echo "server ready" | netcat -c $CLIENT 8000
echo "starting bash..."
exec /bin/bash
diff --git a/configs/boot/netperf-rr.rcS b/configs/boot/netperf-rr.rcS
index 8c5ea050c..1467c1f67 100644
--- a/configs/boot/netperf-rr.rcS
+++ b/configs/boot/netperf-rr.rcS
@@ -19,9 +19,9 @@ echo "262143" > /proc/sys/net/core/optmem_max
echo "100000" > /proc/sys/net/core/netdev_max_backlog
echo -n "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
-BINARY=/benchmarks/netperf/netperf
+BINARY=/benchmarks/netperf-bin/netperf
TEST="TCP_RR"
SHORT_ARGS="-l -1k"
LONG_ARGS="-k10000,0 -K10000,0"
diff --git a/configs/boot/netperf-server.rcS b/configs/boot/netperf-server.rcS
index c75d918a2..95a4ac4cf 100644
--- a/configs/boot/netperf-server.rcS
+++ b/configs/boot/netperf-server.rcS
@@ -19,11 +19,11 @@ echo "262143" > /proc/sys/net/core/optmem_max
echo "100000" > /proc/sys/net/core/netdev_max_backlog
echo "running netserver..."
-/benchmarks/netperf/netserver
+/benchmarks/netperf-bin/netserver
echo -n "signal client to begin..."
sleep 1
-echo "server ready" | /usr/bin/netcat -c $CLIENT 8000
+echo "server ready" | netcat -c $CLIENT 8000
echo "done."
echo "starting bash..."
diff --git a/configs/boot/netperf-stream-client.rcS b/configs/boot/netperf-stream-client.rcS
index 430ac265c..9a2cc0ec1 100644
--- a/configs/boot/netperf-stream-client.rcS
+++ b/configs/boot/netperf-stream-client.rcS
@@ -19,9 +19,9 @@ echo "262143" > /proc/sys/net/core/optmem_max
echo "100000" > /proc/sys/net/core/netdev_max_backlog
echo -n "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
-BINARY=/benchmarks/netperf/netperf
+BINARY=/benchmarks/netperf-bin/netperf
TEST="TCP_STREAM"
SHORT_ARGS="-l -100k"
LONG_ARGS="-k16384,0 -K16384,0 -- -m 65536 -M 65536 -s 262144 -S 262144"
diff --git a/configs/boot/netperf-stream-nt-client.rcS b/configs/boot/netperf-stream-nt-client.rcS
index 6664cd024..568115525 100644
--- a/configs/boot/netperf-stream-nt-client.rcS
+++ b/configs/boot/netperf-stream-nt-client.rcS
@@ -19,9 +19,9 @@ echo "262143" > /proc/sys/net/core/optmem_max
echo "100000" > /proc/sys/net/core/netdev_max_backlog
echo -n "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
-BINARY=/benchmarks/netperf/netperf
+BINARY=/benchmarks/netperf-bin/netperf
TEST="TCP_STREAM"
SHORT_ARGS="-l -100k"
LONG_ARGS="-- -m 65536 -M 65536 -s 262144 -S 262144"
@@ -34,23 +34,12 @@ echo "starting test..."
echo "netperf warmup"
echo $SHORT
eval $SHORT
-NUMCLNTS=`/sbin/m5 initparam`
-[ "$NUMCLNTS" -eq "0" ] && NUMCLNTS=1
-
-echo "netperf benchmark... starting $NUMCLNTS..."
-lcv=0
-
-while [ "$lcv" -lt "$NUMCLNTS" ]
-do
- echo $LONG
- eval $LONG &
- ((lcv += 1))
-done
-
-ckpt=200000000
-((ckpt = ckpt * 12/3 + 1000000000))
-
-echo "configuring checkpointing at $ckpt..."
-/sbin/m5 checkpoint $ckpt 2000000000
-echo "done configuring checkpointing..."
-sleep 100000
+
+echo "netperf benchmark"
+echo $LONG
+/sbin/m5 ivlb 1
+/sbin/m5 resetstats
+/sbin/m5 dumpresetstats 200000000 2000000000
+/sbin/m5 checkpoint 200000000 2000000000
+eval $LONG
+/sbin/m5 exit
diff --git a/configs/boot/nfs-client-nhfsstone.rcS b/configs/boot/nfs-client-nhfsstone.rcS
index 6a9650d38..c59655a47 100755
--- a/configs/boot/nfs-client-nhfsstone.rcS
+++ b/configs/boot/nfs-client-nhfsstone.rcS
@@ -36,7 +36,7 @@ echo -n "starting nfs client..."
echo "done."
echo -n "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
echo -n "mounting remote share..."
mkdir /nfs
@@ -44,6 +44,6 @@ mount 10.0.0.1:/nfs /nfs
echo "done."
/sbin/m5 checkpoint 8000000000 2000000000
-/benchmarks/nfs/nhfsstone -l 300 -t 50 -p 14 -m /benchmarks/nfs/nfs.mix2 /nfs
+/sbin/nhfsstone /nfs
/sbin/m5 exit
diff --git a/configs/boot/nfs-client-tcp-smallb.rcS b/configs/boot/nfs-client-tcp-smallb.rcS
index eeb6aaadd..b71ca0bf1 100755
--- a/configs/boot/nfs-client-tcp-smallb.rcS
+++ b/configs/boot/nfs-client-tcp-smallb.rcS
@@ -36,13 +36,13 @@ echo -n "starting nfs client..."
echo "done."
echo -n "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
echo -n "mounting remote share..."
mkdir /nfs
mount -o rsize=1460,wsize=1460,tcp 10.0.0.1:/nfs /nfs
echo "done."
-/bin/bonnie++ -u 99 -s 700 -r 0 -n 0 -f -F -d /nfs
+/usr/bin/bonnie++ -u 99 -s 700 -r 0 -n 0 -f -F -d /nfs
/sbin/m5 exit
diff --git a/configs/boot/nfs-client-tcp.rcS b/configs/boot/nfs-client-tcp.rcS
index 319281385..e707ef257 100755
--- a/configs/boot/nfs-client-tcp.rcS
+++ b/configs/boot/nfs-client-tcp.rcS
@@ -36,13 +36,13 @@ echo -n "starting nfs client..."
echo "done."
echo -n "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
echo -n "mounting remote share..."
mkdir /nfs
mount -o tcp 10.0.0.1:/nfs /nfs
echo "done."
-/bin/bonnie++ -u 99 -s 700 -r 0 -n 0 -f -F -d /nfs
+/usr/bin/bonnie++ -u 99 -s 700 -r 0 -n 0 -f -F -d /nfs
/sbin/m5 exit
diff --git a/configs/boot/nfs-client.rcS b/configs/boot/nfs-client.rcS
index feae55d58..f3fbe0467 100755
--- a/configs/boot/nfs-client.rcS
+++ b/configs/boot/nfs-client.rcS
@@ -36,13 +36,13 @@ echo -n "starting nfs client..."
echo "done."
echo -n "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
echo -n "mounting remote share..."
mkdir /nfs
mount 10.0.0.1:/nfs /nfs
echo "done."
-/bin/bonnie++ -u 99 -s 700 -r 0 -n 0 -f -F -d /nfs
+/usr/bin/bonnie++ -u 99 -s 700 -r 0 -n 0 -f -F -d /nfs
/sbin/m5 exit
diff --git a/configs/boot/nfs-server-nhfsstone.rcS b/configs/boot/nfs-server-nhfsstone.rcS
index 222ba309e..7fa44a5f2 100755
--- a/configs/boot/nfs-server-nhfsstone.rcS
+++ b/configs/boot/nfs-server-nhfsstone.rcS
@@ -59,7 +59,7 @@ echo "Exporting shares..."
echo -n "signal client to mount..."
sleep 5
-echo "server ready" | /usr/bin/netcat -c 10.0.0.2 8000
+echo "server ready" | netcat -c 10.0.0.2 8000
echo "done."
echo -n "starting bash shell..."
diff --git a/configs/boot/nfs-server.rcS b/configs/boot/nfs-server.rcS
index ecd4d8317..7314d06c3 100755
--- a/configs/boot/nfs-server.rcS
+++ b/configs/boot/nfs-server.rcS
@@ -28,17 +28,24 @@ echo "524287" > /proc/sys/net/core/wmem_max
echo "524287" > /proc/sys/net/core/optmem_max
echo "300000" > /proc/sys/net/core/netdev_max_backlog
echo "131072" > /proc/sys/fs/file-max
-echo "10" > /proc/sys/vm/dirty_writeback_centisecs
echo "done."
-echo "load scsi_debug kernel module..."
+#if [ ! -x /dev/sda ]
+#then
+# mknod /dev/sda b 8 0
+# mknod /dev/sda1 b 8 1
+#fi
+
/sbin/insmod /modules/scsi_debug.ko dev_size_mb=768
echo -n "creating partition and formatting..."
+#echo "1,767,L" > /tmp/sfdisk.run
+#/usr/sbin/sfdisk -uM --force /dev/sda < /tmp/sfdisk.run
/sbin/mke2fs -F /dev/sda
mkdir /nfs
-/bin/mount /dev/sda /nfs
+/bin/mount /dev/sda /nfs
chmod a+rwx /nfs
+#/usr/sbin/sfdisk -uM -l /dev/sda
echo "done."
echo "/nfs 10.0.0.0/255.0.0.0(rw,sync,no_root_squash)" > /etc/exports
@@ -54,7 +61,7 @@ echo "Exporting shares..."
/sbin/exportfs -r -v
echo -n "signal client to mount..."
-echo "server ready" | /usr/bin/netcat -c 10.0.0.2 8000
+echo "server ready" | netcat -c 10.0.0.2 8000
echo "done."
echo -n "starting bash shell..."
diff --git a/configs/boot/ping-client.rcS b/configs/boot/ping-client.rcS
index 3f0ded75e..260ff42e0 100644
--- a/configs/boot/ping-client.rcS
+++ b/configs/boot/ping-client.rcS
@@ -19,7 +19,7 @@ echo "262143" > /proc/sys/net/core/optmem_max
echo "100000" > /proc/sys/net/core/netdev_max_backlog
echo -n "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
ping $SERVER
/sbin/m5 exit
diff --git a/configs/boot/ping-server.rcS b/configs/boot/ping-server.rcS
index 5dab6effb..311c80212 100644
--- a/configs/boot/ping-server.rcS
+++ b/configs/boot/ping-server.rcS
@@ -19,7 +19,7 @@ echo "262143" > /proc/sys/net/core/optmem_max
echo "100000" > /proc/sys/net/core/netdev_max_backlog
echo -n "signal client to begin..."
-echo "server ready" | /usr/bin/netcat -c $CLIENT 8000
+echo "server ready" | netcat -c $CLIENT 8000
echo "done."
echo "starting bash..."
diff --git a/configs/boot/spec-surge-client.rcS b/configs/boot/spec-surge-client.rcS
index f42d6045f..03f25986c 100644
--- a/configs/boot/spec-surge-client.rcS
+++ b/configs/boot/spec-surge-client.rcS
@@ -32,10 +32,10 @@ echo "131072" > /proc/sys/fs/file-max
echo "done."
echo "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
echo -n "running surge client..."
-/bin/bash -c "cd /benchmarks/surge && ./spec-m5 1 20 1 192.168.0.1 5 40000 1000000000 1000"
+/bin/bash -c "cd /benchmarks/specsurge && ./spec-m5 1 20 1 192.168.0.1 5 40000 1000000000 1000"
echo "done."
echo -n "halting machine"
diff --git a/configs/boot/spec-surge-server.rcS b/configs/boot/spec-surge-server.rcS
index e2d0a58d7..89a3fb4f5 100755
--- a/configs/boot/spec-surge-server.rcS
+++ b/configs/boot/spec-surge-server.rcS
@@ -40,13 +40,13 @@ mount /dev/hdb1 /z/htdocs
echo "done."
echo -n "starting httpd..."
-/benchmarks/apache2/bin/apachectl start
+/usr/sbin/apache2 -f /etc/apache2/httpd.conf -k start
sleep 2
-cat /benchmarks/apache2/logs/error_log
+cat /usr/share/apache2/logs/error_log
echo "done."
echo "notifying client..."
-echo "server ready" | /usr/bin/netcat -c 192.168.0.10 8000
+echo "server ready" | netcat -c 192.168.0.10 8000
echo "done"
echo -n "starting bash shell..."
diff --git a/configs/boot/surge-client.rcS b/configs/boot/surge-client.rcS
index c63cc93f0..ba7d87f66 100755
--- a/configs/boot/surge-client.rcS
+++ b/configs/boot/surge-client.rcS
@@ -31,10 +31,10 @@ echo "131072" > /proc/sys/fs/file-max
echo "done."
echo "waiting for server..."
-/usr/bin/netcat -c -l -p 8000
+netcat -c -l -p 8000
echo -n "running surge client..."
-/bin/bash -c "cd /benchmarks/surge && ./Surge 2 100 1 192.168.0.1 5"
+/bin/bash -c "cd /benchmarks/specsurge && ./Surge 2 100 1 192.168.0.1 5"
echo "done."
echo -n "halting machine"
diff --git a/configs/boot/surge-server.rcS b/configs/boot/surge-server.rcS
index 234514bd9..140c02fb3 100755
--- a/configs/boot/surge-server.rcS
+++ b/configs/boot/surge-server.rcS
@@ -41,12 +41,12 @@ mount /dev/hdb1 /z/htdocs
echo "done."
echo -n "starting httpd..."
-/benchmarks/apache2/bin/apachectl start
+/usr/sbin/apache2 -f /etc/apache2/httpd.conf -k start
sleep 2
-cat /benchmarks/apache2/logs/error_log
+cat /usr/share/apache2/logs/error_log
echo "done."
-echo "server ready" | /usr/bin/netcat -c 192.168.10 8000
+echo "server ready" | netcat -c 192.168.10 8000
echo -n "starting bash shell..."
/bin/bash
diff --git a/configs/common/Benchmarks.py b/configs/common/Benchmarks.py
new file mode 100644
index 000000000..bb1ac1ab5
--- /dev/null
+++ b/configs/common/Benchmarks.py
@@ -0,0 +1,106 @@
+# Copyright (c) 2006 The Regents of The University of Michigan
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Ali Saidi
+
+from SysPaths import *
+
+class Machine:
+ def __init__(self, script=None, mem=None, disk=None):
+ self.scriptname = script
+ self.diskname = disk
+ self.memsize = mem
+
+ def script(self):
+ if self.scriptname:
+ return script(self.scriptname)
+ else:
+ return ''
+
+ def mem(self):
+ if self.memsize:
+ return self.memsize
+ else:
+ return '128MB'
+
+ def disk(self):
+ if self.diskname:
+ return disk(self.diskname)
+ else:
+ return env.get('LINUX_IMAGE', disk('linux-latest.img'))
+
+#Benchmarks are defined as a key in a dict which is a list of Machines
+# The first defined machine is the test system, the others are driving systems
+# Currently there is only support for 1 or 2 machines
+
+Benchmarks = {}
+Benchmarks['PovrayBench'] = [Machine('povray-bench.rcS', '512MB', 'povray.img')]
+Benchmarks['PovrayAutumn'] = [Machine('povray-autumn.rcS', '512MB', 'povray.img')]
+Benchmarks['NetperfStream'] = [Machine('netperf-stream-client.rcS'),
+ Machine('netperf-server.rcS')]
+Benchmarks['NetperfStreamNT'] = [Machine('netperf-stream-nt-client.rcS'),
+ Machine('netperf-server.rcS')]
+Benchmarks['NetperfMaerts'] = [Machine('netperf-maerts-client.rcS'),
+ Machine('netperf-server.rcS')]
+Benchmarks['SurgeStandard'] = [Machine('surge-server.rcS', '512MB'),
+ Machine('surge-client.rcS', '256MB')]
+Benchmarks['SurgeSpecweb'] = [Machine('spec-surge-server.rcS', '512MB'),
+ Machine('spec-surge-client.rcS', '256MB')]
+Benchmarks['Nhfsstone'] = [Machine('nfs-server-nhfsstone.rcS', '512MB'),
+ Machine('nfs-client-nhfsstone.rcS')]
+Benchmarks['Nfs'] = [Machine('nfs-server.rcS', '900MB'),
+ Machine('nfs-client-dbench.rcS')]
+Benchmarks['NfsTcp'] = [Machine('nfs-server.rcS', '900MB'),
+ Machine('nfs-client-tcp.rcS')]
+Benchmarks['IScsiInitiator'] = [Machine('iscsi-client.rcS', '512MB'),
+ Machine('iscsi-server.rcS', '512MB')]
+Benchmarks['IScsiTarget'] = [Machine('iscsi-server.rcS', '512MB'),
+ Machine('iscsi-client.rcS', '512MB')]
+Benchmarks['Validation'] = [Machine('iscsi-server.rcS', '512MB'),
+ Machine('iscsi-client.rcS', '512MB')]
+Benchmarks['Ping'] = [Machine('ping-server.rcS',),
+ Machine('ping-client.rcS')]
+
+
+Benchmarks['ValAccDelay'] = [Machine('devtime.rcS', '512MB')]
+Benchmarks['ValAccDelay2'] = [Machine('devtimewmr.rcS', '512MB')]
+Benchmarks['ValMemLat'] = [Machine('micro_memlat.rcS', '512MB')]
+Benchmarks['ValMemLat2MB'] = [Machine('micro_memlat2mb.rcS', '512MB')]
+Benchmarks['ValMemLat8MB'] = [Machine('micro_memlat8mb.rcS', '512MB')]
+Benchmarks['ValMemLat'] = [Machine('micro_memlat8.rcS', '512MB')]
+Benchmarks['ValTlbLat'] = [Machine('micro_tlblat.rcS', '512MB')]
+Benchmarks['ValSysLat'] = [Machine('micro_syscall.rcS', '512MB')]
+Benchmarks['ValCtxLat'] = [Machine('micro_ctx.rcS', '512MB')]
+Benchmarks['ValStream'] = [Machine('micro_stream.rcS', '512MB')]
+Benchmarks['ValStreamScale'] = [Machine('micro_streamscale.rcS', '512MB')]
+Benchmarks['ValStreamCopy'] = [Machine('micro_streamcopy.rcS', '512MB')]
+
+
+Benchmarks['bnAn'] = [Machine('/z/saidi/work/m5.newmem.head/configs/boot/bn-app.rcS', '128MB', '/z/saidi/work/bottleneck/bnimg.img')]
+
+benchs = Benchmarks.keys()
+benchs.sort()
+DefinedBenchmarks = ", ".join(benchs)
diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
new file mode 100644
index 000000000..67a1e5735
--- /dev/null
+++ b/configs/common/FSConfig.py
@@ -0,0 +1,93 @@
+# Copyright (c) 2006 The Regents of The University of Michigan
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Kevin Lim
+
+import m5
+from m5 import makeList
+from m5.objects import *
+from Benchmarks import *
+from FullO3Config import *
+
+class CowIdeDisk(IdeDisk):
+ image = CowDiskImage(child=RawDiskImage(read_only=True),
+ read_only=False)
+
+ def childImage(self, ci):
+ self.image.child.image_file = ci
+
+class BaseTsunami(Tsunami):
+ ethernet = NSGigE(configdata=NSGigEPciData(),
+ pci_bus=0, pci_dev=1, pci_func=0)
+ etherint = NSGigEInt(device=Parent.ethernet)
+ ide = IdeController(disks=[Parent.disk0, Parent.disk2],
+ pci_func=0, pci_dev=0, pci_bus=0)
+
+def makeLinuxAlphaSystem(mem_mode, mdesc = None):
+ self = LinuxAlphaSystem()
+ if not mdesc:
+ # generic system
+ mdesc = Machine()
+ self.readfile = mdesc.script()
+ self.iobus = Bus(bus_id=0)
+ self.membus = Bus(bus_id=1)
+ self.bridge = Bridge()
+ self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem()))
+ self.bridge.side_a = self.iobus.port
+ self.bridge.side_b = self.membus.port
+ self.physmem.port = self.membus.port
+ self.disk0 = CowIdeDisk(driveID='master')
+ self.disk2 = CowIdeDisk(driveID='master')
+ self.disk0.childImage(mdesc.disk())
+ self.disk2.childImage(disk('linux-bigswap2.img'))
+ self.tsunami = BaseTsunami()
+ self.tsunami.attachIO(self.iobus)
+ self.tsunami.ide.pio = self.iobus.port
+ self.tsunami.ethernet.pio = self.iobus.port
+ self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
+ read_only = True))
+ self.intrctrl = IntrControl()
+ self.mem_mode = mem_mode
+ self.sim_console = SimConsole(listener=ConsoleListener(port=3456))
+ self.kernel = binary('vmlinux')
+ self.pal = binary('ts_osfpal')
+ self.console = binary('console')
+ self.boot_osflags = 'root=/dev/hda1 console=ttyS0'
+
+ return self
+
+def makeDualRoot(testSystem, driveSystem, dumpfile):
+ self = Root()
+ self.testsys = testSystem
+ self.drivesys = driveSystem
+ self.etherlink = EtherLink(int1 = Parent.testsys.tsunami.etherint[0],
+ int2 = Parent.drivesys.tsunami.etherint[0])
+ if dumpfile:
+ self.etherdump = EtherDump(file=dumpfile)
+ self.etherlink.dump = Parent.etherdump
+
+ self.clock = '1THz'
+ return self
diff --git a/configs/common/SysPaths.py b/configs/common/SysPaths.py
new file mode 100644
index 000000000..2070d11f8
--- /dev/null
+++ b/configs/common/SysPaths.py
@@ -0,0 +1,68 @@
+# Copyright (c) 2006 The Regents of The University of Michigan
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Ali Saidi
+
+import os, sys
+from os.path import isdir, join as joinpath
+from os import environ as env
+
+def disk(file):
+ system()
+ return joinpath(disk.dir, file)
+
+def binary(file):
+ system()
+ return joinpath(binary.dir, file)
+
+def script(file):
+ system()
+ return joinpath(script.dir, file)
+
+def system():
+ if not system.dir:
+ try:
+ path = env['M5_PATH'].split(':')
+ except KeyError:
+ path = [ '/dist/m5/system', '/n/poolfs/z/dist/m5/system' ]
+
+ for system.dir in path:
+ if os.path.isdir(system.dir):
+ break
+ else:
+ raise ImportError, "Can't find a path to system files."
+
+ if not binary.dir:
+ binary.dir = joinpath(system.dir, 'binaries')
+ if not disk.dir:
+ disk.dir = joinpath(system.dir, 'disks')
+ if not script.dir:
+ script.dir = joinpath(system.dir, 'boot')
+
+system.dir = None
+binary.dir = None
+disk.dir = None
+script.dir = None
diff --git a/configs/example/fs.py b/configs/example/fs.py
new file mode 100644
index 000000000..71c5961ef
--- /dev/null
+++ b/configs/example/fs.py
@@ -0,0 +1,129 @@
+# Copyright (c) 2006 The Regents of The University of Michigan
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Ali Saidi
+
+import optparse, os, sys
+
+import m5
+from m5.objects import *
+m5.AddToPath('../common')
+from FSConfig import *
+from SysPaths import *
+from Benchmarks import *
+
+if not m5.build_env['FULL_SYSTEM']:
+ m5.panic("This script requires full-system mode (ALPHA_FS).")
+
+parser = optparse.OptionParser()
+
+parser.add_option("-d", "--detailed", action="store_true")
+parser.add_option("-t", "--timing", action="store_true")
+parser.add_option("-m", "--maxtick", type="int")
+parser.add_option("--maxtime", type="float")
+parser.add_option("--dual", action="store_true",
+ help="Simulate two systems attached with an ethernet link")
+parser.add_option("-b", "--benchmark", action="store", type="string",
+ dest="benchmark",
+ help="Specify the benchmark to run. Available benchmarks: %s"\
+ % DefinedBenchmarks)
+parser.add_option("--etherdump", action="store", type="string", dest="etherdump",
+ help="Specify the filename to dump a pcap capture of the ethernet"
+ "traffic")
+
+(options, args) = parser.parse_args()
+
+if args:
+ print "Error: script doesn't take any positional arguments"
+ sys.exit(1)
+
+if options.detailed:
+ cpu = DetailedO3CPU()
+ cpu2 = DetailedO3CPU()
+ mem_mode = 'timing'
+elif options.timing:
+ cpu = TimingSimpleCPU()
+ cpu2 = TimingSimpleCPU()
+ mem_mode = 'timing'
+else:
+ cpu = AtomicSimpleCPU()
+ cpu2 = AtomicSimpleCPU()
+ mem_mode = 'atomic'
+
+cpu.clock = '2GHz'
+cpu2.clock = '2GHz'
+
+if options.benchmark:
+ if options.benchmark not in Benchmarks:
+ print "Error benchmark %s has not been defined." % options.benchmark
+ print "Valid benchmarks are: %s" % DefinedBenchmarks
+ sys.exit(1)
+
+ bm = Benchmarks[options.benchmark]
+else:
+ if options.dual:
+ bm = [Machine(), Machine()]
+ else:
+ bm = [Machine()]
+
+if len(bm) == 2:
+ s1 = makeLinuxAlphaSystem(mem_mode, bm[0])
+ s1.cpu = cpu
+ cpu.connectMemPorts(s1.membus)
+ cpu.mem = s1.physmem
+ s2 = makeLinuxAlphaSystem(mem_mode, bm[1])
+ s2.cpu = cpu2
+ cpu2.connectMemPorts(s2.membus)
+ cpu2.mem = s2.physmem
+ root = makeDualRoot(s1, s2, options.etherdump)
+elif len(bm) == 1:
+ root = Root(clock = '1THz',
+ system = makeLinuxAlphaSystem(mem_mode, bm[0]))
+ root.system.cpu = cpu
+ cpu.connectMemPorts(root.system.membus)
+ cpu.mem = root.system.physmem
+else:
+ print "Error I don't know how to create more than 2 systems."
+ sys.exit(1)
+
+m5.instantiate(root)
+
+if options.maxtick:
+ maxtick = options.maxtick
+elif options.maxtime:
+ simtime = int(options.maxtime * root.clock.value)
+ print "simulating for: ", simtime
+ maxtick = simtime
+else:
+ maxtick = -1
+
+exit_event = m5.simulate(maxtick)
+
+while exit_event.getCause() == "checkpoint":
+ m5.checkpoint(root, "cpt.%d")
+ exit_event = m5.simulate(maxtick - m5.curTick())
+
+print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause()
diff --git a/configs/example/se.py b/configs/example/se.py
new file mode 100644
index 000000000..de8b6c890
--- /dev/null
+++ b/configs/example/se.py
@@ -0,0 +1,117 @@
+# Copyright (c) 2006 The Regents of The University of Michigan
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Steve Reinhardt
+
+# Simple test script
+#
+# "m5 test.py"
+
+import m5
+from m5.objects import *
+import os, optparse, sys
+m5.AddToPath('../common')
+from FullO3Config import *
+
+parser = optparse.OptionParser()
+
+parser.add_option("-c", "--cmd",
+ default="../../tests/test-progs/hello/bin/alpha/linux/hello",
+ help="The binary to run in syscall emulation mode.")
+parser.add_option("-o", "--options", default="",
+ help="The options to pass to the binary, use \" \" around the entire\
+ string.")
+parser.add_option("-i", "--input", default="",
+ help="A file of input to give to the binary.")
+parser.add_option("-d", "--detailed", action="store_true")
+parser.add_option("-t", "--timing", action="store_true")
+parser.add_option("-m", "--maxtick", type="int")
+
+(options, args) = parser.parse_args()
+
+if args:
+ print "Error: script doesn't take any positional arguments"
+ sys.exit(1)
+
+process = LiveProcess()
+process.executable = options.cmd
+process.cmd = options.cmd + " " + options.options
+if options.input != "":
+ process.input = options.input
+
+if options.detailed:
+ #check for SMT workload
+ workloads = options.cmd.split(';')
+ if len(workloads) > 1:
+ process = []
+ smt_idx = 0
+ inputs = []
+
+ if options.input != "":
+ inputs = options.input.split(';')
+
+ for wrkld in workloads:
+ smt_process = LiveProcess()
+ smt_process.executable = wrkld
+ smt_process.cmd = wrkld + " " + options.options
+ if inputs and inputs[smt_idx]:
+ smt_process.input = inputs[smt_idx]
+ process += [smt_process, ]
+ smt_idx += 1
+
+
+if options.timing:
+ cpu = TimingSimpleCPU()
+elif options.detailed:
+ cpu = DetailedO3CPU()
+else:
+ cpu = AtomicSimpleCPU()
+
+cpu.workload = process
+
+system = System(cpu = cpu,
+ physmem = PhysicalMemory(),
+ membus = Bus())
+system.physmem.port = system.membus.port
+system.cpu.connectMemPorts(system.membus)
+system.cpu.mem = system.physmem
+
+root = Root(system = system)
+
+if options.timing or options.detailed:
+ root.system.mem_mode = 'timing'
+
+# instantiate configuration
+m5.instantiate(root)
+
+# simulate until program terminates
+if options.maxtick:
+ exit_event = m5.simulate(options.maxtick)
+else:
+ exit_event = m5.simulate()
+
+print 'Exiting @ tick', m5.curTick(), 'because', exit_event.getCause()
+