Skip to content

Commit c87723f

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

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
@@ -419,11 +419,6 @@ void ParallelConnectionRouter::timing_driven_route_connection_from_heap_thread_f
419419

420420
// Should we explore the neighbors of this node?
421421

422-
if (inode == sink_node) {
423-
heap_.setMinPrio(new_total_cost);
424-
continue;
425-
}
426-
427422
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)) {
428423
continue;
429424
}
@@ -648,7 +643,7 @@ void ParallelConnectionRouter::timing_driven_add_to_heap(const t_conn_cost_param
648643

649644
releaseLock(to_node);
650645

651-
heap_.add_to_heap(next.total_cost, to_node);
646+
heap_.add_to_heap(new_total_cost, to_node, target_node);
652647

653648
// update_router_stats(router_stats_,
654649
// true,

vpr/src/route/parallel_connection_router.h

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

13+
// #define PROFILE_HEAP_OCCUPANCY
14+
#ifdef PROFILE_HEAP_OCCUPANCY
1315
#include <fstream>
16+
#endif
1417

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

0 commit comments

Comments
 (0)