def __new__(cls, **kwargs): if Root._the_instance: fatal("Attempt to allocate multiple instances of Root.") return None # first call: allocate the unique instance # # If SimObject ever implements __new__, we may want to pass # kwargs here, but for now this goes straight to # object.__new__ which prints an ugly warning if you pass it # args. Seems like a bad design but that's the way it is. Root._the_instance = SimObject.__new__(cls) return Root._the_instance
def generateDeviceTree(self, state): # The CheckerCPU is not a real CPU and shouldn't generate a DTB # node. This is why we are skipping the BaseCPU implementation # and we are calling the base SimObject one. return SimObject.generateDeviceTree(self, state)