|
5 | 5 | #include <fstream>
|
6 | 6 | #include <cstdlib>
|
7 | 7 | #include <sstream>
|
8 |
| -#include <limits> |
9 |
| -#include <queue> |
10 | 8 |
|
11 | 9 | #include "vtr_assert.h"
|
12 | 10 | #include "vtr_log.h"
|
@@ -42,124 +40,6 @@ static bool try_size_device_grid(const t_arch& arch,
|
42 | 40 | */
|
43 | 41 | static int count_models(const t_model* user_models);
|
44 | 42 |
|
45 |
| -static std::vector<AtomBlockId> find_noc_router_atoms() { |
46 |
| - const auto& atom_ctx = g_vpr_ctx.atom(); |
47 |
| - |
48 |
| - // NoC router atoms are expected to have a specific blif model |
49 |
| - const std::string noc_router_blif_model_name = "noc_router_adapter_block"; |
50 |
| - |
51 |
| - // stores found NoC router atoms |
52 |
| - std::vector<AtomBlockId> noc_router_atoms; |
53 |
| - |
54 |
| - // iterate over all atoms and find those whose blif model matches |
55 |
| - for (auto atom_id : atom_ctx.nlist.blocks()) { |
56 |
| - const t_model* model = atom_ctx.nlist.block_model(atom_id); |
57 |
| - if (noc_router_blif_model_name == model->name) { |
58 |
| - noc_router_atoms.push_back(atom_id); |
59 |
| - } |
60 |
| - } |
61 |
| - |
62 |
| - return noc_router_atoms; |
63 |
| -} |
64 |
| - |
65 |
| -static void update_noc_reachability_partitions(const std::vector<AtomBlockId>& noc_atoms) { |
66 |
| - const auto& atom_ctx = g_vpr_ctx.atom(); |
67 |
| - auto& constraints = g_vpr_ctx.mutable_floorplanning().constraints; |
68 |
| - const auto& high_fanout_thresholds = g_vpr_ctx.cl_helper().high_fanout_thresholds; |
69 |
| - |
70 |
| - const size_t high_fanout_threshold = high_fanout_thresholds.get_threshold(""); |
71 |
| - |
72 |
| - // get the total number of atoms |
73 |
| - const size_t n_atoms = atom_ctx.nlist.blocks().size(); |
74 |
| - |
75 |
| - vtr::vector<AtomBlockId, bool> atom_visited(n_atoms, false); |
76 |
| - |
77 |
| - int exclusivity_cnt = 0; |
78 |
| - |
79 |
| - RegionRectCoord unconstrained_rect{0, |
80 |
| - 0, |
81 |
| - std::numeric_limits<int>::max(), |
82 |
| - std::numeric_limits<int>::max(), |
83 |
| - 0}; |
84 |
| - Region unconstrained_region; |
85 |
| - unconstrained_region.set_region_rect(unconstrained_rect); |
86 |
| - |
87 |
| - for (auto noc_atom_id : noc_atoms) { |
88 |
| - // check if this NoC router has already been visited |
89 |
| - if (atom_visited[noc_atom_id]) { |
90 |
| - continue; |
91 |
| - } |
92 |
| - |
93 |
| - exclusivity_cnt++; |
94 |
| - |
95 |
| - PartitionRegion associated_noc_partition_region; |
96 |
| - associated_noc_partition_region.set_exclusivity_index(exclusivity_cnt); |
97 |
| - associated_noc_partition_region.add_to_part_region(unconstrained_region); |
98 |
| - |
99 |
| - Partition associated_noc_partition; |
100 |
| - associated_noc_partition.set_name(atom_ctx.nlist.block_name(noc_atom_id)); |
101 |
| - associated_noc_partition.set_part_region(associated_noc_partition_region); |
102 |
| - auto associated_noc_partition_id = (PartitionId)constraints.get_num_partitions(); |
103 |
| - constraints.add_partition(associated_noc_partition); |
104 |
| - |
105 |
| - const PartitionId noc_partition_id = constraints.get_atom_partition(noc_atom_id); |
106 |
| - |
107 |
| - if (noc_partition_id == PartitionId::INVALID()) { |
108 |
| - constraints.add_constrained_atom(noc_atom_id, associated_noc_partition_id); |
109 |
| - } else { // noc atom is already in a partition |
110 |
| - auto& noc_partition = constraints.get_mutable_partition(noc_partition_id); |
111 |
| - auto& noc_partition_region = noc_partition.get_mutable_part_region(); |
112 |
| - VTR_ASSERT(noc_partition_region.get_exclusivity_index() < 0); |
113 |
| - noc_partition_region.set_exclusivity_index(exclusivity_cnt); |
114 |
| - } |
115 |
| - |
116 |
| - std::queue<AtomBlockId> q; |
117 |
| - q.push(noc_atom_id); |
118 |
| - atom_visited[noc_atom_id] = true; |
119 |
| - |
120 |
| - while (!q.empty()) { |
121 |
| - AtomBlockId current_atom = q.front(); |
122 |
| - q.pop(); |
123 |
| - |
124 |
| - PartitionId atom_partition_id = constraints.get_atom_partition(current_atom); |
125 |
| - if (atom_partition_id == PartitionId::INVALID()) { |
126 |
| - constraints.add_constrained_atom(current_atom, associated_noc_partition_id); |
127 |
| - } else { |
128 |
| - auto& atom_partition = constraints.get_mutable_partition(atom_partition_id); |
129 |
| - auto& atom_partition_region = atom_partition.get_mutable_part_region(); |
130 |
| - VTR_ASSERT(atom_partition_region.get_exclusivity_index() < 0 || current_atom == noc_atom_id); |
131 |
| - atom_partition_region.set_exclusivity_index(exclusivity_cnt); |
132 |
| - } |
133 |
| - |
134 |
| - for(auto pin : atom_ctx.nlist.block_pins(current_atom)) { |
135 |
| - AtomNetId net_id = atom_ctx.nlist.pin_net(pin); |
136 |
| - size_t net_fanout = atom_ctx.nlist.net_sinks(net_id).size(); |
137 |
| - |
138 |
| - if (net_fanout >= high_fanout_threshold) { |
139 |
| - continue; |
140 |
| - } |
141 |
| - |
142 |
| - AtomBlockId driver_atom_id = atom_ctx.nlist.net_driver_block(net_id); |
143 |
| - if (!atom_visited[driver_atom_id]) { |
144 |
| - q.push(driver_atom_id); |
145 |
| - atom_visited[driver_atom_id] = true; |
146 |
| - } |
147 |
| - |
148 |
| - for (auto sink_pin : atom_ctx.nlist.net_sinks(net_id)) { |
149 |
| - AtomBlockId sink_atom_id = atom_ctx.nlist.pin_block(sink_pin); |
150 |
| - if (!atom_visited[sink_atom_id]) { |
151 |
| - q.push(sink_atom_id); |
152 |
| - atom_visited[sink_atom_id] = true; |
153 |
| - } |
154 |
| - } |
155 |
| - |
156 |
| - } |
157 |
| - } |
158 |
| - |
159 |
| - } |
160 |
| -} |
161 |
| - |
162 |
| - |
163 | 43 | bool try_pack(t_packer_opts* packer_opts,
|
164 | 44 | const t_analysis_opts* analysis_opts,
|
165 | 45 | const t_arch* arch,
|
@@ -252,9 +132,6 @@ bool try_pack(t_packer_opts* packer_opts,
|
252 | 132 | bool floorplan_regions_overfull = false;
|
253 | 133 |
|
254 | 134 | auto constraints_backup = g_vpr_ctx.floorplanning().constraints;
|
255 |
| - // find all NoC router atoms |
256 |
| - auto noc_atoms = find_noc_router_atoms(); |
257 |
| - update_noc_reachability_partitions(noc_atoms); |
258 | 135 |
|
259 | 136 | while (true) {
|
260 | 137 | free_clustering_data(*packer_opts, clustering_data);
|
@@ -397,21 +274,6 @@ bool try_pack(t_packer_opts* packer_opts,
|
397 | 274 | //check clustering and output it
|
398 | 275 | check_and_output_clustering(*packer_opts, is_clock, arch, helper_ctx.total_clb_num, clustering_data.intra_lb_routing);
|
399 | 276 |
|
400 |
| - |
401 |
| - g_vpr_ctx.mutable_floorplanning().constraints = constraints_backup; |
402 |
| - const int max_y = (int)g_vpr_ctx.device().grid.height(); |
403 |
| - const int max_x = (int)g_vpr_ctx.device().grid.width(); |
404 |
| - for (auto& cluster_partition_region : g_vpr_ctx.mutable_floorplanning().cluster_constraints) { |
405 |
| - const auto& regions = cluster_partition_region.get_regions(); |
406 |
| - if (regions.size() == 1) { |
407 |
| - const auto rect = regions[0].get_region_rect(); |
408 |
| - |
409 |
| - if (rect.xmin <= 0 && rect.ymin <= 0 && rect.xmax >= max_x && rect.ymax >= max_y) { |
410 |
| - cluster_partition_region = PartitionRegion(); |
411 |
| - } |
412 |
| - } |
413 |
| - } |
414 |
| - |
415 | 277 | // Free Data Structures
|
416 | 278 | free_clustering_data(*packer_opts, clustering_data);
|
417 | 279 |
|
|
0 commit comments