From: Luke Kenneth Casson Leighton Date: Mon, 9 Mar 2020 20:31:27 +0000 (+0000) Subject: allow name on latchregister X-Git-Tag: 24jan2021_ls180~86 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55d2673359c6a9f007012a8da96f70200895e2d4;p=nmutil.git allow name on latchregister --- diff --git a/src/nmutil/latch.py b/src/nmutil/latch.py index 84235ff..2086fe5 100644 --- 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)