diff --git a/.travis/script.sh b/.travis/script.sh index 126f633d1..b577ee48c 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -48,6 +48,9 @@ python3 openfpga_flow/scripts/run_fpga_task.py duplicate_grid_pin --debug --show ############################################## echo -e "Testing OpenFPGA Shell"; +echo -e "Testing configuration chain of a K4N4 FPGA"; +python3 openfpga_flow/scripts/run_fpga_task.py openfpga_shell/configuration_chain --debug --show_thread_logs + echo -e "Testing Verilog generation with simple fracturable LUT6 "; python3 openfpga_flow/scripts/run_fpga_task.py openfpga_shell/frac_lut --debug --show_thread_logs diff --git a/openfpga/src/fpga_sdc/analysis_sdc_writer_utils.cpp b/openfpga/src/fpga_sdc/analysis_sdc_writer_utils.cpp index f761cafea..1491d161d 100644 --- a/openfpga/src/fpga_sdc/analysis_sdc_writer_utils.cpp +++ b/openfpga/src/fpga_sdc/analysis_sdc_writer_utils.cpp @@ -60,6 +60,7 @@ void disable_analysis_module_input_pin_net_sinks(std::fstream& fp, /* Find the module net which sources from this port! */ ModuleNetId module_net = module_manager.module_instance_port_net(parent_module, parent_module, 0, module_input_port, module_input_pin); + if (true != module_manager.valid_module_net_id(parent_module, module_net)) VTR_ASSERT(true == module_manager.valid_module_net_id(parent_module, module_net)); /* Touch each sink of the net! */ diff --git a/openfpga/src/fpga_verilog/verilog_top_testbench.cpp b/openfpga/src/fpga_verilog/verilog_top_testbench.cpp index 98d69c337..25017d741 100644 --- a/openfpga/src/fpga_verilog/verilog_top_testbench.cpp +++ b/openfpga/src/fpga_verilog/verilog_top_testbench.cpp @@ -273,8 +273,8 @@ void print_verilog_top_testbench_global_ports_stimuli(std::fstream& fp, continue; } - /* Bypass gp output signals, they do not need any drivers */ - if (CIRCUIT_MODEL_PORT_OUTPUT == circuit_lib.port_type(model_global_port)) { + /* Bypass io signals, they do not need any drivers */ + if (true == circuit_lib.port_is_io(model_global_port)) { continue; } diff --git a/openfpga/src/repack/build_physical_truth_table.cpp b/openfpga/src/repack/build_physical_truth_table.cpp index 5e291d88b..51fc93f93 100644 --- a/openfpga/src/repack/build_physical_truth_table.cpp +++ b/openfpga/src/repack/build_physical_truth_table.cpp @@ -17,6 +17,9 @@ /* begin namespace openfpga */ namespace openfpga { +/* Mode 1 is the lut mode while mode 0 is the wire mode */ +constexpr int VPR_PB_TYPE_LUT_MODE = 1; + /*************************************************************************************** * Identify if LUT is used as wiring * In this case, LUT functions as a buffer @@ -56,9 +59,23 @@ std::vector generate_lut_rotated_input_pin_map(const std::vector std::vector rotated_pin_map(input_nets.size(), -1); VTR_ASSERT(1 == pb_graph_node->num_input_ports); + for (int ipin = 0; ipin < pb_graph_node->num_input_pins[0]; ++ipin) { + /* The lut pb_graph_node may not be the primitive node + * because VPR adds two default modes to its LUT pb_type + * If so, we will use the LUT mode of the pb_graph node + */ + t_port* lut_pb_type_in_port = pb_graph_node->input_pins[0][ipin].port; + if (0 != pb_graph_node->pb_type->num_modes) { + VTR_ASSERT(2 == pb_graph_node->pb_type->num_modes); + VTR_ASSERT(1 == pb_graph_node->pb_type->modes[VPR_PB_TYPE_LUT_MODE].num_pb_type_children); + lut_pb_type_in_port = &(pb_graph_node->pb_type->modes[VPR_PB_TYPE_LUT_MODE].pb_type_children[0].ports[0]); + VTR_ASSERT(std::string(lut_pb_type_in_port->name) == std::string(pb_graph_node->input_pins[0][ipin].port->name)); + VTR_ASSERT(lut_pb_type_in_port->num_pins == pb_graph_node->input_pins[0][ipin].port->num_pins); + } + /* Port exists (some LUTs may have no input and hence no port in the atom netlist) */ - AtomPortId atom_port = atom_ctx.nlist.find_atom_port(atom_blk, pb_graph_node->input_pins[0][ipin].port->model_port); + AtomPortId atom_port = atom_ctx.nlist.find_atom_port(atom_blk, lut_pb_type_in_port->model_port); if (!atom_port) { continue; } diff --git a/openfpga_flow/arch/vpr_only_templates/k4_N4_tileable_40nm.xml b/openfpga_flow/arch/vpr_only_templates/k4_N4_tileable_40nm.xml new file mode 100644 index 000000000..533704db8 --- /dev/null +++ b/openfpga_flow/arch/vpr_only_templates/k4_N4_tileable_40nm.xml @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 261e-12 + 261e-12 + 261e-12 + 261e-12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openfpga_flow/arch/vpr_only_templates/k6_N10_40nm.xml b/openfpga_flow/arch/vpr_only_templates/k6_N10_40nm.xml index 630011e84..e94f339c1 100644 --- a/openfpga_flow/arch/vpr_only_templates/k6_N10_40nm.xml +++ b/openfpga_flow/arch/vpr_only_templates/k6_N10_40nm.xml @@ -41,13 +41,12 @@ - - io.outpad io.inpad io.clock - io.outpad io.inpad io.clock - io.outpad io.inpad io.clock - io.outpad io.inpad io.clock + io.outpad io.inpad + io.outpad io.inpad + io.outpad io.inpad + io.outpad io.inpad @@ -135,7 +134,6 @@ - diff --git a/openfpga_flow/arch/vpr_only_templates/k6_N10_tileable_40nm.xml b/openfpga_flow/arch/vpr_only_templates/k6_N10_tileable_40nm.xml index d86d7aa62..f9065d437 100644 --- a/openfpga_flow/arch/vpr_only_templates/k6_N10_tileable_40nm.xml +++ b/openfpga_flow/arch/vpr_only_templates/k6_N10_tileable_40nm.xml @@ -41,13 +41,12 @@ - - io.outpad io.inpad io.clock - io.outpad io.inpad io.clock - io.outpad io.inpad io.clock - io.outpad io.inpad io.clock + io.outpad io.inpad + io.outpad io.inpad + io.outpad io.inpad + io.outpad io.inpad @@ -135,7 +134,6 @@ - diff --git a/openfpga_flow/openfpga_arch/k4_N4_40nm_openfpga.xml b/openfpga_flow/openfpga_arch/k4_N4_40nm_openfpga.xml new file mode 100644 index 000000000..1d48387ed --- /dev/null +++ b/openfpga_flow/openfpga_arch/k4_N4_40nm_openfpga.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/tasks/openfpga_shell/configuration_chain/config/task.conf b/openfpga_flow/tasks/openfpga_shell/configuration_chain/config/task.conf index 481faab3a..7415b96ab 100644 --- a/openfpga_flow/tasks/openfpga_shell/configuration_chain/config/task.conf +++ b/openfpga_flow/tasks/openfpga_shell/configuration_chain/config/task.conf @@ -15,10 +15,10 @@ spice_output=false verilog_output=true timeout_each_job = 20*60 fpga_flow=vpr_blif -openfpga_arch_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_arch/k6_frac_N10_40nm_openfpga.xml +openfpga_arch_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_arch/k4_N4_40nm_openfpga.xml [ARCHITECTURES] -arch0=${PATH:OPENFPGA_PATH}/openfpga_flow/arch/vpr_only_templates/k6_frac_N10_40nm.xml +arch0=${PATH:OPENFPGA_PATH}/openfpga_flow/arch/vpr_only_templates/k4_N4_tileable_40nm.xml [BENCHMARKS] bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/and.blif