add docstring to latchregister
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 4 May 2020 12:53:05 +0000 (13:53 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 4 May 2020 12:53:05 +0000 (13:53 +0100)
src/nmutil/latch.py

index 7d6a1efe22c881585a626e397590337186f6ef1b..1c22483a49b93cfdbeeecb4cb97e40cae2e8b4f3 100644 (file)
@@ -22,6 +22,15 @@ endmodule
 """
 
 def latchregister(m, incoming, outgoing, settrue, name=None):
+    """latchregister
+
+    based on a conditon, "settrue", incoming data will be "latched"
+    into a register and passed out on "outgoing".
+
+    * if "settrue" is ASSERTED, outgoing is COMBINATORIALLY equal to incoming
+    * on the same cycle that settrue is DEASSERTED, outgoing REMAINS
+      equal (indefinitely) to the incoming value
+    """
     # make reg same as input. reset OK.
     if isinstance(incoming, Record):
         reg = Record.like(incoming, name=name)