Skip to content

Commit 14defb5

Browse files
committed
added a function to delete the noc routing object within the Noc_context. This is needed since this object is dynamically created.
1 parent 57ba9a3 commit 14defb5

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

vpr/src/base/vpr_api.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,13 @@ static void free_routing() {
11541154
routing_ctx.net_status.clear();
11551155
routing_ctx.route_bb.clear();
11561156
}
1157+
/**
1158+
* @brief handles the deletion of NoC related datastructures.
1159+
*/
1160+
static void free_noc() {
1161+
auto& noc_ctx = g_vpr_ctx.mutable_noc();
1162+
delete noc_ctx.noc_flows_router;
1163+
}
11571164

11581165
void vpr_free_vpr_data_structures(t_arch& Arch,
11591166
t_vpr_setup& vpr_setup) {
@@ -1165,6 +1172,7 @@ void vpr_free_vpr_data_structures(t_arch& Arch,
11651172
free_placement();
11661173
free_routing();
11671174
free_atoms();
1175+
free_noc();
11681176
}
11691177

11701178
void vpr_free_all(t_arch& Arch,

vpr/src/noc/noc_routing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#include "noc_storage.h"
2929

3030
class NocRouting {
31-
// protected pure virtual functions that should be implemented in derived classes.
32-
protected:
31+
// pure virtual functions that should be implemented in derived classes.
32+
public:
3333
virtual ~NocRouting() {}
3434

3535
/**

0 commit comments

Comments
 (0)