modification on device_rr_gsb

This commit is contained in:
Lin 2024-09-09 11:36:48 +08:00
parent af7201d4bb
commit 41d0eb7736
2 changed files with 13 additions and 15 deletions

View File

@ -66,7 +66,6 @@ size_t DeviceRRGSB::get_num_cb_unique_module(const t_rr_type& cb_type) const {
} }
} }
bool DeviceRRGSB::is_compressed() const { return is_compressed_; } bool DeviceRRGSB::is_compressed() const { return is_compressed_; }
/* Identify if a GSB actually exists at a location */ /* Identify if a GSB actually exists at a location */
bool DeviceRRGSB::is_gsb_exist(const RRGraphView& rr_graph, bool DeviceRRGSB::is_gsb_exist(const RRGraphView& rr_graph,
@ -173,16 +172,17 @@ void DeviceRRGSB::reserve(const vtr::Point<size_t>& coordinate) {
cby_unique_module_id_[x].resize(coordinate.y()); cby_unique_module_id_[x].resize(coordinate.y());
} }
} }
void DeviceRRGSB::reserve_unique_modules(const vtr::Point<size_t>& coordinate) { void DeviceRRGSB::reserve_unique_modules() {
sb_unique_module_id_.resize(coordinate.x()); /* As rr_gsb_ has been built, it has valid size. Will reserve space for unique
cbx_unique_module_id_.resize(coordinate.x()); * blocks according to rr_gsb_'s size*/
cby_unique_module_id_.resize(coordinate.x()); sb_unique_module_id_.resize(rr_gsb_.x());
cbx_unique_module_id_.resize(rr_gsb_.x());
cby_unique_module_id_.resize(rr_gsb_.x());
for (size_t x = 0; x < coordinate.x(); ++x) { for (std::size_t i = 0; i < rr_gsb_.size(); ++i) {
sb_unique_module_id_[x].resize(coordinate.y()); sb_unique_module_id_[i].resize(rr_gsb_[i].size());
cbx_unique_module_id_[i].resize(rr_gsb_[i].size());
cbx_unique_module_id_[x].resize(coordinate.y()); cby_unique_module_id_[i].resize(rr_gsb_[i].size());
cby_unique_module_id_[x].resize(coordinate.y());
} }
} }
@ -353,6 +353,7 @@ void DeviceRRGSB::build_gsb_unique_module() {
} }
} }
} }
is_compressed_ = true;
} }
void DeviceRRGSB::build_unique_module(const RRGraphView& rr_graph) { void DeviceRRGSB::build_unique_module(const RRGraphView& rr_graph) {
@ -361,8 +362,7 @@ void DeviceRRGSB::build_unique_module(const RRGraphView& rr_graph) {
build_cb_unique_module(rr_graph, CHANX); build_cb_unique_module(rr_graph, CHANX);
build_cb_unique_module(rr_graph, CHANY); build_cb_unique_module(rr_graph, CHANY);
build_gsb_unique_module(); build_gsb_unique_module(); /*is_compressed_ flip inside build_gsb_unique_module*/
is_compressed_ = true;
} }
void DeviceRRGSB::add_gsb_unique_module(const vtr::Point<size_t>& coordinate) { void DeviceRRGSB::add_gsb_unique_module(const vtr::Point<size_t>& coordinate) {

View File

@ -117,8 +117,7 @@ int read_xml_unique_blocks(DeviceRRGSB& device_rr_gsb, const char* file_name,
pugi::xml_node xml_root = get_single_child(doc, "unique_blocks", loc_data); pugi::xml_node xml_root = get_single_child(doc, "unique_blocks", loc_data);
/* clear unique modules & reserve memory to relavant vectors */ /* clear unique modules & reserve memory to relavant vectors */
device_rr_gsb.clear_unique_modules(); device_rr_gsb.clear_unique_modules();
vtr::Point<size_t> grid_coord(g_vpr_ctx.device().grid.width() - 1, // vtr::Point<size_t> grid_coord(rr_gsb_.size());
g_vpr_ctx.device().grid.height() - 1);
device_rr_gsb.reserve_unique_modules(grid_coord); device_rr_gsb.reserve_unique_modules(grid_coord);
/* load unique blocks xml file and set up device_rr_gdb */ /* load unique blocks xml file and set up device_rr_gdb */
@ -155,7 +154,6 @@ int read_xml_unique_blocks(DeviceRRGSB& device_rr_gsb, const char* file_name,
/* As preloading gsb hasn't been developed, we should build gsb using the /* As preloading gsb hasn't been developed, we should build gsb using the
* preloaded cbs and sbs*/ * preloaded cbs and sbs*/
device_rr_gsb.build_gsb_unique_module(); device_rr_gsb.build_gsb_unique_module();
device_rr_gsb.set_is_dirty_flag(true);
if (verbose_output) { if (verbose_output) {
report_unique_module_status_read(device_rr_gsb, true); report_unique_module_status_read(device_rr_gsb, true);
} }