projects
/
nmutil.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9335a46
)
allow name on latchregister
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Mon, 9 Mar 2020 20:31:27 +0000
(20:31 +0000)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Mon, 9 Mar 2020 20:31:27 +0000
(20:31 +0000)
src/nmutil/latch.py
patch
|
blob
|
history
diff --git
a/src/nmutil/latch.py
b/src/nmutil/latch.py
index 84235ffada66bb4b69249e585970e5097e939277..2086fe59695c3aad7b2f47d9b7dd005e4c9c128c 100644
(file)
--- a/
src/nmutil/latch.py
+++ b/
src/nmutil/latch.py
@@
-21,8
+21,8
@@
always @ (posedge c)
endmodule
"""
-def latchregister(m, incoming, outgoing, settrue):
- reg = Signal.like(incoming
) # make register same as input. reset is
OK.
+def latchregister(m, incoming, outgoing, settrue
, name=None
):
+ reg = Signal.like(incoming
, name=name) # make reg same as input. reset
OK.
with m.If(settrue):
m.d.sync += reg.eq(incoming) # latch input into register
m.d.comb += outgoing.eq(incoming) # return input (combinatorial)