Skip to content

Commit 601a652

Browse files
committed
updated the command line parser to include a new set of options for the NoC. Also added logic so that the noc setup is only run when the user turns on the noc option in the command line
1 parent 96441da commit 601a652

File tree

7 files changed

+24
-12
lines changed

7 files changed

+24
-12
lines changed

vpr/src/base/SetupVPR.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ static void SetupPlacerOpts(const t_options& Options,
3535
static void SetupAnnealSched(const t_options& Options,
3636
t_annealing_sched* AnnealSched);
3737
static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts);
38+
static void SetupNocOpts(const t_options& Options,
39+
t_noc_opts* NocOpts);
3840
static void SetupRoutingArch(const t_arch& Arch, t_det_routing_arch* RoutingArch);
3941
static void SetupTiming(const t_options& Options, const bool TimingEnabled, t_timing_inf* Timing);
4042
static void SetupSwitches(const t_arch& Arch,
@@ -64,6 +66,7 @@ void SetupVPR(const t_options* Options,
6466
t_annealing_sched* AnnealSched,
6567
t_router_opts* RouterOpts,
6668
t_analysis_opts* AnalysisOpts,
69+
t_noc_opts* NocOpts,
6770
t_det_routing_arch* RoutingArch,
6871
std::vector<t_lb_type_rr_node>** PackerRRGraphs,
6972
std::vector<t_segment_inf>& Segments,
@@ -107,6 +110,7 @@ void SetupVPR(const t_options* Options,
107110
SetupRouterOpts(*Options, RouterOpts);
108111
SetupAnalysisOpts(*Options, *AnalysisOpts);
109112
SetupPowerOpts(*Options, PowerOpts, Arch);
113+
SetupNocOpts(*Options, NocOpts);
110114

111115
if (readArchFile == true) {
112116
vtr::ScopedStartFinishTimer t("Loading Architecture Description");
@@ -644,6 +648,14 @@ static void SetupPowerOpts(const t_options& Options, t_power_opts* power_opts, t
644648
}
645649
}
646650

651+
static void SetupNocOpts(const t_options& Options, t_noc_opts* NocOpts) {
652+
653+
// assign the noc specific options from the command line
654+
NocOpts->noc = Options.noc;
655+
656+
return;
657+
}
658+
647659
static int find_ipin_cblock_switch_index(const t_arch& Arch) {
648660
int ipin_cblock_switch_index = UNDEFINED;
649661
for (int i = 0; i < Arch.num_switches; ++i) {

vpr/src/base/SetupVPR.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ void SetupVPR(const t_options* Options,
1919
t_annealing_sched* AnnealSched,
2020
t_router_opts* RouterOpts,
2121
t_analysis_opts* AnalysisOpts,
22+
t_noc_opts* NocOpts,
2223
t_det_routing_arch* RoutingArch,
2324
std::vector<t_lb_type_rr_node>** PackerRRGraphs,
2425
std::vector<t_segment_inf>& Segments,

vpr/src/base/read_options.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,21 +2485,14 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
24852485

24862486
auto& noc_grp = parser.add_argument_group("noc options");
24872487

2488-
noc_grp.add_argument<bool, ParseOnOff>(args.include_noc, "--include_noc")
2488+
noc_grp.add_argument<bool, ParseOnOff>(args.noc, "--noc")
24892489
.help(
24902490
"Enables a NoC-driven placer that optimizes the placement of routers on the NoC."
24912491
"Also enables an option in the graphical display that can be used to display the NoC on the FPGA."
24922492
"This should be on only when the FPGA device contains a NoC and the provided netlist connects to the NoC.")
24932493
.default_value("off")
24942494
.show_in(argparse::ShowIn::HELP_ONLY);
24952495

2496-
noc_grp.add_argument(args.noc_router_tile_name, "--noc_router_tile_name")
2497-
.help(
2498-
"The name used when describing the NoC router tiles in the FPGA architecture description."
2499-
"This needs to be provided if --include_noc is used.")
2500-
.default_value("")
2501-
.show_in(argparse::ShowIn::HELP_ONLY);
2502-
25032496
return parser;
25042497
}
25052498

vpr/src/base/read_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ struct t_options {
134134
argparse::ArgValue<int> place_constraint_expand;
135135
argparse::ArgValue<bool> place_constraint_subtile;
136136
// NoC-driven placement
137-
argparse::ArgValue<bool> include_noc;
137+
argparse::ArgValue<bool> noc;
138138
argparse::ArgValue<std::string> noc_router_tile_name;
139139

140140
/* Timing-driven placement options only */

vpr/src/base/vpr_api.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ void vpr_init_with_options(const t_options* options, t_vpr_setup* vpr_setup, t_a
289289
&vpr_setup->AnnealSched,
290290
&vpr_setup->RouterOpts,
291291
&vpr_setup->AnalysisOpts,
292+
&vpr_setup->NocOpts,
292293
&vpr_setup->RoutingArch,
293294
&vpr_setup->PackerRRGraph,
294295
vpr_setup->Segments,
@@ -404,6 +405,8 @@ void vpr_create_device(t_vpr_setup& vpr_setup, const t_arch& arch) {
404405

405406
vpr_setup_clock_networks(vpr_setup, arch);
406407

408+
vpr_setup_noc(vpr_setup, arch);
409+
407410
if (vpr_setup.PlacerOpts.place_chan_width != NO_FIXED_CHANNEL_WIDTH) {
408411
vpr_create_rr_graph(vpr_setup, arch, vpr_setup.PlacerOpts.place_chan_width);
409412
}
@@ -501,9 +504,9 @@ void vpr_setup_clock_networks(t_vpr_setup& vpr_setup, const t_arch& Arch) {
501504
void vpr_setup_noc(const t_vpr_setup& vpr_setup, const t_arch& arch)
502505
{
503506
// check if the user provided the option to model the noc
504-
if (vpr_setup.include_noc == true)
507+
if (vpr_setup.NocOpts.noc == true)
505508
{
506-
setup_noc(arch, vpr_setup.noc_router_tile_name);
509+
setup_noc(arch);
507510
}
508511
}
509512

@@ -1149,6 +1152,7 @@ void vpr_setup_vpr(t_options* Options,
11491152
t_annealing_sched* AnnealSched,
11501153
t_router_opts* RouterOpts,
11511154
t_analysis_opts* AnalysisOpts,
1155+
t_noc_opts* NocOpts,
11521156
t_det_routing_arch* RoutingArch,
11531157
std::vector<t_lb_type_rr_node>** PackerRRGraph,
11541158
std::vector<t_segment_inf>& Segments,
@@ -1172,6 +1176,7 @@ void vpr_setup_vpr(t_options* Options,
11721176
AnnealSched,
11731177
RouterOpts,
11741178
AnalysisOpts,
1179+
NocOpts,
11751180
RoutingArch,
11761181
PackerRRGraph,
11771182
Segments,

vpr/src/base/vpr_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ void vpr_setup_vpr(t_options* Options,
157157
t_annealing_sched* AnnealSched,
158158
t_router_opts* RouterOpts,
159159
t_analysis_opts* AnalysisOpts,
160+
t_noc_opts* NocOpts,
160161
t_det_routing_arch* RoutingArch,
161162
std::vector<t_lb_type_rr_node>** PackerRRGraph,
162163
std::vector<t_segment_inf>& Segments,

vpr/src/base/vpr_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ struct t_analysis_opts {
12961296
};
12971297

12981298
struct t_noc_opts {
1299-
bool include_noc; ///<options to model the noc within the FPGA device
1299+
bool noc; ///<options to model the noc within the FPGA device
13001300
std::string noc_router_tile_name; ///<name of the router tile located in the FPGA
13011301
};
13021302

0 commit comments

Comments
 (0)