-
Notifications
You must be signed in to change notification settings - Fork 16
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
Hierarchical Flattening for Modules #86
Comments
This would be a welcome addition!
Particularly re the "other types of leaf nodes": Hdl21 has four Instantiable = Union[Module, ExternalModuleCall, GeneratorCall, PrimitiveCall] I.e. those are the four kinds of things that can be the target of an Of those, two are "irreducible": primitives ( Another (bonus!) feature would be adding the capacity for a "stop list" of
I think that is potentially true, depending whether you'd want to include "floating" Do Modules actually have these? Sure! They have all kinds of weird stuff, both intentionally and not. E.g. for:
Does it matter whether we do? Probably not; if the source-Module has floating Signals, I suppose it makes sense to just transfer them along to the flattened-Module. (Inside of a SPICE simulator, in contrast, you'd need to filter these out, or generally get a singular matrix due to them.) |
Where should this feature go in Hdl21 file structure? |
I think a package-level def flatten(m: Module) -> Module:
elaborate(m)
return flattening_stuff_youre_already_doing(m)
def flattening_stuff_youre_already_doing(m: Module) -> Module:
# Ya know, the stuff you're already doing! |
Why we need it
Hierarchical information might not be needed for some use cases. For example, listing out all MOSes and compute their total area. It would be nice to have a functionality that flattens a module into a module with a single layer.
Specifications
(partial credit from @dan-fritchman)
PrimitiveCall
s or other types of leaf nodes.Example
I have a small script to do this for simple cases (will PR later).
Source Module Vlsir
Flattened Module Vlsir
The text was updated successfully, but these errors were encountered: