Device.py revision 4439
1from m5.params import * 2from m5.proxy import * 3from MemObject import MemObject 4 5class PioDevice(MemObject): 6 type = 'PioDevice' 7 abstract = True 8 pio = Port("Programmed I/O port") 9 platform = Param.Platform(Parent.any, "Platform this device is part of") 10 system = Param.System(Parent.any, "System this device is part of") 11 12class BasicPioDevice(PioDevice): 13 type = 'BasicPioDevice' 14 abstract = True 15 pio_addr = Param.Addr("Device Address") 16 pio_latency = Param.Latency('1ns', "Programmed IO latency in simticks") 17 18class DmaDevice(PioDevice): 19 type = 'DmaDevice' 20 abstract = True 21 dma = Port(Self.pio.peerObj.port, "DMA port") 22 min_backoff_delay = Param.Latency('4ns', 23 "min time between a nack packet being received and the next request made by the device") 24 max_backoff_delay = Param.Latency('10us', 25 "max time between a nack packet being received and the next request made by the device") 26 27 28 29class IsaFake(BasicPioDevice): 30 type = 'IsaFake' 31 pio_size = Param.Addr(0x8, "Size of address range") 32 ret_data8 = Param.UInt8(0xFF, "Default data to return") 33 ret_data16 = Param.UInt16(0xFFFF, "Default data to return") 34 ret_data32 = Param.UInt32(0xFFFFFFFF, "Default data to return") 35 ret_data64 = Param.UInt64(0xFFFFFFFFFFFFFFFF, "Default data to return") 36 ret_bad_addr = Param.Bool(False, "Return pkt status bad address on access") 37 update_data = Param.Bool(False, "Update the data that is returned on writes") 38 warn_access = Param.String("", "String to print when device is accessed") 39 40class BadAddr(IsaFake): 41 ret_bad_addr = Param.Bool(True, "Return pkt status bad address on access") 42 43 44