Skip to content

Conversation

jix
Copy link
Member

@jix jix commented May 7, 2025

What are the reasons/motivation for this change?

For some use cases it is desirable to transfer names from wires to their driving cells.

Explain how this is achieved.

This adds a -move-to-cell option to rename -wire which doesn't add a suffix to the cell name but instead adds a suffix to the wire name, if necessary to avoid conflicts.

It also makes rename -wire use the correct HDL indices for wires with non-zero-indexing, whether using -move-to-cell or not.

If applicable, please suggest to reviewers how they can test the change.

By replacing rename -wire with rename -wire -move-to-cell in an existing flow.

@jix jix requested a review from widlarizer May 7, 2025 11:46
@jix
Copy link
Member Author

jix commented May 7, 2025

@tspyrou @precisionmoon: This implements the renaming we were discussing. To make it easy to test this change in isolation, I rebased this PR branch on top of the Yosys commit that the ORFS master is currently using. Note that this adds a new rename variant, so testing it does require also changing rename -wire to rename -wire -move-to-cell in ORFS's synth.tcl.

@widlarizer
Copy link
Collaborator

This is a pattern that I created with rename -hide that prevents the new mode from doing its job as it checks whatever is the directly driven wire without traversing the tree of aliases or querying a sigmap that would have a public name promoted. The purpose for this pass is to be able to refer cells post-synthesis, so I think we can assume such a shape won't happen, but I'm not 100% sure

image

@ShinyKate
Copy link
Collaborator

@widlarizer any more feedback for this?

@widlarizer widlarizer force-pushed the rename_move_to_cell branch from 983ff1b to 856fc43 Compare August 13, 2025 09:14
@widlarizer widlarizer merged commit 195d3ef into YosysHQ:main Aug 14, 2025
31 checks passed
@precisionmoon
Copy link

image I tried the new option on one design sky130hd / gcd. There is no QoR impact and the resulting FF names look fine. Is it safe to replace rename -wire with rename -wire -move-to-cell?

@widlarizer
Copy link
Collaborator

Yes, feel free to use this in ORFS instead of the current rename -wire @precisionmoon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants