OpenFPGA/openfpga_flow/misc/ys_tmpl_yosys_vpr_bram_flow.ys

91 lines
1.9 KiB
Plaintext

# Yosys synthesis script for ${TOP_MODULE}
#########################
# Parse input files
#########################
# Read verilog files
${READ_VERILOG_FILE}
# Read technology library
read_verilog -lib -specify ${YOSYS_CELL_SIM_VERILOG}
#########################
# Prepare for synthesis
#########################
# Identify top module from hierarchy
hierarchy -check -top ${TOP_MODULE}
# - Convert process blocks to AST
proc
# Flatten all the gates/primitives
flatten
# Identify tri-state buffers from 'z' signal in AST
# with follow-up optimizations to clean up AST
tribuf -logic
opt_expr
opt_clean
# demote inout ports to input or output port
# with follow-up optimizations to clean up AST
deminout
opt -nodffe -nosdff
opt_expr
opt_clean
check
opt -nodffe -nosdff
wreduce -keepdc
peepopt
pmuxtree
opt_clean
#########################
# Run coarse synthesis
#########################
# Extract arithmetic functions
alumacc
share
opt -nodffe -nosdff
fsm
# Run a quick follow-up optimization to sweep out unused nets/signals
opt -fast -nodffe -nosdff
# Optimize any memory cells by merging share-able ports and collecting all the ports belonging to memorcy cells
memory -nomap
opt_clean
#########################
# Map logics to BRAMs
#########################
memory_bram -rules ${YOSYS_BRAM_MAP_RULES}
techmap -map ${YOSYS_BRAM_MAP_VERILOG}
opt -fast -mux_undef -undriven -fine -nodffe -nosdff
memory_map
opt -undriven -fine -nodffe -nosdff
#########################
# Map flip-flops
#########################
dfflegalize -cell $_DFF_P_ 0
techmap -map +/adff2dff.v
opt_expr -mux_undef
simplemap
opt_expr
opt_merge
opt_dff -nodffe -nosdff
opt_clean
opt -nodffe -nosdff
#########################
# Map LUTs
#########################
abc -lut ${LUT_SIZE}
#########################
# Check and show statisitics
#########################
hierarchy -check
stat
#########################
# Output netlists
#########################
opt_clean -purge
write_blif ${OUTPUT_BLIF}