so whilst that may sound completely and utterly insane, to have a python (verilog) function with over 800 inputs and outputs, for a pinmux that’s on the reasonable side.
background: i am currently designing a libre pinmux auto-generator (written in python) that is being designed to aid and assist the process of creating a pin multiplexer for SoCs. documentation will be auto-generated, device-tree files for linux kernels will be auto-generated, header files for inclusion in arduino libraries, linux kernel source code, *BSD kernel source code, libopencm3, everything. all the things that are done by hand right now that have to be done by hand because most of the time a pinmux is implemented by proprietary companies.
the first language-output mode is progressing well, it is for bluespec’s BSV. now with testing underway it is time to move on to myhdl.
and there i have a bit of a problem. the auto-generated output from bluespec’s BSV compiler automatically unpacks any “objects” that are passed to it, such that the wires IN those objects (three in this particular case) end up as auto-generated verilog with over EIGHT HUNDRED arguments.
for a pinmux which has extremely complex inter-dependencies this really is the only way.
the pinmux that i am working with has 160 pins (rows), and 4 muxer entries (columns). so object “1” is the muxer settings (QTY 160 wires @ 2 bits each).
object 2 is the iopads (QTY 160, @ 3 wires each: in-wire, out-wire and direction-setting-wire).
object 3 is the peripherals, of which there are around 30, each with between 2 and 96 “pins”, where each “pin” has, again, depending on function type, an input wire, and output wire, and sometimes both so it also has its own direction-control wire.
bluespec’s BSV compiler handles this really well by allowing objects to be passed as function parameters. that will be three objects: one for the muxer (with a list of 160 wires), one for the iopads (with a list of 480 wires), and one for the peripherals (with hundreds more wires).
does myhdl have the ability to pass objects into functions, where the objects will be recognised as having input and output wires in them, such that i don’t have to have an insane number of arguments to a function?
is it possible to pass in lists of wires for example?