Skip to content

Commit 3777e5f

Browse files
find noc router atoms
1 parent cbe5665 commit 3777e5f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

vpr/src/pack/pack.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,26 @@ static bool try_size_device_grid(const t_arch& arch,
4040
*/
4141
static int count_models(const t_model* user_models);
4242

43+
static std::vector<AtomBlockId> find_noc_router_atoms() {
44+
const auto& atom_ctx = g_vpr_ctx.atom();
45+
46+
// NoC router atoms are expected to have a specific blif model
47+
const std::string noc_router_blif_model_name = "noc_router_adapter_block";
48+
49+
// stores found NoC router atoms
50+
std::vector<AtomBlockId> noc_router_atoms;
51+
52+
// iterate over all atoms and find those whose blif model matches
53+
for (auto atom_id : atom_ctx.nlist.blocks()) {
54+
const t_model* model = atom_ctx.nlist.block_model(atom_id);
55+
if (noc_router_blif_model_name == model->name) {
56+
noc_router_atoms.push_back(atom_id);
57+
}
58+
}
59+
60+
return noc_router_atoms;
61+
}
62+
4363
bool try_pack(t_packer_opts* packer_opts,
4464
const t_analysis_opts* analysis_opts,
4565
const t_arch* arch,
@@ -131,6 +151,11 @@ bool try_pack(t_packer_opts* packer_opts,
131151
int pack_iteration = 1;
132152
bool floorplan_regions_overfull = false;
133153

154+
auto noc_atoms = find_noc_router_atoms();
155+
for (auto noc_atom : noc_atoms) {
156+
std::cout << "NoC Atom: " << atom_ctx.nlist.block_name(noc_atom) << std::endl;
157+
}
158+
134159
while (true) {
135160
free_clustering_data(*packer_opts, clustering_data);
136161

0 commit comments

Comments
 (0)