From 6400605603000d18882123e8c9f8c983c68c7357 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 13 Jan 2023 16:39:06 -0800 Subject: [PATCH 01/18] [benchmark] add clock divider --- .../micro_benchmark/clk_divider/clk_divider.v | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 openfpga_flow/benchmarks/micro_benchmark/clk_divider/clk_divider.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/clk_divider/clk_divider.v b/openfpga_flow/benchmarks/micro_benchmark/clk_divider/clk_divider.v new file mode 100644 index 000000000..c559f49d7 --- /dev/null +++ b/openfpga_flow/benchmarks/micro_benchmark/clk_divider/clk_divider.v @@ -0,0 +1,28 @@ +///////////////////////////////////////// +// Functionality: A two-stage clock divider (Frequency is divided by 4) +// This is to test the clock generated locally by a LUT/FF +// Author: Xifan Tang +//////////////////////////////////////// +`timescale 1ns / 1ps + +module clk_divider(clk_i, clk_o); + +input wire clk_i; +output reg clk_o; + +reg int_clk; + +initial begin + clk_o <= 0; + int_clk <= 0; +end + +always @(posedge clk_i) begin + int_clk <= ~int_clk; +end + +always @(posedge int_clk) begin + clk_o <= ~clk_o; +end + +endmodule From 1353577351d0bc61b81ddc87d240b304c97fcf77 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 13 Jan 2023 16:45:30 -0800 Subject: [PATCH 02/18] [test] added a new test to validate locally generated clocks --- .../config/pin_constraints_reset.xml | 4 ++ .../config/repack_design_constraints.xml | 4 ++ .../k4_series/k4n4_clk_gen/config/task.conf | 43 +++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/pin_constraints_reset.xml create mode 100644 openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/repack_design_constraints.xml create mode 100644 openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf diff --git a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/pin_constraints_reset.xml b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/pin_constraints_reset.xml new file mode 100644 index 000000000..20a21d2cf --- /dev/null +++ b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/pin_constraints_reset.xml @@ -0,0 +1,4 @@ + + + + diff --git a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/repack_design_constraints.xml b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/repack_design_constraints.xml new file mode 100644 index 000000000..06a125111 --- /dev/null +++ b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/repack_design_constraints.xml @@ -0,0 +1,4 @@ + + + + diff --git a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf new file mode 100644 index 000000000..1cf981d22 --- /dev/null +++ b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf @@ -0,0 +1,43 @@ +# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = +# 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 = 3*60 +fpga_flow=yosys_vpr + +[OpenFPGA_SHELL] +openfpga_shell_template=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_shell_scripts/ignore_global_nets_on_pins_example_script.openfpga +openfpga_arch_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_arch/k4_frac_N4_fracff_40nm_cc_openfpga.xml +openfpga_sim_setting_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_simulation_settings/fixed_sim_openfpga.xml +openfpga_repack_design_constraint_file=${PATH:TASK_DIR}/config/repack_design_constraints.xml + +[ARCHITECTURES] +arch0=${PATH:OPENFPGA_PATH}/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_rstOnLut_40nm.xml + +[BENCHMARKS] +bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/clk_divider/clk_divider.v + +[SYNTHESIS_PARAM] +# Yosys script parameters +bench_yosys_cell_sim_verilog_common=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_yosys_techlib/openfpga_dff_sim.v +bench_yosys_dff_map_verilog_common=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_yosys_techlib/openfpga_dff_map.v +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;${PATH:OPENFPGA_PATH}/openfpga_flow/misc/ys_tmpl_rewrite_flow.ys + +bench0_top = clk_divider +bench0_openfpga_pin_constraints_file = ${PATH:TASK_DIR}/config/pin_constraints_reset.xml + +[SCRIPT_PARAM_MIN_ROUTE_CHAN_WIDTH] +end_flow_with_test= +vpr_fpga_verilog_formal_verification_top_netlist= From a06ee30ca0d1887a50c49dedbf602905cb0088c2 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 13 Jan 2023 19:35:00 -0800 Subject: [PATCH 03/18] [arch] added a new vpr arch where clock can be generated by internal logics --- ...ac_N4_tileable_fracff_localClkGen_40nm.xml | 631 ++++++++++++++++++ 1 file changed, 631 insertions(+) create mode 100644 openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml diff --git a/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml b/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml new file mode 100644 index 000000000..6822f473a --- /dev/null +++ b/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml @@ -0,0 +1,631 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + io.outpad io.inpad + io.outpad io.inpad + io.outpad io.inpad + io.outpad io.inpad + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 1 1 1 1 + 1 1 1 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 235e-12 + 235e-12 + 235e-12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 261e-12 + 261e-12 + 261e-12 + 261e-12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1fb39f803b72e07ceb961272e8442fca1e8148c6 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 13 Jan 2023 19:52:58 -0800 Subject: [PATCH 04/18] [doc] updated vpr arch naming rules --- openfpga_flow/vpr_arch/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/openfpga_flow/vpr_arch/README.md b/openfpga_flow/vpr_arch/README.md index 479a359cc..ec4e6fd10 100644 --- a/openfpga_flow/vpr_arch/README.md +++ b/openfpga_flow/vpr_arch/README.md @@ -23,6 +23,7 @@ Please reveal the following architecture features in the names to help quickly s - registerable\_io: If I/Os are registerable (can be either combinational or sequential) - CustomIoLoc: Use OpenFPGA's extended custom I/O location syntax - rstOnLut: The reset signal of CLB can feed LUT inputs through a local routing architecture +- localClkGen: The clock signal of CLB can be generated by internal programmable resources - : The technology node which the delay numbers are extracted from. - TileOrgz: How tile is organized. * Top-left (Tl): the pins of a tile are placed on the top side and left side only From 93107c752ab69d6e15ed05e5a6e64d46c5cfc26a Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 13 Jan 2023 19:53:15 -0800 Subject: [PATCH 05/18] [test] updating test case --- .../tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf index 1cf981d22..d78597e11 100644 --- a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf +++ b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf @@ -22,7 +22,7 @@ openfpga_sim_setting_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_simulatio openfpga_repack_design_constraint_file=${PATH:TASK_DIR}/config/repack_design_constraints.xml [ARCHITECTURES] -arch0=${PATH:OPENFPGA_PATH}/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_rstOnLut_40nm.xml +arch0=${PATH:OPENFPGA_PATH}/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml [BENCHMARKS] bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/clk_divider/clk_divider.v From 9e462d96e0d116ac07697442a70e69f212f5734a Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 13 Jan 2023 20:46:04 -0800 Subject: [PATCH 06/18] [arch] now use a dedicated input for locally generated clock signals --- .../vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml b/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml index 6822f473a..a01191372 100644 --- a/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml +++ b/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml @@ -101,6 +101,8 @@ + + @@ -275,6 +277,7 @@ + - - diff --git a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/repack_design_constraints.xml b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/repack_design_constraints.xml index 06a125111..76ca10a78 100644 --- a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/repack_design_constraints.xml +++ b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/repack_design_constraints.xml @@ -1,4 +1,5 @@ - + + diff --git a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf index d78597e11..d889031ed 100644 --- a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf +++ b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf @@ -36,7 +36,7 @@ bench_yosys_common=${PATH:OPENFPGA_PATH}/openfpga_flow/misc/ys_tmpl_yosys_vpr_df bench_yosys_rewrite_common=${PATH:OPENFPGA_PATH}/openfpga_flow/misc/ys_tmpl_yosys_vpr_flow_with_rewrite.ys;${PATH:OPENFPGA_PATH}/openfpga_flow/misc/ys_tmpl_rewrite_flow.ys bench0_top = clk_divider -bench0_openfpga_pin_constraints_file = ${PATH:TASK_DIR}/config/pin_constraints_reset.xml +bench0_openfpga_pin_constraints_file = ${PATH:TASK_DIR}/config/pin_constraints.xml [SCRIPT_PARAM_MIN_ROUTE_CHAN_WIDTH] end_flow_with_test= From 9222d085cd2f21ed0e84ad86d76fbc5b258dcb94 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 13 Jan 2023 22:04:56 -0800 Subject: [PATCH 08/18] [test] now use local clock as one of the pins in a clock bus, but connected to global routing --- openfpga_flow/openfpga_arch/README.md | 1 + ...N4_fracff_localClkGen_40nm_cc_openfpga.xml | 255 ++++++++++++++++++ .../k4_series/k4n4_clk_gen/config/task.conf | 2 +- ...ac_N4_tileable_fracff_localClkGen_40nm.xml | 11 +- 4 files changed, 261 insertions(+), 8 deletions(-) create mode 100644 openfpga_flow/openfpga_arch/k4_frac_N4_fracff_localClkGen_40nm_cc_openfpga.xml diff --git a/openfpga_flow/openfpga_arch/README.md b/openfpga_flow/openfpga_arch/README.md index e4bd7f1f9..0960d3f2d 100644 --- a/openfpga_flow/openfpga_arch/README.md +++ b/openfpga_flow/openfpga_arch/README.md @@ -29,6 +29,7 @@ Note that an OpenFPGA architecture can be applied to multiple VPR architecture f - registerable\_io: If I/Os are registerable (can be either combinational or sequential) - stdcell: If circuit designs are built with standard cells only - tree\_mux: If routing multiplexers are built with a tree-like structure +- localClkGen: The clock signal of CLB can be generated by internal programmable resources - : The technology node which the delay numbers are extracted from. - powergate : The FPGA has power-gating techniques applied. If not defined, there is no power-gating. - GlobalTileClk: How many clocks are defined through global ports from physical tiles. diff --git a/openfpga_flow/openfpga_arch/k4_frac_N4_fracff_localClkGen_40nm_cc_openfpga.xml b/openfpga_flow/openfpga_arch/k4_frac_N4_fracff_localClkGen_40nm_cc_openfpga.xml new file mode 100644 index 000000000..df8f9b37c --- /dev/null +++ b/openfpga_flow/openfpga_arch/k4_frac_N4_fracff_localClkGen_40nm_cc_openfpga.xml @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10e-12 + + + 10e-12 + + + + + + + + + 10e-12 + + + 10e-12 + + + + + + + + + 10e-12 + + + 10e-12 + + + + + + + + + + + + 10e-12 5e-12 + + + 10e-12 5e-12 + + + + + + + + + + + + + 10e-12 5e-12 5e-12 + + + 10e-12 5e-12 5e-12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf index d889031ed..12ad1855b 100644 --- a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf +++ b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf @@ -17,7 +17,7 @@ fpga_flow=yosys_vpr [OpenFPGA_SHELL] openfpga_shell_template=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_shell_scripts/ignore_global_nets_on_pins_example_script.openfpga -openfpga_arch_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_arch/k4_frac_N4_fracff_40nm_cc_openfpga.xml +openfpga_arch_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_arch/k4_frac_N4_fracff_localClkGen_40nm_cc_openfpga.xml openfpga_sim_setting_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_simulation_settings/fixed_sim_openfpga.xml openfpga_repack_design_constraint_file=${PATH:TASK_DIR}/config/repack_design_constraints.xml diff --git a/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml b/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml index a01191372..9d4d8d737 100644 --- a/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml +++ b/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml @@ -101,12 +101,10 @@ - - - + - + @@ -277,9 +275,8 @@ - - + + + - + @@ -276,7 +278,9 @@ - + + + + + + diff --git a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/dffn_repack_design_constraints.xml b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/dffn_repack_design_constraints.xml new file mode 100644 index 000000000..a84216e64 --- /dev/null +++ b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/dffn_repack_design_constraints.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf index 6e4b75067..5bffd2c6a 100644 --- a/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf +++ b/openfpga_flow/tasks/basic_tests/k4_series/k4n4_clk_gen/config/task.conf @@ -13,7 +13,8 @@ power_analysis = false spice_output=false verilog_output=true timeout_each_job = 3*60 -fpga_flow=yosys_vpr +#fpga_flow=yosys_vpr +fpga_flow=vpr_blif [OpenFPGA_SHELL] openfpga_shell_template=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_shell_scripts/local_clk_gen_example_script.openfpga @@ -25,7 +26,8 @@ openfpga_repack_design_constraint_file=${PATH:TASK_DIR}/config/repack_design_con arch0=${PATH:OPENFPGA_PATH}/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_localClkGen_40nm.xml [BENCHMARKS] -bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/clk_divider/clk_divider.v +bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/discrete_dffn/discrete_dffn.blif +#bench1=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/clk_divider/clk_divider.v [SYNTHESIS_PARAM] # Yosys script parameters @@ -35,10 +37,15 @@ 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;${PATH:OPENFPGA_PATH}/openfpga_flow/misc/ys_tmpl_rewrite_flow.ys -bench0_top = clk_divider -bench0_openfpga_pin_constraints_file = ${PATH:TASK_DIR}/config/pin_constraints.xml +bench0_top = discrete_dffn +bench0_verilog=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/discrete_dffn/discrete_dffn.v +bench0_openfpga_pin_constraints_file = ${PATH:TASK_DIR}/config/dffn_pin_constraints.xml +bench0_openfpga_repack_design_constraint_file=${PATH:TASK_DIR}/config/dffn_repack_design_constraints.xml + +#bench1_top = clk_divider +#bench1_openfpga_pin_constraints_file = ${PATH:TASK_DIR}/config/pin_constraints.xml [SCRIPT_PARAM_MIN_ROUTE_CHAN_WIDTH] # FIXME: Enable this once VPR can accept clock routing for specific clock signals -#end_flow_with_test= -#vpr_fpga_verilog_formal_verification_top_netlist= +end_flow_with_test= +vpr_fpga_verilog_formal_verification_top_netlist=