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

Jacob Lifshay programmerjake at gmail.com
Tue Sep 21 03:33:42 BST 2021

On Mon, Sep 20, 2021, 18:50 Luke Kenneth Casson Leighton <lkcl at lkcl.net>

> nmigen's m.If/Else and m.Switch/Case constructs map down
> onto case statements in an AST parser phase.  those case
> statements are then in turn mapped onto nmigen MUX, CAT
> and PART.

nmigen doesn't do that, nmigen leaves that all to yosys's process passes.

> by the time the m.If/Else and m.Switch/Case statements are
> done, the entire AST is completely devoid of all evidence of
> If/Else, and pure IR-level Mux and IR-level case/switch is
> all that is left.
> therefore, by providing an over-ride mechanism whereby
> MUX, CAT and PART may redirect to kls.__MUX__,
> kls.__CAT__ and kls.__PART__ respectively,

nmigen isn't where that translation logic could be hooked into, so that
approach won't work.



More information about the Libre-soc-dev mailing list