Update config file language to take simobj and no longer use siminst
objects/AlphaConsole.mpy: objects/AlphaTLB.mpy: objects/BadDevice.mpy: objects/BaseCPU.mpy: objects/BaseCache.mpy: objects/BaseSystem.mpy: objects/Bus.mpy: objects/CoherenceProtocol.mpy: objects/Device.mpy: objects/DiskImage.mpy: objects/Ethernet.mpy: objects/Ide.mpy: objects/IntrControl.mpy: objects/MemTest.mpy: objects/Pci.mpy: objects/PhysicalMemory.mpy: objects/Platform.mpy: objects/Process.mpy: objects/Repl.mpy: objects/Root.mpy: objects/SimConsole.mpy: objects/SimpleDisk.mpy: objects/Tsunami.mpy: objects/Uart.mpy: simobj now requires a type= line if it is actually intended to be a type sim/pyconfig/SConscript: keep track of the filename of embedded files for better error messages. sim/pyconfig/m5config.py: Add support for the trickery done with the compiler to get the simobj language feature added to the importer. fix the bug that gave objects the wrong name in error messages. test/genini.py: Globals have been fixed and use execfile --HG-- extra : convert_revision : b74495fd6f3479a87ecea7f1234ebb6731279b2b
This commit is contained in:
parent
45bb2bf14d
commit
a736a8fab6
27 changed files with 84 additions and 30 deletions
|
@ -1,8 +1,9 @@
|
||||||
from Device import PioDevice
|
from Device import PioDevice
|
||||||
|
|
||||||
simobj AlphaConsole(PioDevice):
|
simobj AlphaConsole(PioDevice):
|
||||||
|
type = 'AlphaConsole'
|
||||||
cpu = Param.BaseCPU(Super, "Processor")
|
cpu = Param.BaseCPU(Super, "Processor")
|
||||||
disk = Param.SimpleDisk("Simple Disk")
|
disk = Param.SimpleDisk("Simple Disk")
|
||||||
num_cpus = Param.Int(1, "Number of CPU's")
|
num_cpus = Param.Int(1, "Number of CPUs")
|
||||||
sim_console = Param.SimConsole(Super, "The Simulator Console")
|
sim_console = Param.SimConsole(Super, "The Simulator Console")
|
||||||
system = Param.BaseSystem(Super, "system object")
|
system = Param.BaseSystem(Super, "system object")
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
simobj AlphaTLB(SimObject):
|
simobj AlphaTLB(SimObject):
|
||||||
|
type = 'AlphaTLB'
|
||||||
abstract = True
|
abstract = True
|
||||||
size = Param.Int("TLB size")
|
size = Param.Int("TLB size")
|
||||||
|
|
||||||
simobj AlphaDTB(AlphaTLB):
|
simobj AlphaDTB(AlphaTLB):
|
||||||
|
type = 'AlphaDTB'
|
||||||
size = 64
|
size = 64
|
||||||
|
|
||||||
simobj AlphaITB(AlphaTLB):
|
simobj AlphaITB(AlphaTLB):
|
||||||
|
type = 'AlphaITB'
|
||||||
size = 48
|
size = 48
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from Device import PioDevice
|
from Device import PioDevice
|
||||||
|
|
||||||
simobj BadDevice(PioDevice):
|
simobj BadDevice(PioDevice):
|
||||||
|
type = 'BadDevice'
|
||||||
devicename = Param.String("Name of device to error on")
|
devicename = Param.String("Name of device to error on")
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
simobj BaseCPU(SimObject):
|
simobj BaseCPU(SimObject):
|
||||||
|
type = 'BaseCPU'
|
||||||
abstract = True
|
abstract = True
|
||||||
icache = Param.BaseMem(NULL, "L1 instruction cache object")
|
icache = Param.BaseMem(NULL, "L1 instruction cache object")
|
||||||
dcache = Param.BaseMem(NULL, "L1 data cache object")
|
dcache = Param.BaseMem(NULL, "L1 data cache object")
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
from BaseMem import BaseMem
|
from BaseMem import BaseMem
|
||||||
|
|
||||||
simobj BaseCache(BaseMem):
|
simobj BaseCache(BaseMem):
|
||||||
|
type = 'BaseCache'
|
||||||
adaptive_compression = Param.Bool(false,
|
adaptive_compression = Param.Bool(false,
|
||||||
"Use an adaptive compression scheme")
|
"Use an adaptive compression scheme")
|
||||||
assoc = Param.Int("associativity")
|
assoc = Param.Int("associativity")
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
simobj BaseSystem(SimObject):
|
simobj BaseSystem(SimObject):
|
||||||
|
type = 'BaseSystem'
|
||||||
abstract = True
|
abstract = True
|
||||||
memctrl = Param.MemoryController(Super, "memory controller")
|
memctrl = Param.MemoryController(Super, "memory controller")
|
||||||
physmem = Param.PhysicalMemory(Super, "phsyical memory")
|
physmem = Param.PhysicalMemory(Super, "phsyical memory")
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from BaseHier import BaseHier
|
from BaseHier import BaseHier
|
||||||
|
|
||||||
simobj Bus(BaseHier):
|
simobj Bus(BaseHier):
|
||||||
|
type = 'Bus'
|
||||||
clock_ratio = Param.Int("ratio of CPU to bus frequency")
|
clock_ratio = Param.Int("ratio of CPU to bus frequency")
|
||||||
width = Param.Int("bus width in bytes")
|
width = Param.Int("bus width in bytes")
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
Coherence = Enum('uni', 'msi', 'mesi', 'mosi', 'moesi')
|
Coherence = Enum('uni', 'msi', 'mesi', 'mosi', 'moesi')
|
||||||
|
|
||||||
simobj CoherenceProtocol(SimObject):
|
simobj CoherenceProtocol(SimObject):
|
||||||
|
type = 'CoherenceProtocol'
|
||||||
do_upgrades = Param.Bool(true, "use upgrade transactions?")
|
do_upgrades = Param.Bool(true, "use upgrade transactions?")
|
||||||
protocol = Param.Coherence("name of coherence protocol")
|
protocol = Param.Coherence("name of coherence protocol")
|
||||||
|
|
|
@ -11,21 +11,23 @@ from FunctionalMemory import FunctionalMemory
|
||||||
# initialization phase at which point all SimObject pointers will be
|
# initialization phase at which point all SimObject pointers will be
|
||||||
# valid.
|
# valid.
|
||||||
simobj FooPioDevice(FunctionalMemory):
|
simobj FooPioDevice(FunctionalMemory):
|
||||||
abstract = True
|
|
||||||
type = 'PioDevice'
|
type = 'PioDevice'
|
||||||
|
abstract = True
|
||||||
addr = Param.Addr("Device Address")
|
addr = Param.Addr("Device Address")
|
||||||
mmu = Param.MemoryController(Super, "Memory Controller")
|
mmu = Param.MemoryController(Super, "Memory Controller")
|
||||||
io_bus = Param.Bus(NULL, "The IO Bus to attach to")
|
io_bus = Param.Bus(NULL, "The IO Bus to attach to")
|
||||||
pio_latency = Param.Tick(1, "Programmed IO latency in bus cycles")
|
pio_latency = Param.Tick(1, "Programmed IO latency in bus cycles")
|
||||||
|
|
||||||
simobj FooDmaDevice(FooPioDevice):
|
simobj FooDmaDevice(FooPioDevice):
|
||||||
abstract = True
|
|
||||||
type = 'DmaDevice'
|
type = 'DmaDevice'
|
||||||
|
abstract = True
|
||||||
|
|
||||||
simobj PioDevice(FooPioDevice):
|
simobj PioDevice(FooPioDevice):
|
||||||
|
type = 'PioDevice'
|
||||||
abstract = True
|
abstract = True
|
||||||
platform = Param.Platform(Super, "Platform")
|
platform = Param.Platform(Super, "Platform")
|
||||||
|
|
||||||
simobj DmaDevice(PioDevice):
|
simobj DmaDevice(PioDevice):
|
||||||
|
type = 'DmaDevice'
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
simobj DiskImage(SimObject):
|
simobj DiskImage(SimObject):
|
||||||
|
type = 'DiskImage'
|
||||||
abstract = True
|
abstract = True
|
||||||
image_file = Param.String("disk image file")
|
image_file = Param.String("disk image file")
|
||||||
read_only = Param.Bool(false, "read only image")
|
read_only = Param.Bool(false, "read only image")
|
||||||
|
|
||||||
simobj RawDiskImage(DiskImage):
|
simobj RawDiskImage(DiskImage):
|
||||||
pass
|
type = 'RawDiskImage'
|
||||||
|
|
||||||
simobj CowDiskImage(DiskImage):
|
simobj CowDiskImage(DiskImage):
|
||||||
|
type = 'CowDiskImage'
|
||||||
child = Param.DiskImage("child image")
|
child = Param.DiskImage("child image")
|
||||||
table_size = Param.Int(65536, "initial table size")
|
table_size = Param.Int(65536, "initial table size")
|
||||||
image_file = ''
|
image_file = ''
|
||||||
|
|
|
@ -2,10 +2,12 @@ from Device import DmaDevice
|
||||||
from Pci import PciDevice
|
from Pci import PciDevice
|
||||||
|
|
||||||
simobj EtherInt(SimObject):
|
simobj EtherInt(SimObject):
|
||||||
|
type = 'EtherInt'
|
||||||
abstract = True
|
abstract = True
|
||||||
peer = Param.EtherInt(NULL, "peer interface")
|
peer = Param.EtherInt(NULL, "peer interface")
|
||||||
|
|
||||||
simobj EtherLink(SimObject):
|
simobj EtherLink(SimObject):
|
||||||
|
type = 'EtherLink'
|
||||||
int1 = Param.EtherInt("interface 1")
|
int1 = Param.EtherInt("interface 1")
|
||||||
int2 = Param.EtherInt("interface 2")
|
int2 = Param.EtherInt("interface 2")
|
||||||
delay = Param.Tick(0, "transmit delay of packets in us")
|
delay = Param.Tick(0, "transmit delay of packets in us")
|
||||||
|
@ -13,20 +15,24 @@ simobj EtherLink(SimObject):
|
||||||
dump = Param.EtherDump(NULL, "dump object")
|
dump = Param.EtherDump(NULL, "dump object")
|
||||||
|
|
||||||
simobj EtherBus(SimObject):
|
simobj EtherBus(SimObject):
|
||||||
|
type = 'EtherBus'
|
||||||
loopback = Param.Bool(true,
|
loopback = Param.Bool(true,
|
||||||
"send packet back to the interface from which it came")
|
"send packet back to the interface from which it came")
|
||||||
dump = Param.EtherDump(NULL, "dump object")
|
dump = Param.EtherDump(NULL, "dump object")
|
||||||
speed = Param.UInt64(100000000, "bus speed in bits per second")
|
speed = Param.UInt64(100000000, "bus speed in bits per second")
|
||||||
|
|
||||||
simobj EtherTap(EtherInt):
|
simobj EtherTap(EtherInt):
|
||||||
|
type = 'EtherTap'
|
||||||
bufsz = Param.Int(10000, "tap buffer size")
|
bufsz = Param.Int(10000, "tap buffer size")
|
||||||
dump = Param.EtherDump(NULL, "dump object")
|
dump = Param.EtherDump(NULL, "dump object")
|
||||||
port = Param.UInt16(3500, "tap port")
|
port = Param.UInt16(3500, "tap port")
|
||||||
|
|
||||||
simobj EtherDump(SimObject):
|
simobj EtherDump(SimObject):
|
||||||
|
type = 'EtherDump'
|
||||||
file = Param.String("dump file")
|
file = Param.String("dump file")
|
||||||
|
|
||||||
simobj EtherDev(DmaDevice):
|
simobj EtherDev(DmaDevice):
|
||||||
|
type = 'EtherDev'
|
||||||
hardware_address = Param.EthernetAddr(NextEthernetAddr,
|
hardware_address = Param.EthernetAddr(NextEthernetAddr,
|
||||||
"Ethernet Hardware Address")
|
"Ethernet Hardware Address")
|
||||||
|
|
||||||
|
@ -47,6 +53,7 @@ simobj EtherDev(DmaDevice):
|
||||||
tlaser = Param.Turbolaser(Super, "Turbolaser")
|
tlaser = Param.Turbolaser(Super, "Turbolaser")
|
||||||
|
|
||||||
simobj NSGigE(PciDevice):
|
simobj NSGigE(PciDevice):
|
||||||
|
type = 'NSGigE'
|
||||||
hardware_address = Param.EthernetAddr(NextEthernetAddr,
|
hardware_address = Param.EthernetAddr(NextEthernetAddr,
|
||||||
"Ethernet Hardware Address")
|
"Ethernet Hardware Address")
|
||||||
|
|
||||||
|
@ -69,9 +76,11 @@ simobj NSGigE(PciDevice):
|
||||||
physmem = Param.PhysicalMemory(Super, "Physical Memory")
|
physmem = Param.PhysicalMemory(Super, "Physical Memory")
|
||||||
|
|
||||||
simobj EtherDevInt(EtherInt):
|
simobj EtherDevInt(EtherInt):
|
||||||
|
type = 'EtherDevInt'
|
||||||
device = Param.EtherDev("Ethernet device of this interface")
|
device = Param.EtherDev("Ethernet device of this interface")
|
||||||
|
|
||||||
simobj NSGigEInt(EtherInt):
|
simobj NSGigEInt(EtherInt):
|
||||||
|
type = 'NSGigEInt'
|
||||||
device = Param.NSGigE("Ethernet device of this interface")
|
device = Param.NSGigE("Ethernet device of this interface")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,12 @@ from Pci import PciDevice
|
||||||
IdeID = Enum('master', 'slave')
|
IdeID = Enum('master', 'slave')
|
||||||
|
|
||||||
simobj IdeDisk(SimObject):
|
simobj IdeDisk(SimObject):
|
||||||
|
type = 'IdeDisk'
|
||||||
delay = Param.Tick(1, "Fixed disk delay in microseconds")
|
delay = Param.Tick(1, "Fixed disk delay in microseconds")
|
||||||
driveID = Param.IdeID('master', "Drive ID")
|
driveID = Param.IdeID('master', "Drive ID")
|
||||||
image = Param.DiskImage("Disk image")
|
image = Param.DiskImage("Disk image")
|
||||||
physmem = Param.PhysicalMemory(Super, "Physical memory")
|
physmem = Param.PhysicalMemory(Super, "Physical memory")
|
||||||
|
|
||||||
simobj IdeController(PciDevice):
|
simobj IdeController(PciDevice):
|
||||||
|
type = 'IdeController'
|
||||||
disks = VectorParam.IdeDisk("IDE disks attached to this controller")
|
disks = VectorParam.IdeDisk("IDE disks attached to this controller")
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
simobj IntrControl(SimObject):
|
simobj IntrControl(SimObject):
|
||||||
|
type = 'IntrControl'
|
||||||
cpu = Param.BaseCPU(Super, "the cpu")
|
cpu = Param.BaseCPU(Super, "the cpu")
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
simobj MemTest(SimObject):
|
simobj MemTest(SimObject):
|
||||||
|
type = 'MemTest'
|
||||||
cache = Param.BaseCache("L1 cache")
|
cache = Param.BaseCache("L1 cache")
|
||||||
check_mem = Param.FunctionalMemory("check memory")
|
check_mem = Param.FunctionalMemory("check memory")
|
||||||
main_mem = Param.FunctionalMemory("hierarchical memory")
|
main_mem = Param.FunctionalMemory("hierarchical memory")
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
from Device import FooPioDevice, DmaDevice
|
from Device import FooPioDevice, DmaDevice
|
||||||
|
|
||||||
simobj PciConfigData(FooPioDevice):
|
simobj PciConfigData(FooPioDevice):
|
||||||
|
type = 'PciConfigData'
|
||||||
addr = 0xffffffffffffffffL
|
addr = 0xffffffffffffffffL
|
||||||
VendorID = Param.UInt16("Vendor ID")
|
VendorID = Param.UInt16("Vendor ID")
|
||||||
DeviceID = Param.UInt16("Device ID")
|
DeviceID = Param.UInt16("Device ID")
|
||||||
|
@ -38,9 +39,10 @@ simobj PciConfigData(FooPioDevice):
|
||||||
MinimumGrant = Param.UInt8(0x00, "Minimum Grant")
|
MinimumGrant = Param.UInt8(0x00, "Minimum Grant")
|
||||||
|
|
||||||
simobj PciConfigAll(FooPioDevice):
|
simobj PciConfigAll(FooPioDevice):
|
||||||
pass
|
type = 'PciConfigAll'
|
||||||
|
|
||||||
simobj PciDevice(DmaDevice):
|
simobj PciDevice(DmaDevice):
|
||||||
|
type = 'PciDevice'
|
||||||
abstract = True
|
abstract = True
|
||||||
pci_bus = Param.Int("PCI bus")
|
pci_bus = Param.Int("PCI bus")
|
||||||
pci_dev = Param.Int("PCI device number")
|
pci_dev = Param.Int("PCI device number")
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
from FunctionalMemory import FunctionalMemory
|
from FunctionalMemory import FunctionalMemory
|
||||||
|
|
||||||
simobj PhysicalMemory(FunctionalMemory):
|
simobj PhysicalMemory(FunctionalMemory):
|
||||||
|
type = 'PhysicalMemory'
|
||||||
range = Param.AddrRange("Device Address")
|
range = Param.AddrRange("Device Address")
|
||||||
file = Param.String('', "memory mapped file")
|
file = Param.String('', "memory mapped file")
|
||||||
mmu = Param.MemoryController(Super, "Memory Controller")
|
mmu = Param.MemoryController(Super, "Memory Controller")
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
simobj Platform(SimObject):
|
simobj Platform(SimObject):
|
||||||
|
type = 'Platform'
|
||||||
abstract = True
|
abstract = True
|
||||||
interrupt_frequency = Param.Tick(1200, "frequency of interrupts")
|
interrupt_frequency = Param.Tick(1200, "frequency of interrupts")
|
||||||
intrctrl = Param.IntrControl(Super, "interrupt controller")
|
intrctrl = Param.IntrControl(Super, "interrupt controller")
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
simobj Process(SimObject):
|
simobj Process(SimObject):
|
||||||
|
type = 'Process'
|
||||||
abstract = True
|
abstract = True
|
||||||
output = Param.String('cout', 'filename for stdout/stderr')
|
output = Param.String('cout', 'filename for stdout/stderr')
|
||||||
|
|
||||||
simobj LiveProcess(Process):
|
simobj LiveProcess(Process):
|
||||||
|
type = 'LiveProcess'
|
||||||
cmd = VectorParam.String("command line (executable plus arguments)")
|
cmd = VectorParam.String("command line (executable plus arguments)")
|
||||||
env = VectorParam.String('', "environment settings")
|
env = VectorParam.String('', "environment settings")
|
||||||
input = Param.String('cin', "filename for stdin")
|
input = Param.String('cin', "filename for stdin")
|
||||||
|
|
||||||
simobj EioProcess(Process):
|
simobj EioProcess(Process):
|
||||||
|
type = 'EioProcess'
|
||||||
chkpt = Param.String('', "EIO checkpoint file name (optional)")
|
chkpt = Param.String('', "EIO checkpoint file name (optional)")
|
||||||
file = Param.String("EIO trace file name")
|
file = Param.String("EIO trace file name")
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
simobj Repl(SimObject):
|
simobj Repl(SimObject):
|
||||||
|
type = 'Repl'
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
simobj GenRepl(Repl):
|
simobj GenRepl(Repl):
|
||||||
|
type = 'GenRepl'
|
||||||
fresh_res = Param.Int("associativity")
|
fresh_res = Param.Int("associativity")
|
||||||
num_pools = Param.Int("capacity in bytes")
|
num_pools = Param.Int("capacity in bytes")
|
||||||
pool_res = Param.Int("block size in bytes")
|
pool_res = Param.Int("block size in bytes")
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from HierParams import HierParams
|
from HierParams import HierParams
|
||||||
simobj Root(SimObject):
|
simobj Root(SimObject):
|
||||||
|
type = 'Root'
|
||||||
frequency = Param.Tick(200000000, "tick frequency")
|
frequency = Param.Tick(200000000, "tick frequency")
|
||||||
output_dir = Param.String('.', "directory to output data to")
|
output_dir = Param.String('.', "directory to output data to")
|
||||||
output_file = Param.String('cout', "file to dump simulator output to")
|
output_file = Param.String('cout', "file to dump simulator output to")
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
simobj ConsoleListener(SimObject):
|
simobj ConsoleListener(SimObject):
|
||||||
|
type = 'ConsoleListener'
|
||||||
port = Param.UInt16(3456, "listen port")
|
port = Param.UInt16(3456, "listen port")
|
||||||
|
|
||||||
simobj SimConsole(SimObject):
|
simobj SimConsole(SimObject):
|
||||||
|
type = 'SimConsole'
|
||||||
append_name = Param.Bool(true, "append name() to filename")
|
append_name = Param.Bool(true, "append name() to filename")
|
||||||
intr_control = Param.IntrControl(Super, "interrupt controller")
|
intr_control = Param.IntrControl(Super, "interrupt controller")
|
||||||
listener = Param.ConsoleListener("console listener")
|
listener = Param.ConsoleListener("console listener")
|
||||||
number = Param.Int(0, "console number")
|
number = Param.Int(0, "console number")
|
||||||
output = Param.String("", "file to dump output to")
|
output = Param.String('', "file to dump output to")
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
simobj SimpleDisk(SimObject):
|
simobj SimpleDisk(SimObject):
|
||||||
|
type = 'SimpleDisk'
|
||||||
disk = Param.DiskImage("Disk Image")
|
disk = Param.DiskImage("Disk Image")
|
||||||
physmem = Param.PhysicalMemory(Super, "Physical Memory")
|
physmem = Param.PhysicalMemory(Super, "Physical Memory")
|
||||||
|
|
|
@ -2,20 +2,24 @@ from Device import FooPioDevice
|
||||||
from Platform import Platform
|
from Platform import Platform
|
||||||
|
|
||||||
simobj Tsunami(Platform):
|
simobj Tsunami(Platform):
|
||||||
|
type = 'Tsunami'
|
||||||
pciconfig = Param.PciConfigAll("PCI configuration")
|
pciconfig = Param.PciConfigAll("PCI configuration")
|
||||||
system = Param.BaseSystem(Super, "system")
|
system = Param.BaseSystem(Super, "system")
|
||||||
interrupt_frequency = Param.Int(1024, "frequency of interrupts")
|
interrupt_frequency = Param.Int(1024, "frequency of interrupts")
|
||||||
|
|
||||||
simobj TsunamiCChip(FooPioDevice):
|
simobj TsunamiCChip(FooPioDevice):
|
||||||
|
type = 'TsunamiCChip'
|
||||||
tsunami = Param.Tsunami(Super, "Tsunami")
|
tsunami = Param.Tsunami(Super, "Tsunami")
|
||||||
|
|
||||||
simobj TsunamiFake(FooPioDevice):
|
simobj TsunamiFake(FooPioDevice):
|
||||||
pass
|
type = 'TsunamiFake'
|
||||||
|
|
||||||
simobj TsunamiIO(FooPioDevice):
|
simobj TsunamiIO(FooPioDevice):
|
||||||
|
type = 'TsunamiIO'
|
||||||
time = Param.UInt64(1136073600,
|
time = Param.UInt64(1136073600,
|
||||||
"System time to use (0 for actual time, default is 1/1/06)")
|
"System time to use (0 for actual time, default is 1/1/06)")
|
||||||
tsunami = Param.Tsunami(Super, "Tsunami")
|
tsunami = Param.Tsunami(Super, "Tsunami")
|
||||||
|
|
||||||
simobj TsunamiPChip(FooPioDevice):
|
simobj TsunamiPChip(FooPioDevice):
|
||||||
|
type = 'TsunamiPChip'
|
||||||
tsunami = Param.Tsunami(Super, "Tsunami")
|
tsunami = Param.Tsunami(Super, "Tsunami")
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from Device import PioDevice
|
from Device import PioDevice
|
||||||
|
|
||||||
simobj Uart(PioDevice):
|
simobj Uart(PioDevice):
|
||||||
|
type = 'Uart'
|
||||||
console = Param.SimConsole(Super, "The console")
|
console = Param.SimConsole(Super, "The console")
|
||||||
size = Param.Addr(0x8, "Device size")
|
size = Param.Addr(0x8, "Device size")
|
||||||
|
|
|
@ -28,14 +28,15 @@
|
||||||
|
|
||||||
import os, os.path, re
|
import os, os.path, re
|
||||||
|
|
||||||
def WriteEmbeddedPyFile(target, source, path, name, ext):
|
def WriteEmbeddedPyFile(target, source, path, name, ext, filename):
|
||||||
if isinstance(source, str):
|
if isinstance(source, str):
|
||||||
source = file(source, 'r')
|
source = file(source, 'r')
|
||||||
|
|
||||||
if isinstance(target, str):
|
if isinstance(target, str):
|
||||||
target = file(target, 'w')
|
target = file(target, 'w')
|
||||||
|
|
||||||
print >>target, "AddModule(%s, %s, %s, '''\\" % (`path`, `name`, `ext`)
|
print >>target, "AddModule(%s, %s, %s, %s, '''\\" % \
|
||||||
|
(`path`, `name`, `ext`, `filename`)
|
||||||
|
|
||||||
for line in source:
|
for line in source:
|
||||||
line = line
|
line = line
|
||||||
|
@ -105,7 +106,7 @@ def MakeEmbeddedPyFile(target, source, env):
|
||||||
name,ext = pyfile.split('.')
|
name,ext = pyfile.split('.')
|
||||||
if name == '__init__':
|
if name == '__init__':
|
||||||
node['.hasinit'] = True
|
node['.hasinit'] = True
|
||||||
node[pyfile] = (src,name,ext)
|
node[pyfile] = (src,name,ext,src)
|
||||||
|
|
||||||
done = False
|
done = False
|
||||||
while not done:
|
while not done:
|
||||||
|
@ -136,12 +137,12 @@ def MakeEmbeddedPyFile(target, source, env):
|
||||||
raise NameError, 'package directory missing __init__.py'
|
raise NameError, 'package directory missing __init__.py'
|
||||||
populate(entry, path + [ name ])
|
populate(entry, path + [ name ])
|
||||||
else:
|
else:
|
||||||
pyfile,name,ext = entry
|
pyfile,name,ext,filename = entry
|
||||||
files.append((pyfile, path, name, ext))
|
files.append((pyfile, path, name, ext, filename))
|
||||||
populate(tree)
|
populate(tree)
|
||||||
|
|
||||||
for pyfile, path, name, ext in files:
|
for pyfile, path, name, ext, filename in files:
|
||||||
WriteEmbeddedPyFile(target, pyfile, path, name, ext)
|
WriteEmbeddedPyFile(target, pyfile, path, name, ext, filename)
|
||||||
|
|
||||||
CFileCounter = 0
|
CFileCounter = 0
|
||||||
def MakePythonCFile(target, source, env):
|
def MakePythonCFile(target, source, env):
|
||||||
|
|
|
@ -221,6 +221,10 @@ def isParamContext(value):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
class_decorator = '_M5M5_SIMOBJECT_'
|
||||||
|
expr_decorator = '_M5M5_EXPRESSION_'
|
||||||
|
dot_decorator = '_M5M5_DOT_'
|
||||||
|
|
||||||
# The metaclass for ConfigNode (and thus for everything that derives
|
# The metaclass for ConfigNode (and thus for everything that derives
|
||||||
# from ConfigNode, including SimObject). This class controls how new
|
# from ConfigNode, including SimObject). This class controls how new
|
||||||
# classes that derive from ConfigNode are instantiated, and provides
|
# classes that derive from ConfigNode are instantiated, and provides
|
||||||
|
@ -230,7 +234,6 @@ def isParamContext(value):
|
||||||
class MetaConfigNode(type):
|
class MetaConfigNode(type):
|
||||||
keywords = { 'abstract' : types.BooleanType,
|
keywords = { 'abstract' : types.BooleanType,
|
||||||
'check' : types.FunctionType,
|
'check' : types.FunctionType,
|
||||||
'_init' : types.FunctionType,
|
|
||||||
'type' : (types.NoneType, types.StringType) }
|
'type' : (types.NoneType, types.StringType) }
|
||||||
|
|
||||||
# __new__ is called before __init__, and is where the statements
|
# __new__ is called before __init__, and is where the statements
|
||||||
|
@ -246,6 +249,11 @@ class MetaConfigNode(type):
|
||||||
'_disable' : {} }
|
'_disable' : {} }
|
||||||
|
|
||||||
for key,val in dict.items():
|
for key,val in dict.items():
|
||||||
|
del dict[key]
|
||||||
|
|
||||||
|
if key.startswith(expr_decorator):
|
||||||
|
key = key[len(expr_decorator):]
|
||||||
|
|
||||||
if mcls.keywords.has_key(key):
|
if mcls.keywords.has_key(key):
|
||||||
if not isinstance(val, mcls.keywords[key]):
|
if not isinstance(val, mcls.keywords[key]):
|
||||||
raise TypeError, \
|
raise TypeError, \
|
||||||
|
@ -255,11 +263,9 @@ class MetaConfigNode(type):
|
||||||
if isinstance(val, types.FunctionType):
|
if isinstance(val, types.FunctionType):
|
||||||
val = classmethod(val)
|
val = classmethod(val)
|
||||||
priv[key] = val
|
priv[key] = val
|
||||||
del dict[key]
|
|
||||||
|
|
||||||
elif key.startswith('_'):
|
elif key.startswith('_'):
|
||||||
priv[key] = val
|
priv[key] = val
|
||||||
del dict[key]
|
|
||||||
|
|
||||||
elif not isNullPointer(val) and isConfigNode(val):
|
elif not isNullPointer(val) and isConfigNode(val):
|
||||||
dict[key] = val()
|
dict[key] = val()
|
||||||
|
@ -267,19 +273,22 @@ class MetaConfigNode(type):
|
||||||
elif isSimObjSequence(val):
|
elif isSimObjSequence(val):
|
||||||
dict[key] = [ v() for v in val ]
|
dict[key] = [ v() for v in val ]
|
||||||
|
|
||||||
|
else:
|
||||||
|
dict[key] = val
|
||||||
|
|
||||||
# If your parent has a value in it that's a config node, clone it.
|
# If your parent has a value in it that's a config node, clone it.
|
||||||
for base in bases:
|
for base in bases:
|
||||||
if not isConfigNode(base):
|
if not isConfigNode(base):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for name,value in base._values.iteritems():
|
for key,value in base._values.iteritems():
|
||||||
if dict.has_key(name):
|
if dict.has_key(key):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if isConfigNode(value):
|
if isConfigNode(value):
|
||||||
priv['_values'][name] = value()
|
priv['_values'][key] = value()
|
||||||
elif isSimObjSequence(value):
|
elif isSimObjSequence(value):
|
||||||
priv['_values'][name] = [ val() for val in value ]
|
priv['_values'][key] = [ val() for val in value ]
|
||||||
|
|
||||||
# entries left in dict will get passed to __init__, where we'll
|
# entries left in dict will get passed to __init__, where we'll
|
||||||
# deal with them as params.
|
# deal with them as params.
|
||||||
|
@ -293,12 +302,12 @@ class MetaConfigNode(type):
|
||||||
cls._bases = [c for c in cls.__mro__ if isConfigNode(c)]
|
cls._bases = [c for c in cls.__mro__ if isConfigNode(c)]
|
||||||
|
|
||||||
# initialize attributes with values from class definition
|
# initialize attributes with values from class definition
|
||||||
for pname,value in dict.iteritems():
|
for key,value in dict.iteritems():
|
||||||
setattr(cls, pname, value)
|
key = key.split(dot_decorator)
|
||||||
|
c = cls
|
||||||
if hasattr(cls, '_init'):
|
for item in key[:-1]:
|
||||||
cls._init()
|
c = getattr(c, item)
|
||||||
del cls._init
|
setattr(c, key[-1], value)
|
||||||
|
|
||||||
def _isvalue(cls, name):
|
def _isvalue(cls, name):
|
||||||
for c in cls._bases:
|
for c in cls._bases:
|
||||||
|
@ -390,7 +399,6 @@ class MetaConfigNode(type):
|
||||||
raise AttributeError, \
|
raise AttributeError, \
|
||||||
"object '%s' has no attribute '%s'" % (cls.__name__, cls)
|
"object '%s' has no attribute '%s'" % (cls.__name__, cls)
|
||||||
|
|
||||||
|
|
||||||
# Set attribute (called on foo.attr = value when foo is an
|
# Set attribute (called on foo.attr = value when foo is an
|
||||||
# instance of class cls).
|
# instance of class cls).
|
||||||
def __setattr__(cls, attr, value):
|
def __setattr__(cls, attr, value):
|
||||||
|
|
|
@ -31,7 +31,7 @@ sys.path.append('..')
|
||||||
sys.path.append('../configs/kernel')
|
sys.path.append('../configs/kernel')
|
||||||
sys.path.append('../sim/pyconfig')
|
sys.path.append('../sim/pyconfig')
|
||||||
|
|
||||||
from importer import mpy_exec, AddToPath
|
from importer import mpy_exec, mpy_execfile, AddToPath
|
||||||
from m5config import *
|
from m5config import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -51,7 +51,7 @@ except getopt.GetoptError:
|
||||||
|
|
||||||
for arg in args:
|
for arg in args:
|
||||||
AddToPath(os.path.dirname(arg))
|
AddToPath(os.path.dirname(arg))
|
||||||
mpy_exec(file(arg, 'r'), globals())
|
mpy_execfile(arg)
|
||||||
|
|
||||||
if globals().has_key('root') and isinstance(root, type) \
|
if globals().has_key('root') and isinstance(root, type) \
|
||||||
and issubclass(root, Root):
|
and issubclass(root, Root):
|
||||||
|
|
Loading…
Reference in a new issue