diff --git a/openfpga/src/fpga_verilog/verilog_preconfig_top_module.cpp b/openfpga/src/fpga_verilog/verilog_preconfig_top_module.cpp index 7c6862380..aaec1ceb7 100644 --- a/openfpga/src/fpga_verilog/verilog_preconfig_top_module.cpp +++ b/openfpga/src/fpga_verilog/verilog_preconfig_top_module.cpp @@ -237,6 +237,8 @@ int print_verilog_preconfig_top_module_connect_global_ports(std::fstream &fp, std::vector default_values(module_global_pin.get_width(), fabric_global_ports.global_port_default_value(global_port_id)); /* For configuration done signals, we should enable them in preconfigured wrapper */ if (fabric_global_ports.global_port_is_config_enable(global_port_id)) { + VTR_LOG("Config-enable port '%s' is detected with default value '%ld'", module_global_pin.get_name().c_str(), fabric_global_ports.global_port_default_value(global_port_id)); + default_values.clear(); default_values.resize(module_global_pin.get_width(), 1 - fabric_global_ports.global_port_default_value(global_port_id)); } print_verilog_wire_constant_values(fp, module_global_pin, default_values); diff --git a/openfpga_flow/openfpga_arch/k4_N4_40nm_cc_cfgdscffio_openfpga.xml b/openfpga_flow/openfpga_arch/k4_N4_40nm_cc_cfgdscffio_openfpga.xml new file mode 100644 index 000000000..ce9403181 --- /dev/null +++ b/openfpga_flow/openfpga_arch/k4_N4_40nm_cc_cfgdscffio_openfpga.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/openfpga_cell_library/verilog/gpio.v b/openfpga_flow/openfpga_cell_library/verilog/gpio.v index 1b3618ab2..383a5af96 100644 --- a/openfpga_flow/openfpga_cell_library/verilog/gpio.v +++ b/openfpga_flow/openfpga_cell_library/verilog/gpio.v @@ -19,6 +19,24 @@ module GPIO ( assign PAD = DIR ? 1'bz : A; endmodule +//----------------------------------------------------- +// Function : A minimum general purpose I/O with config_done signal +// which can block signals during configuration phase +//----------------------------------------------------- +module GPIO_CFGD ( + input CONFIG_DONE, // Control signal to block signals + input A, // Data output + output Y, // Data input + inout PAD, // bi-directional pad + input DIR // direction control +); + //----- when direction enabled, the signal is propagated from PAD to data input + assign Y = CONFIG_DONE ? (DIR ? PAD : 1'bz) : 1'bz; + //----- when direction is disabled, the signal is propagated from data out to pad + assign PAD = CONFIG_DONE ? (DIR ? 1'bz : A) : 1'bz; +endmodule + + //----------------------------------------------------- // Function : A minimum input pad //----------------------------------------------------- diff --git a/openfpga_flow/regression_test_scripts/basic_reg_test.sh b/openfpga_flow/regression_test_scripts/basic_reg_test.sh index 69e8cf4fb..2fa69fb87 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_io --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_io/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_io/config/task.conf index 6b55acd3e..0a148ee3c 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_io/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_cfgdscffio_openfpga.xml openfpga_sim_setting_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_simulation_settings/auto_sim_openfpga.xml [ARCHITECTURES]