123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- from __future__ import division, absolute_import, print_function, unicode_literals
- from awlsim.common.compat import *
- from awlsim.common.util import *
- from awlsim.common.exceptions import *
- from awlsim.core.hardware_params import *
- from awlsim.core.hardware import *
- from awlsim.core.operators import *
- from awlsim.core.offset import *
- from awlsim.core.cpu import *
- class HardwareInterface_Dummy(AbstractHardwareInterface):
- name = "dummy"
- description = "Dummy hardware module that does nothing."
- def __init__(self, sim, parameters={}):
- AbstractHardwareInterface.__init__(self,
- sim = sim,
- parameters = parameters)
- def doStartup(self):
- pass
- def doShutdown(self):
- pass
- def readInputs(self):
- pass
- def writeOutputs(self):
- pass
- def directReadInput(self, accessWidth, accessOffset):
- if accessOffset < self.inputAddressBase:
- return bytearray()
-
- try:
- return self.sim.cpu.fetchInputRange(accessOffset, accessWidth // 8)
- except AwlSimError as e:
-
- return bytearray( (0,) * (accessWidth // 8) )
- def directWriteOutput(self, accessWidth, accessOffset, data):
- if accessOffset < self.outputAddressBase:
- return False
-
- return True
- HardwareInterface = HardwareInterface_Dummy
|