add comments on convenience names
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 12 May 2019 04:29:40 +0000 (05:29 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 12 May 2019 04:29:40 +0000 (05:29 +0100)
src/nmutil/queue.py

index 0038953d6ea8b3d33fd21273219f4922a725101b..9407e5e0007356db40bd2e6b433d425899907fd6 100644 (file)
@@ -65,14 +65,18 @@ class Queue(FIFOInterface, Elaboratable):
         m.submodules.ram_read = ram_read = ram.read_port(synchronous=False)
         m.submodules.ram_write = ram_write = ram.write_port()
 
-        # convenience names
+        # convenience names, for people familiar with ready/valid terminology
+        # "p" stands for "previous stage", "n" stands for "next stage"
+        # for people familiar with the chisel Decoupled library:
+        # enq is "enqueue" (data in, aka "prev stage"),
+        # deq is "dequeue" (data out, aka "next stage")
         p_ready_o = self.writable
         p_valid_i = self.we
-        enq_data = self.din
+        enq_data = self.din # aka p_data_i
 
         n_valid_o = self.readable
         n_ready_i = self.re
-        deq_data = self.dout
+        deq_data = self.dout # aka n_data_o
 
         # intermediaries
         ptr_width = bits_for(self.depth - 1) if self.depth > 1 else 0