Skip to content

Commit dda0e33

Browse files
add --read_rr_edge_delay_offset_file command line option
1 parent df1318b commit dda0e33

File tree

7 files changed

+19
-4
lines changed

7 files changed

+19
-4
lines changed

libs/librrgraph/src/io/rr_graph_reader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void load_rr_file(RRGraphBuilder* rr_graph_builder,
118118
}
119119

120120
void load_rr_edge_attribute_offset_file(RRGraphBuilder& rr_graph_builder,
121-
RRGraphView& rr_graph,
121+
const RRGraphView& rr_graph,
122122
std::string_view rr_edge_attribute_offset_filename) {
123123
std::ifstream file(rr_edge_attribute_offset_filename.data());
124124

libs/librrgraph/src/io/rr_graph_reader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void load_rr_file(RRGraphBuilder* rr_graph_builder,
3636
bool is_flat);
3737

3838
void load_rr_edge_attribute_offset_file(RRGraphBuilder& rr_graph_builder,
39-
RRGraphView& rr_graph,
39+
const RRGraphView& rr_graph,
4040
std::string_view rr_edge_attribute_offset_filename);
4141

4242
#endif /* RR_GRAPH_READER_H */

vpr/src/base/SetupVPR.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ void SetupVPR(const t_options* options,
232232
SetupPackerOpts(*options, packerOpts);
233233
routingArch->write_rr_graph_filename = options->write_rr_graph_file;
234234
routingArch->read_rr_graph_filename = options->read_rr_graph_file;
235+
routingArch->read_rr_edge_delay_offset_filename = options->read_rr_edge_delay_offset_file;
235236

236237
for (auto has_global_routing : arch->layer_global_routing) {
237238
device_ctx.inter_cluster_prog_routing_resources.emplace_back(has_global_routing);

vpr/src/base/read_options.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,6 +1623,13 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
16231623
.metavar("RR_GRAPH_FILE")
16241624
.show_in(argparse::ShowIn::HELP_ONLY);
16251625

1626+
file_grp.add_argument(args.read_rr_edge_delay_offset_file, "--read_rr_edge_delay_offset_file")
1627+
.help(
1628+
"to be written")
1629+
.metavar("RR_GRAPH_EDGE_DELAY_OFFSET_FILE")
1630+
.show_in(argparse::ShowIn::HELP_ONLY);
1631+
1632+
16261633
file_grp.add_argument(args.write_rr_graph_file, "--write_rr_graph")
16271634
.help("Writes the routing resource graph to the specified file")
16281635
.metavar("RR_GRAPH_FILE")
@@ -3148,7 +3155,7 @@ void set_conditional_defaults(t_options& args) {
31483155

31493156
bool verify_args(const t_options& args) {
31503157
/*
3151-
* Check for conflicting paramaters or dependencies where one parameter set requires another parameter to be included
3158+
* Check for conflicting parameters or dependencies where one parameter set requires another parameter to be included
31523159
*/
31533160
if (args.read_rr_graph_file.provenance() == Provenance::SPECIFIED
31543161
&& args.RouteChanWidth.provenance() != Provenance::SPECIFIED) {

vpr/src/base/read_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct t_options {
2828
argparse::ArgValue<std::string> constraints_file;
2929
argparse::ArgValue<std::string> write_rr_graph_file;
3030
argparse::ArgValue<std::string> read_rr_graph_file;
31+
argparse::ArgValue<std::string> read_rr_edge_delay_offset_file;
3132
argparse::ArgValue<std::string> write_initial_place_file;
3233
argparse::ArgValue<std::string> read_initial_place_file;
3334
argparse::ArgValue<std::string> read_vpr_constraints_file;

vpr/src/base/vpr_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ struct t_det_routing_arch {
14161416
float R_minW_pmos;
14171417

14181418
std::string read_rr_graph_filename;
1419-
std::string read_rr_edge_attribute_offset_filename;
1419+
std::string read_rr_edge_delay_offset_filename;
14201420
std::string write_rr_graph_filename;
14211421
};
14221422

vpr/src/route/rr_graph.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,12 @@ void create_rr_graph(const t_graph_type graph_type,
830830
}
831831
}
832832

833+
if (!det_routing_arch->read_rr_edge_delay_offset_filename.empty()) {
834+
load_rr_edge_attribute_offset_file(mutable_device_ctx.rr_graph_builder,
835+
device_ctx.rr_graph,
836+
det_routing_arch->read_rr_edge_delay_offset_filename);
837+
}
838+
833839
if (is_flat) {
834840
int delayless_switch = get_delayless_switch_id(det_routing_arch, load_rr_graph);
835841
VTR_ASSERT(delayless_switch != OPEN);

0 commit comments

Comments
 (0)