Skip to content

Commit c713e0b

Browse files
committed
[ParallelRouter] Fixed Issues and Upgraded CPS Submodule
Fixed issues in PR#6 and upgraded the CPS submodule.
1 parent b6ffc69 commit c713e0b

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

libs/EXTERNAL/CPS

Submodule CPS updated from d8b81cb to e6bab59

vpr/src/route/multi_queue_priority_queue.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void MultiQueuePriorityQueue::init_heap(const DeviceGrid& grid) {
2020
}
2121

2222
bool MultiQueuePriorityQueue::try_pop(pq_prio_t &prio, RRNodeId &node) {
23-
auto tmp = pq_->tryPopWithMinPrio();
23+
auto tmp = pq_->tryPop();
2424
if (!tmp) {
2525
return false;
2626
} else {
@@ -37,7 +37,13 @@ static inline pq_index_t cast_RRNodeId_to_pq_index_t(RRNodeId node) {
3737
return static_cast<pq_index_t>(std::size_t(node));
3838
}
3939

40-
void MultiQueuePriorityQueue::add_to_heap(const pq_prio_t& prio, const RRNodeId& node) {
40+
void MultiQueuePriorityQueue::add_to_heap(const pq_prio_t& prio, const RRNodeId& node, const RRNodeId& target_node) {
41+
if (node == target_node) {
42+
#ifdef MQ_IO_ENABLE_CLEAR_FOR_POP
43+
pq_.setMinPrio(new_total_cost);
44+
#endif
45+
return;
46+
}
4147
pq_->push({prio, cast_RRNodeId_to_pq_index_t(node)});
4248
}
4349

vpr/src/route/multi_queue_priority_queue.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef _MULTI_QUEUE_PRIORITY_QUEUE_H
22
#define _MULTI_QUEUE_PRIORITY_QUEUE_H
33

4+
// #define MQ_IO_ENABLE_CLEAR_FOR_POP
5+
46
#include "heap_type.h"
57

68
#include "MultiQueueIO.h"
@@ -26,7 +28,7 @@ class MultiQueuePriorityQueue {
2628

2729
void init_heap(const DeviceGrid& grid);
2830
bool try_pop(pq_prio_t &prio, RRNodeId &node);
29-
void add_to_heap(const pq_prio_t& prio, const RRNodeId& node);
31+
void add_to_heap(const pq_prio_t& prio, const RRNodeId& node, const RRNodeId& target_node);
3032
void push_back(const pq_prio_t& prio, const RRNodeId& node);
3133
bool is_empty_heap() const;
3234
bool is_valid() const;
@@ -36,7 +38,6 @@ class MultiQueuePriorityQueue {
3638
inline uint64_t getNumPops() const { return pq_->getNumPops(); }
3739
inline uint64_t getHeapOccupancy() const { return pq_->getQueueOccupancy(); }
3840
inline void reset() { pq_->reset(); }
39-
inline void setMinPrio(const pq_prio_t min_prio) { pq_->setMinPrioForPop(min_prio); }
4041

4142
private:
4243
MQ_IO* pq_;

vpr/src/route/parallel_connection_router.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,6 @@ void ParallelConnectionRouter::timing_driven_route_connection_from_heap_thread_f
405405

406406
// Should we explore the neighbors of this node?
407407

408-
if (inode == sink_node) {
409-
heap_.setMinPrio(new_total_cost);
410-
continue;
411-
}
412-
413408
if (should_not_explore_neighbors(inode, new_total_cost, rr_node_route_inf_[inode].backward_path_cost, sink_node, rr_node_route_inf_, cost_params)) {
414409
continue;
415410
}
@@ -634,7 +629,7 @@ void ParallelConnectionRouter::timing_driven_add_to_heap(const t_conn_cost_param
634629

635630
releaseLock(to_node);
636631

637-
heap_.add_to_heap(next.total_cost, to_node);
632+
heap_.add_to_heap(new_total_cost, to_node, target_node);
638633

639634
// update_router_stats(router_stats_,
640635
// true,

vpr/src/route/parallel_connection_router.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
#include "router_stats.h"
1212
#include "spatial_route_tree_lookup.h"
1313

14+
// #define PROFILE_HEAP_OCCUPANCY
15+
#ifdef PROFILE_HEAP_OCCUPANCY
1416
#include <fstream>
17+
#endif
1518

1619
// For details on setting core affinity, please see `parse_core_affinity_list`.
1720
#define ENABLE_CORE_AFFINITY

0 commit comments

Comments
 (0)