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

lkcl luke.leighton at gmail.com
Tue Sep 21 21:50:55 BST 2021



On September 21, 2021 8:22:36 PM UTC, Jacob Lifshay <programmerjake at gmail.com> wrote:

>20:17 <programmerjake> unfortunately, just duplicating the If statement
>bodies isn't sufficient, since you'd end up overwriting whole Signals
>assigned to inside the bodies 

no: read what i wrote, again, on the list thread and in the bugreport.

you do ***NOT*** assign whole Signals.

that is precisely and exactly what is not done.

you assign SOLELY AND EXCLUSIVELY THE PARTITION LANE.

if 64 bit and subdivided into 8 that is 8 switch/cases each ONLY DEALING WITH 8 BIT ASSIGNMENTS NOT 64 BIT ASSIGNMENTS.

the spread of the "if" bit across the whole of the partition (part of the rules of PartitionedMux) means that even when the partitions are all open, the "if" will
have either 8 zeros or 8 ones and in all 8 separate Switch-Case statements they all copy/assign their 8 separate partition columns completely independently

but because all 8 bits are all set or all clear it is *as if* the entire 64 bit ("whole") Signal is copied through.

 THERE IS NO OVERWRITING.

i repeat.

THERE IS NO OVERWRITING.

each independent switch/case deals EXLUSIVELY AND ONLY with its respective "lane" or "column".

it is incredibly simple and straightforward.

i did say, it is so incredibly that i anticipated it would be met with disbelief.  "it *has* to be more complex" (no it doesn't)

ArrayProxy on the other hand, holleeey cow.

l.




More information about the Libre-soc-dev mailing list