| 1 |
# Usage |
| 2 |
# tcl synth_generic.tcl {K} {out.json} |
| 3 |
|
| 4 |
set LUT_K 4 |
| 5 |
if {$argc > 0} { set LUT_K [lindex $argv 0] } |
| 6 |
yosys read_verilog -lib [file dirname [file normalize $argv0]]/prims.v |
| 7 |
yosys hierarchy -check -auto-top |
| 8 |
yosys proc |
| 9 |
yosys flatten |
| 10 |
yosys tribuf -logic |
| 11 |
yosys deminout |
| 12 |
yosys synth -run coarse |
| 13 |
yosys memory_map |
| 14 |
yosys opt -full |
| 15 |
yosys techmap -map +/techmap.v |
| 16 |
yosys opt -fast |
| 17 |
yosys dfflegalize -cell \$_DFF_P_ 0 |
| 18 |
yosys abc -lut $LUT_K -dress |
| 19 |
yosys clean |
| 20 |
yosys techmap -D LUT_K=$LUT_K -map [file dirname [file normalize $argv0]]/cells_map.v |
| 21 |
yosys clean |
| 22 |
yosys hierarchy -check |
| 23 |
yosys stat |
| 24 |
|
| 25 |
if {$argc > 1} { yosys write_json [lindex $argv 1] } |