Add shrink SOP and PCF files

This commit is contained in:
annoyatron255 2024-05-05 02:29:15 -05:00
parent 22ef300f0a
commit 08aef59f79
No known key found for this signature in database
GPG key ID: 95283811BE4E93F8
4 changed files with 50 additions and 0 deletions

26
shrink_sop.tcl Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env -S yosys -c
yosys -import
# Check arguments
if { $argc < 3 } {
puts "USAGE: $argv0 -- <JSON_FILE> <SOP_NAME> <MAX_SIZE>"
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

View file

@ -0,0 +1,5 @@
set_io a 2
set_io b 3
set_io c 4
set_io y 12
set_io z 13

13
testcases/mc14500b.pcf Normal file
View file

@ -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

6
testcases/tristate.pcf Normal file
View file

@ -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