Skip to content

Conversation

widlarizer
Copy link
Collaborator

@widlarizer widlarizer commented Jun 26, 2025

OpenSTA's read_verilog command supports a limited subset of Verilog. With this PR, yosys should be able to consistently present a design including derived blackboxes of internal cells made public with. The usefulness of these code changes is yet to be determined so it's a draft for now

I'm adding to box_derive a mode named -apply which actually remaps instances of parametric modules to be instances of the new derived ones. I'm also adding a publish pass that escapes internal cell types to become valid identifiers. @povik does the -apply mode seem sensible?

  • add tests
  • discard cell parameters in box_derive -apply I ended up not using this but for my use case I'm contributing it anyway since it's well defined and tested. Removing the parameters could be done in a followup if necessary

@widlarizer widlarizer changed the title Emil/opensta verilog export OpenSTA verilog compatibility Jun 26, 2025
Copy link
Member

@povik povik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rename the new option otherwise the box_derive changes look good to me

@widlarizer widlarizer mentioned this pull request Jul 18, 2025
2 tasks
@widlarizer widlarizer force-pushed the emil/opensta-verilog-export branch 2 times, most recently from 7c61c30 to 4706c82 Compare October 8, 2025 23:49
@widlarizer
Copy link
Collaborator Author

Ideally, I'd add

design -reset
read_verilog <<EOT
module top(input A, input B, output Y);
assign Y = A ^ B;
endmodule
EOT

select -assert-count 1 t:$xor
select -assert-count 0 t:\$xor
chtype -publish_icells
dump
select -assert-count 0 t:$xor
select -assert-count 1 t:\$xor

or similar to tests/techmap/techmap_chtype.ys. However, #5414

@widlarizer widlarizer marked this pull request as ready for review October 9, 2025 00:08
@widlarizer widlarizer force-pushed the emil/opensta-verilog-export branch from 72c2081 to e42b1e5 Compare October 13, 2025 15:26
@widlarizer widlarizer force-pushed the emil/opensta-verilog-export branch from e42b1e5 to e9aedf5 Compare October 14, 2025 13:03
@widlarizer widlarizer merged commit a5960ce into main Oct 14, 2025
30 checks passed
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.

2 participants