Skip to content

Commit d5076db

Browse files
author
Umar Iqbal
committed
New changes has been made in rr_graph_uxsdcxx_serializer.h
1 parent fc5e3d6 commit d5076db

6 files changed

+23
-13
lines changed

vpr/src/device/rr_graph_view.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class RRGraphView {
263263
* @note The routing segments here may not be exactly same as those defined in architecture file. They have been adapted to fit the context of routing resource graphs.
264264
*/
265265

266-
inline const t_segment_inf& rr_segments(RRSegmentId seg_id) const {
266+
inline const t_segment_inf& rr_segments(RRSegmentId seg_id) const {
267267
return rr_segments_[seg_id];
268268
}
269269

vpr/src/route/rr_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ static void build_rr_graph(const t_graph_type graph_type,
449449
//device_ctx.rr_segments = segment_inf;
450450
size_t num_segments = segment_inf.size();
451451
device_ctx.rr_segments.reserve(num_segments);
452-
for (int iseg = 0; iseg <num_segments; ++iseg) {
453-
device_ctx.rr_segments.push_back(segment_inf[iseg]);
452+
for (long unsigned int iseg = 0; iseg <num_segments; ++iseg) {
453+
device_ctx.rr_segments.push_back(segment_inf[(iseg)]);
454454
}
455455

456456
int num_seg_details = 0;

vpr/src/route/rr_graph_indexed_data.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static void print_rr_index_info(const char* fname, const std::vector<t_segment_i
5353
* etc. more expensive than others. I give each segment type in an *
5454
* x-channel its own cost_index, and each segment type in a y-channel its *
5555
* own cost_index. */
56-
void alloc_and_load_rr_indexed_data(const vtr::vector<RRSegmentId, t_segment_inf>& segment_inf,
56+
void alloc_and_load_rr_indexed_data(const std::vector<t_segment_inf>& segment_inf,
5757
int wire_to_ipin_switch,
5858
enum e_base_cost_type base_cost_type) {
5959
int iseg, length, i, index;

vpr/src/route/rr_graph_indexed_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define RR_GRAPH_INDEXED_DATA_H
33
#include "physical_types.h"
44

5-
void alloc_and_load_rr_indexed_data(const vtr::vector<RRSegmentId, t_segment_inf>& segment_inf,
5+
void alloc_and_load_rr_indexed_data(const std::vector<t_segment_inf>& segment_inf,
66
int wire_to_ipin_switch,
77
enum e_base_cost_type base_cost_type);
88

vpr/src/route/rr_graph_reader.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ void load_rr_file(const t_graph_type graph_type,
4747

4848
auto& device_ctx = g_vpr_ctx.mutable_device();
4949

50-
//device_ctx.rr_segments = segment_inf;
50+
5151
size_t num_segments = segment_inf.size();
5252
device_ctx.rr_segments.reserve(num_segments);
53-
for (int iseg = 0; iseg < num_segments; ++iseg) {
53+
for (long unsigned int iseg = 0; iseg < num_segments; ++iseg) {
5454
device_ctx.rr_segments.push_back(segment_inf[iseg]);
5555
}
56+
//device_ctx.rr_segments = segment_inf;
5657
RrGraphSerializer reader(
5758
graph_type,
5859
base_cost_type,

vpr/src/route/rr_graph_uxsdcxx_serializer.h

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "check_rr_graph.h"
1717
#include "rr_graph2.h"
1818
#include "rr_graph_indexed_data.h"
19-
19+
#include "globals.h"
2020
class MetadataBind {
2121
public:
2222
MetadataBind(vtr::string_internment* strings, vtr::interned_string empty)
@@ -1308,6 +1308,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
13081308
return std::make_pair(tile, &tile->class_inf[n]);
13091309
}
13101310

1311+
13111312
/** Generated for complex type "block_type":
13121313
* <xs:complexType name="block_type">
13131314
* <xs:sequence>
@@ -1543,14 +1544,21 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
15431544
inline void* get_rr_graph_rr_nodes(void*& /*ctx*/) final {
15441545
return nullptr;
15451546
}
1546-
15471547
void finish_load() final {
1548+
auto& device_ctx = g_vpr_ctx.mutable_device();
15481549
process_rr_node_indices();
15491550

1550-
rr_nodes_->init_fan_in();
1551+
rr_nodes_->init_fan_in();
1552+
1553+
auto& segment_inf = segment_inf_;
1554+
size_t num_segments = segment_inf_.size();
1555+
device_ctx.rr_segments.reserve(num_segments);
1556+
for (long unsigned int iseg = 0; iseg <num_segments; ++iseg) {
1557+
device_ctx.rr_segments.push_back(segment_inf_[RRSegmentId(iseg)]);
1558+
}
15511559

1552-
alloc_and_load_rr_indexed_data(
1553-
segment_inf_,
1560+
alloc_and_load_rr_indexed_data(
1561+
segment_inf,
15541562
*wire_to_rr_ipin_switch_,
15551563
base_cost_type_);
15561564

@@ -1846,6 +1854,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
18461854

18471855
// Temporary storage
18481856
vtr::vector<RRIndexedDataId, short> seg_index_;
1857+
vtr::vector<RRSegmentId, short> seg_id_;
18491858
std::string temp_string_;
18501859

18511860
// Constant mapping which is frequently used
@@ -1871,7 +1880,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
18711880

18721881
const size_t num_arch_switches_;
18731882
const t_arch_switch_inf* arch_switch_inf_;
1874-
const vtr::vector<RRSegmentId,t_segment_inf>& segment_inf_;
1883+
const vtr::vector<RRSegmentId, t_segment_inf>& segment_inf_;
18751884
const std::vector<t_physical_tile_type>& physical_tile_types_;
18761885
const DeviceGrid& grid_;
18771886
MetadataStorage<int>* rr_node_metadata_;

0 commit comments

Comments
 (0)