[Libre-soc-dev] SimdSignal scalar/vector switching and SimdShape.width

lkcl luke.leighton at gmail.com
Sat Oct 30 10:43:11 BST 2021


On Fri, Oct 29, 2021 at 1:21 PM lkcl <luke.leighton at gmail.com> wrote:

> it's quite a long chain, but it means that some SimdShape()s get created *before all parameters are known*.
>
> which means some tweaking is needed of how to bring all that together.

rrright.  i remembered what the issue is, and how to solve it.

* a new function __call__ to be added to SimdScope which takes a
module parameter
* SimdScope to be permitted to have module=None
* should that be detected in SimdScope.Signal an assertion is thrown

usage is:

s = SimdScope(module=None, .....)

m = Module()
with s(m) as newscope:

and all parameters - including the module this time - are copied over
to the new scope instance.

this allows the creation of scope variables (and associated
SImdShapes) loooong before they're
used in an actual Elaboratable.


another issue is that a new scope is needed for a sync domain.  this
will require having
that __call__ function take a new elwid parameter as well:

with currentscope(elwid=next_elwid) as syncdomainscope:
   ....
   ...
   sync += next_elwid.eq(currentscope.elwid)

elwid in each scope cannot be global, it has to be DFF-latch-synced
and progress just
like everything else in every pipeline stage.

l.



More information about the Libre-soc-dev mailing list