Can I translate Structural Verilog to JSON with no optimizations? #3338
-
I'm working on a project that generates Structural Verilog. I want to translate this to JSON so that I can run PnR. Yosys does a bunch of optimizations and for clarity I'd like to turn those off. Is there a way to run Yosys on a Example workflowAs an example of my desired workflow, suppose I run the following script:
This writes two files: What I'd like to do is run "Why do you want to do this?"Great question!! I don't actually care about
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Verilog is unfortunately the representation that is the furthest away from Yosys' internal representation (RTLIL), so there are more places for both the frontend and the backend to introduce differences. This would probably be much more likely to work if you were able to use RTLIL or JSON for the round-trip, but it seems that's not a possibility for your use case. But generally, the shortest script to get json from a verilog file would be:
If your |
Beta Was this translation helpful? Give feedback.
Verilog is unfortunately the representation that is the furthest away from Yosys' internal representation (RTLIL), so there are more places for both the frontend and the backend to introduce differences. This would probably be much more likely to work if you were able to use RTLIL or JSON for the round-trip, but it seems that's not a possibility for your use case.
But generally, the shortest script to get json from a verilog file would be:
If your
out.sv
is actually structural, i.e. does not contain any always blocks, there is some chance that this will not be too far from the out.json of your first script. However,wri…