allow name on latchregister
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 9 Mar 2020 20:31:27 +0000 (20:31 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 9 Mar 2020 20:31:27 +0000 (20:31 +0000)
src/nmutil/latch.py

index 84235ffada66bb4b69249e585970e5097e939277..2086fe59695c3aad7b2f47d9b7dd005e4c9c128c 100644 (file)
@@ -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)