2 from m5
.objects
import *
6 parser
= optparse
.OptionParser(option_list
=m5
.standardOptions
)
8 parser
.add_option("-t", "--timing", action
="store_true")
10 (options
, args
) = parser
.parse_args()
11 m5
.setStandardOptions(options
)
14 print "Error: script doesn't take any positional arguments"
17 # Base for tests is directory containing this file.
18 test_base
= os
.path
.dirname(__file__
)
20 linux_image
= env
.get('LINUX_IMAGE', disk('linux-latest.img'))
22 class IdeControllerPciData(PciConfigData
):
45 class SinicPciData(PciConfigData
):
64 class NSGigEPciData(PciConfigData
):
84 class LinuxRootDisk(IdeDisk
):
85 raw_image
= RawDiskImage(image_file
=linux_image
, read_only
=True)
86 image
= CowDiskImage(child
=Parent
.raw_image
, read_only
=False)
88 class LinuxSwapDisk(IdeDisk
):
89 raw_image
= RawDiskImage(image_file
= disk('linux-bigswap2.img'),
91 image
= CowDiskImage(child
= Parent
.raw_image
, read_only
=False)
93 class SpecwebFilesetDisk(IdeDisk
):
94 raw_image
= RawDiskImage(image_file
= disk('specweb-fileset.img'),
96 image
= CowDiskImage(child
= Parent
.raw_image
, read_only
=False)
98 class BaseTsunami(Tsunami
):
99 cchip
= TsunamiCChip(pio_addr
=0x801a0000000)
100 pchip
= TsunamiPChip(pio_addr
=0x80180000000)
101 pciconfig
= PciConfigAll(pio_addr
=0x801fe000000)
102 fake_sm_chip
= IsaFake(pio_addr
=0x801fc000370)
104 fake_uart1
= IsaFake(pio_addr
=0x801fc0002f8)
105 fake_uart2
= IsaFake(pio_addr
=0x801fc0003e8)
106 fake_uart3
= IsaFake(pio_addr
=0x801fc0002e8)
107 fake_uart4
= IsaFake(pio_addr
=0x801fc0003f0)
109 fake_ppc
= IsaFake(pio_addr
=0x801fc0003bc)
111 fake_OROM
= IsaFake(pio_addr
=0x800000a0000, pio_size
=0x60000)
113 fake_pnp_addr
= IsaFake(pio_addr
=0x801fc000279)
114 fake_pnp_write
= IsaFake(pio_addr
=0x801fc000a79)
115 fake_pnp_read0
= IsaFake(pio_addr
=0x801fc000203)
116 fake_pnp_read1
= IsaFake(pio_addr
=0x801fc000243)
117 fake_pnp_read2
= IsaFake(pio_addr
=0x801fc000283)
118 fake_pnp_read3
= IsaFake(pio_addr
=0x801fc0002c3)
119 fake_pnp_read4
= IsaFake(pio_addr
=0x801fc000303)
120 fake_pnp_read5
= IsaFake(pio_addr
=0x801fc000343)
121 fake_pnp_read6
= IsaFake(pio_addr
=0x801fc000383)
122 fake_pnp_read7
= IsaFake(pio_addr
=0x801fc0003c3)
124 fake_ata0
= IsaFake(pio_addr
=0x801fc0001f0)
125 fake_ata1
= IsaFake(pio_addr
=0x801fc000170)
127 fb
= BadDevice(pio_addr
=0x801fc0003d0, devicename
='FrameBuffer')
128 io
= TsunamiIO(pio_addr
=0x801fc000000)
129 uart
= Uart8250(pio_addr
=0x801fc0003f8)
130 ethernet
= NSGigE(configdata
=NSGigEPciData(),
131 pci_bus
=0, pci_dev
=1, pci_func
=0)
132 etherint
= NSGigEInt(device
=Parent
.ethernet
)
133 console
= AlphaConsole(pio_addr
=0x80200000000, disk
=Parent
.simple_disk
)
135 class LinuxTsunami(BaseTsunami
):
136 disk0
= LinuxRootDisk(driveID
='master')
137 disk1
= SpecwebFilesetDisk(driveID
='slave')
138 disk2
= LinuxSwapDisk(driveID
='master')
139 ide
= IdeController(disks
=[Parent
.disk0
, Parent
.disk1
, Parent
.disk2
],
140 configdata
=IdeControllerPciData(),
141 pci_func
=0, pci_dev
=0, pci_bus
=0)
143 class MyLinuxAlphaSystem(LinuxAlphaSystem
):
144 magicbus
= Bus(bus_id
=0)
145 magicbus2
= Bus(bus_id
=1)
147 physmem
= PhysicalMemory(range = AddrRange('128MB'))
148 bridge
.side_a
= magicbus
.port
149 bridge
.side_b
= magicbus2
.port
150 physmem
.port
= magicbus2
.port
151 tsunami
= LinuxTsunami()
152 tsunami
.cchip
.pio
= magicbus
.port
153 tsunami
.pchip
.pio
= magicbus
.port
154 tsunami
.pciconfig
.pio
= magicbus
.port
155 tsunami
.fake_sm_chip
.pio
= magicbus
.port
156 tsunami
.ethernet
.pio
= magicbus
.port
157 tsunami
.ethernet
.dma
= magicbus
.port
158 tsunami
.fake_uart1
.pio
= magicbus
.port
159 tsunami
.fake_uart2
.pio
= magicbus
.port
160 tsunami
.fake_uart3
.pio
= magicbus
.port
161 tsunami
.fake_uart4
.pio
= magicbus
.port
162 tsunami
.ide
.pio
= magicbus
.port
163 tsunami
.ide
.dma
= magicbus
.port
164 tsunami
.fake_ppc
.pio
= magicbus
.port
165 tsunami
.fake_OROM
.pio
= magicbus
.port
166 tsunami
.fake_pnp_addr
.pio
= magicbus
.port
167 tsunami
.fake_pnp_write
.pio
= magicbus
.port
168 tsunami
.fake_pnp_read0
.pio
= magicbus
.port
169 tsunami
.fake_pnp_read1
.pio
= magicbus
.port
170 tsunami
.fake_pnp_read2
.pio
= magicbus
.port
171 tsunami
.fake_pnp_read3
.pio
= magicbus
.port
172 tsunami
.fake_pnp_read4
.pio
= magicbus
.port
173 tsunami
.fake_pnp_read5
.pio
= magicbus
.port
174 tsunami
.fake_pnp_read6
.pio
= magicbus
.port
175 tsunami
.fake_pnp_read7
.pio
= magicbus
.port
176 tsunami
.fake_ata0
.pio
= magicbus
.port
177 tsunami
.fake_ata1
.pio
= magicbus
.port
178 tsunami
.fb
.pio
= magicbus
.port
179 tsunami
.io
.pio
= magicbus
.port
180 tsunami
.uart
.pio
= magicbus
.port
181 tsunami
.console
.pio
= magicbus
.port
182 raw_image
= RawDiskImage(image_file
=disk('linux-latest.img'),
184 simple_disk
= SimpleDisk(disk
=Parent
.raw_image
)
185 intrctrl
= IntrControl()
187 cpu
= TimingSimpleCPU()
189 cpu
= AtomicSimpleCPU()
193 sim_console
= SimConsole(listener
=ConsoleListener(port
=3456))
194 kernel
= binary('vmlinux')
195 pal
= binary('ts_osfpal')
196 console
= binary('console')
197 boot_osflags
= 'root=/dev/hda1 console=ttyS0'
198 # readfile = os.path.join(test_base, 'halt.sh')
202 class TsunamiRoot(System
):
206 def DualRoot(clientSystem
, serverSystem
):
208 self
.client
= clientSystem
209 self
.server
= serverSystem
211 self
.etherdump
= EtherDump(file='ethertrace')
212 self
.etherlink
= EtherLink(int1
= Parent
.client
.tsunami
.etherint
[0],
213 int2
= Parent
.server
.tsunami
.etherint
[0],
214 dump
= Parent
.etherdump
)
219 MyLinuxAlphaSystem(readfile
=script('netperf-stream-nt-client.rcS')),
220 MyLinuxAlphaSystem(readfile
=script('netperf-server.rcS')))
224 exit_event
= m5
.simulate()
226 print 'Exiting @ cycle', m5
.curTick(), 'because', exit_event
.getCause()