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 linux_image
= env
.get('LINUX_IMAGE', disk('linux-latest.img'))
27 class CowIdeDisk(IdeDisk
):
28 image
= CowDiskImage(child
=RawDiskImage(read_only
=True),
31 def childImage(self
, ci
):
32 self
.image
.child
.image_file
= ci
34 class BaseTsunami(Tsunami
):
35 ethernet
= NSGigE(configdata
=NSGigEPciData(),
36 pci_bus
=0, pci_dev
=1, pci_func
=0)
37 etherint
= NSGigEInt(device
=Parent
.ethernet
)
38 ide
= IdeController(disks
=[Parent
.disk0
, Parent
.disk2
],
39 pci_func
=0, pci_dev
=0, pci_bus
=0)
41 class MyLinuxAlphaSystem(LinuxAlphaSystem
):
43 membus
= Bus(bus_id
=1)
45 physmem
= PhysicalMemory(range = AddrRange('128MB'))
46 bridge
.side_a
= iobus
.port
47 bridge
.side_b
= membus
.port
48 physmem
.port
= membus
.port
49 disk0
= CowIdeDisk(driveID
='master')
50 disk2
= CowIdeDisk(driveID
='master')
51 disk0
.childImage(linux_image
)
52 disk2
.childImage(disk('linux-bigswap2.img'))
53 tsunami
= BaseTsunami()
54 tsunami
.attachIO(iobus
)
55 tsunami
.ide
.pio
= iobus
.port
56 tsunami
.ide
.dma
= iobus
.port
57 tsunami
.ide
.config
= iobus
.port
58 tsunami
.ethernet
.pio
= iobus
.port
59 tsunami
.ethernet
.dma
= iobus
.port
60 tsunami
.ethernet
.config
= iobus
.port
61 simple_disk
= SimpleDisk(disk
=RawDiskImage(image_file
= linux_image
,
63 intrctrl
= IntrControl()
67 cpu
= TimingSimpleCPU()
69 cpu
= AtomicSimpleCPU()
71 cpu
.icache_port
= membus
.port
72 cpu
.dcache_port
= membus
.port
75 sim_console
= SimConsole(listener
=ConsoleListener(port
=3456))
76 kernel
= binary('vmlinux')
77 pal
= binary('ts_osfpal')
78 console
= binary('console')
79 boot_osflags
= 'root=/dev/hda1 console=ttyS0'
81 class TsunamiRoot(Root
):
84 def DualRoot(clientSystem
, serverSystem
):
86 self
.client
= clientSystem
87 self
.server
= serverSystem
89 self
.etherdump
= EtherDump(file='ethertrace')
90 self
.etherlink
= EtherLink(int1
= Parent
.client
.tsunami
.etherint
[0],
91 int2
= Parent
.server
.tsunami
.etherint
[0],
92 dump
= Parent
.etherdump
)
98 MyLinuxAlphaSystem(readfile
=script('netperf-stream-nt-client.rcS')),
99 MyLinuxAlphaSystem(readfile
=script('netperf-server.rcS')))
101 root
= TsunamiRoot(clock
= '2GHz', system
= MyLinuxAlphaSystem())
106 exit_event
= m5
.simulate(options
.maxtick
)
108 exit_event
= m5
.simulate()
110 print 'Exiting @ cycle', m5
.curTick(), 'because', exit_event
.getCause()