[libre-riscv-dev] need help with auto-pipeline stage creation

Luke Kenneth Casson Leighton lkcl at lkcl.net
Thu Apr 4 04:32:47 BST 2019

i got it... holy cow was it complicated.

i found that modifying nmigen to prepend the unique ID (DUID - see
hdl/ast.py) to the auto-generated name, such that it showed up in the
graphviz, plus an awful, awful lot of debug print statements,
eventually allowed me to get there in an extremely haphazard way.

so, FINALLY... after several days of messing about... we have an
auto-stage system for creating pipelines, and can do things like this:

            with pipe.Stage("second", p) as (p, m):
                o = ObjectProxy(None, pipemode=False)
                o.d = p.o.b + Const(5)
                p.n = p.o.a
                p.o = o

where the assignments are *automatically* added to a *nmigen module*
that is managed by an UnbufferedPipeline object, with valid/ready
management and synchronised data transfer.

it is *NOT* even necessary to know that the UnbufferedPipeline object
is being used!

pretty awesome and very very close to what's *already* in the fmul.py
code, for example, aleksander.


More information about the libre-riscv-dev mailing list