BerkeleyHCI / PolymorphicBlocks

A work-in-progress board-level hardware description language (HDL) providing design automation through generators and block polymorphism.
BSD 3-Clause "New" or "Revised" License
70 stars 11 forks source link

Allow split nets in generators #29

Closed ducky64 closed 2 years ago

ducky64 commented 3 years ago

Currently, links must be fully defined in a generate function or in the base block definition - they can't be split. This makes for some awkward code (though generators are advanced functionality).

One idea to fix this would be to defer link size resolution until all the generators that could attach to a link runs (perhaps sharing infrastructure with #20). Generators would need to declare where they connect, though.

Alternatively, generators could define the block's implementation so the block doesn't elaborate until its generator runs. Which, if it doesn't break any use cases, could be the more elegant solution. This limits to one generator per block.

ducky64 commented 2 years ago

Thinking about the "generators define the block's implementation" a bit more:

As a concrete example of something that could break (I think - not tested yet):

Ideas