From b27a04eb24eac0bc71848216d5069846392b82fd Mon Sep 17 00:00:00 2001 From: tangxifan Date: Wed, 23 Feb 2022 22:07:11 -0800 Subject: [PATCH] [Test] Now test case has a config done CCFF --- .../k4_N4_40nm_cc_cfgdscff_openfpga.xml | 195 ++++++++++++++++++ .../openfpga_cell_library/verilog/dff.v | 44 ++++ .../regression_test_scripts/basic_reg_test.sh | 2 +- .../config/task.conf | 2 +- 4 files changed, 241 insertions(+), 2 deletions(-) create mode 100644 openfpga_flow/openfpga_arch/k4_N4_40nm_cc_cfgdscff_openfpga.xml rename openfpga_flow/tasks/basic_tests/preconfig_testbench/{configuration_chain_config_enable_scff => configuration_chain_config_done_scff}/config/task.conf (97%) diff --git a/openfpga_flow/openfpga_arch/k4_N4_40nm_cc_cfgdscff_openfpga.xml b/openfpga_flow/openfpga_arch/k4_N4_40nm_cc_cfgdscff_openfpga.xml new file mode 100644 index 000000000..6526bdd75 --- /dev/null +++ b/openfpga_flow/openfpga_arch/k4_N4_40nm_cc_cfgdscff_openfpga.xml @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10e-12 + + + 10e-12 + + + + + + + + + 10e-12 + + + 10e-12 + + + + + + + + + 10e-12 + + + 10e-12 + + + + + + + + + + + + + 10e-12 5e-12 5e-12 + + + 10e-12 5e-12 5e-12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openfpga_flow/openfpga_cell_library/verilog/dff.v b/openfpga_flow/openfpga_cell_library/verilog/dff.v index 07c22ea7c..9413ee2c7 100644 --- a/openfpga_flow/openfpga_cell_library/verilog/dff.v +++ b/openfpga_flow/openfpga_cell_library/verilog/dff.v @@ -438,6 +438,50 @@ assign QN = !Q; endmodule //End Of Module +//----------------------------------------------------- +// Function : D-type flip-flop with +// - asynchronous active high reset +// - scan-chain input +// - a scan-chain enable +// - a configure enable, when enabled the registered output will +// be released to the CFGQ +// - a configure done, when enable, the regsitered output will be released to the Q +//----------------------------------------------------- +module CFGDSDFFR ( + input RST, // Reset input + input CK, // Clock Input + input SE, // Scan-chain Enable + input D, // Data Input + input SI, // Scan-chain input + input CFGE, // Configure enable + input CFG_DONE, // Configure done + output Q, // Regular Q output + output CFGQ, // Data Q output which is released when configure enable is activated + output CFGQN // Data Qb output which is released when configure enable is activated +); +//------------Internal Variables-------- +reg q_reg; +wire QN; + +//-------------Code Starts Here--------- +always @ ( posedge CK or posedge RST) +if (RST) begin + q_reg <= 1'b0; +end else if (SE) begin + q_reg <= SI; +end else begin + q_reg <= D; +end + +assign CFGQ = CFGE ? Q : 1'b0; +assign CFGQN = CFGE ? QN : 1'b1; + +assign Q = CFG_DONE ? q_reg : 1'b0; +assign QN = CFG_DONE ? !Q : 1'b1; + +endmodule //End Of Module + + //----------------------------------------------------- // Function : D-type flip-flop with // - asynchronous active high reset diff --git a/openfpga_flow/regression_test_scripts/basic_reg_test.sh b/openfpga_flow/regression_test_scripts/basic_reg_test.sh index 69e8cf4fb..ca6f9e1ab 100755 --- a/openfpga_flow/regression_test_scripts/basic_reg_test.sh +++ b/openfpga_flow/regression_test_scripts/basic_reg_test.sh @@ -23,7 +23,7 @@ run-task basic_tests/full_testbench/fast_configuration_chain_use_set --debug --s run-task basic_tests/full_testbench/smart_fast_configuration_chain --debug --show_thread_logs run-task basic_tests/full_testbench/smart_fast_multi_region_configuration_chain --debug --show_thread_logs run-task basic_tests/preconfig_testbench/configuration_chain --debug --show_thread_logs -run-task basic_tests/preconfig_testbench/configuration_chain_config_enable_scff --debug --show_thread_logs +run-task basic_tests/preconfig_testbench/configuration_chain_config_done_scff --debug --show_thread_logs run-task basic_tests/preconfig_testbench/configuration_chain_no_time_stamp --debug --show_thread_logs echo -e "Testing fram-based configuration protocol of a K4N4 FPGA"; diff --git a/openfpga_flow/tasks/basic_tests/preconfig_testbench/configuration_chain_config_enable_scff/config/task.conf b/openfpga_flow/tasks/basic_tests/preconfig_testbench/configuration_chain_config_done_scff/config/task.conf similarity index 97% rename from openfpga_flow/tasks/basic_tests/preconfig_testbench/configuration_chain_config_enable_scff/config/task.conf rename to openfpga_flow/tasks/basic_tests/preconfig_testbench/configuration_chain_config_done_scff/config/task.conf index 6b55acd3e..328d008fc 100644 --- a/openfpga_flow/tasks/basic_tests/preconfig_testbench/configuration_chain_config_enable_scff/config/task.conf +++ b/openfpga_flow/tasks/basic_tests/preconfig_testbench/configuration_chain_config_done_scff/config/task.conf @@ -17,7 +17,7 @@ fpga_flow=yosys_vpr [OpenFPGA_SHELL] openfpga_shell_template=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_shell_scripts/example_script.openfpga -openfpga_arch_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_arch/k4_N4_40nm_cc_cfgscff_openfpga.xml +openfpga_arch_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_arch/k4_N4_40nm_cc_cfgdscff_openfpga.xml openfpga_sim_setting_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_simulation_settings/auto_sim_openfpga.xml [ARCHITECTURES]