mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
structure: remove Fragment.call_sim
This commit is contained in:
parent
9b9bd77d00
commit
dd0f3311cd
2 changed files with 7 additions and 7 deletions
|
@ -293,8 +293,3 @@ class Fragment:
|
|||
pass
|
||||
else:
|
||||
cd.rename(new)
|
||||
|
||||
def call_sim(self, simulator):
|
||||
for s in self.sim:
|
||||
if simulator.cycle_counter >= 0 or (hasattr(s, "initialize") and s.initialize):
|
||||
s(simulator)
|
||||
|
|
|
@ -73,6 +73,11 @@ end
|
|||
r += "\nendmodule"
|
||||
return r
|
||||
|
||||
def _call_sim(fragment, simulator):
|
||||
for s in fragment.sim:
|
||||
if simulator.cycle_counter >= 0 or (hasattr(s, "initialize") and s.initialize):
|
||||
s(simulator)
|
||||
|
||||
class Simulator:
|
||||
def __init__(self, fragment, top_level=None, sim_runner=None, sockaddr="simsocket", **vopts):
|
||||
if not isinstance(fragment, Fragment):
|
||||
|
@ -102,7 +107,7 @@ class Simulator:
|
|||
self.ipc.accept()
|
||||
reply = self.ipc.recv()
|
||||
assert(isinstance(reply, MessageTick))
|
||||
self.fragment.call_sim(self)
|
||||
_call_sim(self.fragment, self)
|
||||
|
||||
def run(self, ncycles=-1):
|
||||
self.interrupt = False
|
||||
|
@ -113,7 +118,7 @@ class Simulator:
|
|||
self.ipc.send(MessageGo())
|
||||
reply = self.ipc.recv()
|
||||
assert(isinstance(reply, MessageTick))
|
||||
self.fragment.call_sim(self)
|
||||
_call_sim(self.fragment, self)
|
||||
|
||||
def rd(self, item, index=0):
|
||||
name = self.top_level.top_name + "." \
|
||||
|
|
Loading…
Reference in a new issue