From 06231befc456f8dc9fcc2d46c30aea0dc3e88b45 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 4 Aug 2020 12:44:13 +0100 Subject: [PATCH] get litex sim to kick off a "STEP" via the DMI interface every N cycles --- src/soc/litex/florent/sim.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/soc/litex/florent/sim.py b/src/soc/litex/florent/sim.py index 50ab2a98..d9046f75 100755 --- a/src/soc/litex/florent/sim.py +++ b/src/soc/litex/florent/sim.py @@ -47,8 +47,8 @@ class LibreSoCSim(SoCCore): # setup running of DMI FSM dmi_addr = Signal(3) dmi_din = Signal(64) - dmi_wen = Signal(64) dmi_dout = Signal(64) + dmi_wen = Signal(1) dmi_req = Signal(1) uptime = Signal(64) @@ -69,10 +69,6 @@ class LibreSoCSim(SoCCore): self.cpu.dmi_wr.eq(1), # DMI write If(self.cpu.dmi_ack, (NextState("IDLE"), - self.cpu.dmi_addr.eq(0), - self.cpu.dmi_din.eq(0), - self.cpu.dmi_req.eq(0), - self.cpu.dmi_wr.eq(0), ) ), ), @@ -81,11 +77,15 @@ class LibreSoCSim(SoCCore): dmifsm.act("IDLE", (NextValue(dmi_req, 0), + NextValue(dmi_addr, 0), + NextValue(dmi_din, 0), + NextValue(dmi_wen, 0), + NextState("START"), # back to start on next cycle ) ) # kick off a "stop" - self.comb += If(uptime == 0, + self.sync += If(uptime == 0, (dmi_addr.eq(0), # CTRL dmi_din.eq(1<<0), # STOP dmi_req.eq(1), @@ -93,6 +93,18 @@ class LibreSoCSim(SoCCore): ) ) + # loop every 1<