[Libre-soc-dev] adding PartitionedSignal support to nmigen's If/Switch/Case

lkcl luke.leighton at gmail.com
Tue Sep 21 22:34:12 BST 2021



On September 21, 2021 9:14:57 PM UTC, Jacob Lifshay <programmerjake at gmail.com> wrote:

>
>assigning just the partition lane still has problems afaict, it will
>require more thought.

take your time to absorb and go through it.  it doesn't *seem* to work... or at least, i have asked myself many times, "noo, surely it's not that simple" and yes, i believe it is, because of the duplication (the rules set by PartitionedMux and obeyed by PartitionedSignsl.__eq__ etc)

remember i spent several months planning this.

>one of the problems is: what happens when something in the If body is
>partitioned differently than the If condition.

that would be a violation of the rules i.e. is flat-out prohibited.

there is only one Partition Mask incoming via the Stage API, and all PartitionedSignals *MUST* use that and no other Mask.

we will need an override on nmigen.Module (or some other method) which establishes that there can and will be only one Mask.

if anyone else wants to break that rule, good luck to them.

this is all very specific, very restricted, very simple, and yet insanely hard to grasp at the same time.

it took me many months to work out.

l.



More information about the Libre-soc-dev mailing list