From: Luke Kenneth Casson Leighton Date: Sat, 25 Sep 2021 15:23:59 +0000 (+0100) Subject: move pc_i and svstate_i to HDLRunner X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46b475da7b0984d50ad06a2635e223633cbc96c4;p=soc.git move pc_i and svstate_i to HDLRunner --- diff --git a/src/soc/simple/test/test_runner.py b/src/soc/simple/test/test_runner.py index ca2b9341..af42368a 100644 --- a/src/soc/simple/test/test_runner.py +++ b/src/soc/simple/test/test_runner.py @@ -179,10 +179,10 @@ class SimRunner(StateRunner): class HDLRunner(StateRunner): - def __init__(self, dut, m, pspec, pc_i, svstate_i): + def __init__(self, dut, m, pspec): self.dut = dut - self.pc_i = pc_i - self.svstate_i = svstate_i + self.pc_i = Signal(32) + self.svstate_i = Signal(64) #hard_reset = Signal(reset_less=True) self.issuer = TestIssuerInternal(pspec) @@ -192,6 +192,10 @@ class HDLRunner(StateRunner): m.submodules.issuer = self.issuer self.dmi = self.issuer.dbg.dmi + comb = m.d.comb + comb += self.issuer.pc_i.data.eq(self.pc_i) + comb += self.issuer.svstate_i.data.eq(self.svstate_i) + def prepare_for_test(self, test): self.test = test @@ -365,9 +369,7 @@ class TestRunner(FHDLTestCase): # StateRunner.setup_for_test() if self.run_hdl: - pc_i = Signal(32) - svstate_i = Signal(64) - hdlrun = HDLRunner(self, m, pspec, pc_i, svstate_i) + hdlrun = HDLRunner(self, m, pspec) if self.run_sim: simrun = SimRunner(self, m, pspec) @@ -376,10 +378,6 @@ class TestRunner(FHDLTestCase): intclk = ClockSignal("coresync") comb += intclk.eq(ClockSignal()) - if self.run_hdl: - comb += hdlrun.issuer.pc_i.data.eq(pc_i) - comb += hdlrun.issuer.svstate_i.data.eq(svstate_i) - # nmigen Simulation - everything runs around this, so it # still has to be created. sim = Simulator(m)