Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a good "template" Yosys synthesis script?

Tags:

yosys

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.

like image 357
CliffordVienna Avatar asked Jul 15 '15 15:07

CliffordVienna


1 Answers

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
like image 81
CliffordVienna Avatar answered Sep 17 '22 06:09

CliffordVienna