From 08aef59f79da4da6355082c880f968ca19c440fc Mon Sep 17 00:00:00 2001 From: annoyatron255 Date: Sun, 5 May 2024 02:29:15 -0500 Subject: [PATCH] Add shrink SOP and PCF files --- shrink_sop.tcl | 26 ++++++++++++++++++++++++++ testcases/inout_tristate.pcf | 5 +++++ testcases/mc14500b.pcf | 13 +++++++++++++ testcases/tristate.pcf | 6 ++++++ 4 files changed, 50 insertions(+) create mode 100755 shrink_sop.tcl create mode 100644 testcases/inout_tristate.pcf create mode 100644 testcases/mc14500b.pcf create mode 100644 testcases/tristate.pcf diff --git a/shrink_sop.tcl b/shrink_sop.tcl new file mode 100755 index 0000000..c857789 --- /dev/null +++ b/shrink_sop.tcl @@ -0,0 +1,26 @@ +#!/usr/bin/env -S yosys -c +yosys -import + +# Check arguments +if { $argc < 3 } { + puts "USAGE: $argv0 -- " + exit +} + +read_json [lindex $argv 0] +hierarchy -auto-top +read_verilog -lib cells_sim.v +read_liberty -lib techmaps/gal_dff.lib + +# PLAs +chtype -set "\$__sop" [lindex $argv 1] +techmap -map techmaps/pla.v -D PLA_MAX_PRODUCTS=[lindex $argv 2] [lindex $argv 1] +#chtype -map "\$__sop" "GAL_SOP" * + +# Add OLMC for internal GAL_SOPs +techmap -max_iter 1 -map techmaps/pla_olmc_int.v */t:GAL_SOP %co1 */w:* %i */t:GAL_SOP %ci1 */w:* %i %i %c %ci1 %D + +clean -purge + +write_json [lindex $argv 0] +#write_json test.json diff --git a/testcases/inout_tristate.pcf b/testcases/inout_tristate.pcf new file mode 100644 index 0000000..7354505 --- /dev/null +++ b/testcases/inout_tristate.pcf @@ -0,0 +1,5 @@ +set_io a 2 +set_io b 3 +set_io c 4 +set_io y 12 +set_io z 13 diff --git a/testcases/mc14500b.pcf b/testcases/mc14500b.pcf new file mode 100644 index 0000000..9e9cc9d --- /dev/null +++ b/testcases/mc14500b.pcf @@ -0,0 +1,13 @@ +set_io clk 1 +set_io i_inst[0] 2 +set_io i_inst[1] 3 +set_io i_inst[2] 4 +set_io i_inst[3] 5 +set_io i_data 6 +set_io write 16 +set_io jmp 17 +set_io rtn 14 +set_io flag0 23 +set_io flagf 20 +set_io o_rr 21 +set_io o_data 22 diff --git a/testcases/tristate.pcf b/testcases/tristate.pcf new file mode 100644 index 0000000..6f2a016 --- /dev/null +++ b/testcases/tristate.pcf @@ -0,0 +1,6 @@ +set_io a 2 +set_io b 3 +set_io c 4 +set_io d 5 +set_io x 12 +set_io y 13