New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multipack support #116
Multipack support #116
Conversation
Latest set of changes add the This should be ready for review. |
ugh how did that become a pulldown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me.
Overview
Add multipack device (eg, 4-resistor array as a single board component), where individual blocks across the design tree can be packed into this multipack device. The multipack device is otherwise a normal Block and defined as such (including support for parameters, generators, and ports.
Internally, multipack is implemented through two tunneling (cross-hierarchy) constructs: export tunnel (where the port being exported to can be anywhere in the hierarchy - so for example we can have a resistor but the packed resistor is "inside" it). Typically, the packed device will be at the top of the design, while the element devices are across the design tree. The multipack device should enforce that the devices can be packed and export the relevant parameters (for example, a multipack resistor's resistance spec should be the intersection of all the element resistances, and once a part is selected should set the individual element's resistances to be the packed resistance).
Resolves #74
Resolves #115
Examples
Example multipack definition for a resistor array:
Example top-level packing definition using that resistor array:
Detailed changelog
Frontend changes:
DesignTop
. Since multipack is kind of in-between the design tree and refinements, it is defined in its own block / method.multipack()
adds packing data into an internal data structure, which is then generated into IR constructs (exported tunnel and assign tunnel) in proto generation and refinements (instance refinements for the element type).self.PackedBlock
is used to defined a multipack device at the top level (analogous toself.Block
), thenself.pack
is used to set the multipack device's elements to anywhere in the design hierarchy (usingList[str]
/DesignPath
).MultipackBlock
as an extension ofBlock
- a block that is a packed device, can define packed elements (possibly n-elementPackedBlockArray
), and defines rules of how the packed elements export/assign into its ports and parameters.List[str]
->DesignPath
IR & compiler changes:
ExportedTunnel
, where the internal-side port must be a subblock port (like a typical export) but the external-side port can be anywhere within the subtreeAllocatedTunnelExport
PortConnection type, which is structured like AllocatedConnect but only supporting export connections.AssignTunnel
, where the expression can contain references arbitrarily deep in the subtree. (not that Assign currently checks for locality - but it may in the future)Array
ValueExpr
, that takes a collection ofValueExprs
and packs them into an array. This is needed for multipack array, eg to pack 4 resistors, this takes each one'sresistance
and packs it into the packed-resistor'sresistances
array-parameter.Library changes:
ResistorArray
abstract type, for a packed resistor array.JlcResistorArray
, which parses (some) resistor arrays from the JLC parts tables. This matches on the part number, in part to determine whether it's concave or convex type.Future work:
ConstraintExpr
andPackedBlockParamArray
andPackedBlockParam
- and having all those if cases) once it gets to DesignTop?