VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
SetupVPR.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void SetupVPR (INP t_options *Options, INP boolean TimingEnabled, INP boolean readArchFile, OUTP struct s_file_name_opts *FileNameOpts, INOUTP t_arch *Arch, OUTP enum e_operation *Operation, OUTP t_model **user_models, OUTP t_model **library_models, OUTP struct s_packer_opts *PackerOpts, OUTP struct s_placer_opts *PlacerOpts, OUTP struct s_annealing_sched *AnnealSched, OUTP struct s_router_opts *RouterOpts, OUTP struct s_det_routing_arch *RoutingArch, OUTP t_segment_inf **Segments, OUTP t_timing_inf *Timing, OUTP boolean *ShowGraphics, OUTP int *GraphPause, OUTP t_power_opts *power_opts)
 
void CheckSetup (INP enum e_operation Operation, INP struct s_placer_opts PlacerOpts, INP struct s_annealing_sched AnnealSched, INP struct s_router_opts RouterOpts, INP struct s_det_routing_arch RoutingArch, INP t_segment_inf *Segments, INP t_timing_inf Timing, INP t_chan_width_dist Chans)
 
void CheckArch (INP t_arch Arch, INP boolean TimingEnabled)
 
void CheckOptions (INP t_options Options, INP boolean TimingEnabled)
 
void ShowSetup (INP t_options options, INP t_vpr_setup vpr_setup)
 
void printClusteredNetlistStats (void)
 

Function Documentation

void CheckArch ( INP t_arch  Arch,
INP boolean  TimingEnabled 
)

Definition at line 17 of file CheckArch.c.

17  {
18  CheckSwitches(Arch, TimingEnabled);
19  CheckSegments(Arch);
20 }
static void CheckSegments(INP t_arch Arch)
Definition: CheckArch.c:51
static void CheckSwitches(INP t_arch Arch, INP boolean TimingEnabled)
Definition: CheckArch.c:22

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CheckOptions ( INP t_options  Options,
INP boolean  TimingEnabled 
)

Definition at line 12 of file CheckOptions.c.

12  {
13  boolean TimingPlacer;
14  boolean TimingRouter;
15  boolean default_flow;
16 
17  const struct s_TokenPair *Cur;
18  enum e_OptionBaseToken Yes;
19 
20  default_flow = (boolean) (Options.Count[OT_ROUTE] == 0
21  && Options.Count[OT_PLACE] == 0 && Options.Count[OT_PACK] == 0
22  && Options.Count[OT_TIMING_ANALYZE_ONLY_WITH_NET_DELAY] == 0);
23 
24  /* Check that all filenames were given */
25  if ((NULL == Options.CircuitName) || (NULL == Options.ArchFile)) {
26  vpr_printf(TIO_MESSAGE_ERROR, "Not enough args. Need at least 'vpr <archfile> <circuit_name>'.\n");
27  exit(1);
28  }
29 
30  /* Check that options aren't over specified */
31  Cur = OptionBaseTokenList;
32  while (Cur->Str) {
33  if (Options.Count[Cur->Enum] > 1) {
34  vpr_printf(TIO_MESSAGE_ERROR, "Parameter '%s' was specified more than once on command line.\n", Cur->Str);
35  exit(1);
36  }
37  ++Cur;
38  }
39 
40  /* Todo: Add in checks for packer */
41 
42  /* Check for conflicting parameters and determine if placer and
43  * router are on. */
44 
45  if (Options.Count[OT_TIMING_ANALYZE_ONLY_WITH_NET_DELAY]
46  && (Options.Count[OT_PACK] || Options.Count[OT_PLACE]
47  || Options.Count[OT_ROUTE])) {
48  vpr_printf(TIO_MESSAGE_ERROR, "'cluster'/'route'/'place', and 'timing_analysis_only_with_net_delay' are mutually exclusive flags..\n");
49  exit(1);
50  }
51 
52  /* If placing and timing is enabled, default to a timing placer */
53  TimingPlacer = (boolean)((Options.Count[OT_PLACE] || default_flow) && TimingEnabled);
54  if (Options.Count[OT_PLACE_ALGORITHM] > 0) {
55  if ((PATH_TIMING_DRIVEN_PLACE != Options.PlaceAlgorithm)
56  && (NET_TIMING_DRIVEN_PLACE != Options.PlaceAlgorithm)) {
57  /* Turn off the timing placer if they request a different placer */
58  TimingPlacer = FALSE;
59  }
60  }
61 
62  /* If routing and timing is enabled, default to a timing router */
63  TimingRouter = (boolean)((Options.Count[OT_ROUTE] || default_flow) && TimingEnabled);
64  if (Options.Count[OT_ROUTER_ALGORITHM] > 0) {
65  if (TIMING_DRIVEN != Options.RouterAlgorithm) {
66  /* Turn off the timing router if they request a different router */
67  TimingRouter = FALSE;
68  }
69  }
70 
71  Yes = OT_BASE_UNKNOWN;
72  if (Options.Count[OT_SEED] > 0) {
73  Yes = OT_SEED;
74  }
75  if (Options.Count[OT_INNER_NUM] > 0) {
76  Yes = OT_INNER_NUM;
77  }
78  if (Options.Count[OT_INIT_T] > 0) {
79  Yes = OT_INIT_T;
80  }
81  if (Options.Count[OT_ALPHA_T] > 0) {
82  Yes = OT_ALPHA_T;
83  }
84  if (Options.Count[OT_EXIT_T] > 0) {
85  Yes = OT_EXIT_T;
86  }
87  if (Options.Count[OT_FIX_PINS] > 0) {
88  Yes = OT_FIX_PINS;
89  }
90  if (Options.Count[OT_PLACE_ALGORITHM] > 0) {
91  Yes = OT_PLACE_ALGORITHM;
92  }
93  if (Options.Count[OT_PLACE_COST_EXP] > 0) {
94  Yes = OT_PLACE_COST_EXP;
95  }
96  if (Options.Count[OT_PLACE_CHAN_WIDTH] > 0) {
97  Yes = OT_PLACE_CHAN_WIDTH;
98  }
99  if (Options.Count[OT_ENABLE_TIMING_COMPUTATIONS] > 0) {
101  }
102  if (Options.Count[OT_BLOCK_DIST] > 0) {
103  Yes = OT_BLOCK_DIST;
104  }
105  /* Make sure if place is off none of those options were given */
106  if ((Options.Count[OT_PLACE] == 0) && !default_flow
107  && (Yes < OT_BASE_UNKNOWN)) {
108  Cur = OptionBaseTokenList;
109  while (Cur->Str) {
110  if (Yes == Cur->Enum) {
111  vpr_printf(TIO_MESSAGE_ERROR, "Option '%s' is not allowed when placement is not run.\n", Cur->Str);
112  exit(1);
113  }
114  ++Cur;
115  }
116  }
117 
118  Yes = OT_BASE_UNKNOWN;
119  if (Options.Count[OT_TIMING_TRADEOFF] > 0) {
120  Yes = OT_TIMING_TRADEOFF;
121  }
122  if (Options.Count[OT_RECOMPUTE_CRIT_ITER] > 0) {
124  }
125  if (Options.Count[OT_INNER_LOOP_RECOMPUTE_DIVIDER] > 0) {
127  }
128  if (Options.Count[OT_TD_PLACE_EXP_FIRST] > 0) {
129  Yes = OT_TD_PLACE_EXP_FIRST;
130  }
131  if (Options.Count[OT_TD_PLACE_EXP_LAST] > 0) {
132  Yes = OT_TD_PLACE_EXP_LAST;
133  }
134  /* Make sure if place is off none of those options were given */
135  if ((FALSE == TimingPlacer) && (Yes < OT_BASE_UNKNOWN)) {
136  Cur = OptionBaseTokenList;
137  while (Cur->Str) {
138  if (Yes == Cur->Enum) {
139  vpr_printf(TIO_MESSAGE_ERROR, "Option '%s' is not allowed when timing placement is not used.\n", Cur->Str);
140  exit(1);
141  }
142  ++Cur;
143  }
144  }
145 
146  Yes = OT_BASE_UNKNOWN;
147  if (Options.Count[OT_ROUTE_TYPE] > 0) {
148  Yes = OT_ROUTE_TYPE;
149  }
150  if (Options.Count[OT_ROUTE_CHAN_WIDTH] > 0) {
151  Yes = OT_ROUTE_CHAN_WIDTH;
152  }
153  if (Options.Count[OT_ROUTER_ALGORITHM] > 0) {
154  Yes = OT_ROUTER_ALGORITHM;
155  }
156  if (Options.Count[OT_MAX_ROUTER_ITERATIONS] > 0) {
158  }
159  if (Options.Count[OT_INITIAL_PRES_FAC] > 0) {
160  Yes = OT_INITIAL_PRES_FAC;
161  }
162  if (Options.Count[OT_FIRST_ITER_PRES_FAC] > 0) {
164  }
165  if (Options.Count[OT_PRES_FAC_MULT] > 0) {
166  Yes = OT_PRES_FAC_MULT;
167  }
168  if (Options.Count[OT_ACC_FAC] > 0) {
169  Yes = OT_ACC_FAC;
170  }
171  if (Options.Count[OT_BB_FACTOR] > 0) {
172  Yes = OT_BB_FACTOR;
173  }
174  if (Options.Count[OT_BASE_COST_TYPE] > 0) {
175  Yes = OT_BASE_COST_TYPE;
176  }
177  if (Options.Count[OT_BEND_COST] > 0) {
178  Yes = OT_BEND_COST;
179  }
180  if (Options.Count[OT_BASE_COST_TYPE] > 0) {
181  Yes = OT_BASE_COST_TYPE;
182  }
183  if (Options.Count[OT_ASTAR_FAC] > 0) {
184  Yes = OT_ASTAR_FAC;
185  }
186  Yes = OT_BASE_UNKNOWN;
187  if (Options.Count[OT_MAX_CRITICALITY] > 0) {
188  Yes = OT_MAX_CRITICALITY;
189  }
190  if (Options.Count[OT_CRITICALITY_EXP] > 0) {
191  Yes = OT_CRITICALITY_EXP;
192  }
193  /* Make sure if timing router is off none of those options were given */
194  if ((FALSE == TimingRouter) && (Yes < OT_BASE_UNKNOWN)) {
195  Cur = OptionBaseTokenList;
196  while (Cur->Str) {
197  if (Yes == Cur->Enum) {
198  vpr_printf(TIO_MESSAGE_ERROR, "Option '%s' is not allowed when timing router is not used.\n", Cur->Str);
199  exit(1);
200  }
201  ++Cur;
202  }
203  }
204 }
const char * Str
Definition: vpr_types.h:1027
boolean
Definition: util.h:11
struct s_TokenPair OptionBaseTokenList[]
Definition: OptionTokens.c:7
Definition: util.h:12
e_OptionBaseToken
Definition: OptionTokens.h:6
messagelogger vpr_printf
Definition: util.c:17

+ Here is the caller graph for this function:

void CheckSetup ( INP enum e_operation  Operation,
INP struct s_placer_opts  PlacerOpts,
INP struct s_annealing_sched  AnnealSched,
INP struct s_router_opts  RouterOpts,
INP struct s_det_routing_arch  RoutingArch,
INP t_segment_inf Segments,
INP t_timing_inf  Timing,
INP t_chan_width_dist  Chans 
)

Definition at line 9 of file CheckSetup.c.

14  {
15  int i;
16  int Tmp;
17 
18  if ((GLOBAL == RouterOpts.route_type)
19  && (TIMING_DRIVEN == RouterOpts.router_algorithm)) {
20 
21  vpr_printf(TIO_MESSAGE_ERROR, "The global router does not support timing-drvien routing.\n");
22  exit(1);
23  }
24 
25  if ((GLOBAL == RouterOpts.route_type)
26  && (BOUNDING_BOX_PLACE != PlacerOpts.place_algorithm)) {
27 
28  /* Works, but very weird. Can't optimize timing well, since you're
29  * not doing proper architecture delay modelling. */
30  vpr_printf(TIO_MESSAGE_WARNING, "Using global routing with timing-driven placement. "
31  "This is allowed, but strange, and circuit speed will suffer.\n");
32  }
33 
34  if ((FALSE == Timing.timing_analysis_enabled)
35  && ((PlacerOpts.place_algorithm == NET_TIMING_DRIVEN_PLACE)
36  || (PlacerOpts.place_algorithm == PATH_TIMING_DRIVEN_PLACE))) {
37 
38  /* May work, not tested */
39  vpr_printf(TIO_MESSAGE_ERROR, "Timing analysis must be enabled for timing-driven placement.\n");
40  exit(1);
41  }
42 
43  if (!PlacerOpts.doPlacement && (USER == PlacerOpts.pad_loc_type)) {
44  vpr_printf(TIO_MESSAGE_ERROR, "A pad location file requires that placement is enabled.\n");
45  exit(1);
46  }
47 
48  if (RouterOpts.doRouting) {
49  if ((TIMING_DRIVEN == RouterOpts.router_algorithm)
50  && (FALSE == Timing.timing_analysis_enabled)) {
51  vpr_printf(TIO_MESSAGE_ERROR, "Cannot perform timing-driven routing when timing analysis is disabled.\n");
52  exit(1);
53  }
54 
55  if ((FALSE == Timing.timing_analysis_enabled)
56  && (DEMAND_ONLY != RouterOpts.base_cost_type)) {
57  vpr_printf(TIO_MESSAGE_ERROR, "base_cost_type must be demand_only when timing analysis is disabled.\n");
58  exit(1);
59  }
60  }
61 
62  if ((TIMING_ANALYSIS_ONLY == Operation)
63  && (FALSE == Timing.timing_analysis_enabled)) {
64  vpr_printf(TIO_MESSAGE_ERROR, "-timing_analyze_only_with_net_delay option requires that timing analysis not be disabled.\n");
65  exit(1);
66  }
67 
68  if (DETAILED == RouterOpts.route_type) {
69  if ((Chans.chan_x_dist.type != UNIFORM)
70  || (Chans.chan_y_dist.type != UNIFORM)
71  || (Chans.chan_x_dist.peak != Chans.chan_y_dist.peak)
72  || (Chans.chan_x_dist.peak != Chans.chan_width_io)) {
73  vpr_printf(TIO_MESSAGE_ERROR, "Detailed routing currently only supported on FPGAs with all channels of equal width.\n");
74  exit(1);
75  }
76  }
77 
78  for (i = 0; i < RoutingArch.num_segment; ++i) {
79  Tmp = Segments[i].opin_switch;
80  if (FALSE == switch_inf[Tmp].buffered) {
81  vpr_printf(TIO_MESSAGE_ERROR, "opin_switch (#%d) of segment type #%d is not buffered.\n", Tmp, i);
82  exit(1);
83  }
84  }
85 
86  if (UNI_DIRECTIONAL == RoutingArch.directionality) {
87  if ((RouterOpts.fixed_channel_width != NO_FIXED_CHANNEL_WIDTH)
88  && (RouterOpts.fixed_channel_width % 2 > 0)) {
89  vpr_printf(TIO_MESSAGE_ERROR, "Routing channel width must be even for unidirectional.\n");
90  exit(1);
91  }
92  if ((PlacerOpts.place_chan_width != NO_FIXED_CHANNEL_WIDTH)
93  && (PlacerOpts.place_chan_width % 2 > 0)) {
94  vpr_printf(TIO_MESSAGE_ERROR, "Place channel width must be even for unidirectional.\n");
95  exit(1);
96  }
97  }
98 }
Definition: util.h:12
struct s_switch_inf * switch_inf
Definition: globals.c:83
#define NO_FIXED_CHANNEL_WIDTH
Definition: vpr_types.h:692
messagelogger vpr_printf
Definition: util.c:17

+ Here is the caller graph for this function:

void printClusteredNetlistStats ( void  )

Definition at line 50 of file ShowSetup.c.

50  {
51  int i, j, L_num_p_inputs, L_num_p_outputs;
52  int *num_blocks_type;
53  num_blocks_type = (int*) my_calloc(num_types, sizeof(int));
54 
55  vpr_printf(TIO_MESSAGE_INFO, "\n");
56  vpr_printf(TIO_MESSAGE_INFO, "Netlist num_nets: %d\n", num_nets);
57  vpr_printf(TIO_MESSAGE_INFO, "Netlist num_blocks: %d\n", num_blocks);
58 
59  for (i = 0; i < num_types; i++) {
60  num_blocks_type[i] = 0;
61  }
62  /* Count I/O input and output pads */
63  L_num_p_inputs = 0;
64  L_num_p_outputs = 0;
65 
66  for (i = 0; i < num_blocks; i++) {
67  num_blocks_type[block[i].type->index]++;
68  if (block[i].type == IO_TYPE) {
69  for (j = 0; j < IO_TYPE->num_pins; j++) {
70  if (block[i].nets[j] != OPEN) {
72  == DRIVER) {
73  L_num_p_inputs++;
74  } else {
75  assert(
76  IO_TYPE-> class_inf[IO_TYPE-> pin_class[j]]. type == RECEIVER);
77  L_num_p_outputs++;
78  }
79  }
80  }
81  }
82  }
83 
84  for (i = 0; i < num_types; i++) {
85  if (IO_TYPE != &type_descriptors[i]) {
86  vpr_printf(TIO_MESSAGE_INFO, "Netlist %s blocks: %d.\n", type_descriptors[i].name, num_blocks_type[i]);
87  }
88  }
89 
90  /* Print out each block separately instead */
91  vpr_printf(TIO_MESSAGE_INFO, "Netlist inputs pins: %d\n", L_num_p_inputs);
92  vpr_printf(TIO_MESSAGE_INFO, "Netlist output pins: %d\n", L_num_p_outputs);
93  vpr_printf(TIO_MESSAGE_INFO, "\n");
94  free(num_blocks_type);
95 }
struct s_class * class_inf
void * my_calloc(size_t nelem, size_t size)
Definition: util.c:132
int num_nets
Definition: globals.c:27
t_type_ptr type
Definition: vpr_types.h:561
int num_blocks
Definition: globals.c:30
struct s_block * block
Definition: globals.c:31
int num_types
Definition: globals.c:37
t_type_ptr IO_TYPE
Definition: globals.c:40
Definition: slre.c:50
struct s_type_descriptor * type_descriptors
Definition: globals.c:38
enum e_pin_type type
messagelogger vpr_printf
Definition: util.c:17

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SetupVPR ( INP t_options Options,
INP boolean  TimingEnabled,
INP boolean  readArchFile,
OUTP struct s_file_name_opts FileNameOpts,
INOUTP t_arch Arch,
OUTP enum e_operation Operation,
OUTP t_model **  user_models,
OUTP t_model **  library_models,
OUTP struct s_packer_opts PackerOpts,
OUTP struct s_placer_opts PlacerOpts,
OUTP struct s_annealing_sched AnnealSched,
OUTP struct s_router_opts RouterOpts,
OUTP struct s_det_routing_arch RoutingArch,
OUTP t_segment_inf **  Segments,
OUTP t_timing_inf Timing,
OUTP boolean ShowGraphics,
OUTP int *  GraphPause,
OUTP t_power_opts power_opts 
)
void ShowSetup ( INP t_options  options,
INP t_vpr_setup  vpr_setup 
)

Definition at line 22 of file ShowSetup.c.

22  {
23  vpr_printf(TIO_MESSAGE_INFO, "Timing analysis: %s\n", (vpr_setup.TimingEnabled? "ON" : "OFF"));
24 
25  vpr_printf(TIO_MESSAGE_INFO, "Circuit netlist file: %s\n", vpr_setup.FileNameOpts.NetFile);
26  vpr_printf(TIO_MESSAGE_INFO, "Circuit placement file: %s\n", vpr_setup.FileNameOpts.PlaceFile);
27  vpr_printf(TIO_MESSAGE_INFO, "Circuit routing file: %s\n", vpr_setup.FileNameOpts.RouteFile);
28  vpr_printf(TIO_MESSAGE_INFO, "Circuit SDC file: %s\n", vpr_setup.Timing.SDCFile);
29 
30  ShowOperation(vpr_setup.Operation);
31  vpr_printf(TIO_MESSAGE_INFO, "Packer: %s\n", (vpr_setup.PackerOpts.doPacking ? "ENABLED" : "DISABLED"));
32  vpr_printf(TIO_MESSAGE_INFO, "Placer: %s\n", (vpr_setup.PlacerOpts.doPlacement ? "ENABLED" : "DISABLED"));
33  vpr_printf(TIO_MESSAGE_INFO, "Router: %s\n", (vpr_setup.RouterOpts.doRouting ? "ENABLED" : "DISABLED"));
34 
35  if (vpr_setup.PackerOpts.doPacking) {
36  ShowPackerOpts(vpr_setup.PackerOpts);
37  }
38  if (vpr_setup.PlacerOpts.doPlacement) {
39  ShowPlacerOpts(options, vpr_setup.PlacerOpts, vpr_setup.AnnealSched);
40  }
41  if (vpr_setup.RouterOpts.doRouting) {
42  ShowRouterOpts(vpr_setup.RouterOpts);
43  }
44 
45  if (DETAILED == vpr_setup.RouterOpts.route_type)
46  ShowRoutingArch(vpr_setup.RoutingArch);
47 
48 }
static void ShowRouterOpts(INP struct s_router_opts RouterOpts)
Definition: ShowSetup.c:158
static void ShowPlacerOpts(INP t_options Options, INP struct s_placer_opts PlacerOpts, INP struct s_annealing_sched AnnealSched)
Definition: ShowSetup.c:295
static void ShowRoutingArch(INP struct s_det_routing_arch RoutingArch)
Definition: ShowSetup.c:97
messagelogger vpr_printf
Definition: util.c:17
static void ShowPackerOpts(INP struct s_packer_opts PackerOpts)
Definition: ShowSetup.c:371
static void ShowOperation(INP enum e_operation Operation)
Definition: ShowSetup.c:280

+ Here is the call graph for this function:

+ Here is the caller graph for this function: