[libre-riscv-dev] [Bug 64] data handling / io control / data routing API needed

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Tue Apr 30 00:28:10 BST 2019


--- Comment #35 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #8)

> >   self.o_valid
> >   self.o_data
> >   self.i_data
> >   self.i_ready
> I have no opinion about the assignment order, reorder as you please.

 it's not about me, it's about other people (not necessarily me)
 not being visually confused because there are clear and clean
 patterns in the code that make "differences" easier to spot.

> > Queue
> > -----
> > 
> > * like this class a lot, prefer that it be derived from FIFOInterface,
> >   to make it clear that it conforms to the nmigen FIFO API.
> It doesn't necessarily conform to the nmigen FIFO API.
> I want it to have the same interface as Block so it can be used in
> Block-based pipelines without friction.

 that's what FIFOControl is for: to provide a transition between
 the API-of-Queue and the API-of-ControlBase (Block-esque)

> > * Queue entries can actually be zero, as long as fwft (first-word
> >   fall-through) is enabled.
> that would actually make it identical to Identity, so I think that won't be
> useful.

from a programmatic perspective, the way i see it, it would be very useful.
the alternative would have to be this:

class FIFOControl:
    def __init__(self, depth....):
        if depth == 0:
            # ARGH!  we actually needed to *derive* from Identity!
            # TODO: some sort of god-awful meta-classing
            # ARGH!  we need to meta-derive from Queue here!

or... *shudder*... provide wrapper-functions or worse have logic that
says, throughout the *entirety* of FIFOControl, "if depth == 0 do something
involving Identity else do something involving Queue"

it may actually turn out that that's what's needed anyway, so as to skip
some of the more complex parts of Queue when depth == 0.

it creates zero-width Signals to do so!

by being able to dynamically set the depth argument even to zero, 
it becomes possible to experiment *without* major code rewrites.

> > * using the name "fwft" as opposed to "allow_comb" makes it clear
> >   that it has the same purpose and effect as fwft in the nmigen FIFO API.
> allow_comb doesn't have the same purpose or effect as fwft. It specifically
> allows combinational forwarding, but also enables more than that.
> allow_comb=False specifically requires Queue to be a Moore FSM (outputs are
> produced only from flip-flop outputs) instead of a Mealy FSM (outputs are
> produced from a combinatorial combination of flip-flop outputs and input
> signals).

okay! this is very interesting.  i've been looking for these definitions
for some time.

can you please check that i have these comments correct:


if not, can you please make the necessary modifications, or explain it
clearly enough, or provide a very simple wrapper class around FIFOControl
that performs the conversion of fwft/pipe semantics into what you mean?

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-riscv-dev mailing list