diff --git a/CMakeLists.txt b/CMakeLists.txt index 6087633c..b1fe5715 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,24 +131,24 @@ FILE(COPY ${EBLIF_TRANSFORM_SRC_H} ${EBLIF_TRANSFORM_DEST}) # patch VPR -FILE(COPY ${PACKER_SRC_DIR}/cluster.cpp - ${PACKER_SRC_DIR}/cluster_util.cpp - ${PACKER_SRC_DIR}/cluster_util.h - ${PACKER_SRC_DIR}/output_clustering.cpp - ${PACKER_SRC_DIR}/output_clustering.h - ${PACKER_SRC_DIR}/cluster_router.cpp - ${PACKER_SRC_DIR}/post_routing_pb_pin_fixup.cpp - DESTINATION - ${VPR_DEST_DIR}/src/pack) +#FILE(COPY ${PACKER_SRC_DIR}/cluster.cpp +# ${PACKER_SRC_DIR}/cluster_util.cpp +# ${PACKER_SRC_DIR}/cluster_util.h +# ${PACKER_SRC_DIR}/output_clustering.cpp +# ${PACKER_SRC_DIR}/output_clustering.h +# ${PACKER_SRC_DIR}/cluster_router.cpp +# ${PACKER_SRC_DIR}/post_routing_pb_pin_fixup.cpp +# DESTINATION +# ${VPR_DEST_DIR}/src/pack) # add to VPR/pack -FILE(COPY ${PACKER_SRC_DIR}/nl_Par.h - ${PACKER_SRC_DIR}/nl_Par.cpp - ${PACKER_SRC_DIR}/pinc_log.h - ${PACKER_SRC_DIR}/pinc_log.cpp - DESTINATION - ${VPR_DEST_DIR}/src/pack) -message(STATUS "NOTE: ADDED to VPR src/pack: nl_Par.cpp,h pinc_log.cpp,h") +#FILE(COPY ${PACKER_SRC_DIR}/nl_Par.h +# ${PACKER_SRC_DIR}/nl_Par.cpp +# ${PACKER_SRC_DIR}/pinc_log.h +# ${PACKER_SRC_DIR}/pinc_log.cpp +# DESTINATION +# ${VPR_DEST_DIR}/src/pack) +#message(STATUS "NOTE: ADDED to VPR src/pack: nl_Par.cpp,h pinc_log.cpp,h") # add to VPR/base file(COPY @@ -169,20 +169,20 @@ message(STATUS "NOTE: OVERWRITING netlist_writer.cpp") file(COPY ${PATCH_DIR}/base_fix/PATCHED/netlist_writer.cpp DESTINATION ${TARGET_DIR}) message(STATUS "NOTE: COPIED ${PATCH_DIR}/base_fix/PATCHED/netlist_writer.cpp\n to ${TARGET_DIR}/\n") -message(STATUS "NOTE: PATCHING base/vpr_api.cpp ..") -set(DIFF_FILE ${PATCH_DIR}/base_fix/DIFF/vpr_api_cpp.diff) -apply_patch(${DIFF_FILE} ${TARGET_DIR} "base/vpr_api.cpp") +#message(STATUS "NOTE: PATCHING base/vpr_api.cpp ..") +#set(DIFF_FILE ${PATCH_DIR}/base_fix/DIFF/vpr_api_cpp.diff) +#apply_patch(${DIFF_FILE} ${TARGET_DIR} "base/vpr_api.cpp") message(STATUS "NOTE: OVERWRITING base/read_.*") file(COPY ${PATCH_DIR}/base_fix/PATCHED/read_blif.cpp ${PATCH_DIR}/base_fix/PATCHED/read_circuit.cpp ${PATCH_DIR}/base_fix/PATCHED/read_circuit.h - ${PATCH_DIR}/base_fix/PATCHED/vpr_types.h - ${PATCH_DIR}/base_fix/PATCHED/vpr_context.h + #${PATCH_DIR}/base_fix/PATCHED/vpr_types.h + #${PATCH_DIR}/base_fix/PATCHED/vpr_context.h ${PATCH_DIR}/base_fix/PATCHED/read_options.cpp ${PATCH_DIR}/base_fix/PATCHED/read_options.h - ${PATCH_DIR}/base_fix/PATCHED/SetupVPR.cpp + #${PATCH_DIR}/base_fix/PATCHED/SetupVPR.cpp DESTINATION ${TARGET_DIR}) message(STATUS "NOTE: COPIED ${PATCH_DIR}/base_fix/PATCHED/read_.*\n to ${TARGET_DIR}/\n") @@ -268,26 +268,26 @@ file(COPY ${ENCRYPTION_CONFIG_PATH}/config.txt # ${LIB_RRG_DEST_DIR}/src/io) # Logical Levels -message(STATUS "NOTE: PATCHING TimingReporter") -FILE(COPY ${TATUM_SRC_DIR}/TimingReporter.hpp - ${TATUM_SRC_DIR}/TimingReporter.cpp - DESTINATION - ${OPENFPGA_DEST_DIR}/vtr-verilog-to-routing/libs/EXTERNAL/libtatum/libtatum/tatum -) +#message(STATUS "NOTE: PATCHING TimingReporter") +#FILE(COPY ${TATUM_SRC_DIR}/TimingReporter.hpp +# ${TATUM_SRC_DIR}/TimingReporter.cpp +# DESTINATION +# ${OPENFPGA_DEST_DIR}/vtr-verilog-to-routing/libs/EXTERNAL/libtatum/libtatum/tatum +#) ## Logical Levels -FILE(COPY ${UTIL_SRC_DIR}/rsbe_utils.cpp - ${UTIL_SRC_DIR}/rsbe_utils.h - DESTINATION - ${VPR_DEST_DIR}/src/util/ -) -message(STATUS "NOTE: ADDED to VPR src/util: rsbe_utils.cpp,h") +#FILE(COPY ${UTIL_SRC_DIR}/rsbe_utils.cpp +# ${UTIL_SRC_DIR}/rsbe_utils.h +# DESTINATION +# ${VPR_DEST_DIR}/src/util/ +#) +#message(STATUS "NOTE: ADDED to VPR src/util: rsbe_utils.cpp,h") # Logical Levels -FILE(COPY ${ANALYSIS_SRC_DIR}/timing_reports.cpp - DESTINATION - ${VPR_DEST_DIR}/src/analysis -) +#FILE(COPY ${ANALYSIS_SRC_DIR}/timing_reports.cpp +# DESTINATION +# ${VPR_DEST_DIR}/src/analysis +#) message(STATUS "NOTE: DONE PATCHING\n") diff --git a/include/base_fix/PATCHED/read_options.cpp b/include/base_fix/PATCHED/read_options.cpp index 9e5b32dd..50852d1c 100644 --- a/include/base_fix/PATCHED/read_options.cpp +++ b/include/base_fix/PATCHED/read_options.cpp @@ -101,14 +101,6 @@ struct ParseCircuitFormat { conv_value.set_value(e_circuit_format::BLIF); else if (str == "eblif") conv_value.set_value(e_circuit_format::EBLIF); - else if (str == "verilog") - conv_value.set_value(e_circuit_format::VERILOG); - else if (str == "edif") - conv_value.set_value(e_circuit_format::EDIF); - else if (str == "edf") - conv_value.set_value(e_circuit_format::EDIF); - else if (str == "edn") - conv_value.set_value(e_circuit_format::EDIF); else if (str == "fpga-interchange") conv_value.set_value(e_circuit_format::FPGA_INTERCHANGE); else { @@ -128,10 +120,6 @@ struct ParseCircuitFormat { conv_value.set_value("blif"); else if (val == e_circuit_format::EBLIF) conv_value.set_value("eblif"); - else if (val == e_circuit_format::VERILOG) - conv_value.set_value("verilog"); - else if (val == e_circuit_format::EDIF) - conv_value.set_value("edif"); else { VTR_ASSERT(val == e_circuit_format::FPGA_INTERCHANGE); conv_value.set_value("fpga-interchange"); @@ -141,7 +129,7 @@ struct ParseCircuitFormat { } std::vector default_choices() { - return {"auto", "blif", "eblif", "verilog", "edif", "edn", "edf", "fpga-interchange"}; + return {"auto", "blif", "eblif", "fpga-interchange"}; } }; struct ParseRoutePredictor { @@ -410,8 +398,6 @@ struct ParsePlaceAlgorithm { conv_value.set_value(CRITICALITY_TIMING_PLACE); } else if (str == "slack_timing") { conv_value.set_value(SLACK_TIMING_PLACE); - } else if (str == "congestion_aware") { - conv_value.set_value(CONGESTION_AWARE_PLACE); } else { std::stringstream msg; msg << "Invalid conversion from '" << str << "' to e_place_algorithm (expected one of: " << argparse::join(default_choices(), ", ") << ")"; @@ -433,8 +419,6 @@ struct ParsePlaceAlgorithm { conv_value.set_value("bounding_box"); } else if (val == CRITICALITY_TIMING_PLACE) { conv_value.set_value("criticality_timing"); - } else if (val == CONGESTION_AWARE_PLACE) { - conv_value.set_value("congestion_aware"); } else { VTR_ASSERT(val == SLACK_TIMING_PLACE); conv_value.set_value("slack_timing"); @@ -443,7 +427,7 @@ struct ParsePlaceAlgorithm { } std::vector default_choices() { - return {"bounding_box", "criticality_timing", "slack_timing", "congestion_aware"}; + return {"bounding_box", "criticality_timing", "slack_timing"}; } }; @@ -548,9 +532,9 @@ struct ParseFixPins { ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "free") - conv_value.set_value(FREE); + conv_value.set_value(e_pad_loc_type::FREE); else if (str == "random") - conv_value.set_value(RANDOM); + conv_value.set_value(e_pad_loc_type::RANDOM); else { std::stringstream msg; msg << "Invalid conversion from '" << str << "' to e_router_algorithm (expected one of: " << argparse::join(default_choices(), ", ") << ")"; @@ -561,10 +545,10 @@ struct ParseFixPins { ConvertedValue to_str(e_pad_loc_type val) { ConvertedValue conv_value; - if (val == FREE) + if (val == e_pad_loc_type::FREE) conv_value.set_value("free"); else { - VTR_ASSERT(val == RANDOM); + VTR_ASSERT(val == e_pad_loc_type::RANDOM); conv_value.set_value("random"); } return conv_value; @@ -1077,6 +1061,8 @@ struct ParseRouterHeap { ConvertedValue conv_value; if (str == "binary") conv_value.set_value(e_heap_type::BINARY_HEAP); + else if (str == "four_ary") + conv_value.set_value(e_heap_type::FOUR_ARY_HEAP); else if (str == "bucket") conv_value.set_value(e_heap_type::BUCKET_HEAP_APPROXIMATION); else { @@ -1091,6 +1077,8 @@ struct ParseRouterHeap { ConvertedValue conv_value; if (val == e_heap_type::BINARY_HEAP) conv_value.set_value("binary"); + else if (val == e_heap_type::FOUR_ARY_HEAP) + conv_value.set_value("four_ary"); else { VTR_ASSERT(val == e_heap_type::BUCKET_HEAP_APPROXIMATION); conv_value.set_value("bucket"); @@ -1099,7 +1087,7 @@ struct ParseRouterHeap { } std::vector default_choices() { - return {"binary", "bucket"}; + return {"binary", "four_ary", "bucket"}; } }; @@ -1336,6 +1324,11 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio .action(argparse::Action::STORE_TRUE) .default_value("off"); + stage_grp.add_argument(args.do_analytical_placement, "--analytical_place") + .help("Run analytical placement. Analytical Placement uses an integrated packing and placement algorithm, using information from the primitive level to improve clustering and placement.") + .action(argparse::Action::STORE_TRUE) + .default_value("off"); + stage_grp.add_argument(args.do_routing, "--route") .help("Run routing") .action(argparse::Action::STORE_TRUE) @@ -1439,10 +1432,6 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio .help("Show this help message then exit") .action(argparse::Action::HELP); - gen_grp.add_argument(args.top_mod, "--top", "-t") - .help("Top module name") - .default_value(""); - gen_grp.add_argument(args.show_version, "--version") .help("Show version information then exit") .action(argparse::Action::VERSION); @@ -1648,6 +1637,11 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio .metavar("INITIAL_PLACE_FILE") .show_in(argparse::ShowIn::HELP_ONLY); + file_grp.add_argument(args.read_initial_place_file, "--read_initial_place_file") + .help("Reads the initial placement and continues the rest of the placement process from there.") + .metavar("INITIAL_PLACE_FILE") + .show_in(argparse::ShowIn::HELP_ONLY); + file_grp.add_argument(args.read_vpr_constraints_file, "--read_vpr_constraints") .help("Reads the floorplanning constraints that packing and placement must respect from the specified XML file.") .show_in(argparse::ShowIn::HELP_ONLY); @@ -1915,16 +1909,6 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio .default_value("semiDirectedSwap") .show_in(argparse::ShowIn::HELP_ONLY); - pack_grp.add_argument(args.use_partitioning_in_pack, "--use_partitioning_in_pack") - .help("Whether to use partitioning in pack.") - .default_value("off") - .show_in(argparse::ShowIn::HELP_ONLY); - - pack_grp.add_argument(args.number_of_molecules_in_partition, "--number_of_molecules_in_partition") - .help("Average number of molecules in each cluster. It should be used when --use_partitioning_in_pack is on.") - .default_value("64") - .show_in(argparse::ShowIn::HELP_ONLY); - auto& place_grp = parser.add_argument_group("placement options"); place_grp.add_argument(args.Seed, "--seed") @@ -2030,7 +2014,7 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio " * criticality_timing: Focuses on minimizing both the wirelength and the connection timing costs (criticality * delay).\n" " * slack_timing: Focuses on improving the circuit slack values to reduce critical path delay.\n") .default_value("criticality_timing") - .choices({"bounding_box", "criticality_timing", "slack_timing", "congestion_aware"}) + .choices({"bounding_box", "criticality_timing", "slack_timing"}) .show_in(argparse::ShowIn::HELP_ONLY); place_grp.add_argument(args.PlaceQuenchAlgorithm, "--place_quench_algorithm") @@ -2042,7 +2026,7 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio " * criticality_timing: Focuses on minimizing both the wirelength and the connection timing costs (criticality * delay).\n" " * slack_timing: Focuses on improving the circuit slack values to reduce critical path delay.\n") .default_value("criticality_timing") - .choices({"bounding_box", "criticality_timing", "slack_timing", "congestion_aware"}) + .choices({"bounding_box", "criticality_timing", "slack_timing"}) .show_in(argparse::ShowIn::HELP_ONLY); place_grp.add_argument(args.PlaceChanWidth, "--place_chan_width") @@ -2080,14 +2064,6 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio .default_value("false") .show_in(argparse::ShowIn::HELP_ONLY); - // Cascade Placer - place_grp.add_argument(args.enable_cascade_placer, "--enable_cascade_placer") - .help( - "Enables the cascade placer. " - "Once analytic placement is done, the result is passed through the annealing (SA) placer") - .default_value("false") - .show_in(argparse::ShowIn::HELP_ONLY); - place_grp.add_argument(args.place_static_move_prob, "--place_static_move_prob") .help( "The percentage probabilities of different moves in Simulated Annealing placement. " @@ -2184,20 +2160,20 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio place_grp.add_argument(args.place_constraint_expand, "--place_constraint_expand") .help( - "The value used to decide how much to expand the floorplan constraint region when writing" - "a floorplan constraint XML file. Takes in an integer value from zero to infinity." - "If the value is zero, the block stays at the same x, y location. If it is" - "greater than zero the constraint region expands by the specified value in each direction." - "For example, if 1 was specified, a block at the x, y location (1, 1) would have a constraint region" + "The value used to decide how much to expand the floorplan constraint region when writing " + "a floorplan constraint XML file. Takes in an integer value from zero to infinity. " + "If the value is zero, the block stays at the same x, y location. If it is " + "greater than zero the constraint region expands by the specified value in each direction. " + "For example, if 1 was specified, a block at the x, y location (1, 1) would have a constraint region " "of 2x2 centered around (1, 1), from (0, 0) to (2, 2).") .default_value("0") .show_in(argparse::ShowIn::HELP_ONLY); place_grp.add_argument(args.place_constraint_subtile, "--place_constraint_subtile") .help( - "The bool used to say whether to print subtile constraints when printing a floorplan constraints XML file." - "If it is off, no subtile locations are specified when printing the floorplan constraints." - "If it is on, the floorplan constraints are printed with the subtiles from current placement.") + "The bool used to say whether to print subtile constraints when printing a floorplan constraints XML file. " + "If it is off, no subtile locations are specified when printing the floorplan constraints. " + "If it is on, the floorplan constraints are printed with the subtiles from current placement. ") .default_value("off") .show_in(argparse::ShowIn::HELP_ONLY); @@ -2310,7 +2286,7 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio " * 'simple' uses map router lookahead\n" " * 'delta' uses differences in position only\n" " * 'delta_override' uses differences in position with overrides for direct connects\n") - .default_value("delta") + .default_value("simple") .show_in(argparse::ShowIn::HELP_ONLY); place_timing_grp.add_argument(args.place_delay_model_reducer, "--place_delay_model_reducer") @@ -2524,6 +2500,18 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio .default_value("false") .show_in(argparse::ShowIn::HELP_ONLY); + + route_grp.add_argument(args.route_verbosity, "--route_verbosity") + .help("Controls the verbosity of routing's output. Higher values produce more output (useful for debugging routing problems)") + .default_value("1") + .show_in(argparse::ShowIn::HELP_ONLY); + route_grp.add_argument(args.custom_3d_sb_fanin_fanout, "--custom_3d_sb_fanin_fanout") + .help( + "Specifies the number of tracks that can drive a 3D switch block connection" + "and the number of tracks that can be driven by a 3D switch block connection") + .default_value("1") + .show_in(argparse::ShowIn::HELP_ONLY); + auto& route_timing_grp = parser.add_argument_group("timing-driven routing options"); route_timing_grp.add_argument(args.astar_fac, "--astar_fac") @@ -2533,6 +2521,14 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio .default_value("1.2") .show_in(argparse::ShowIn::HELP_ONLY); + route_timing_grp.add_argument(args.astar_offset, "--astar_offset") + .help( + "Controls the directedness of the timing-driven router's exploration." + " It is a subtractive adjustment to the lookahead heuristic." + " Values between 0 and 1e-9 are resonable; higher values may increase quality at the expense of run-time.") + .default_value("0.0") + .show_in(argparse::ShowIn::HELP_ONLY); + route_timing_grp.add_argument(args.router_profiler_astar_fac, "--router_profiler_astar_fac") .help( "Controls the directedness of the timing-driven router's exploration" @@ -2686,15 +2682,16 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio .help( "Controls what type of heap to use for timing driven router.\n" " * binary: A binary heap is used.\n" + " * four_ary: A four_ary heap is used.\n" " * bucket: A bucket heap approximation is used. The bucket heap\n" " * is faster because it is only a heap approximation.\n" " * Testing has shown the approximation results in\n" - " * similiar QoR with less CPU work.\n") - .default_value("binary") + " * similar QoR with less CPU work.\n") + .default_value("four_ary") .show_in(argparse::ShowIn::HELP_ONLY); route_timing_grp.add_argument(args.router_first_iteration_timing_report_file, "--router_first_iter_timing_report") - .help("Name of the post first routing iteration timing report file (not generated if unspecfied)") + .help("Name of the post first routing iteration timing report file (not generated if unspecified)") .default_value("") .show_in(argparse::ShowIn::HELP_ONLY); @@ -3105,6 +3102,13 @@ void set_conditional_defaults(t_options& args) { } } + // If MAP Router lookahead is not used, we cannot use simple place delay lookup + if (args.place_delay_model.provenance() != Provenance::SPECIFIED) { + if (args.router_lookahead_type != e_router_lookahead::MAP) { + args.place_delay_model.set(PlaceDelayModelType::DELTA, Provenance::INFERRED); + } + } + // Check for correct options combinations // If you are running WLdriven placement, the RL reward function should be // either basic or nonPenalizing basic diff --git a/include/base_fix/PATCHED/read_options.h b/include/base_fix/PATCHED/read_options.h index 6396de7f..5ea360cb 100644 --- a/include/base_fix/PATCHED/read_options.h +++ b/include/base_fix/PATCHED/read_options.h @@ -29,6 +29,7 @@ struct t_options { argparse::ArgValue write_rr_graph_file; argparse::ArgValue read_rr_graph_file; argparse::ArgValue write_initial_place_file; + argparse::ArgValue read_initial_place_file; argparse::ArgValue read_vpr_constraints_file; argparse::ArgValue write_vpr_constraints_file; argparse::ArgValue write_constraints_file; @@ -49,6 +50,7 @@ struct t_options { argparse::ArgValue do_packing; argparse::ArgValue do_legalize; argparse::ArgValue do_placement; + argparse::ArgValue do_analytical_placement; argparse::ArgValue do_routing; argparse::ArgValue do_analysis; argparse::ArgValue do_power; @@ -223,9 +225,12 @@ struct t_options { argparse::ArgValue reorder_rr_graph_nodes_seed; argparse::ArgValue flat_routing; argparse::ArgValue has_choking_spot; + argparse::ArgValue route_verbosity; + argparse::ArgValue custom_3d_sb_fanin_fanout; /* Timing-driven router options only */ argparse::ArgValue astar_fac; + argparse::ArgValue astar_offset; argparse::ArgValue router_profiler_astar_fac; argparse::ArgValue max_criticality; argparse::ArgValue criticality_exp;