-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] add a new test case to validate the new feature
- Loading branch information
Showing
7 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
openfpga_flow/openfpga_shell_scripts/write_testbench_template_example_script.openfpga
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Run VPR for the 'and' design | ||
#--write_rr_graph example_rr_graph.xml | ||
vpr ${VPR_ARCH_FILE} ${VPR_TESTBENCH_BLIF} --clock_modeling ideal | ||
|
||
# Read OpenFPGA architecture definition | ||
read_openfpga_arch -f ${OPENFPGA_ARCH_FILE} | ||
|
||
# Read OpenFPGA simulation settings | ||
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 --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 | ||
|
||
# Apply fix-up to Look-Up Table truth tables based on packing results | ||
lut_truth_table_fixup | ||
|
||
# Build the module graph | ||
# - Enabled compression on routing architecture modules | ||
# - Enable pin duplication on grid modules | ||
build_fabric --compress_routing #--verbose | ||
|
||
# Write the fabric hierarchy of module graph to a file | ||
# This is used by hierarchical PnR flows | ||
write_fabric_hierarchy --file ./fabric_hierarchy.txt | ||
|
||
# Repack the netlist to physical pbs | ||
# This must be done before bitstream generator and testbench generation | ||
# Strongly recommend it is done after all the fix-up have been applied | ||
repack #--verbose | ||
|
||
# Build the bitstream | ||
# - Output the fabric-independent bitstream to a file | ||
build_architecture_bitstream --verbose --write_file fabric_independent_bitstream.xml | ||
|
||
# Build fabric-dependent bitstream | ||
build_fabric_bitstream --verbose | ||
|
||
# Write fabric-dependent bitstream | ||
write_fabric_bitstream --file fabric_bitstream.bit --format plain_text | ||
|
||
# Write the Verilog netlist for FPGA fabric | ||
# - Enable the use of explicit port mapping in Verilog netlist | ||
write_fabric_verilog --file ./SRC --explicit_port_mapping --include_timing --verbose | ||
|
||
# Write template testbenches | ||
write_testbench_template --file ./TESTBENCH/template_testbench.v --top_module template_top_tb ${OPENFPGA_VERILOG_PORT_MAPPING} | ||
write_testbench_io_connection --file ./TESTBENCH/io_connections.v --pin_constraints_file ${OPENFPGA_PIN_CONSTRAINTS_FILE} --bus_group_file ${OPENFPGA_BUS_GROUP_FILE} | ||
|
||
# Finish and exit OpenFPGA | ||
exit | ||
|
||
# Note : | ||
# To run verification at the end of the flow maintain source in ./SRC directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
openfpga_flow/tasks/basic_tests/generate_template_testbench/config/counter8_bus_group.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<bus_group> | ||
<bus name="result[7:0]" big_endian="false"> | ||
<pin id="0" name="result_0_"/> | ||
<pin id="1" name="result_1_"/> | ||
<pin id="2" name="result_2_"/> | ||
<pin id="3" name="result_3_"/> | ||
<pin id="4" name="result_4_"/> | ||
<pin id="5" name="result_5_"/> | ||
<pin id="6" name="result_6_"/> | ||
<pin id="7" name="result_7_"/> | ||
</bus> | ||
</bus_group> |
26 changes: 26 additions & 0 deletions
26
openfpga_flow/tasks/basic_tests/generate_template_testbench/config/mac4_bus_group.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<bus_group> | ||
<bus name="a[3:0]" big_endian="false"> | ||
<pin id="0" name="a_0_"/> | ||
<pin id="1" name="a_1_"/> | ||
<pin id="2" name="a_2_"/> | ||
<pin id="3" name="a_3_"/> | ||
</bus> | ||
<bus name="b[3:0]" big_endian="false"> | ||
<pin id="0" name="b_0_"/> | ||
<pin id="1" name="b_1_"/> | ||
<pin id="2" name="b_2_"/> | ||
<pin id="3" name="b_3_"/> | ||
</bus> | ||
<bus name="c[3:0]" big_endian="false"> | ||
<pin id="0" name="c_0_"/> | ||
<pin id="1" name="c_1_"/> | ||
<pin id="2" name="c_2_"/> | ||
<pin id="3" name="c_3_"/> | ||
</bus> | ||
<bus name="out[3:0]" big_endian="false"> | ||
<pin id="0" name="out_0_"/> | ||
<pin id="1" name="out_1_"/> | ||
<pin id="2" name="out_2_"/> | ||
<pin id="3" name="out_3_"/> | ||
</bus> | ||
</bus_group> |
5 changes: 5 additions & 0 deletions
5
openfpga_flow/tasks/basic_tests/generate_template_testbench/config/pin_constraints_dummy.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<pin_constraints> | ||
<!-- A dummy pin constraints file | ||
--> | ||
</pin_constraints> | ||
|
7 changes: 7 additions & 0 deletions
7
openfpga_flow/tasks/basic_tests/generate_template_testbench/config/pin_constraints_reset.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<pin_constraints> | ||
<!-- For a given .blif file, we want to assign | ||
- the reset signal to the op_reset[0] port of the FPGA fabric | ||
--> | ||
<set_io pin="op_reset[0]" net="reset"/> | ||
</pin_constraints> | ||
|
51 changes: 51 additions & 0 deletions
51
openfpga_flow/tasks/basic_tests/generate_template_testbench/config/task.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = | ||
# Configuration file for running experiments | ||
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = | ||
# timeout_each_job : FPGA Task script splits fpga flow into multiple jobs | ||
# Each job execute fpga_flow script on combination of architecture & benchmark | ||
# timeout_each_job is timeout for each job | ||
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = | ||
|
||
[GENERAL] | ||
run_engine=openfpga_shell | ||
power_tech_file = ${PATH:OPENFPGA_PATH}/openfpga_flow/tech/PTM_45nm/45nm.xml | ||
power_analysis = false | ||
spice_output=false | ||
verilog_output=true | ||
timeout_each_job = 20*60 | ||
fpga_flow=yosys_vpr | ||
|
||
[OpenFPGA_SHELL] | ||
openfpga_shell_template=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_shell_scripts/write_testbench_template_example_script.openfpga | ||
openfpga_arch_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_arch/k6_frac_N10_adder_chain_dpram8K_dsp36_fracff_40nm_openfpga.xml | ||
openfpga_sim_setting_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_simulation_settings/fixed_sim_openfpga.xml | ||
openfpga_verilog_port_mapping=--explicit_port_mapping | ||
|
||
[ARCHITECTURES] | ||
arch0=${PATH:OPENFPGA_PATH}/openfpga_flow/vpr_arch/k6_frac_N10_tileable_adder_chain_dpram8K_dsp36_fracff_40nm.xml | ||
|
||
[BENCHMARKS] | ||
bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_reset/counter.v | ||
bench1=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/mac/mac_4/mac_4.v | ||
|
||
[SYNTHESIS_PARAM] | ||
# Yosys script parameters | ||
bench_yosys_cell_sim_verilog_common=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_yosys_techlib/k6_frac_N10_tileable_adder_chain_dpram8K_dsp36_fracff_40nm_cell_sim.v | ||
bench_yosys_dff_map_verilog_common=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_yosys_techlib/k6_frac_N10_tileable_adder_chain_dpram8K_dsp36_fracff_40nm_dff_map.v | ||
bench_yosys_bram_map_rules_common=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_yosys_techlib/k6_frac_N10_tileable_adder_chain_dpram8K_dsp36_40nm_bram.txt | ||
bench_yosys_bram_map_verilog_common=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_yosys_techlib/k6_frac_N10_tileable_adder_chain_dpram8K_dsp36_40nm_bram_map.v | ||
bench_yosys_dsp_map_verilog_common=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_yosys_techlib/k6_frac_N10_tileable_adder_chain_dpram8K_dsp36_40nm_dsp_map.v | ||
bench_yosys_dsp_map_parameters_common=-D DSP_A_MAXWIDTH=36 -D DSP_B_MAXWIDTH=36 -D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2 -D DSP_NAME=mult_36x36 | ||
bench_read_verilog_options_common = -nolatches | ||
bench_yosys_common=${PATH:OPENFPGA_PATH}/openfpga_flow/misc/ys_tmpl_yosys_vpr_dff_flow.ys | ||
bench_yosys_rewrite_common=${PATH:OPENFPGA_PATH}/openfpga_flow/misc/ys_tmpl_yosys_vpr_flow_with_rewrite.ys | ||
|
||
bench0_top = counter | ||
bench0_openfpga_pin_constraints_file=${PATH:TASK_DIR}/config/pin_constraints_reset.xml | ||
bench0_openfpga_bus_group_file=${PATH:TASK_DIR}/config/counter8_bus_group.xml | ||
|
||
bench1_top = mac_4 | ||
bench1_openfpga_pin_constraints_file=${PATH:TASK_DIR}/config/pin_constraints_dummy.xml | ||
bench1_openfpga_bus_group_file=${PATH:TASK_DIR}/config/mac4_bus_group.xml | ||
|
||
[SCRIPT_PARAM_MIN_ROUTE_CHAN_WIDTH] |