|
1 | | -// |
2 | | -// Created by shrevena on 08/06/24. |
3 | | -// |
4 | | - |
5 | 1 | #include <sstream> |
6 | 2 |
|
7 | 3 | #include "globals.h" |
@@ -31,7 +27,7 @@ void LookaheadProfiler::record(int iteration, |
31 | 27 | VTR_LOG_ERROR("Could not open lookahead_verifier_info.csv"); |
32 | 28 | throw vtr::VtrError("Could not open lookahead_verifier_info.csv", |
33 | 29 | "lookahead_profiler.cpp", |
34 | | - 32); |
| 30 | + 28); |
35 | 31 | } |
36 | 32 |
|
37 | 33 | lookahead_verifier_csv_ |
@@ -62,57 +58,47 @@ void LookaheadProfiler::record(int iteration, |
62 | 58 | } |
63 | 59 |
|
64 | 60 | if (!lookahead_verifier_csv_.is_open()) { |
65 | | - if (toggle_warn_) { |
66 | | - VTR_LOG_WARN("lookahead_verifier_info.csv is not open"); |
67 | | - toggle_warn_ = false; |
68 | | - } |
69 | | - |
70 | | - return; |
71 | | - } else { |
72 | | - toggle_warn_ = true; |
| 61 | + VTR_LOG_ERROR("lookahead_verifier_info.csv is not open."); |
| 62 | + throw vtr::VtrError("lookahead_verifier_info.csv is not open.", |
| 63 | + "lookahead_profiler.cpp", |
| 64 | + 62); |
73 | 65 | } |
74 | 66 |
|
75 | 67 | // The default value in RouteTree::update_from_heap() is -1; only calls which descend from route_net() |
76 | 68 | // pass in an iteration value, which is the only context in which we want to profile. |
77 | 69 | if (iteration < 1) |
78 | 70 | return; |
79 | 71 |
|
80 | | - RRNodeId source_inode = branch_inodes.back(); // Not necessarily an actual SOURCE node. |
| 72 | + RRNodeId source_inode = branch_inodes.back(); // Not necessarily a SOURCE node. |
81 | 73 | RRNodeId sink_inode = branch_inodes.front(); |
82 | 74 |
|
83 | 75 | VTR_ASSERT(rr_graph.node_type(sink_inode) == SINK); |
| 76 | + VTR_ASSERT(net_id != ParentNetId::INVALID()); |
| 77 | + VTR_ASSERT(target_net_pin_index != OPEN); |
84 | 78 |
|
85 | 79 | /* Get sink node attributes (atom block name, atom block model, cluster type, tile dimensions) */ |
86 | 80 |
|
87 | | - if (atom_block_names_.find(sink_inode) == atom_block_names_.end()) { |
88 | | - if (net_id != ParentNetId::INVALID() && target_net_pin_index != OPEN) { |
89 | | - atom_block_names_[sink_inode] = net_list.block_name(net_list.net_pin_block(net_id, target_net_pin_index)); |
90 | | - |
91 | | - AtomBlockId atom_block_id = g_vpr_ctx.atom().nlist.find_block(atom_block_names_[sink_inode]); |
92 | | - atom_block_models_[sink_inode] = g_vpr_ctx.atom().nlist.block_model(atom_block_id)->name; |
| 81 | + if (net_pin_blocks_.find(sink_inode) == net_pin_blocks_.end()) { |
| 82 | + net_pin_blocks_[sink_inode] = net_list.net_pin_block(net_id, target_net_pin_index); |
93 | 83 |
|
94 | | - ClusterBlockId cluster_block_id = atom_to_cluster(atom_block_id); |
| 84 | + AtomBlockId atom_block_id = g_vpr_ctx.atom().nlist.find_block(net_list.block_name(net_pin_blocks_[sink_inode])); |
| 85 | + sink_atom_block_[sink_inode] = g_vpr_ctx.atom().nlist.block_model(atom_block_id); |
95 | 86 |
|
96 | | - cluster_block_types_[sink_inode] = g_vpr_ctx.clustering().clb_nlist.block_type(cluster_block_id)->name; |
| 87 | + ClusterBlockId cluster_block_id = atom_to_cluster(atom_block_id); |
| 88 | + sink_cluster_block_[sink_inode] = g_vpr_ctx.clustering().clb_nlist.block_type(cluster_block_id); |
97 | 89 |
|
98 | | - auto tile_type = physical_tile_type(cluster_block_id); |
99 | | - tile_dimensions_[sink_inode] = std::pair(std::to_string(tile_type->width), std::to_string(tile_type->height)); |
100 | | - } else { |
101 | | - atom_block_names_[sink_inode] = "--"; |
102 | | - atom_block_models_[sink_inode] = "--"; |
103 | | - cluster_block_types_[sink_inode] = "--"; |
104 | | - tile_dimensions_[sink_inode] = {"--", "--"}; |
105 | | - } |
| 90 | + tile_types_[sink_inode] = physical_tile_type(cluster_block_id); |
106 | 91 | } |
107 | 92 |
|
108 | | - VTR_ASSERT_SAFE(atom_block_models_.find(sink_inode) != atom_block_models_.end()); |
109 | | - VTR_ASSERT_SAFE(cluster_block_types_.find(sink_inode) != cluster_block_types_.end()); |
110 | | - VTR_ASSERT_SAFE(tile_dimensions_.find(sink_inode) != tile_dimensions_.end()); |
| 93 | + VTR_ASSERT_SAFE(sink_atom_block_.find(sink_inode) != sink_atom_block_.end()); |
| 94 | + VTR_ASSERT_SAFE(sink_cluster_block_.find(sink_inode) != sink_cluster_block_.end()); |
| 95 | + VTR_ASSERT_SAFE(tile_types_.find(sink_inode) != tile_types_.end()); |
111 | 96 |
|
112 | | - const std::string& block_name = atom_block_names_[sink_inode]; |
113 | | - const std::string& atom_block_model = atom_block_models_[sink_inode]; |
114 | | - const std::string& cluster_block_type = cluster_block_types_[sink_inode]; |
115 | | - const auto& [tile_width, tile_height] = tile_dimensions_[sink_inode]; |
| 97 | + const std::string& block_name = net_list.block_name(net_pin_blocks_[sink_inode]); |
| 98 | + const std::string atom_block_model = sink_atom_block_[sink_inode]->name; |
| 99 | + const std::string cluster_block_type = sink_cluster_block_[sink_inode]->name; |
| 100 | + const std::string tile_width = std::to_string(tile_types_[sink_inode]->width); |
| 101 | + const std::string tile_height = std::to_string(tile_types_[sink_inode]->height); |
116 | 102 |
|
117 | 103 | /* Iterate through the given path and record information for each node */ |
118 | 104 | for (size_t nodes_from_sink = 2; nodes_from_sink < branch_inodes.size(); ++nodes_from_sink) { // Distance one node away is always 0. (IPIN->SINK) |
|
0 commit comments