Skip to content

Implementing Custom Passes in Yosys for Module Integration and Signal Connection #4246

Closed Answered by nakengelhardt
mmxsrup asked this question in Q&A
Discussion options

You must be logged in to vote

This document has an introduction to how to create your own pass: https://github.com/YosysHQ/yosys/blob/master/guidelines/GettingStarted

To add a module, your pass can use the design->addModule(ID(your_custom_module_name)) function, and then module->addPort(), module->addWire(), and all the module->addXXX() for internal cells to construct the module contents. To instantiate the module inside another existing module, you find the module you want using design->module(ID(module_name)), then use module->addCell(ID(your_custom_module_name)) to instantiate the custom module. Then you can use cell->setPort() to connect it to wires within the existing module. If you need to add new ports to exist…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mmxsrup
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants