From 9e15932cac3c9f96dfc0217d2bd059b44963b1c7 Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Wed, 17 May 2023 16:01:57 -0400 Subject: [PATCH 01/11] placer seed was printed before it was set --- vpr/src/base/SetupVPR.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vpr/src/base/SetupVPR.cpp b/vpr/src/base/SetupVPR.cpp index ea05407f04d..f18e7c9b032 100644 --- a/vpr/src/base/SetupVPR.cpp +++ b/vpr/src/base/SetupVPR.cpp @@ -666,6 +666,9 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts) PlacerOpts->place_constraint_subtile = Options.place_constraint_subtile; PlacerOpts->floorplan_num_horizontal_partitions = Options.floorplan_num_horizontal_partitions; PlacerOpts->floorplan_num_vertical_partitions = Options.floorplan_num_vertical_partitions; + + PlacerOpts->seed = Options.Seed; + } static void SetupAnalysisOpts(const t_options& Options, t_analysis_opts& analysis_opts) { From cbb366a6f922f67172839f7ae662646bb9d64b2d Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Wed, 17 May 2023 16:42:13 -0400 Subject: [PATCH 02/11] make format --- vpr/src/base/SetupVPR.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/vpr/src/base/SetupVPR.cpp b/vpr/src/base/SetupVPR.cpp index f18e7c9b032..0848032b034 100644 --- a/vpr/src/base/SetupVPR.cpp +++ b/vpr/src/base/SetupVPR.cpp @@ -668,7 +668,6 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts) PlacerOpts->floorplan_num_vertical_partitions = Options.floorplan_num_vertical_partitions; PlacerOpts->seed = Options.Seed; - } static void SetupAnalysisOpts(const t_options& Options, t_analysis_opts& analysis_opts) { From e975b36c7d0198c6cf4baec890cd299e6afe9cd5 Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Thu, 18 May 2023 18:27:18 -0400 Subject: [PATCH 03/11] removed the extra seed setup before placement --- vpr/src/base/SetupVPR.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/vpr/src/base/SetupVPR.cpp b/vpr/src/base/SetupVPR.cpp index f18e7c9b032..31a1e87724d 100644 --- a/vpr/src/base/SetupVPR.cpp +++ b/vpr/src/base/SetupVPR.cpp @@ -267,7 +267,6 @@ void SetupVPR(const t_options* Options, vtr::out_file_prefix = Options->out_file_prefix; /* Set seed for pseudo-random placement, default seed to 1 */ - PlacerOpts->seed = Options->Seed; vtr::srandom(PlacerOpts->seed); { From 1bc2039f1e15601e4a218c58d7d3d889d00a523b Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Fri, 2 Jun 2023 15:05:09 -0400 Subject: [PATCH 04/11] removed todo for PlacerOpts documentation --- vpr/src/base/SetupVPR.cpp | 2 -- vpr/src/base/vpr_types.h | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vpr/src/base/SetupVPR.cpp b/vpr/src/base/SetupVPR.cpp index ae8949af738..84650d654b7 100644 --- a/vpr/src/base/SetupVPR.cpp +++ b/vpr/src/base/SetupVPR.cpp @@ -599,7 +599,6 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts) PlacerOpts->inner_loop_recompute_divider = Options.inner_loop_recompute_divider; PlacerOpts->quench_recompute_divider = Options.quench_recompute_divider; - //TODO: document? PlacerOpts->place_cost_exp = 1; PlacerOpts->td_place_exp_first = Options.place_exp_first; @@ -628,7 +627,6 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts) PlacerOpts->delay_model_type = Options.place_delay_model; PlacerOpts->delay_model_reducer = Options.place_delay_model_reducer; - //TODO: document? PlacerOpts->place_freq = PLACE_ONCE; /* DEFAULT */ PlacerOpts->post_place_timing_report_file = Options.post_place_timing_report_file; diff --git a/vpr/src/base/vpr_types.h b/vpr/src/base/vpr_types.h index 1fc87f71e7c..7a2b98e109c 100644 --- a/vpr/src/base/vpr_types.h +++ b/vpr/src/base/vpr_types.h @@ -1038,7 +1038,10 @@ enum class e_place_delta_delay_algorithm { * When in CRITICALITY_TIMING_PLACE mode, what is the * tradeoff between timing and wiring costs. * @param place_cost_exp - * Power to which denominator is raised for linear_cong. + * Wiring cost is divided by the average channel width over + * a net's bounding box taken to this exponent. + * Only impacts devices with different channel widths in + * different directions or regions. (Default: 1) * @param place_chan_width * The channel width assumed if only one placement is performed. * @param pad_loc_type @@ -1050,7 +1053,7 @@ enum class e_place_delta_delay_algorithm { * File to read pad locations from if pad_loc_type is USER. * @param place_freq * Should the placement be skipped, done once, or done - * for each channel width in the binary search. + * for each channel width in the binary search. (Default: ONCE) * @param recompute_crit_iter * How many temperature stages pass before we recompute * criticalities based on the current placement and its From c56d7b8093db6f2e875453148310fd4a9122eb97 Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Fri, 2 Jun 2023 15:31:34 -0400 Subject: [PATCH 05/11] updated command line documentation for RLPlace1/2 options --- doc/src/vpr/command_line_usage.rst | 62 ++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/doc/src/vpr/command_line_usage.rst b/doc/src/vpr/command_line_usage.rst index f589969d8ef..e5db18ccd37 100644 --- a/doc/src/vpr/command_line_usage.rst +++ b/doc/src/vpr/command_line_usage.rst @@ -821,6 +821,68 @@ Setting any of the following options selects `Dusty's annealing schedule + + Wiring cost is divided by the average channel width over a net's bounding box + taken to this exponent.Only impacts devices with different channel widths in + different directions or regions. + + **Default:** ``1`` + +.. option:: --RL_agent_placement {on | off} + + Uses a Reinforcement Learning (RL) agent in choosing the appropiate move type in placement. + It activates the RL agent placement instead of using fixed probability for each move type. + + **Default:** ``on`` + +.. option:: --place_agent_multistate {on | off} + + Enable multistate agent in the placement. A second state will be activated late in + the annealing and in the Quench that includes all the timing driven directed moves. + + **Default:** ``on`` + +.. option:: --place_agent_algorithm {e_greedy | softmax} + + Controls which placement RL agent is used. + + **Default:** ``softmax`` + +.. option:: --place_agent_epsilon + + Placement RL agent's epsilon for epsilon-greedy agent. Epsilon represents + the percentage of exploration actions taken vs the exploitation ones. + + **Default:** ``0.3`` + +.. option:: --place_agent_gamma + + Controls how quickly the agent's memory decays. Values between [0., 1.] specify + the fraction of weight in the exponentially weighted reward average applied to moves + which occured greater than moves_per_temp moves ago. Values < 0 cause the + unweighted reward sample average to be used (all samples are weighted equally) + + **Default:** ``0.05`` + +.. option:: --place_reward_fun {basic | nonPenalizing_basic | runtime_aware | WLbiased_runtime_aware} + + The reward function used by placement RL agent to learn best action at each anneal stage. + + .. note:: The latter two are only available for timing-driven placement. + + **Default:** ``WLbiased_runtime_aware`` + +.. option:: --place_agent_space {move_type | move_block_type} + + Agent exploration space can be either based on only move types or also consider different block types. + The available values are: move_type, move_block_type + + **Default:** ``move_block_type`` + + + + .. _timing_driven_placer_options: Timing-Driven Placer Options From 71e6c9a3b7cb21ecc5d521f3a718e199e5f05fb5 Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Fri, 2 Jun 2023 15:48:32 -0400 Subject: [PATCH 06/11] added noc command-line options to doc --- doc/src/vpr/command_line_usage.rst | 74 +++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/doc/src/vpr/command_line_usage.rst b/doc/src/vpr/command_line_usage.rst index e5db18ccd37..0c69e743a35 100644 --- a/doc/src/vpr/command_line_usage.rst +++ b/doc/src/vpr/command_line_usage.rst @@ -881,8 +881,6 @@ Setting any of the following options selects `Dusty's annealing schedule + + XML file containing the list of traffic flows within the NoC (communication between routers). + + .. note:: noc_flows_file are required to specify if NoC optimization is turned on (--noc on). + +.. option:: --noc_routing_algorithm {xy_routing | bfs_routing} + + Controls the algorithm used by the NoC to route packets. + xy_routing: Uses the direction oriented routing algorithm. This is recommended to be used with mesh NoC topologies. + bfs_routing: Uses the breadth first search algorithm. The objective is to find a route that uses a minimum number of links. + This can be used with any NoC topology. + + **Default:** ``bfs_routing`` + +.. option:: --noc_placement_weighting + + Controls the importance of the NoC placement parameters relative to timing and wirelength of the design. + This value can be >=0, where 0 would mean the placement is based solely on timing and wirelength, a value of 1 would + mean noc placement is considered equal to timing and wirelength and a value greater than 1 would mean the placement is + increasingly dominated by NoC parameters. + + **Default:** ``0.6`` + +.. option:: --noc_latency_constraints_weighting + + Controls the importance of meeting all the NoC traffic flow latency constraints. + This value can be >=0, where 0 would mean the latency constraints have no relevance to placement, + a value of 1 would mean the latency constraints are weighted equally to the sum of other placement cost components + and a value greater than 1 would mean the placement is increasingly dominated by meeting the latency constraints of the traffic flows. + + **Default:** ``1`` + +.. option:: --noc_latency_weighting + + Controls the importance of reducing the latencies of the NoC traffic flows. + This value can be >=0, where 0 would mean the latencies have no relevance to placement, + a value of 1 would mean the latencies are weighted equally to the sum of other placement cost components and a value greater + than 1 would mean the placement is increasingly dominated by reducing the latencies of the traffic flows. + + **Default:** ``0.05`` + +.. option:: --noc_swap_percentage + + Sets the minimum fraction of swaps attempted by the placer that are NoC blocks. + This value is an integer ranging from 0-100. + 0 means NoC blocks will be moved at the same rate as other blocks. + 100 means all swaps attempted by the placer are NoC router blocks. + + **Default:** ``40`` + +.. option:: --noc_placement_file_name + + Name of the output file that contains the NoC placement information. + The default name is 'vpr_noc_placement_output.txt' + + **Default:** ``vpr_noc_placement_output.txt`` + .. _router_options: Router Options From 7da4ef5d96e9070b4bacb113a5e3c4678dcf22b6 Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Fri, 2 Jun 2023 15:59:13 -0400 Subject: [PATCH 07/11] clean up the NoC documentations --- doc/src/vpr/command_line_usage.rst | 36 +++++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/doc/src/vpr/command_line_usage.rst b/doc/src/vpr/command_line_usage.rst index 0c69e743a35..f3b223a77c0 100644 --- a/doc/src/vpr/command_line_usage.rst +++ b/doc/src/vpr/command_line_usage.rst @@ -1003,52 +1003,56 @@ The following options are only used when FPGA device and netlist contain a NoC r .. option:: --noc_routing_algorithm {xy_routing | bfs_routing} Controls the algorithm used by the NoC to route packets. - xy_routing: Uses the direction oriented routing algorithm. This is recommended to be used with mesh NoC topologies. - bfs_routing: Uses the breadth first search algorithm. The objective is to find a route that uses a minimum number of links. - This can be used with any NoC topology. + + * ``xy_routing`` Uses the direction oriented routing algorithm. This is recommended to be used with mesh NoC topologies. + * ``bfs_routing`` Uses the breadth first search algorithm. The objective is to find a route that uses a minimum number of links. This can be used with any NoC topology. **Default:** ``bfs_routing`` .. option:: --noc_placement_weighting Controls the importance of the NoC placement parameters relative to timing and wirelength of the design. - This value can be >=0, where 0 would mean the placement is based solely on timing and wirelength, a value of 1 would - mean noc placement is considered equal to timing and wirelength and a value greater than 1 would mean the placement is - increasingly dominated by NoC parameters. + + * ``noc_placement_weighting = 0`` means the placement is based solely on timing and wirelength. + * ``noc_placement_weighting = 1`` means noc placement is considered equal to timing and wirelength. + * ``noc_placement_weighting > 1`` means the placement is increasingly dominated by NoC parameters. **Default:** ``0.6`` .. option:: --noc_latency_constraints_weighting Controls the importance of meeting all the NoC traffic flow latency constraints. - This value can be >=0, where 0 would mean the latency constraints have no relevance to placement, - a value of 1 would mean the latency constraints are weighted equally to the sum of other placement cost components - and a value greater than 1 would mean the placement is increasingly dominated by meeting the latency constraints of the traffic flows. + + * ``latency_constraints = 0`` means the latency constraints have no relevance to placement. + * ``0 < latency_constraints < 1`` means the latency constraints are weighted equally to the sum of other placement cost components. + * ``latency_constraints > 1`` means the placement is increasingly dominated by reducing the latency constraints of the traffic flows. **Default:** ``1`` .. option:: --noc_latency_weighting Controls the importance of reducing the latencies of the NoC traffic flows. - This value can be >=0, where 0 would mean the latencies have no relevance to placement, - a value of 1 would mean the latencies are weighted equally to the sum of other placement cost components and a value greater - than 1 would mean the placement is increasingly dominated by reducing the latencies of the traffic flows. + This value can be >=0, + + * ``latency = 0`` means the latencies have no relevance to placement. + * ``0 < latency < 1`` means the latencies are weighted equally to the sum of other placement cost components. + * ``latency > 1`` means the placement is increasingly dominated by reducing the latencies of the traffic flows. **Default:** ``0.05`` .. option:: --noc_swap_percentage Sets the minimum fraction of swaps attempted by the placer that are NoC blocks. - This value is an integer ranging from 0-100. - 0 means NoC blocks will be moved at the same rate as other blocks. - 100 means all swaps attempted by the placer are NoC router blocks. + This value is an integer ranging from [0-100]. + + * ``0`` means NoC blocks will be moved at the same rate as other blocks. + * ``100`` means all swaps attempted by the placer are NoC router blocks. **Default:** ``40`` .. option:: --noc_placement_file_name Name of the output file that contains the NoC placement information. - The default name is 'vpr_noc_placement_output.txt' **Default:** ``vpr_noc_placement_output.txt`` From 3ed40eea915d8f3d9449fc0cb70b584497a56846 Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Fri, 2 Jun 2023 16:01:43 -0400 Subject: [PATCH 08/11] fix some traffic flow typos in NoC benchmarks --- ..._star_2_bandwdiths.flows => simple_32_star_2_bandwidths.flows} | 0 ..._star_3_bandwdiths.flows => simple_32_star_3_bandwidths.flows} | 0 ..._star_4_bandwdiths.flows => simple_32_star_4_bandwidths.flows} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/{simple_32_star_2_bandwdiths.flows => simple_32_star_2_bandwidths.flows} (100%) rename vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/{simple_32_star_3_bandwdiths.flows => simple_32_star_3_bandwidths.flows} (100%) rename vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/{simple_32_star_4_bandwdiths.flows => simple_32_star_4_bandwidths.flows} (100%) diff --git a/vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_2_bandwdiths.flows b/vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_2_bandwidths.flows similarity index 100% rename from vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_2_bandwdiths.flows rename to vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_2_bandwidths.flows diff --git a/vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_3_bandwdiths.flows b/vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_3_bandwidths.flows similarity index 100% rename from vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_3_bandwdiths.flows rename to vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_3_bandwidths.flows diff --git a/vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_4_bandwdiths.flows b/vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_4_bandwidths.flows similarity index 100% rename from vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_4_bandwdiths.flows rename to vtr_flow/benchmarks/noc/Synthetic_Designs/simple_32_noc_star/simple_32_star_4_bandwidths.flows From 8b761d3c65cde230cf813284fc9fc64b2854c41f Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Fri, 2 Jun 2023 17:57:29 -0400 Subject: [PATCH 09/11] applied PR suggestions for placer options --- doc/src/vpr/command_line_usage.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/src/vpr/command_line_usage.rst b/doc/src/vpr/command_line_usage.rst index f3b223a77c0..e46e55e0a7b 100644 --- a/doc/src/vpr/command_line_usage.rst +++ b/doc/src/vpr/command_line_usage.rst @@ -824,7 +824,7 @@ Setting any of the following options selects `Dusty's annealing schedule Wiring cost is divided by the average channel width over a net's bounding box - taken to this exponent.Only impacts devices with different channel widths in + taken to this exponent. Only impacts devices with different channel widths in different directions or regions. **Default:** ``1`` @@ -832,13 +832,13 @@ Setting any of the following options selects `Dusty's annealing schedule - Placement RL agent's epsilon for epsilon-greedy agent. Epsilon represents + Placement RL agent's epsilon for the epsilon-greedy agent. Epsilon represents the percentage of exploration actions taken vs the exploitation ones. **Default:** ``0.3`` @@ -867,7 +867,7 @@ Setting any of the following options selects `Dusty's annealing schedule Date: Thu, 8 Jun 2023 12:29:56 -0400 Subject: [PATCH 10/11] moved noc router connection list print to arch.echo file --- libs/libarchfpga/src/echo_arch.cpp | 15 +++++++++++++++ libs/libarchfpga/src/read_xml_arch_file.cpp | 10 ---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/libs/libarchfpga/src/echo_arch.cpp b/libs/libarchfpga/src/echo_arch.cpp index 489a3d32931..c390d3320c2 100644 --- a/libs/libarchfpga/src/echo_arch.cpp +++ b/libs/libarchfpga/src/echo_arch.cpp @@ -322,6 +322,21 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) { } fprintf(Echo, "*************************************************\n\n"); + //Router Connection List + if(arch->noc != nullptr){ + fprintf(Echo, "*************************************************\n"); + fprintf(Echo, "NoC Router Connection List:\n"); + + for(auto noc_router : arch->noc->router_list){ + fprintf(Echo, "NoC router %d is connected to:\t",noc_router.id); + for(auto noc_conn_id : noc_router.connection_list){ + fprintf(Echo, "%d\t", noc_conn_id); + } + fprintf(Echo,"\n"); + } + fprintf(Echo, "*************************************************\n\n"); + } + //Architecture Power fprintf(Echo, "*************************************************\n"); fprintf(Echo, "Power:\n"); diff --git a/libs/libarchfpga/src/read_xml_arch_file.cpp b/libs/libarchfpga/src/read_xml_arch_file.cpp index 73c6f002f39..a2b4949d63c 100644 --- a/libs/libarchfpga/src/read_xml_arch_file.cpp +++ b/libs/libarchfpga/src/read_xml_arch_file.cpp @@ -4682,16 +4682,6 @@ static void ProcessNoc(pugi::xml_node noc_tag, t_arch* arch, const pugiutil::loc if (noc_mesh_topology) { processMeshTopology(noc_mesh_topology, loc_data, noc_ref); - - for (auto i = noc_ref->router_list.begin(); i != noc_ref->router_list.end(); i++) { - std::cout << "router " << i->id << ": "; - - for (auto j = i->connection_list.begin(); j != i->connection_list.end(); j++) { - std::cout << *j << ","; - } - - std::cout << "\n"; - } } else { noc_topology = pugiutil::get_single_child(noc_tag, "topology", loc_data, pugiutil::REQUIRED); From f4b3d2f10e2dcb3610ab2620f03372baab031ede Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Thu, 8 Jun 2023 16:17:01 -0400 Subject: [PATCH 11/11] make format --- libs/libarchfpga/src/echo_arch.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/libarchfpga/src/echo_arch.cpp b/libs/libarchfpga/src/echo_arch.cpp index c390d3320c2..83005f805a5 100644 --- a/libs/libarchfpga/src/echo_arch.cpp +++ b/libs/libarchfpga/src/echo_arch.cpp @@ -323,20 +323,20 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) { fprintf(Echo, "*************************************************\n\n"); //Router Connection List - if(arch->noc != nullptr){ + if (arch->noc != nullptr) { fprintf(Echo, "*************************************************\n"); fprintf(Echo, "NoC Router Connection List:\n"); - for(auto noc_router : arch->noc->router_list){ - fprintf(Echo, "NoC router %d is connected to:\t",noc_router.id); - for(auto noc_conn_id : noc_router.connection_list){ + for (auto noc_router : arch->noc->router_list) { + fprintf(Echo, "NoC router %d is connected to:\t", noc_router.id); + for (auto noc_conn_id : noc_router.connection_list) { fprintf(Echo, "%d\t", noc_conn_id); } - fprintf(Echo,"\n"); + fprintf(Echo, "\n"); } fprintf(Echo, "*************************************************\n\n"); } - + //Architecture Power fprintf(Echo, "*************************************************\n"); fprintf(Echo, "Power:\n");