Closed anshumanmohan closed 2 weeks ago
A silly thought re: FIFO's max length
At present, the FIFO is internally just 1-d memory that I treat as a circular buffer. Two registers, read
and write
, mark which cell of the memory should next be read from or written to. The registers are incremented as needed, and, when they equal the maximum length of the queue, they are zeroed out to simulate a wraparound.
Perhaps super silly, but I was wondering how we'd feel about requiring the queue's maximum length to be a power of 2. Then we'd be able to simply keep incrementing these registers forever, trusting actual overflow to do the zeroing-out for us. We'd save a couple of equality-checking cells and the wiring needed to run those checks and potentially zero the registers.
Update: the silly thought is its own PR, #2028
Just a little tidying in the FIFO and the PIFO.
ans
cell when the queue component had an error; this turned out not to be necessary.My original goal was actually to turn
ans
anderr
, which are currently registers passed to the queue component by reference, into output ports. I've decided that change is a little too much trouble for now.I have a new silly thought, which I'll flesh out in a comment below.