1 import optparse
, os
, sys
4 from m5
.objects
import *
6 from FullO3Config
import *
8 parser
= optparse
.OptionParser()
10 parser
.add_option("-d", "--detailed", action
="store_true")
11 parser
.add_option("-t", "--timing", action
="store_true")
12 parser
.add_option("-m", "--maxtick", type="int")
13 parser
.add_option("--dual", help="Run full system using dual systems",
16 (options
, args
) = parser
.parse_args()
19 print "Error: script doesn't take any positional arguments"
22 # Base for tests is directory containing this file.
23 test_base
= os
.path
.dirname(__file__
)
25 script
.dir = '/z/saidi/work/m5.newmem/configs/boot'
27 linux_image
= env
.get('LINUX_IMAGE', disk('linux-latest.img'))
29 class CowIdeDisk(IdeDisk
):
30 image
= CowDiskImage(child
=RawDiskImage(read_only
=True),
33 def childImage(self
, ci
):
34 self
.image
.child
.image_file
= ci
36 class BaseTsunami(Tsunami
):
37 ethernet
= NSGigE(configdata
=NSGigEPciData(),
38 pci_bus
=0, pci_dev
=1, pci_func
=0)
39 etherint
= NSGigEInt(device
=Parent
.ethernet
)
40 ide
= IdeController(disks
=[Parent
.disk0
, Parent
.disk2
],
41 pci_func
=0, pci_dev
=0, pci_bus
=0)
43 class MyLinuxAlphaSystem(LinuxAlphaSystem
):
45 membus
= Bus(bus_id
=1)
47 physmem
= PhysicalMemory(range = AddrRange('128MB'))
48 bridge
.side_a
= iobus
.port
49 bridge
.side_b
= membus
.port
50 physmem
.port
= membus
.port
51 disk0
= CowIdeDisk(driveID
='master')
52 disk2
= CowIdeDisk(driveID
='master')
53 disk0
.childImage(linux_image
)
54 disk2
.childImage(disk('linux-bigswap2.img'))
55 tsunami
= BaseTsunami()
56 tsunami
.attachIO(iobus
)
57 tsunami
.ide
.pio
= iobus
.port
58 tsunami
.ide
.dma
= iobus
.port
59 tsunami
.ide
.config
= iobus
.port
60 tsunami
.ethernet
.pio
= iobus
.port
61 tsunami
.ethernet
.dma
= iobus
.port
62 tsunami
.ethernet
.config
= iobus
.port
63 simple_disk
= SimpleDisk(disk
=RawDiskImage(image_file
= linux_image
,
65 intrctrl
= IntrControl()
69 cpu
= TimingSimpleCPU()
72 cpu
= AtomicSimpleCPU()
74 cpu
.icache_port
= membus
.port
75 cpu
.dcache_port
= membus
.port
79 sim_console
= SimConsole(listener
=ConsoleListener(port
=3456))
80 kernel
= binary('vmlinux')
81 pal
= binary('ts_osfpal')
82 console
= binary('console')
83 boot_osflags
= 'root=/dev/hda1 console=ttyS0'
85 class TsunamiRoot(Root
):
88 def DualRoot(clientSystem
, serverSystem
):
90 self
.client
= clientSystem
91 self
.server
= serverSystem
93 self
.etherdump
= EtherDump(file='ethertrace')
94 self
.etherlink
= EtherLink(int1
= Parent
.client
.tsunami
.etherint
[0],
95 int2
= Parent
.server
.tsunami
.etherint
[0],
96 dump
= Parent
.etherdump
)
102 MyLinuxAlphaSystem(readfile
=script('netperf-stream-nt-client.rcS')),
103 MyLinuxAlphaSystem(readfile
=script('netperf-server.rcS')))
105 root
= TsunamiRoot(clock
= '2GHz', system
= MyLinuxAlphaSystem())
109 #exit_event = m5.simulate(2600000000000)
110 #if exit_event.getCause() != "user interrupt received":
111 # m5.checkpoint(root, 'cpt')
112 # exit_event = m5.simulate(300000000000)
113 # if exit_event.getCause() != "user interrupt received":
114 # m5.checkpoint(root, 'cptA')
118 exit_event
= m5
.simulate(options
.maxtick
)
120 exit_event
= m5
.simulate()
122 print 'Exiting @ cycle', m5
.curTick(), 'because', exit_event
.getCause()