VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
ReadOptions.h File Reference
#include "OptionTokens.h"
+ Include dependency graph for ReadOptions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  s_options
 

Typedefs

typedef struct s_options t_options
 

Enumerations

enum  e_echo_files {
  E_ECHO_INITIAL_CLB_PLACEMENT = 0, E_ECHO_INITIAL_PLACEMENT_TIMING_GRAPH, E_ECHO_INITIAL_PLACEMENT_SLACK, E_ECHO_INITIAL_PLACEMENT_CRITICALITY,
  E_ECHO_END_CLB_PLACEMENT, E_ECHO_PLACEMENT_SINK_DELAYS, E_ECHO_FINAL_PLACEMENT_TIMING_GRAPH, E_ECHO_FINAL_PLACEMENT_SLACK,
  E_ECHO_FINAL_PLACEMENT_CRITICALITY, E_ECHO_PLACEMENT_CRIT_PATH, E_ECHO_PB_GRAPH, E_ECHO_ARCH,
  E_ECHO_PLACEMENT_CRITICAL_PATH, E_ECHO_PLACEMENT_LOWER_BOUND_SINK_DELAYS, E_ECHO_PLACEMENT_LOGIC_SINK_DELAYS, E_ECHO_ROUTING_SINK_DELAYS,
  E_ECHO_POST_FLOW_TIMING_GRAPH, E_ECHO_POST_PACK_NETLIST, E_ECHO_BLIF_INPUT, E_ECHO_NET_DELAY,
  E_ECHO_TIMING_GRAPH, E_ECHO_LUT_REMAPPING, E_ECHO_PRE_PACKING_TIMING_GRAPH, E_ECHO_PRE_PACKING_TIMING_GRAPH_AS_BLIF,
  E_ECHO_CLUSTERING_TIMING_INFO, E_ECHO_PRE_PACKING_SLACK, E_ECHO_PRE_PACKING_CRITICALITY, E_ECHO_CLUSTERING_BLOCK_CRITICALITIES,
  E_ECHO_PRE_PACKING_MOLECULES_AND_PATTERNS, E_ECHO_MEM, E_ECHO_RR_GRAPH, E_ECHO_TIMING_CONSTRAINTS,
  E_ECHO_CRITICAL_PATH, E_ECHO_SLACK, E_ECHO_CRITICALITY, E_ECHO_COMPLETE_NET_TRACE,
  E_ECHO_SEG_DETAILS, E_ECHO_END_TOKEN
}
 
enum  e_output_files { E_CRIT_PATH_FILE, E_SLACK_FILE, E_CRITICALITY_FILE, E_FILE_END_TOKEN }
 

Functions

void ReadOptions (INP int argc, INP char **argv, OUTP t_options *Options)
 
boolean getEchoEnabled (void)
 
void setEchoEnabled (boolean echo_enabled)
 
void setAllEchoFileEnabled (boolean value)
 
void setEchoFileEnabled (enum e_echo_files echo_option, boolean value)
 
void setEchoFileName (enum e_echo_files echo_option, const char *name)
 
boolean isEchoFileEnabled (enum e_echo_files echo_option)
 
char * getEchoFileName (enum e_echo_files echo_option)
 
void alloc_and_load_echo_file_info ()
 
void free_echo_file_info ()
 
void setOutputFileName (enum e_output_files ename, const char *name, const char *default_name)
 
char * getOutputFileName (enum e_output_files ename)
 
void alloc_and_load_output_file_names (const char *default_name)
 
void free_output_file_names ()
 
boolean IsTimingEnabled (INP t_options *Options)
 
boolean IsEchoEnabled (INP t_options *Options)
 
boolean GetPostSynthesisOption (void)
 
void SetPostSynthesisOption (boolean post_synthesis_enabled)
 
boolean IsPostSynthesisEnabled (INP t_options *Options)
 

Typedef Documentation

typedef struct s_options t_options

Definition at line 6 of file ReadOptions.h.

Enumeration Type Documentation

Enumerator
E_ECHO_INITIAL_CLB_PLACEMENT 
E_ECHO_INITIAL_PLACEMENT_TIMING_GRAPH 
E_ECHO_INITIAL_PLACEMENT_SLACK 
E_ECHO_INITIAL_PLACEMENT_CRITICALITY 
E_ECHO_END_CLB_PLACEMENT 
E_ECHO_PLACEMENT_SINK_DELAYS 
E_ECHO_FINAL_PLACEMENT_TIMING_GRAPH 
E_ECHO_FINAL_PLACEMENT_SLACK 
E_ECHO_FINAL_PLACEMENT_CRITICALITY 
E_ECHO_PLACEMENT_CRIT_PATH 
E_ECHO_PB_GRAPH 
E_ECHO_ARCH 
E_ECHO_PLACEMENT_CRITICAL_PATH 
E_ECHO_PLACEMENT_LOWER_BOUND_SINK_DELAYS 
E_ECHO_PLACEMENT_LOGIC_SINK_DELAYS 
E_ECHO_ROUTING_SINK_DELAYS 
E_ECHO_POST_FLOW_TIMING_GRAPH 
E_ECHO_POST_PACK_NETLIST 
E_ECHO_BLIF_INPUT 
E_ECHO_NET_DELAY 
E_ECHO_TIMING_GRAPH 
E_ECHO_LUT_REMAPPING 
E_ECHO_PRE_PACKING_TIMING_GRAPH 
E_ECHO_PRE_PACKING_TIMING_GRAPH_AS_BLIF 
E_ECHO_CLUSTERING_TIMING_INFO 
E_ECHO_PRE_PACKING_SLACK 
E_ECHO_PRE_PACKING_CRITICALITY 
E_ECHO_CLUSTERING_BLOCK_CRITICALITIES 
E_ECHO_PRE_PACKING_MOLECULES_AND_PATTERNS 
E_ECHO_MEM 
E_ECHO_RR_GRAPH 
E_ECHO_TIMING_CONSTRAINTS 
E_ECHO_CRITICAL_PATH 
E_ECHO_SLACK 
E_ECHO_CRITICALITY 
E_ECHO_COMPLETE_NET_TRACE 
E_ECHO_SEG_DETAILS 
E_ECHO_END_TOKEN 

Definition at line 95 of file ReadOptions.h.

95  {
107  E_ECHO_ARCH,
125  E_ECHO_MEM,
129  E_ECHO_SLACK,
134 };
Enumerator
E_CRIT_PATH_FILE 
E_SLACK_FILE 
E_CRITICALITY_FILE 
E_FILE_END_TOKEN 

Definition at line 137 of file ReadOptions.h.

Function Documentation

void alloc_and_load_echo_file_info ( )

Definition at line 126 of file ReadOptions.c.

126  {
127  echoFileEnabled = (boolean*)my_calloc((int) E_ECHO_END_TOKEN, sizeof(boolean));
128  echoFileNames = (char**)my_calloc((int) E_ECHO_END_TOKEN, sizeof(char*));
129 
131 
132  setEchoFileName(E_ECHO_INITIAL_CLB_PLACEMENT, "initial_clb_placement.echo");
133  setEchoFileName(E_ECHO_INITIAL_PLACEMENT_TIMING_GRAPH, "initial_placement_timing_graph.echo");
134  setEchoFileName(E_ECHO_INITIAL_PLACEMENT_SLACK, "initial_placement_slack.echo");
135  setEchoFileName(E_ECHO_INITIAL_PLACEMENT_CRITICALITY, "initial_placement_criticality.echo");
136  setEchoFileName(E_ECHO_END_CLB_PLACEMENT, "end_clb_placement.echo");
137  setEchoFileName(E_ECHO_PLACEMENT_SINK_DELAYS, "placement_sink_delays.echo");
138  setEchoFileName(E_ECHO_FINAL_PLACEMENT_TIMING_GRAPH, "final_placement_timing_graph.echo");
139  setEchoFileName(E_ECHO_FINAL_PLACEMENT_SLACK, "final_placement_slack.echo");
140  setEchoFileName(E_ECHO_FINAL_PLACEMENT_CRITICALITY, "final_placement_criticality.echo");
141  setEchoFileName(E_ECHO_PLACEMENT_CRIT_PATH, "placement_crit_path.echo");
142  setEchoFileName(E_ECHO_PB_GRAPH, "pb_graph.echo");
143  setEchoFileName(E_ECHO_ARCH, "arch.echo");
144  setEchoFileName(E_ECHO_PLACEMENT_CRITICAL_PATH, "placement_critical_path.echo");
145  setEchoFileName(E_ECHO_PLACEMENT_LOWER_BOUND_SINK_DELAYS, "placement_lower_bound_sink_delays.echo");
146  setEchoFileName(E_ECHO_PLACEMENT_LOGIC_SINK_DELAYS, "placement_logic_sink_delays.echo");
147  setEchoFileName(E_ECHO_ROUTING_SINK_DELAYS, "routing_sink_delays.echo");
148  setEchoFileName(E_ECHO_POST_FLOW_TIMING_GRAPH, "post_flow_timing_graph.blif");
149  setEchoFileName(E_ECHO_POST_PACK_NETLIST, "post_pack_netlist.blif");
150  setEchoFileName(E_ECHO_BLIF_INPUT, "blif_input.echo");
151  setEchoFileName(E_ECHO_NET_DELAY, "net_delay.echo");
152  setEchoFileName(E_ECHO_TIMING_GRAPH, "timing_graph.echo");
153  setEchoFileName(E_ECHO_LUT_REMAPPING, "lut_remapping.echo");
154  setEchoFileName(E_ECHO_PRE_PACKING_TIMING_GRAPH, "pre_packing_timing_graph.echo");
155  setEchoFileName(E_ECHO_PRE_PACKING_TIMING_GRAPH_AS_BLIF, "pre_packing_timing_graph_as_blif.blif");
156  setEchoFileName(E_ECHO_CLUSTERING_TIMING_INFO, "clustering_timing_info.echo");
157  setEchoFileName(E_ECHO_PRE_PACKING_SLACK, "pre_packing_slack.echo");
158  setEchoFileName(E_ECHO_PRE_PACKING_CRITICALITY, "pre_packing_criticality.echo");
159  setEchoFileName(E_ECHO_CLUSTERING_BLOCK_CRITICALITIES, "clustering_block_criticalities.echo");
160  setEchoFileName(E_ECHO_PRE_PACKING_MOLECULES_AND_PATTERNS, "pre_packing_molecules_and_patterns.echo");
161  setEchoFileName(E_ECHO_MEM, "mem.echo");
162  setEchoFileName(E_ECHO_RR_GRAPH, "rr_graph.echo");
163  setEchoFileName(E_ECHO_TIMING_CONSTRAINTS, "timing_constraints.echo");
164  setEchoFileName(E_ECHO_CRITICAL_PATH, "critical_path.echo");
165  setEchoFileName(E_ECHO_SLACK, "slack.echo");
166  setEchoFileName(E_ECHO_CRITICALITY, "criticality.echo");
167  setEchoFileName(E_ECHO_COMPLETE_NET_TRACE, "complete_net_trace.echo");
168  setEchoFileName(E_ECHO_SEG_DETAILS, "seg_details.txt");
169 }
boolean
Definition: util.h:11
void * my_calloc(size_t nelem, size_t size)
Definition: util.c:132
static boolean * echoFileEnabled
Definition: ReadOptions.c:16
void setAllEchoFileEnabled(boolean value)
Definition: ReadOptions.c:97
static char ** echoFileNames
Definition: ReadOptions.c:17
void setEchoFileName(enum e_echo_files echo_option, const char *name)
Definition: ReadOptions.c:108
Definition: util.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void alloc_and_load_output_file_names ( const char *  default_name)

Definition at line 200 of file ReadOptions.c.

200  {
201  char *name;
202 
203  if(outputFileNames == NULL) {
204 
205  outputFileNames = (char**)my_calloc((int)E_FILE_END_TOKEN, sizeof(char*));
206 
207  name = (char*)my_malloc((strlen(default_name) + 40) * sizeof(char));
208  sprintf(name, "%s.critical_path.out", default_name);
209  setOutputFileName(E_CRIT_PATH_FILE, name, default_name);
210 
211  sprintf(name, "%s.slack.out", default_name);
212  setOutputFileName(E_SLACK_FILE, name, default_name);
213 
214  sprintf(name, "%s.criticality.out", default_name);
215  setOutputFileName(E_CRITICALITY_FILE, name, default_name);
216 
217  free(name);
218  }
219 }
void * my_calloc(size_t nelem, size_t size)
Definition: util.c:132
static void * my_malloc(int ibytes)
Definition: graphics.c:499
void setOutputFileName(enum e_output_files ename, const char *name, const char *default_name)
Definition: ReadOptions.c:186
static char ** outputFileNames
Definition: ReadOptions.c:19

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void free_echo_file_info ( )

Definition at line 171 of file ReadOptions.c.

171  {
172  int i;
173  if(echoFileEnabled != NULL) {
174  for(i = 0; i < (int) E_ECHO_END_TOKEN; i++) {
175  if(echoFileNames[i] != NULL) {
176  free(echoFileNames[i]);
177  }
178  }
179  free(echoFileNames);
180  free(echoFileEnabled);
181  echoFileNames = NULL;
182  echoFileEnabled = NULL;
183  }
184 }
static boolean * echoFileEnabled
Definition: ReadOptions.c:16
static char ** echoFileNames
Definition: ReadOptions.c:17

+ Here is the caller graph for this function:

void free_output_file_names ( )

Definition at line 221 of file ReadOptions.c.

221  {
222  int i;
223  if(outputFileNames != NULL) {
224  for(i = 0; i < (int)E_FILE_END_TOKEN; i++) {
225  if(outputFileNames[i] != NULL) {
226  free(outputFileNames[i]);
227  outputFileNames[i] = NULL;
228  }
229  }
230  free(outputFileNames);
231  outputFileNames = NULL;
232  }
233 }
static char ** outputFileNames
Definition: ReadOptions.c:19

+ Here is the caller graph for this function:

boolean getEchoEnabled ( void  )

Definition at line 67 of file ReadOptions.c.

67  {
68  return EchoEnabled;
69 }
static boolean EchoEnabled
Definition: ReadOptions.c:12

+ Here is the caller graph for this function:

char* getEchoFileName ( enum e_echo_files  echo_option)

Definition at line 122 of file ReadOptions.c.

122  {
123  return echoFileNames[(int)echo_option];
124 }
static char ** echoFileNames
Definition: ReadOptions.c:17

+ Here is the caller graph for this function:

char* getOutputFileName ( enum e_output_files  ename)

Definition at line 196 of file ReadOptions.c.

196  {
197  return outputFileNames[(int)ename];
198 }
static char ** outputFileNames
Definition: ReadOptions.c:19

+ Here is the caller graph for this function:

boolean GetPostSynthesisOption ( void  )

Definition at line 80 of file ReadOptions.c.

80  {
82 }
static boolean Generate_PostSynthesis_Netlist
Definition: ReadOptions.c:14

+ Here is the caller graph for this function:

boolean IsEchoEnabled ( INP t_options Options)

Definition at line 58 of file ReadOptions.c.

58  {
59  /* First priority to the '--echo_file' flag */
60  if (Options->Count[OT_CREATE_ECHO_FILE]) {
61  return Options->CreateEchoFile;
62  }
63  return FALSE;
64 }
Definition: util.h:12

+ Here is the caller graph for this function:

boolean isEchoFileEnabled ( enum e_echo_files  echo_option)

Definition at line 115 of file ReadOptions.c.

115  {
116  if(echoFileEnabled == NULL) {
117  return FALSE;
118  } else {
119  return echoFileEnabled[(int)echo_option];
120  }
121 }
static boolean * echoFileEnabled
Definition: ReadOptions.c:16
Definition: util.h:12

+ Here is the caller graph for this function:

boolean IsPostSynthesisEnabled ( INP t_options Options)

Definition at line 88 of file ReadOptions.c.

88  {
89  /* First priority to the '--generate_postsynthesis_netlist' flag */
90  if (Options->Count[OT_GENERATE_POST_SYNTHESIS_NETLIST]) {
91  return Options->Generate_Post_Synthesis_Netlist;
92  }
93  return FALSE;
94 }
Definition: util.h:12

+ Here is the caller graph for this function:

boolean IsTimingEnabled ( INP t_options Options)

Definition at line 47 of file ReadOptions.c.

47  {
48  /* First priority to the '--timing_analysis' flag */
49  if (Options->Count[OT_TIMING_ANALYSIS]) {
50  return Options->TimingAnalysis;
51  }
52  return TRUE;
53 }
Definition: util.h:12

+ Here is the caller graph for this function:

void ReadOptions ( INP int  argc,
INP char **  argv,
OUTP t_options Options 
)

Definition at line 239 of file ReadOptions.c.

239  {
240  char **Args, **head;
241  int offset;
242 
243  /* Clear values and pointers to zero */
244  memset(Options, 0, sizeof(t_options));
245 
246  /* Alloc a new pointer list for args with a NULL at end.
247  * This makes parsing the same as for archfile for consistency.
248  * Skips the first arg as it is the program image path */
249  --argc;
250  ++argv;
251  head = Args = (char **) my_malloc(sizeof(char *) * (argc + 1));
252  memcpy(Args, argv, (sizeof(char *) * argc));
253  Args[argc] = NULL;
254 
255  /* Go through the command line args. If they have hyphens they are
256  * options. Otherwise assume they are part of the four mandatory
257  * arguments */
258  while (*Args) {
259  if (strncmp("--", *Args, 2) == 0) {
260  *Args += 2; /* Skip the prefix */
261  Args = ProcessOption(Args, Options);
262  } else if (strncmp("-", *Args, 1) == 0) {
263  *Args += 1; /* Skip the prefix */
264  Args = ProcessOption(Args, Options);
265  } else if (NULL == Options->ArchFile) {
266  Options->ArchFile = my_strdup(*Args);
267  vpr_printf(TIO_MESSAGE_INFO, "Architecture file: %s\n", Options->ArchFile);
268  ++Args;
269  } else if (NULL == Options->CircuitName) {
270  Options->CircuitName = my_strdup(*Args);
271  /*if the user entered the circuit name with the .blif extension, remove it now*/
272  offset = strlen(Options->CircuitName) - 5;
273  if (offset > 0 && !strcmp(Options->CircuitName + offset, ".blif")) {
274  Options->CircuitName[offset] = '\0';
275  }
276  vpr_printf(TIO_MESSAGE_INFO, "Circuit name: %s.blif\n", Options->CircuitName);
277  vpr_printf(TIO_MESSAGE_INFO, "\n");
278  ++Args;
279  } else {
280  /* Not an option and arch and net already specified so fail */
281  Error(*Args);
282  }
283 
284  if (Options->Count[OT_SETTINGS_FILE] != Options->read_settings)
285  {
286  int tmp_argc = 0;
287  char **tmp_argv = NULL;
288  t_options SettingsFileOptions;
289 
290  tmp_argc = read_settings_file(Options->SettingsFile, &tmp_argv);
291 
292  ReadOptions(tmp_argc, tmp_argv, &SettingsFileOptions);
293 
294  MergeOptions(Options, &SettingsFileOptions, Options->Count[OT_SETTINGS_FILE]);
295 
296  Options->read_settings = Options->Count[OT_SETTINGS_FILE];
297 
298  /* clean up local data structures */
299  free(tmp_argv);
300  }
301  }
302  free(head);
303 }
int Count[OT_BASE_UNKNOWN]
Definition: ReadOptions.h:88
static void Error(INP const char *Token)
Definition: ReadOptions.c:749
static void MergeOptions(INOUTP t_options *dest, INP t_options *src, int id)
Definition: ReadOptions.c:488
void ReadOptions(INP int argc, INP char **argv, OUTP t_options *Options)
Definition: ReadOptions.c:239
static void * my_malloc(int ibytes)
Definition: graphics.c:499
static char ** ProcessOption(INP char **Args, INOUTP t_options *Options)
Definition: ReadOptions.c:306
int read_settings_file(char *file_name, char ***outv)
Definition: read_settings.c:53
char * my_strdup(const char *str)
Definition: util.c:101
messagelogger vpr_printf
Definition: util.c:17

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setAllEchoFileEnabled ( boolean  value)

Definition at line 97 of file ReadOptions.c.

97  {
98  int i;
99  for(i = 0; i < (int) E_ECHO_END_TOKEN; i++) {
100  echoFileEnabled[i] = value;
101  }
102 }
static boolean * echoFileEnabled
Definition: ReadOptions.c:16

+ Here is the caller graph for this function:

void setEchoEnabled ( boolean  echo_enabled)

Definition at line 71 of file ReadOptions.c.

71  {
72  /* enable echo outputs */
73  EchoEnabled = echo_enabled;
74  if(echoFileEnabled == NULL) {
75  /* initialize default echo options */
77  }
78 }
static boolean * echoFileEnabled
Definition: ReadOptions.c:16
static boolean EchoEnabled
Definition: ReadOptions.c:12
void alloc_and_load_echo_file_info()
Definition: ReadOptions.c:126

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setEchoFileEnabled ( enum e_echo_files  echo_option,
boolean  value 
)

Definition at line 104 of file ReadOptions.c.

104  {
105  echoFileEnabled[(int)echo_option] = value;
106 }
static boolean * echoFileEnabled
Definition: ReadOptions.c:16
void setEchoFileName ( enum e_echo_files  echo_option,
const char *  name 
)

Definition at line 108 of file ReadOptions.c.

108  {
109  if(echoFileNames[(int)echo_option] != NULL) {
110  free(echoFileNames[(int)echo_option]);
111  }
112  echoFileNames[(int)echo_option] = my_strdup(name);
113 }
static char ** echoFileNames
Definition: ReadOptions.c:17
char * my_strdup(const char *str)
Definition: util.c:101

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setOutputFileName ( enum e_output_files  ename,
const char *  name,
const char *  default_name 
)

Definition at line 186 of file ReadOptions.c.

186  {
187  if(outputFileNames == NULL) {
188  alloc_and_load_output_file_names(default_name);
189  }
190  if(outputFileNames[(int)ename] != NULL) {
191  free(outputFileNames[(int)ename]);
192  }
193  outputFileNames[(int)ename] = my_strdup(name);
194 }
static char ** outputFileNames
Definition: ReadOptions.c:19
char * my_strdup(const char *str)
Definition: util.c:101
void alloc_and_load_output_file_names(const char *default_name)
Definition: ReadOptions.c:200

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SetPostSynthesisOption ( boolean  post_synthesis_enabled)

Definition at line 84 of file ReadOptions.c.

84  {
85  Generate_PostSynthesis_Netlist = post_synthesis_enabled;
86 }
static boolean Generate_PostSynthesis_Netlist
Definition: ReadOptions.c:14

+ Here is the caller graph for this function: