aboutsummaryrefslogtreecommitdiffstats
path: root/generic/synth/synth_generic.tcl
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2019-04-19 17:40:55 +0100
committerGitHub <noreply@github.com>2019-04-19 17:40:55 +0100
commit5344bc3b65f4e06f983db781e9a82d30b3f1512b (patch)
tree5f794074ccc963a9dbf756558e34a8eba0d5fa26 /generic/synth/synth_generic.tcl
parent0be844e6a8d0a36a50815ec5331fd7480dd20db6 (diff)
parent87a24460813b9f52189323352554a1c352836ee2 (diff)
downloadnextpnr-5344bc3b65f4e06f983db781e9a82d30b3f1512b.tar.gz
nextpnr-5344bc3b65f4e06f983db781e9a82d30b3f1512b.tar.bz2
nextpnr-5344bc3b65f4e06f983db781e9a82d30b3f1512b.zip
Merge pull request #261 from YosysHQ/pygeneric
Python API for generic architecture
Diffstat (limited to 'generic/synth/synth_generic.tcl')
-rw-r--r--generic/synth/synth_generic.tcl24
1 files changed, 24 insertions, 0 deletions
diff --git a/generic/synth/synth_generic.tcl b/generic/synth/synth_generic.tcl
new file mode 100644
index 00000000..e5d88e0d
--- /dev/null
+++ b/generic/synth/synth_generic.tcl
@@ -0,0 +1,24 @@
+# Usage
+# tcl synth_generic.tcl {K} {out.json}
+
+set LUT_K 4
+if {$argc > 0} { set LUT_K [lindex $argv 0] }
+yosys read_verilog -lib [file dirname [file normalize $argv0]]/prims.v
+yosys hierarchy -check
+yosys proc
+yosys flatten
+yosys tribuf -logic
+yosys deminout
+yosys synth -run coarse
+yosys memory_map
+yosys opt -full
+yosys techmap -map +/techmap.v
+yosys opt -fast
+yosys abc -lut $LUT_K -dress
+yosys clean
+yosys techmap -D LUT_K=$LUT_K -map [file dirname [file normalize $argv0]]/cells_map.v
+yosys clean
+yosys hierarchy -check
+yosys stat
+
+if {$argc > 1} { yosys write_json [lindex $argv 1] }