changeset eeb293859255 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=eeb293859255
description:
MEM: Introduce the master/slave port roles in the Python classes
This patch classifies all ports in Python as either Master or Slave
and enforces a binding of master to slave. Conceptually, a master (such
as a CPU or DMA port) issues requests, and receives responses, and
conversely, a slave (such as a memory or a PIO device) receives
requests and sends back responses. Currently there is no
differentiation between coherent and non-coherent masters and slaves.
The classification as master/slave also involves splitting the dual
role port of the bus into a master and slave port and updating all the
system assembly scripts to use the appropriate port. Similarly, the
interrupt devices have to have their int_port split into a master and
slave port. The intdev and its children have minimal changes to
facilitate the extra port.
Note that this patch does not enforce any port typing in the C++
world, it merely ensures that the Python objects have a notion of the
port roles and are connected in an appropriate manner. This check is
carried when two ports are connected, e.g. bus.master =
memory.port. The following patches will make use of the
classifications and specialise the C++ ports into masters and slaves.
diffstat:
configs/common/CacheConfig.py | 4 +-
configs/common/FSConfig.py | 98 +++++-----
configs/example/fs.py | 8 +-
configs/example/ruby_fs.py | 5 +-
configs/example/se.py | 4 +-
configs/ruby/Ruby.py | 2 +-
src/arch/arm/ArmTLB.py | 2 +-
src/arch/x86/X86LocalApic.py | 15 +-
src/arch/x86/X86TLB.py | 2 +-
src/arch/x86/interrupts.hh | 22 ++-
src/cpu/BaseCPU.py | 33 ++-
src/cpu/simple/AtomicSimpleCPU.py | 2 +-
src/cpu/testers/directedtest/RubyDirectedTester.py | 2 +-
src/cpu/testers/memtest/MemTest.py | 5 +-
src/cpu/testers/networktest/NetworkTest.py | 2 +-
src/cpu/testers/rubytest/RubyTester.py | 2 +-
src/dev/Device.py | 4 +-
src/dev/Ethernet.py | 6 +-
src/dev/Pci.py | 2 +-
src/dev/alpha/Tsunami.py | 50 ++--
src/dev/arm/RealView.py | 194 ++++++++++----------
src/dev/x86/I82094AA.py | 2 +-
src/dev/x86/Pc.py | 14 +-
src/dev/x86/SouthBridge.py | 24 +-
src/dev/x86/i82094aa.hh | 2 +-
src/dev/x86/intdev.hh | 2 +-
src/mem/Bridge.py | 4 +-
src/mem/Bus.py | 7 +-
src/mem/PhysicalMemory.py | 2 +-
src/mem/cache/BaseCache.py | 4 +-
src/mem/ruby/system/RubyPort.cc | 15 +-
src/mem/ruby/system/Sequencer.py | 7 +-
src/python/m5/SimObject.py | 2 +-
src/python/m5/params.py | 92 ++++++++-
src/sim/System.py | 2 +-
tests/configs/inorder-timing.py | 4 +-
tests/configs/memtest-ruby.py | 2 +-
tests/configs/memtest.py | 10 +-
tests/configs/o3-timing-mp-ruby.py | 4 +-
tests/configs/o3-timing-mp.py | 8 +-
tests/configs/o3-timing-ruby.py | 4 +-
tests/configs/o3-timing.py | 4 +-
tests/configs/pc-o3-timing.py | 8 +-
tests/configs/pc-simple-atomic.py | 8 +-
tests/configs/pc-simple-timing.py | 8 +-
tests/configs/realview-o3-dual.py | 8 +-
tests/configs/realview-o3.py | 8 +-
tests/configs/realview-simple-atomic-dual.py | 8 +-
tests/configs/realview-simple-atomic.py | 8 +-
tests/configs/realview-simple-timing-dual.py | 8 +-
tests/configs/realview-simple-timing.py | 8 +-
tests/configs/rubytest-ruby.py | 2 +-
tests/configs/simple-atomic-mp-ruby.py | 4 +-
tests/configs/simple-atomic-mp.py | 8 +-
tests/configs/simple-atomic.py | 4 +-
tests/configs/simple-timing-mp.py | 8 +-
tests/configs/simple-timing.py | 4 +-
tests/configs/tsunami-inorder.py | 8 +-
tests/configs/tsunami-o3-dual.py | 8 +-
tests/configs/tsunami-o3.py | 8 +-
tests/configs/tsunami-simple-atomic-dual.py | 8 +-
tests/configs/tsunami-simple-atomic.py | 8 +-
tests/configs/tsunami-simple-timing-dual.py | 8 +-
tests/configs/tsunami-simple-timing.py | 8 +-
tests/configs/twosys-tsunami-simple-atomic.py | 8 +-
65 files changed, 483 insertions(+), 362 deletions(-)
diffs (truncated from 1942 to 300 lines):
diff -r 6a859084ee92 -r eeb293859255 configs/common/CacheConfig.py
--- a/configs/common/CacheConfig.py Sun Feb 12 18:35:59 2012 -0600
+++ b/configs/common/CacheConfig.py Mon Feb 13 06:43:09 2012 -0500
@@ -44,8 +44,8 @@
block_size=options.cacheline_size)
system.tol2bus = Bus()
- system.l2.cpu_side = system.tol2bus.port
- system.l2.mem_side = system.membus.port
+ system.l2.cpu_side = system.tol2bus.master
+ system.l2.mem_side = system.membus.slave
system.l2.num_cpus = options.num_cpus
for i in xrange(options.num_cpus):
diff -r 6a859084ee92 -r eeb293859255 configs/common/FSConfig.py
--- a/configs/common/FSConfig.py Sun Feb 12 18:35:59 2012 -0600
+++ b/configs/common/FSConfig.py Mon Feb 13 06:43:09 2012 -0500
@@ -74,21 +74,21 @@
self.bridge = Bridge(delay='50ns', nack_delay='4ns',
ranges = [AddrRange(IO_address_space_base, Addr.max)])
self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem()))
- self.bridge.master = self.iobus.port
- self.bridge.slave = self.membus.port
- self.physmem.port = self.membus.port
+ self.bridge.master = self.iobus.slave
+ self.bridge.slave = self.membus.master
+ self.physmem.port = self.membus.master
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.ide.config = self.iobus.port
- self.tsunami.ide.dma = self.iobus.port
- self.tsunami.ethernet.pio = self.iobus.port
- self.tsunami.ethernet.config = self.iobus.port
- self.tsunami.ethernet.dma = self.iobus.port
+ self.tsunami.ide.pio = self.iobus.master
+ self.tsunami.ide.config = self.iobus.master
+ self.tsunami.ide.dma = self.iobus.slave
+ self.tsunami.ethernet.pio = self.iobus.master
+ self.tsunami.ethernet.config = self.iobus.master
+ self.tsunami.ethernet.dma = self.iobus.slave
self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
read_only = True))
self.intrctrl = IntrControl()
@@ -99,7 +99,7 @@
self.console = binary('console')
self.boot_osflags = 'root=/dev/hda1 console=ttyS0'
- self.system_port = self.membus.port
+ self.system_port = self.membus.slave
return self
@@ -124,7 +124,7 @@
# RubyPort currently does support functional accesses. Therefore provide
# the piobus a direct connection to physical memory
#
- self.piobus.port = physmem.port
+ self.piobus.master_port = physmem.port
self.disk0 = CowIdeDisk(driveID='master')
self.disk2 = CowIdeDisk(driveID='master')
@@ -132,12 +132,12 @@
self.disk2.childImage(disk('linux-bigswap2.img'))
self.tsunami = BaseTsunami()
self.tsunami.attachIO(self.piobus)
- self.tsunami.ide.pio = self.piobus.port
- self.tsunami.ide.config = self.piobus.port
- self.tsunami.ide.dma = self.piobus.port
- self.tsunami.ethernet.pio = self.piobus.port
- self.tsunami.ethernet.config = self.piobus.port
- self.tsunami.ethernet.dma = self.piobus.port
+ self.tsunami.ide.pio = self.piobus.master
+ self.tsunami.ide.config = self.piobus.master
+ self.tsunami.ide.dma = self.piobus.slave
+ self.tsunami.ethernet.pio = self.piobus.master
+ self.tsunami.ethernet.config = self.piobus.master
+ self.tsunami.ethernet.dma = self.piobus.slave
#
# Store the dma devices for later connection to dma ruby ports.
@@ -182,18 +182,18 @@
self.t1000.attachIO(self.iobus)
self.physmem = PhysicalMemory(range = AddrRange(Addr('1MB'), size =
'64MB'), zero = True)
self.physmem2 = PhysicalMemory(range = AddrRange(Addr('2GB'), size
='256MB'), zero = True)
- self.bridge.master = self.iobus.port
- self.bridge.slave = self.membus.port
- self.physmem.port = self.membus.port
- self.physmem2.port = self.membus.port
- self.rom.port = self.membus.port
- self.nvram.port = self.membus.port
- self.hypervisor_desc.port = self.membus.port
- self.partition_desc.port = self.membus.port
+ self.bridge.master = self.iobus.slave
+ self.bridge.slave = self.membus.master
+ self.physmem.port = self.membus.master
+ self.physmem2.port = self.membus.master
+ self.rom.port = self.membus.master
+ self.nvram.port = self.membus.master
+ self.hypervisor_desc.port = self.membus.master
+ self.partition_desc.port = self.membus.master
self.intrctrl = IntrControl()
self.disk0 = CowMmDisk()
self.disk0.childImage(disk('disk.s10hw2'))
- self.disk0.pio = self.iobus.port
+ self.disk0.pio = self.iobus.master
# The puart0 and hvuart are placed on the IO bus, so create ranges
# for them. The remaining IO range is rather fragmented, so poke
@@ -220,7 +220,7 @@
self.hypervisor_desc_bin = binary('1up-hv.bin')
self.partition_desc_bin = binary('1up-md.bin')
- self.system_port = self.membus.port
+ self.system_port = self.membus.slave
return self
@@ -241,8 +241,8 @@
self.membus = MemBus(bus_id=1)
self.membus.badaddr_responder.warn_access = "warn"
self.bridge = Bridge(delay='50ns', nack_delay='4ns')
- self.bridge.master = self.iobus.port
- self.bridge.slave = self.membus.port
+ self.bridge.master = self.iobus.slave
+ self.bridge.slave = self.membus.master
self.mem_mode = mem_mode
@@ -285,7 +285,7 @@
zero = True)
self.nvmem = PhysicalMemory(range = AddrRange(Addr('2GB'),
size = '64MB'), zero = True)
- self.nvmem.port = self.membus.port
+ self.nvmem.port = self.membus.master
self.boot_loader = binary('boot.arm')
self.boot_loader_mem = self.nvmem
self.gic_cpu_addr = self.realview.gic.cpu_addr
@@ -295,14 +295,14 @@
boot_flags += " init=/init "
self.boot_osflags = boot_flags
- self.physmem.port = self.membus.port
+ self.physmem.port = self.membus.master
self.realview.attachOnChipIO(self.membus, self.bridge)
self.realview.attachIO(self.iobus)
self.intrctrl = IntrControl()
self.terminal = Terminal()
self.vncserver = VncServer()
- self.system_port = self.membus.port
+ self.system_port = self.membus.slave
return self
@@ -322,21 +322,21 @@
self.membus = MemBus(bus_id=1)
self.bridge = Bridge(delay='50ns', nack_delay='4ns')
self.physmem = PhysicalMemory(range = AddrRange('1GB'))
- self.bridge.master = self.iobus.port
- self.bridge.slave = self.membus.port
- self.physmem.port = self.membus.port
+ self.bridge.master = self.iobus.slave
+ self.bridge.slave = self.membus.master
+ self.physmem.port = self.membus.master
self.disk0 = CowIdeDisk(driveID='master')
self.disk2 = CowIdeDisk(driveID='master')
self.disk0.childImage(mdesc.disk())
self.disk2.childImage(disk('linux-bigswap2.img'))
self.malta = BaseMalta()
self.malta.attachIO(self.iobus)
- self.malta.ide.pio = self.iobus.port
- self.malta.ide.config = self.iobus.port
- self.malta.ide.dma = self.iobus.port
- self.malta.ethernet.pio = self.iobus.port
- self.malta.ethernet.config = self.iobus.port
- self.malta.ethernet.dma = self.iobus.port
+ self.malta.ide.pio = self.iobus.master
+ self.malta.ide.config = self.iobus.master
+ self.malta.ide.dma = self.iobus.slave
+ self.malta.ethernet.pio = self.iobus.master
+ self.malta.ethernet.config = self.iobus.master
+ self.malta.ethernet.dma = self.iobus.slave
self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
read_only = True))
self.intrctrl = IntrControl()
@@ -346,7 +346,7 @@
self.console = binary('mips/console')
self.boot_osflags = 'root=/dev/hda1 console=ttyS0'
- self.system_port = self.membus.port
+ self.system_port = self.membus.slave
return self
@@ -362,13 +362,13 @@
APIC_range_size = 1 << 12;
x86_sys.membus = MemBus(bus_id=1)
- x86_sys.physmem.port = x86_sys.membus.port
+ x86_sys.physmem.port = x86_sys.membus.master
# North Bridge
x86_sys.iobus = Bus(bus_id=0)
x86_sys.bridge = Bridge(delay='50ns', nack_delay='4ns')
- x86_sys.bridge.master = x86_sys.iobus.port
- x86_sys.bridge.slave = x86_sys.membus.port
+ x86_sys.bridge.master = x86_sys.iobus.slave
+ x86_sys.bridge.slave = x86_sys.membus.master
# Allow the bridge to pass through the IO APIC (two pages),
# everything in the IO address range up to the local APIC, and
# then the entire PCI address space and beyond
@@ -386,8 +386,8 @@
# Create a bridge from the IO bus to the memory bus to allow access to
# the local APIC (two pages)
x86_sys.apicbridge = Bridge(delay='50ns', nack_delay='4ns')
- x86_sys.apicbridge.slave = x86_sys.iobus.port
- x86_sys.apicbridge.master = x86_sys.membus.port
+ x86_sys.apicbridge.slave = x86_sys.iobus.master
+ x86_sys.apicbridge.master = x86_sys.membus.slave
x86_sys.apicbridge.ranges = [AddrRange(interrupts_address_space_base,
interrupts_address_space_base +
APIC_range_size - 1)]
@@ -395,7 +395,7 @@
# connect the io bus
x86_sys.pc.attachIO(x86_sys.iobus)
- x86_sys.system_port = x86_sys.membus.port
+ x86_sys.system_port = x86_sys.membus.slave
def connectX86RubySystem(x86_sys):
# North Bridge
@@ -406,7 +406,7 @@
# RubyPort currently does support functional accesses. Therefore provide
# the piobus a direct connection to physical memory
#
- x86_sys.piobus.port = x86_sys.physmem.port
+ x86_sys.piobus.master = x86_sys.physmem.port
x86_sys.pc.attachIO(x86_sys.piobus)
diff -r 6a859084ee92 -r eeb293859255 configs/example/fs.py
--- a/configs/example/fs.py Sun Feb 12 18:35:59 2012 -0600
+++ b/configs/example/fs.py Mon Feb 13 06:43:09 2012 -0500
@@ -160,13 +160,13 @@
mem_size = SysConfig().mem()
if options.caches or options.l2cache:
test_sys.iocache = IOCache(addr_range=mem_size)
- test_sys.iocache.cpu_side = test_sys.iobus.port
- test_sys.iocache.mem_side = test_sys.membus.port
+ test_sys.iocache.cpu_side = test_sys.iobus.master
+ test_sys.iocache.mem_side = test_sys.membus.slave
else:
test_sys.iobridge = Bridge(delay='50ns', nack_delay='4ns',
ranges = [AddrRange(mem_size)])
- test_sys.iobridge.slave = test_sys.iobus.port
- test_sys.iobridge.master = test_sys.membus.port
+ test_sys.iobridge.slave = test_sys.iobus.master
+ test_sys.iobridge.master = test_sys.membus.slave
for i in xrange(np):
if options.fastmem:
diff -r 6a859084ee92 -r eeb293859255 configs/example/ruby_fs.py
--- a/configs/example/ruby_fs.py Sun Feb 12 18:35:59 2012 -0600
+++ b/configs/example/ruby_fs.py Mon Feb 13 06:43:09 2012 -0500
@@ -130,8 +130,9 @@
if buildEnv['TARGET_ISA'] == "x86":
cpu.itb.walker.port = system.ruby._cpu_ruby_ports[i].port
cpu.dtb.walker.port = system.ruby._cpu_ruby_ports[i].port
- cpu.interrupts.pio = system.piobus.port
- cpu.interrupts.int_port = system.piobus.port
+ cpu.interrupts.pio = system.piobus.master
+ cpu.interrupts.int_master = system.piobus.slave
+ cpu.interrupts.int_slave = system.piobus.master
root = Root(full_system = True, system = system)
diff -r 6a859084ee92 -r eeb293859255 configs/example/se.py
--- a/configs/example/se.py Sun Feb 12 18:35:59 2012 -0600
+++ b/configs/example/se.py Mon Feb 13 06:43:09 2012 -0500
@@ -182,8 +182,8 @@
Ruby.create_system(options, system)
assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))
else:
- system.system_port = system.membus.port
- system.physmem.port = system.membus.port
+ system.system_port = system.membus.slave
+ system.physmem.port = system.membus.master
CacheConfig.config_cache(options, system)
for i in xrange(np):
diff -r 6a859084ee92 -r eeb293859255 configs/ruby/Ruby.py
--- a/configs/ruby/Ruby.py Sun Feb 12 18:35:59 2012 -0600
+++ b/configs/ruby/Ruby.py Mon Feb 13 06:43:09 2012 -0500
@@ -106,7 +106,7 @@
system.sys_port_proxy = sys_port_proxy
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev