projects
/
nmutil.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4bbcb8
)
store latch next in temporary
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Mon, 31 Jan 2022 16:13:15 +0000
(16:13 +0000)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Mon, 31 Jan 2022 16:13:22 +0000
(16:13 +0000)
src/nmutil/latch.py
patch
|
blob
|
history
diff --git
a/src/nmutil/latch.py
b/src/nmutil/latch.py
index f4c03ab9f5784f7c1365bc3c8454c12fc6e95140..e25050867aab9825f0d7541d6444cec2a310995e 100644
(file)
--- 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