Skip to content

Commit 1871d53

Browse files
authored
Merge pull request #2378 from verilog-to-routing/tileable_rr_graph_write
Added Optional Attribute to RRGraph
2 parents 265bfc0 + 3e16a0f commit 1871d53

12 files changed

+300
-147
lines changed

libs/librrgraph/src/base/rr_graph_builder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ void RRGraphBuilder::add_node_to_all_locs(RRNodeId node) {
2929
t_rr_type node_type = node_storage_.node_type(node);
3030
short node_ptc_num = node_storage_.node_ptc_num(node);
3131
short node_layer = node_storage_.node_layer(node);
32+
short node_twist = node_storage_.node_ptc_twist(node);
33+
int node_offset = 0;
3234
for (int ix = node_storage_.node_xlow(node); ix <= node_storage_.node_xhigh(node); ix++) {
3335
for (int iy = node_storage_.node_ylow(node); iy <= node_storage_.node_yhigh(node); iy++) {
36+
node_ptc_num += node_twist * node_offset;
37+
node_offset++;
3438
switch (node_type) {
3539
case SOURCE:
3640
case SINK:

libs/librrgraph/src/base/rr_graph_builder.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ class RRGraphBuilder {
193193
node_storage_.set_node_layer(id, layer);
194194
}
195195

196+
/** @brief set the ptc twist increment number for TILEABLE rr graphs (for more information see rr_graph_storage.h twist increment comment) */
197+
inline void set_node_ptc_twist_incr(RRNodeId id, int twist){
198+
node_storage_.set_node_ptc_twist_incr(id, twist);
199+
}
200+
201+
196202
/** @brief set_node_pin_num() is designed for logic blocks, which are IPIN and OPIN nodes */
197203
inline void set_node_pin_num(RRNodeId id, int new_pin_num) {
198204
node_storage_.set_node_pin_num(id, new_pin_num);
@@ -295,6 +301,12 @@ class RRGraphBuilder {
295301
inline void resize_nodes(size_t size) {
296302
node_storage_.resize(size);
297303
}
304+
305+
/** @brief This function resize node ptc twist increment; Since it is only used for tileable rr-graph, we don't put it in general resize function*/
306+
inline void resize_ptc_twist_incr(size_t size){
307+
node_storage_.resize(size);
308+
}
309+
298310
/** @brief This function resize rr_switch to accomidate size RR Switch. */
299311
inline void resize_switches(size_t size) {
300312
rr_switch_inf_.resize(size);

libs/librrgraph/src/base/rr_graph_storage.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,11 @@ void t_rr_graph_storage::set_node_layer(RRNodeId id, short layer) {
622622
node_layer_[id] = layer;
623623
}
624624

625+
void t_rr_graph_storage::set_node_ptc_twist_incr(RRNodeId id, short twist_incr){
626+
VTR_ASSERT(!node_ptc_twist_incr_.empty());
627+
node_ptc_twist_incr_[id] = twist_incr;
628+
}
629+
625630
void t_rr_graph_storage::set_node_ptc_num(RRNodeId id, int new_ptc_num) {
626631
node_ptc_[id].ptc_.pin_num = new_ptc_num; //TODO: eventually remove
627632
}
@@ -785,6 +790,7 @@ t_rr_graph_view t_rr_graph_storage::view() const {
785790
vtr::make_const_array_view_id(node_first_edge_),
786791
vtr::make_const_array_view_id(node_fan_in_),
787792
vtr::make_const_array_view_id(node_layer_),
793+
vtr::make_const_array_view_id(node_ptc_twist_incr_),
788794
vtr::make_const_array_view_id(edge_src_node_),
789795
vtr::make_const_array_view_id(edge_dest_node_),
790796
vtr::make_const_array_view_id(edge_switch_));

0 commit comments

Comments
 (0)