[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:03:22 BST 2019
http://bugs.libre-riscv.org/show_bug.cgi?id=64
--- Comment #34 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #8)
> > * why does Block.wrap exist? the need for Block and BlockLike is not
> > clear, and is probably down to the (unnecessary) type-restricting
> Block.wrap is a function that takes an instance of Block or CombSeg and
> returns an instance of Block. It is needed because CombSeg does not have the
> ready/valid signalling that Block instances do.
interestingly this still didn't help me to understand. it was only
when i realised that Block holds duplicate (redundant) data-specs to
CombSeg that i finally *deduced* that Block.wrap must exist as a means
to make CombSeg look like a Block, by connecting CombSeg's in/out data
to Block's in/out-data.
that this took me several attempts to understand, when i have been looking
at the code for some considerable time, has me concerned (as does the
duplication).
i am much more comfortable with Block not having data *until* it is
passed a Stage, where Stage says what the data format *is*. not
*contains* the data: contains (specifies) what the *format* is.
Stage API specifies the format of the data and specifies how it is processed.
connecting Stage API compliant "things" together creates a combinatorial
chain that *STILL DOES NOT CONTAIN ANY DATA*.
when calling StageChain with "nospecallocate" it results in a *python*
function-chain which is in effect:
def process(i):
return chain[0].process(chain[1].process(chain[2].process(i))))
this *still* does not allocate any data.
however due to some issues with nmigen modules, i added a variant on that
which can actually allocate *intermediary* ispec/ospec objects. the python
intermediary ispec/ospec objects are not actually stored anywhere, and it's
important to appreciate that they do not have to be. they are still part
of the nmigen HDL/AST.
in this way, it is possible to use and chain together *even static classes*,
because by virtue of the static classes not containing any actual data,
it's perfectly fine to chain their process() functions together.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-riscv-dev
mailing list