I want to write my own Yosys synthesis script. What is a good template to start with? The manual and webpage contain various examples, but no "authoritative" hello world example.
The synth
command runs the recommended script for general-purpose synthesis tasks. See help synth
for a complete list of commands called by this meta-command.
Your script should either borrow from synth
or simply call synth
to get the general-purpose stuff done. Many scripts call synth -run coarse
for the coarse-grain part of synthesis and then continue with a custom sequence of commands for fine grains synthesis. See for example synth_xilinx
.
For ASIC synthesis to a library in liberty format, use the following script as a starting point:
# read design
read_verilog mydesign.v
# generic synthesis
synth -top mytop
# mapping to mycells.lib
dfflibmap -liberty mycells.lib
abc -liberty mycells.lib
clean
# write synthesized design
write_verilog synth.v
A less aggressive set of optimizations is often desired for scripts that do formal verification. In this cases the following sequence of commands is usually a good starting point for the "synthesis" portion of a formal verification flow:
hierarchy [-check -top <top-module>]
proc; opt; memory [-nomap]; opt -fast; check -assert
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With