From dd0f3311cd4d2090ffe2717a9e87812f5cab15c1 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 15 Mar 2013 19:15:48 +0100 Subject: [PATCH] structure: remove Fragment.call_sim --- migen/fhdl/structure.py | 5 ----- migen/sim/generic.py | 9 +++++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index 056d602d..ce128019 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -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) diff --git a/migen/sim/generic.py b/migen/sim/generic.py index 0f56423e..ff47e656 100644 --- a/migen/sim/generic.py +++ b/migen/sim/generic.py @@ -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 + "." \ -- 2.30.2