Comments (4)
I think the best option is to have an unsafe output_name
field on any CoreIR module (maybe instance too), which will override the default CoreIR name generation logic. Throwing a bunch of logic into name generation @ CoreIR level seems complicated and hard to get right. We could do logic at the higher levels (e.g. magma) to make sure that any output_name
overrides are safe.
from coreir.
A seemingly simple option: provide some option for verilog code generation for a prefix that goes before all modules (e.g. coreir --verilog_module_name_prefix=foo
). Then, simply do a pass on all the verilogAST modules and insert the prefix. The main benefit here is that this should work for code that includes multiple namespaces (e.g. we may want to have separate namespaces to handle shared names, but at the end of the day we want everything to have a shared prefix for the above use case). This feels simpler than having to do a pass at the magma level to set output_name for all modules. Also, I'm not sure that would work for commonlib muxes for example, since in magma we reference them as instances of generators, to the actual generated module does not have a handle until rungenerators is invoked later on (so we'd need to do this logic at the coreir level not the magma level)
from coreir.
A code-generation/verilogAST specific pass seems fine to me. I was concerned if it was a CoreIR pass/abstraction, it would be clunky but doing that in verilogAST seems reasonable.
from coreir.
The verilogAST pass seems reasonable to me.
from coreir.
Related Issues (20)
- Add module longname C API
- Compilation error on Apple M1 chip HOT 11
- Request for CoreIR compatible with Windows. HOT 1
- InstanceVisitorPass does not allow passing in functors that have access to the class object itself.
- Need to change googletest tag from master to main HOT 2
- google test throws sign conversion warnings
- Add a Custom Name for CoreIR Generator When Generate Verilog HOT 14
- Cannot get two bit types to wire together regardless of direction? HOT 3
- [RFC] Bit Pattern Support in coreir HOT 6
- Regression in inline commonlib mux verilog generation
- Verilog backend can clobber names when generating instance output port wires
- Having trouble at branch rm-ubuf-master HOT 3
- inline_single_instance pass should maintain instance name HOT 1
- Update JSON for Modern C++
- Why is IEEE compliance for CW floating point add/mul set to 0? HOT 2
- verilog ND-array generation should be packed arrays instead of unpacked arrays. HOT 3
- Add Multiply optimization
- segfault when using prototype components. HOT 44
- add_dummy_inputs pass doesn't work with sliced signals
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coreir.