Skip to content

Commit a8cbc83

Browse files
author
Nathan Shreve
committed
Changed comments on t_heap and made pure virtual functions
1 parent 5c40446 commit a8cbc83

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

vpr/src/route/heap_type.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ struct t_heap {
2727
t_heap_path* path_data;
2828

2929
/**
30-
* @brief Get <i>u.next</i>.
30+
* @brief Get the next t_heap item in the linked list.
3131
*/
3232
t_heap* next_heap_item() const {
3333
return u.next;
3434
}
3535

3636
/**
37-
* @brief Set <i>u.next</i>.
37+
* @brief Set the next t_heap item in the linked list.
3838
*/
3939
void set_next_heap_item(t_heap* next) {
4040
u.next = next;
4141
}
4242

4343
/**
44-
* @brief Get <i>u.prev_edge</i>.
44+
* @brief Get the edge from the previous node used to reach the current node.
4545
*
4646
* @note
4747
* Be careful: will return 0 (a valid id!) if uninitialized.
@@ -52,7 +52,7 @@ struct t_heap {
5252
}
5353

5454
/**
55-
* @brief Set <i>u.prev_edge</i>.
55+
* @brief Set the edge from the previous node used to reach the current node..
5656
*/
5757
inline void set_prev_edge(RREdgeId edge) {
5858
static_assert(sizeof(uint32_t) == sizeof(RREdgeId));
@@ -61,7 +61,7 @@ struct t_heap {
6161

6262
private:
6363
union {
64-
///@brief Pointer to the next s_heap structure in the free linked list.
64+
///@brief Pointer to the next t_heap structure in the free linked list.
6565
t_heap* next = nullptr;
6666

6767
/**
@@ -121,12 +121,13 @@ class HeapStorage {
121121
* As a general rule, any t_heap objects returned from this interface,
122122
* **must** be HeapInterface::free'd before destroying the HeapInterface
123123
* instance. This ensure that no leaks are present in the users of the heap.
124-
* Violating this assumption may result in a assertion violation.
124+
* Violating this assumption may result in an assertion violation.
125125
*/
126126
class HeapInterface {
127127
public:
128128
virtual ~HeapInterface() {}
129129

130+
protected:
130131
/**
131132
* @brief Allocate a heap item.
132133
*
@@ -160,7 +161,7 @@ class HeapInterface {
160161
* - empty_heap<BR>
161162
* - build_heap<BR>
162163
*
163-
* @param grid
164+
* @param grid The FGPA device grid
164165
*/
165166
virtual void init_heap(const DeviceGrid& grid) = 0;
166167

vpr/src/route/k_ary_heap.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ class KAryHeap : public HeapInterface {
2424
void set_prune_limit(size_t max_index, size_t prune_limit) final;
2525
void free_all_memory() final;
2626

27-
virtual bool is_valid() const = 0;
28-
virtual t_heap* get_heap_head() = 0;
29-
3027
protected:
3128
/**
3229
* @brief The struct which the heap_ vector contains.
@@ -54,6 +51,9 @@ class KAryHeap : public HeapInterface {
5451
float cost;
5552
};
5653

54+
virtual bool is_valid() const = 0;
55+
virtual t_heap* get_heap_head() = 0;
56+
5757
/**
5858
* @return The number of elements in the heap.
5959
*/

0 commit comments

Comments
 (0)