Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Yosys HQ v0.10 as a submodule #403

Merged
merged 31 commits into from
Oct 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b213faa
[Git] Add YosysHQ as a submodule in the place of QuickLogic Yosys
tangxifan Oct 29, 2021
f2ce2e6
[Github] debugging
tangxifan Oct 29, 2021
39fa050
[Github] debugging
tangxifan Oct 29, 2021
aece87b
[Github] debugging
tangxifan Oct 29, 2021
104e177
[Git] Update yosys submodule:
tangxifan Oct 29, 2021
e8b3c68
[Github] Now use YosysHQ v0.10 release as a submodule
tangxifan Oct 29, 2021
9c06041
[Flow] Update yosys script by replacing the deprecated command 'opt_r…
tangxifan Oct 30, 2021
0a449cc
[HDL] Fixed critical bugs in multi-mode FF HDL modeling, which caused…
tangxifan Oct 30, 2021
91627ab
[FPGA-Verilog] Fixed a bug on the non-inverted reset signal in testbe…
tangxifan Oct 30, 2021
9432835
[Script] Replace deprecated ``rmdff`` in out-of-date yosys scripts
tangxifan Oct 30, 2021
16de60e
[Test] Turn off ACE2 run in bitstream generation only flows
tangxifan Oct 30, 2021
18bab18
[Test] Disable all the quicklogic tests due to missing support in Yos…
tangxifan Oct 30, 2021
978c60e
[Flow] Disable DFFE and SDFF in no-ff Yosys scripts
tangxifan Oct 30, 2021
59a622a
[Flow] Disable DFFE and SDFF in no-ff Yosys scripts
tangxifan Oct 30, 2021
0b770f3
[Flow] Disable DFFE and SDFF in no-ff Yosys scripts
tangxifan Oct 30, 2021
ec184ef
[Flow] Flatten the synthesis recipe in default yosys script to disabl…
tangxifan Oct 30, 2021
b7ad612
[Flow] Flatten the synthesis recipe in default yosys script to disabl…
tangxifan Oct 30, 2021
40d11a4
[Test] Disable ACE2 in implicit verilog test cases due to Yosys upgrade
tangxifan Oct 30, 2021
8dea7e8
[Flow] Update yosys script to not use sdff and dffe
tangxifan Oct 30, 2021
ad5cce0
[Test] Use frac_ff arch for SAPone; Otherwise Yosys cannot map reset …
tangxifan Oct 30, 2021
e6cc3c4
[Flow] Enable flatten for dff-related yosys scripts
tangxifan Oct 30, 2021
be47e78
[Arch] Change arch for Sapone test
tangxifan Oct 30, 2021
6277234
[Flow] bug fix in BRAM-oriented yosys scripts
tangxifan Oct 30, 2021
335347a
[Test] Bug fix
tangxifan Oct 30, 2021
a4cfc84
[Test] Bug fix
tangxifan Oct 30, 2021
27b82d1
[Flow] bug fix
tangxifan Oct 30, 2021
c8e9dfb
[Test] bug fix
tangxifan Oct 30, 2021
7455990
[Flow] bug fix
tangxifan Oct 30, 2021
370e3fe
[Test] Now use pre-configured testbench when verifying signal gen mic…
tangxifan Oct 31, 2021
7f999d0
[Test] update golden results for the vtr benchmarks due to Yosys v0.1…
tangxifan Oct 31, 2021
0d14aa4
[Flow] Add comments to clarify the limitations
tangxifan Oct 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "yosys"]
path = yosys
url = https://github.com/QuickLogic-Corp/yosys.git
branch = quicklogic-rebased
url = https://github.com/YosysHQ/yosys
branch = release-branch-0.10
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ void print_verilog_random_testbench_fpga_instance(std::fstream& fp,
const std::string& circuit_name,
const AtomContext& atom_ctx,
const VprNetlistAnnotation& netlist_annotation,
const PinConstraints& pin_constraints,
const bool& explicit_port_mapping) {
/* Validate the file stream */
valid_file_stream(fp);
Expand All @@ -157,7 +158,7 @@ void print_verilog_random_testbench_fpga_instance(std::fstream& fp,
std::vector<std::string>(),
std::string(FPGA_PORT_POSTFIX),
atom_ctx, netlist_annotation,
PinConstraints(),
pin_constraints,
explicit_port_mapping);

print_verilog_comment(fp, std::string("----- End FPGA Fabric Instanication -------"));
Expand Down Expand Up @@ -301,6 +302,7 @@ void print_verilog_random_top_testbench(const std::string& circuit_name,
/* Call defined top-level module */
print_verilog_random_testbench_fpga_instance(fp, circuit_name,
atom_ctx, netlist_annotation,
pin_constraints,
options.explicit_port_mapping());

/* Call defined benchmark */
Expand Down
16 changes: 8 additions & 8 deletions openfpga_flow/misc/ys_tmpl_yosys_vpr_bram_dsp_dff_flow.ys
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ opt_clean
# demote inout ports to input or output port
# with follow-up optimizations to clean up AST
deminout
opt
opt -nodffe -nosdff

opt_expr
opt_clean
check
opt
opt -nodffe -nosdff
wreduce -keepdc
peepopt
pmuxtree
Expand Down Expand Up @@ -58,10 +58,10 @@ chtype -set $mul t:$__soft_mul# Extract arithmetic functions
techmap
alumacc
share
opt
opt -nodffe -nosdff
fsm
# Run a quick follow-up optimization to sweep out unused nets/signals
opt -fast
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
Expand All @@ -71,9 +71,9 @@ opt_clean
#########################
memory_bram -rules ${YOSYS_BRAM_MAP_RULES}
techmap -map ${YOSYS_BRAM_MAP_VERILOG}
opt -fast -mux_undef -undriven -fine
opt -fast -mux_undef -undriven -fine -nodffe -nosdff
memory_map
opt -undriven -fine
opt -undriven -fine -nodffe -nosdff

#########################
# Map flip-flops
Expand All @@ -83,9 +83,9 @@ opt_expr -mux_undef
simplemap
opt_expr
opt_merge
opt_rmdff
opt_dff -nodffe -nosdff
opt_clean
opt
opt -nodffe -nosdff

#########################
# Map LUTs
Expand Down
17 changes: 9 additions & 8 deletions openfpga_flow/misc/ys_tmpl_yosys_vpr_bram_dsp_flow.ys
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ opt_clean
# demote inout ports to input or output port
# with follow-up optimizations to clean up AST
deminout
opt
opt -nodffe -nosdff

opt_expr
opt_clean
check
opt
opt -nodffe -nosdff
wreduce -keepdc
peepopt
pmuxtree
Expand Down Expand Up @@ -58,10 +58,10 @@ chtype -set $mul t:$__soft_mul# Extract arithmetic functions
techmap
alumacc
share
opt
opt -nodffe -nosdff
fsm
# Run a quick follow-up optimization to sweep out unused nets/signals
opt -fast
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
Expand All @@ -71,21 +71,22 @@ opt_clean
#########################
memory_bram -rules ${YOSYS_BRAM_MAP_RULES}
techmap -map ${YOSYS_BRAM_MAP_VERILOG}
opt -fast -mux_undef -undriven -fine
opt -fast -mux_undef -undriven -fine -nodffe -nosdff
memory_map
opt -undriven -fine
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_rmdff
opt_dff -nodffe -nosdff
opt_clean
opt
opt -nodffe -nosdff

#########################
# Map LUTs
Expand Down
18 changes: 10 additions & 8 deletions openfpga_flow/misc/ys_tmpl_yosys_vpr_bram_flow.ys
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ opt_clean
# demote inout ports to input or output port
# with follow-up optimizations to clean up AST
deminout
opt
opt -nodffe -nosdff

opt_expr
opt_clean
check
opt
opt -nodffe -nosdff
wreduce -keepdc
peepopt
pmuxtree
Expand All @@ -42,10 +42,11 @@ opt_clean
# Extract arithmetic functions
alumacc
share
opt
opt -nodffe -nosdff
fsm
# Run a quick follow-up optimization to sweep out unused nets/signals
opt -fast
# FIXME: In Yosys v0.10, when options '-nodffe' and '-nosdff' is on, some dual-port ram cannot be inferred correctly
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
Expand All @@ -55,21 +56,22 @@ opt_clean
#########################
memory_bram -rules ${YOSYS_BRAM_MAP_RULES}
techmap -map ${YOSYS_BRAM_MAP_VERILOG}
opt -fast -mux_undef -undriven -fine
opt -fast -mux_undef -undriven -fine -nodffe -nosdff
memory_map
opt -undriven -fine
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_rmdff
opt_dff -nodffe -nosdff
opt_clean
opt
opt -nodffe -nosdff

#########################
# Map LUTs
Expand Down
19 changes: 18 additions & 1 deletion openfpga_flow/misc/ys_tmpl_yosys_vpr_dff_flow.ys
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ proc
techmap -D NO_LUT -map ${YOSYS_DFF_MAP_VERILOG}

# Synthesis
synth -top ${TOP_MODULE} -flatten
flatten
opt_expr
opt_clean
check
opt -nodffe -nosdff
fsm
opt -nodffe -nosdff
wreduce
peepopt
opt_clean
opt -nodffe -nosdff
memory -nomap
opt_clean
opt -fast -full -nodffe -nosdff
memory_map
opt -full -nodffe -nosdff
techmap
opt -fast -nodffe -nosdff
clean

# LUT mapping
Expand Down
15 changes: 8 additions & 7 deletions openfpga_flow/misc/ys_tmpl_yosys_vpr_dsp_flow.ys
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ opt_clean
# demote inout ports to input or output port
# with follow-up optimizations to clean up AST
deminout
opt
opt -nodffe -nosdff

opt_expr
opt_clean
check
opt
opt -nodffe -nosdff
wreduce -keepdc
peepopt
pmuxtree
Expand Down Expand Up @@ -58,25 +58,26 @@ chtype -set $mul t:$__soft_mul# Extract arithmetic functions
techmap
alumacc
share
opt
opt -nodffe -nosdff
fsm
# Run a quick follow-up optimization to sweep out unused nets/signals
opt -fast
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 flip-flops
#########################
dfflegalize -cell $_DFF_P_ 0
techmap -map +/adff2dff.v
opt_expr -mux_undef
simplemap
opt_expr
opt_merge
opt_rmdff
opt_dff -nodffe -nosdff
opt_clean
opt
opt -nodffe -nosdff

#########################
# Map LUTs
Expand All @@ -93,4 +94,4 @@ stat
# Output netlists
#########################
opt_clean -purge
write_blif ${OUTPUT_BLIF}
write_blif ${OUTPUT_BLIF}
19 changes: 18 additions & 1 deletion openfpga_flow/misc/ys_tmpl_yosys_vpr_flow.ys
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,24 @@ proc
techmap -D NO_LUT -map +/adff2dff.v

# Synthesis
synth -top ${TOP_MODULE} -flatten
flatten
opt_expr
opt_clean
check
opt -nodffe -nosdff
fsm
opt -nodffe -nosdff
wreduce
peepopt
opt_clean
opt -nodffe -nosdff
memory -nomap
opt_clean
opt -fast -full -nodffe -nosdff
memory_map
opt -full -nodffe -nosdff
techmap
opt -fast -nodffe -nosdff
clean

# LUT mapping
Expand Down
21 changes: 20 additions & 1 deletion openfpga_flow/misc/ys_tmpl_yosys_vpr_flow_with_rewrite.ys
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,26 @@ proc
techmap -D NO_LUT -map +/adff2dff.v

# Synthesis
synth -top ${TOP_MODULE} -flatten
flatten
opt_expr
opt_clean
check
opt -nodffe -nosdff
fsm
opt -nodffe -nosdff
wreduce
peepopt
opt_clean
opt -nodffe -nosdff
memory -nomap
opt_clean
opt -fast -full -nodffe -nosdff
memory_map
opt -full -nodffe -nosdff
techmap
opt -fast -nodffe -nosdff
clean

clean

# LUT mapping
Expand Down
4 changes: 2 additions & 2 deletions openfpga_flow/openfpga_cell_library/verilog/dff.v
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ module MULTI_MODE_DFFSRQ (
);

wire post_set = mode[1] ? ~SET : SET;
wire post_reset = mode[0] ? ~RST : RST;
wire post_rst = mode[0] ? ~RST : RST;

DFFSRQ FF_CORE (.SET(post_set),
.RST(post_rst),
Expand All @@ -284,7 +284,7 @@ module MULTI_MODE_DFFRQ (
input mode // mode-selection bits: bit0 for reset polarity; bit1 for set polarity
);

wire post_reset = mode ? ~RST : RST;
wire post_rst = mode ? ~RST : RST;

DFFRQ FF_CORE (.RST(post_rst),
.CK(CK),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Run VPR for the 'and' design
#--write_rr_graph example_rr_graph.xml
vpr ${VPR_ARCH_FILE} ${VPR_TESTBENCH_BLIF} --clock_modeling route --route_chan_width ${OPENFPGA_VPR_ROUTE_CHAN_WIDTH} --device ${OPENFPGA_VPR_DEVICE_LAYOUT}
vpr ${VPR_ARCH_FILE} ${VPR_TESTBENCH_BLIF} --clock_modeling ideal --route_chan_width ${OPENFPGA_VPR_ROUTE_CHAN_WIDTH} --device ${OPENFPGA_VPR_DEVICE_LAYOUT}

# Read OpenFPGA architecture definition
read_openfpga_arch -f ${OPENFPGA_ARCH_FILE}
Expand All @@ -10,7 +10,7 @@ read_openfpga_simulation_setting -f ${OPENFPGA_SIM_SETTING_FILE}

# Annotate the OpenFPGA architecture to VPR data base
# to debug use --verbose options
link_openfpga_arch --activity_file ${ACTIVITY_FILE} --sort_gsb_chan_node_in_edges
link_openfpga_arch --sort_gsb_chan_node_in_edges

# Check and correct any naming conflicts in the BLIF netlist
check_netlist_naming_conflict --fix --report ./netlist_renaming.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ read_openfpga_simulation_setting -f ${OPENFPGA_SIM_SETTING_FILE}

# Annotate the OpenFPGA architecture to VPR data base
# to debug use --verbose options
link_openfpga_arch --activity_file ${ACTIVITY_FILE} --sort_gsb_chan_node_in_edges
link_openfpga_arch --sort_gsb_chan_node_in_edges

# Check and correct any naming conflicts in the BLIF netlist
check_netlist_naming_conflict --fix --report ./netlist_renaming.xml
Expand Down
18 changes: 10 additions & 8 deletions openfpga_flow/regression_test_scripts/quicklogic_reg_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ PYTHON_EXEC=python3.8
##############################################
echo -e "QuickLogic regression tests";

echo -e "Testing yosys flow using custom ys script for running quicklogic device";
run-task quicklogic_tests/flow_test --debug --show_thread_logs
# TODO: Disabled all the tests here because Quicklogic's synthesis script is not in Yosys v0.10 release. Will bring back once Quicklogic manages to merge their contribution to Yosys upstream
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tpagarani @coolbreeze413 Please be aware of this


echo -e "Testing yosys flow using custom ys script for running multi-clock quicklogic device";
run-task quicklogic_tests/counter_5clock_test --debug --show_thread_logs
run-task quicklogic_tests/sdc_controller_test --debug --show_thread_logs

echo -e "Testing yosys flow using custom ys script for adders in quicklogic device";
run-task quicklogic_tests/lut_adder_test --debug --show_thread_logs
##echo -e "Testing yosys flow using custom ys script for running quicklogic device";
##run-task quicklogic_tests/flow_test --debug --show_thread_logs
##
##echo -e "Testing yosys flow using custom ys script for running multi-clock quicklogic device";
##run-task quicklogic_tests/counter_5clock_test --debug --show_thread_logs
##run-task quicklogic_tests/sdc_controller_test --debug --show_thread_logs
##
##echo -e "Testing yosys flow using custom ys script for adders in quicklogic device";
##run-task quicklogic_tests/lut_adder_test --debug --show_thread_logs
Loading