Skip to content

Commit 9135061

Browse files
committed
[vpr][route][crr] add get_pattern_file_name
1 parent e933685 commit 9135061

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

vpr/src/route/rr_graph_generation/tileable_rr_graph/crr_generator/crr_switch_block_manager.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ void SwitchBlockManager::initialize(const std::string& sb_maps_file,
9595
}
9696
}
9797

98+
std::string SwitchBlockManager::get_pattern_file_name(const std::string& pattern) const {
99+
auto it = switch_block_to_file_.find(pattern);
100+
101+
if (it == switch_block_to_file_.end()) {
102+
return "";
103+
} else {
104+
std::filesystem::path path(it->second);
105+
return path.filename().string();
106+
}
107+
}
108+
98109
const DataFrame* SwitchBlockManager::get_switch_block_dataframe(const std::string& pattern) const {
99110
auto it = dataframes_.find(pattern);
100111
return (it != dataframes_.end()) ? it->second : nullptr;

vpr/src/route/rr_graph_generation/tileable_rr_graph/crr_generator/crr_switch_block_manager.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ class SwitchBlockManager {
2929
const std::string& sb_annotated_dir,
3030
const bool is_annotated_excel);
3131

32+
/**
33+
* @brief Get the switch template file name for a given pattern
34+
*/
35+
std::string get_pattern_file_name(const std::string& pattern) const;
36+
3237
/**
3338
* @brief Get DataFrame for a specific switch block pattern
3439
* @param pattern Switch block pattern name (e.g., "SB_1__2_")

0 commit comments

Comments
 (0)