From: Luke Kenneth Casson Leighton Date: Mon, 31 Jan 2022 16:13:15 +0000 (+0000) Subject: store latch next in temporary X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a5d3936b335ceaef952a53e98b06bd5dcdc1f295;p=nmutil.git store latch next in temporary --- diff --git a/src/nmutil/latch.py b/src/nmutil/latch.py index f4c03ab..e250508 100644 --- a/src/nmutil/latch.py +++ b/src/nmutil/latch.py @@ -74,11 +74,13 @@ class SRLatch(Elaboratable): def elaborate(self, platform): m = Module() - m.d.sync += self.q_int.eq((self.q_int & ~self.r) | self.s) + next_o = Signal(self.llen, reset_less=True) + m.d.comb += next_o.eq((self.q_int & ~self.r) | self.s) + m.d.sync += self.q_int.eq(next_o) if self.sync: m.d.comb += self.q.eq(self.q_int) else: - m.d.comb += self.q.eq((self.q_int & ~self.r) | self.s) + m.d.comb += self.q.eq(next_o) m.d.comb += self.qn.eq(~self.q) m.d.comb += self.qlq.eq(self.q | self.q_int) # useful output