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

Go to the source code of this file.

Functions

void vpr_init (INP int argc, INP char **argv, OUTP t_options *options, OUTP t_vpr_setup *vpr_setup, OUTP t_arch *arch)
 
void vpr_pack (INP t_vpr_setup vpr_setup, INP t_arch arch)
 
void vpr_init_pre_place_and_route (INP t_vpr_setup vpr_setup, INP t_arch Arch)
 
void vpr_place_and_route (INP t_vpr_setup vpr_setup, INP t_arch arch)
 
void vpr_power_estimation (t_vpr_setup vpr_setup, t_arch Arch)
 
void vpr_free_vpr_data_structures (INOUTP t_arch Arch, INOUTP t_options options, INOUTP t_vpr_setup vpr_setup)
 
void vpr_free_all (INOUTP t_arch Arch, INOUTP t_options options, INOUTP t_vpr_setup vpr_setup)
 
void vpr_print_title (void)
 
void vpr_print_usage (void)
 
void vpr_read_options (INP int argc, INP char **argv, OUTP t_options *options)
 
void vpr_setup_vpr (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, t_power_opts *PowerOpts)
 
void vpr_check_options (INP t_options Options, INP boolean TimingEnabled)
 
void vpr_check_arch (INP t_arch Arch, INP boolean TimingEnabled)
 
void vpr_check_setup (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 vpr_read_and_process_blif (INP char *blif_file, INP boolean sweep_hanging_nets_and_inputs, INP t_model *user_models, INP t_model *library_models, boolean read_activity_file, char *activity_file)
 
void vpr_show_setup (INP t_options options, INP t_vpr_setup vpr_setup)
 
void vpr_alloc_and_load_output_file_names (const char *default_name)
 
void vpr_set_output_file_name (enum e_output_files ename, const char *name, const char *default_name)
 
char * vpr_get_output_file_name (enum e_output_files ename)
 
t_tracevpr_resync_post_route_netlist_to_TI_CLAY_v1_architecture (INP const t_arch *arch)
 

Function Documentation

void vpr_alloc_and_load_output_file_names ( const char *  default_name)

Definition at line 852 of file vpr_api.c.

852  {
853  alloc_and_load_output_file_names(default_name);
854 }
void alloc_and_load_output_file_names(const char *default_name)
Definition: ReadOptions.c:200

+ Here is the call graph for this function:

void vpr_check_arch ( INP t_arch  Arch,
INP boolean  TimingEnabled 
)

Definition at line 825 of file vpr_api.c.

825  {
826  CheckArch(Arch, TimingEnabled);
827 }
void CheckArch(INP t_arch Arch, INP boolean TimingEnabled)
Definition: CheckArch.c:17

+ Here is the call graph for this function:

void vpr_check_options ( INP t_options  Options,
INP boolean  TimingEnabled 
)

Definition at line 822 of file vpr_api.c.

822  {
823  CheckOptions(Options, TimingEnabled);
824 }
void CheckOptions(INP t_options Options, INP boolean TimingEnabled)
Definition: CheckOptions.c:12

+ Here is the call graph for this function:

void vpr_check_setup ( 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 829 of file vpr_api.c.

834  {
835  CheckSetup(Operation, PlacerOpts, AnnealSched, RouterOpts, RoutingArch,
836  Segments, Timing, Chans);
837 }
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: CheckSetup.c:9

+ Here is the call graph for this function:

void vpr_free_all ( INOUTP t_arch  Arch,
INOUTP t_options  options,
INOUTP t_vpr_setup  vpr_setup 
)

Definition at line 781 of file vpr_api.c.

782  {
783  free_rr_graph();
784  if (vpr_setup.RouterOpts.doRouting) {
786  }
788  vpr_free_vpr_data_structures(Arch, options, vpr_setup);
790  PrintHandlerDelete();
791  }
792 }
void free_rr_graph(void)
Definition: rr_graph.c:798
void vpr_free_vpr_data_structures(INOUTP t_arch Arch, INOUTP t_options options, INOUTP t_vpr_setup vpr_setup)
Definition: vpr_api.c:764
void free_trace_structs(void)
Definition: route_common.c:733
Definition: util.h:12
static boolean has_printhandler_pre_vpr
Definition: vpr_api.c:53
void free_route_structs()
Definition: route_common.c:750

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vpr_free_vpr_data_structures ( INOUTP t_arch  Arch,
INOUTP t_options  options,
INOUTP t_vpr_setup  vpr_setup 
)

Definition at line 764 of file vpr_api.c.

765  {
766 
767  if (vpr_setup.Timing.SDCFile != NULL) {
768  free(vpr_setup.Timing.SDCFile);
769  vpr_setup.Timing.SDCFile = NULL;
770  }
771 
772  free_options(&options);
773  free_circuit();
774  free_arch(&Arch);
779 }
static void free_arch(t_arch *Arch)
Definition: vpr_api.c:452
static void free_circuit(void)
Definition: vpr_api.c:711
void free_output_file_names()
Definition: ReadOptions.c:221
void free_sdc_related_structs(void)
Definition: read_sdc.c:1280
void free_timing_stats(void)
Definition: path_delay.c:427
void free_echo_file_info()
Definition: ReadOptions.c:171
static void free_options(t_options *options)
Definition: vpr_api.c:554

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char* vpr_get_output_file_name ( enum e_output_files  ename)

Definition at line 859 of file vpr_api.c.

859  {
860  return getOutputFileName(ename);
861 }
char * getOutputFileName(enum e_output_files ename)
Definition: ReadOptions.c:196

+ Here is the call graph for this function:

void vpr_init ( INP int  argc,
INP char **  argv,
OUTP t_options options,
OUTP t_vpr_setup vpr_setup,
OUTP t_arch arch 
)

General API for VPR

VPR is a CAD tool used to conduct FPGA architecture exploration. It takes, as input, a technology-mapped netlist and a description of the FPGA architecture being investigated. VPR then generates a packed, placed, and routed FPGA (in .net, .place, and .route files respectively) that implements the input netlist

Software tools interfacing to VPR should generally call just the functions defined here For advanced/power users, you can call functions defined elsewhere in VPR or modify the data structures directly at your discretion but be aware that doing so can break the correctness of this tool

General Usage:

  1. vpr_init
  2. vpr_pack
  3. vpr_init_pre_place_and_route
  4. vpr_place_and_route
  5. vpr_free_all

If you are a new developer, key files to begin understanding this code base are:

  1. libarchfpga/physical_types.h - Data structures that define the properties of the FPGA architecture
  2. vpr_types.h - Very major file that defines the core data structures used in VPR. This includes detailed architecture information, user netlist data structures, and data structures that describe the mapping between those two.
  3. globals.h - Defines the global variables used by VPR.

Author: Jason Luu June 21, 2012

Definition at line 161 of file vpr_api.c.

162  {
163  char* pszLogFileName = "vpr_stdout.log";
164  unsigned char enableTimeStamps = 1;
165  unsigned long maxWarningCount = 100000;
166  unsigned long maxErrorCount = 1000;
167 
168  if (PrintHandlerExists() == 1) {
170  } else {
172  }
174  PrintHandlerNew(pszLogFileName);
175  PrintHandlerInit(enableTimeStamps, maxWarningCount, maxErrorCount);
176  }
177 
178  /* Print title message */
179  vpr_print_title();
180 
181  /* Print usage message if no args */
182  if (argc < 3) {
183  vpr_print_usage();
184  exit(1);
185  }
186 
187  memset(options, 0, sizeof(t_options));
188  memset(vpr_setup, 0, sizeof(t_vpr_setup));
189  memset(arch, 0, sizeof(t_arch));
190 
191  /* Read in user options */
192  ReadOptions(argc, argv, options);
193  /* Timing option priorities */
194  vpr_setup->TimingEnabled = IsTimingEnabled(options);
195  /* Determine whether echo is on or off */
196  setEchoEnabled(IsEchoEnabled(options));
198  vpr_setup->constant_net_delay = options->constant_net_delay;
199 
200  /* Read in arch and circuit */
201  SetupVPR(options, vpr_setup->TimingEnabled, TRUE, &vpr_setup->FileNameOpts,
202  arch, &vpr_setup->Operation, &vpr_setup->user_models,
203  &vpr_setup->library_models, &vpr_setup->PackerOpts,
204  &vpr_setup->PlacerOpts, &vpr_setup->AnnealSched,
205  &vpr_setup->RouterOpts, &vpr_setup->RoutingArch,
206  &vpr_setup->Segments, &vpr_setup->Timing, &vpr_setup->ShowGraphics,
207  &vpr_setup->GraphPause, &vpr_setup->PowerOpts);
208 
209  /* Check inputs are reasonable */
210  CheckOptions(*options, vpr_setup->TimingEnabled);
211  CheckArch(*arch, vpr_setup->TimingEnabled);
212 
213  /* Verify settings don't conflict or otherwise not make sense */
214  CheckSetup(vpr_setup->Operation, vpr_setup->PlacerOpts,
215  vpr_setup->AnnealSched, vpr_setup->RouterOpts,
216  vpr_setup->RoutingArch, vpr_setup->Segments, vpr_setup->Timing,
217  arch->Chans);
218 
219  /* flush any messages to user still in stdout that hasn't gotten displayed */
220  fflush(stdout);
221 
222  /* Read blif file and sweep unused components */
223  read_and_process_blif(vpr_setup->PackerOpts.blif_file_name,
224  vpr_setup->PackerOpts.sweep_hanging_nets_and_inputs,
225  vpr_setup->user_models, vpr_setup->library_models,
226  vpr_setup->PowerOpts.do_power, vpr_setup->FileNameOpts.ActFile);
227  fflush(stdout);
228 
229  ShowSetup(*options, *vpr_setup);
230 }
void setEchoEnabled(boolean echo_enabled)
Definition: ReadOptions.c:71
boolean IsPostSynthesisEnabled(INP t_options *Options)
Definition: ReadOptions.c:88
void vpr_print_usage(void)
Definition: vpr_api.c:82
boolean IsTimingEnabled(INP t_options *Options)
Definition: ReadOptions.c:47
boolean IsEchoEnabled(INP t_options *Options)
Definition: ReadOptions.c:58
void CheckOptions(INP t_options Options, INP boolean TimingEnabled)
Definition: CheckOptions.c:12
void ReadOptions(INP int argc, INP char **argv, OUTP t_options *Options)
Definition: ReadOptions.c:239
Definition: util.h:12
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, t_power_opts *PowerOpts)
Definition: SetupVPR.c:38
void CheckArch(INP t_arch Arch, INP boolean TimingEnabled)
Definition: CheckArch.c:17
void read_and_process_blif(char *blif_file, boolean sweep_hanging_nets_and_inputs, t_model *user_models, t_model *library_models, boolean read_activity_file, char *activity_file)
Definition: read_blif.c:1765
static boolean has_printhandler_pre_vpr
Definition: vpr_api.c:53
void vpr_print_title(void)
Definition: vpr_api.c:70
void ShowSetup(INP t_options options, INP t_vpr_setup vpr_setup)
Definition: ShowSetup.c:22
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: CheckSetup.c:9
void SetPostSynthesisOption(boolean post_synthesis_enabled)
Definition: ReadOptions.c:84
Definition: util.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vpr_init_pre_place_and_route ( INP t_vpr_setup  vpr_setup,
INP t_arch  Arch 
)

Definition at line 236 of file vpr_api.c.

236  {
237  int *num_instances_type, *num_blocks_type;
238  int i;
239  int current, high, low;
240  boolean fit;
241 
242  /* Read in netlist file for placement and routing */
243  if (vpr_setup.FileNameOpts.NetFile) {
244  read_netlist(vpr_setup.FileNameOpts.NetFile, &Arch, &num_blocks, &block,
245  &num_nets, &clb_net);
246  /* This is done so that all blocks have subblocks and can be treated the same */
247  check_netlist();
248  }
249 
250  /* Output the current settings to console. */
252 
253  if (vpr_setup.Operation == TIMING_ANALYSIS_ONLY) {
254  do_constant_net_delay_timing_analysis(vpr_setup.Timing,
255  vpr_setup.constant_net_delay);
256  } else {
257  current = nint((float)sqrt((float)num_blocks)); /* current is the value of the smaller side of the FPGA */
258  low = 1;
259  high = -1;
260 
261  num_instances_type = (int*) my_calloc(num_types, sizeof(int));
262  num_blocks_type = (int*) my_calloc(num_types, sizeof(int));
263 
264  for (i = 0; i < num_blocks; i++) {
265  num_blocks_type[block[i].type->index]++;
266  }
267 
268  if (Arch.clb_grid.IsAuto) {
269  /* Auto-size FPGA, perform a binary search */
270  while (high == -1 || low < high) {
271  /* Generate grid */
272  if (Arch.clb_grid.Aspect >= 1.0) {
273  ny = current;
274  nx = nint(current * Arch.clb_grid.Aspect);
275  } else {
276  nx = current;
277  ny = nint(current / Arch.clb_grid.Aspect);
278  }
279 #if DEBUG
280  vpr_printf(TIO_MESSAGE_INFO,
281  "Auto-sizing FPGA at x = %d y = %d\n", nx, ny);
282 #endif
283  alloc_and_load_grid(num_instances_type);
284  freeGrid();
285 
286  /* Test if netlist fits in grid */
287  fit = TRUE;
288  for (i = 0; i < num_types; i++) {
289  if (num_blocks_type[i] > num_instances_type[i]) {
290  fit = FALSE;
291  break;
292  }
293  }
294 
295  /* get next value */
296  if (!fit) {
297  /* increase size of max */
298  if (high == -1) {
299  current = current * 2;
300  if (current > MAX_SHORT) {
301  vpr_printf(TIO_MESSAGE_ERROR,
302  "FPGA required is too large for current architecture settings.\n");
303  exit(1);
304  }
305  } else {
306  if (low == current)
307  current++;
308  low = current;
309  current = low + ((high - low) / 2);
310  }
311  } else {
312  high = current;
313  current = low + ((high - low) / 2);
314  }
315  }
316  /* Generate grid */
317  if (Arch.clb_grid.Aspect >= 1.0) {
318  ny = current;
319  nx = nint(current * Arch.clb_grid.Aspect);
320  } else {
321  nx = current;
322  ny = nint(current / Arch.clb_grid.Aspect);
323  }
324  alloc_and_load_grid(num_instances_type);
325  vpr_printf(TIO_MESSAGE_INFO, "FPGA auto-sized to x = %d y = %d\n",
326  nx, ny);
327  } else {
328  nx = Arch.clb_grid.W;
329  ny = Arch.clb_grid.H;
330  alloc_and_load_grid(num_instances_type);
331  }
332 
333  vpr_printf(TIO_MESSAGE_INFO,
334  "The circuit will be mapped into a %d x %d array of clbs.\n",
335  nx, ny);
336 
337  /* Test if netlist fits in grid */
338  fit = TRUE;
339  for (i = 0; i < num_types; i++) {
340  if (num_blocks_type[i] > num_instances_type[i]) {
341  fit = FALSE;
342  break;
343  }
344  }
345  if (!fit) {
346  vpr_printf(TIO_MESSAGE_ERROR,
347  "Not enough physical locations for type %s, number of blocks is %d but number of locations is %d.\n",
348  type_descriptors[i].name, num_blocks_type[i],
349  num_instances_type[i]);
350  exit(1);
351  }
352 
353  vpr_printf(TIO_MESSAGE_INFO, "\n");
354  vpr_printf(TIO_MESSAGE_INFO, "Resource usage...\n");
355  for (i = 0; i < num_types; i++) {
356  vpr_printf(TIO_MESSAGE_INFO,
357  "\tNetlist %d\tblocks of type: %s\n",
358  num_blocks_type[i], type_descriptors[i].name);
359  vpr_printf(TIO_MESSAGE_INFO,
360  "\tArchitecture %d\tblocks of type: %s\n",
361  num_instances_type[i], type_descriptors[i].name);
362  }
363  vpr_printf(TIO_MESSAGE_INFO, "\n");
364  chan_width_x = (int *) my_malloc((ny + 1) * sizeof(int));
365  chan_width_y = (int *) my_malloc((nx + 1) * sizeof(int));
366 
367  free(num_blocks_type);
368  free(num_instances_type);
369  }
370 }
void printClusteredNetlistStats(void)
Definition: ShowSetup.c:50
void freeGrid()
Definition: SetupGrid.c:130
#define nint(a)
Definition: util.h:24
int * chan_width_x
Definition: globals.c:56
void check_netlist()
Definition: check_netlist.c:37
void * my_calloc(size_t nelem, size_t size)
Definition: util.c:132
int num_nets
Definition: globals.c:27
int * chan_width_y
Definition: globals.c:57
t_type_ptr type
Definition: vpr_types.h:561
#define MAX_SHORT
Definition: vpr_types.h:75
int num_blocks
Definition: globals.c:30
Definition: util.h:12
void alloc_and_load_grid(INOUTP int *num_instances_type)
Definition: SetupGrid.c:22
static void * my_malloc(int ibytes)
Definition: graphics.c:499
void do_constant_net_delay_timing_analysis(t_timing_inf timing_inf, float constant_net_delay_value)
Definition: path_delay.c:2636
struct s_block * block
Definition: globals.c:31
struct s_net * clb_net
Definition: globals.c:28
int nx
Definition: globals.c:46
int num_types
Definition: globals.c:37
void read_netlist(INP const char *net_file, INP const t_arch *arch, OUTP int *L_num_blocks, OUTP struct s_block *block_list[], OUTP int *L_num_nets, OUTP struct s_net *net_list[])
Definition: read_netlist.c:72
struct s_type_descriptor * type_descriptors
Definition: globals.c:38
int ny
Definition: globals.c:47
messagelogger vpr_printf
Definition: util.c:17
Definition: util.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vpr_pack ( INP t_vpr_setup  vpr_setup,
INP t_arch  arch 
)

Definition at line 372 of file vpr_api.c.

372  {
373  clock_t begin, end;
374  float inter_cluster_delay = UNDEFINED, Tdel_opin_switch, Tdel_wire_switch,
375  Tdel_wtoi_switch, R_opin_switch, R_wire_switch, R_wtoi_switch,
376  Cout_opin_switch, Cout_wire_switch, Cout_wtoi_switch,
377  opin_switch_del, wire_switch_del, wtoi_switch_del, Rmetal, Cmetal,
378  first_wire_seg_delay, second_wire_seg_delay;
379  begin = clock();
380  vpr_printf(TIO_MESSAGE_INFO, "Initialize packing.\n");
381 
382  /* If needed, estimate inter-cluster delay. Assume the average routing hop goes out of
383  a block through an opin switch to a length-4 wire, then through a wire switch to another
384  length-4 wire, then through a wire-to-ipin-switch into another block. */
385 
386  if (vpr_setup.PackerOpts.timing_driven
387  && vpr_setup.PackerOpts.auto_compute_inter_cluster_net_delay) {
388  opin_switch_del = get_switch_info(arch.Segments[0].opin_switch,
389  Tdel_opin_switch, R_opin_switch, Cout_opin_switch);
390  wire_switch_del = get_switch_info(arch.Segments[0].wire_switch,
391  Tdel_wire_switch, R_wire_switch, Cout_wire_switch);
392  wtoi_switch_del = get_switch_info(
393  vpr_setup.RoutingArch.wire_to_ipin_switch, Tdel_wtoi_switch,
394  R_wtoi_switch, Cout_wtoi_switch); /* wire-to-ipin switch */
395  Rmetal = arch.Segments[0].Rmetal;
396  Cmetal = arch.Segments[0].Cmetal;
397 
398  /* The delay of a wire with its driving switch is the switch delay plus the
399  product of the equivalent resistance and capacitance experienced by the wire. */
400 
401 #define WIRE_SEGMENT_LENGTH 4
402  first_wire_seg_delay = opin_switch_del
403  + (R_opin_switch + Rmetal * WIRE_SEGMENT_LENGTH / 2)
404  * (Cout_opin_switch + Cmetal * WIRE_SEGMENT_LENGTH);
405  second_wire_seg_delay = wire_switch_del
406  + (R_wire_switch + Rmetal * WIRE_SEGMENT_LENGTH / 2)
407  * (Cout_wire_switch + Cmetal * WIRE_SEGMENT_LENGTH);
408  inter_cluster_delay = 4
409  * (first_wire_seg_delay + second_wire_seg_delay
410  + wtoi_switch_del); /* multiply by 4 to get a more conservative estimate */
411  }
412 
413  try_pack(&vpr_setup.PackerOpts, &arch, vpr_setup.user_models,
414  vpr_setup.library_models, vpr_setup.Timing, inter_cluster_delay);
415  end = clock();
416 #ifdef CLOCKS_PER_SEC
417  vpr_printf(TIO_MESSAGE_INFO, "Packing took %g seconds.\n",
418  (float) (end - begin) / CLOCKS_PER_SEC);
419  vpr_printf(TIO_MESSAGE_INFO, "Packing completed.\n");
420 #else
421  vpr_printf(TIO_MESSAGE_INFO, "Packing took %g seconds.\n", (float)(end - begin) / CLK_PER_SEC);
422 #endif
423  fflush(stdout);
424 }
#define WIRE_SEGMENT_LENGTH
float get_switch_info(short switch_index, float &Tdel_switch, float &R_switch, float &Cout_switch)
Definition: pack.c:107
#define UNDEFINED
Definition: vpr_types.h:103
messagelogger vpr_printf
Definition: util.c:17
void try_pack(INP struct s_packer_opts *packer_opts, INP const t_arch *arch, INP t_model *user_models, INP t_model *library_models, t_timing_inf timing_inf, float interc_delay)
Definition: pack.c:20

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vpr_place_and_route ( INP t_vpr_setup  vpr_setup,
INP t_arch  arch 
)

Definition at line 426 of file vpr_api.c.

426  {
427  /* Startup X graphics */
428  set_graphics_state(vpr_setup.ShowGraphics, vpr_setup.GraphPause,
429  vpr_setup.RouterOpts.route_type);
430  if (vpr_setup.ShowGraphics) {
431  init_graphics("VPR: Versatile Place and Route for FPGAs", WHITE);
433  }
434 
435  /* Do placement and routing */
436  place_and_route(vpr_setup.Operation, vpr_setup.PlacerOpts,
437  vpr_setup.FileNameOpts.PlaceFile, vpr_setup.FileNameOpts.NetFile,
438  vpr_setup.FileNameOpts.ArchFile, vpr_setup.FileNameOpts.RouteFile,
439  vpr_setup.AnnealSched, vpr_setup.RouterOpts, vpr_setup.RoutingArch,
440  vpr_setup.Segments, vpr_setup.Timing, arch.Chans, arch.models,
441  arch.Directs, arch.num_directs);
442 
443  fflush(stdout);
444 
445  /* Close down X Display */
446  if (vpr_setup.ShowGraphics)
447  close_graphics();
449 }
void close_graphics(void)
Definition: graphics.c:2417
void init_graphics(const char *window_name, int cindex)
Definition: graphics.c:1003
void free_draw_structs(void)
Definition: draw.c:400
void set_graphics_state(boolean show_graphics_val, int gr_automode_val, enum e_route_type route_type)
Definition: draw.c:144
void alloc_draw_structs(void)
Definition: draw.c:376
void place_and_route(enum e_operation operation, struct s_placer_opts placer_opts, char *place_file, char *net_file, char *arch_file, char *route_file, struct s_annealing_sched annealing_sched, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf, t_chan_width_dist chan_width_dist, struct s_model *models, t_direct_inf *directs, int num_directs)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vpr_power_estimation ( t_vpr_setup  vpr_setup,
t_arch  Arch 
)

Definition at line 1424 of file vpr_api.c.

1424  {
1425  e_power_ret_code power_ret_code;
1426  boolean power_error;
1427 
1428  /* Ensure we are only using 1 clock */
1429  assert(count_netlist_clocks() == 1);
1430 
1431  /* Get the critical path of this clock */
1433  assert(g_solution_inf.T_crit > 0.);
1434 
1435  vpr_printf(TIO_MESSAGE_INFO, "\n\nPower Estimation:\n");
1436  vpr_printf(TIO_MESSAGE_INFO, "-----------------\n");
1437 
1438  vpr_printf(TIO_MESSAGE_INFO, "Initializing power module\n");
1439 
1440  /* Initialize the power module */
1441  power_error = power_init(vpr_setup.FileNameOpts.PowerFile,
1442  vpr_setup.FileNameOpts.CmosTechFile, &Arch, &vpr_setup.RoutingArch);
1443  if (power_error) {
1444  vpr_printf(TIO_MESSAGE_ERROR, "Power initialization failed.\n");
1445  }
1446 
1447  if (!power_error) {
1448  float power_runtime_s;
1449 
1450  vpr_printf(TIO_MESSAGE_INFO, "Running power estimation\n");
1451 
1452  /* Run power estimation */
1453  power_ret_code = power_total(&power_runtime_s, vpr_setup, &Arch,
1454  &vpr_setup.RoutingArch);
1455 
1456  /* Check for errors/warnings */
1457  if (power_ret_code == POWER_RET_CODE_ERRORS) {
1458  vpr_printf(TIO_MESSAGE_ERROR,
1459  "Power estimation failed. See power output for error details.\n");
1460  } else if (power_ret_code == POWER_RET_CODE_WARNINGS) {
1461  vpr_printf(TIO_MESSAGE_WARNING,
1462  "Power estimation completed with warnings. See power output for more details.\n");
1463  } else if (power_ret_code == POWER_RET_CODE_SUCCESS) {
1464  }
1465  vpr_printf(TIO_MESSAGE_INFO, "Power estimation took %g seconds\n",
1466  power_runtime_s);
1467  }
1468 
1469  /* Uninitialize power module */
1470  if (!power_error) {
1471  vpr_printf(TIO_MESSAGE_INFO, "Uninitializing power module\n");
1472  power_error = power_uninit();
1473  if (power_error) {
1474  vpr_printf(TIO_MESSAGE_ERROR, "Power uninitialization failed.\n");
1475  } else {
1476 
1477  }
1478  }
1479  vpr_printf(TIO_MESSAGE_INFO, "\n");
1480 }
char * CmosTechFile
Definition: vpr_types.h:584
float get_critical_path_delay(void)
Definition: path_delay.c:3060
boolean power_init(char *power_out_filepath, char *cmos_tech_behavior_filepath, t_arch *arch, t_det_routing_arch *routing_arch)
Definition: power.c:1270
struct s_file_name_opts FileNameOpts
Definition: vpr_types.h:1034
int count_netlist_clocks(void)
Definition: stats.c:449
boolean power_uninit(void)
Definition: power.c:1326
t_solution_inf g_solution_inf
Definition: power.c:64
float T_crit
Definition: power.h:83
char * PowerFile
Definition: vpr_types.h:583
struct s_det_routing_arch RoutingArch
Definition: vpr_types.h:1042
e_power_ret_code
Definition: power.h:42
messagelogger vpr_printf
Definition: util.c:17
e_power_ret_code power_total(float *run_time_s, t_vpr_setup vpr_setup, t_arch *arch, t_det_routing_arch *routing_arch)
Definition: power.c:1695

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vpr_print_title ( void  )

Definition at line 70 of file vpr_api.c.

70  {
71  vpr_printf(TIO_MESSAGE_INFO, "\n");
72  vpr_printf(TIO_MESSAGE_INFO, "VPR FPGA Placement and Routing.\n");
73  vpr_printf(TIO_MESSAGE_INFO, "Version: Version " VPR_VERSION "\n");
74  vpr_printf(TIO_MESSAGE_INFO, "Compiled: " __DATE__ ".\n");
75  vpr_printf(TIO_MESSAGE_INFO, "University of Toronto\n");
76  vpr_printf(TIO_MESSAGE_INFO, "vpr@eecg.utoronto.ca\n");
77  vpr_printf(TIO_MESSAGE_INFO, "This is free open source code under MIT license.\n");
78  vpr_printf(TIO_MESSAGE_INFO, "\n");
79 }
#define VPR_VERSION
Definition: arch_types.h:16
messagelogger vpr_printf
Definition: util.c:17

+ Here is the caller graph for this function:

void vpr_print_usage ( void  )

Definition at line 82 of file vpr_api.c.

82  {
83  vpr_printf(TIO_MESSAGE_INFO,
84  "Usage: vpr fpga_architecture.xml circuit_name [Options ...]\n");
85  vpr_printf(TIO_MESSAGE_INFO, "\n");
86  vpr_printf(TIO_MESSAGE_INFO,
87  "General Options: [--nodisp] [--auto <int>] [--pack]\n");
88  vpr_printf(TIO_MESSAGE_INFO,
89  "\t[--place] [--route] [--timing_analyze_only_with_net_delay <float>]\n");
90  vpr_printf(TIO_MESSAGE_INFO,
91  "\t[--fast] [--full_stats] [--timing_analysis on | off] [--outfile_prefix <string>]\n");
92  vpr_printf(TIO_MESSAGE_INFO,
93  "\t[--blif_file <string>][--net_file <string>][--place_file <string>]\n");
94  vpr_printf(TIO_MESSAGE_INFO,
95  "\t[--route_file <string>][--sdc_file <string>][--echo_file on | off]\n");
96  vpr_printf(TIO_MESSAGE_INFO, "\n");
97  vpr_printf(TIO_MESSAGE_INFO, "Packer Options:\n");
98  /* vpr_printf(TIO_MESSAGE_INFO, "\t[-global_clocks on|off]\n");
99  vpr_printf(TIO_MESSAGE_INFO, "\t[-hill_climbing on|off]\n");
100  vpr_printf(TIO_MESSAGE_INFO, "\t[-sweep_hanging_nets_and_inputs on|off]\n"); */
101  vpr_printf(TIO_MESSAGE_INFO, "\t[--timing_driven_clustering on|off]\n");
102  vpr_printf(TIO_MESSAGE_INFO,
103  "\t[--cluster_seed_type timing|max_inputs] [--alpha_clustering <float>] [--beta_clustering <float>]\n");
104  /* vpr_printf(TIO_MESSAGE_INFO, "\t[-recompute_timing_after <int>] [-cluster_block_delay <float>]\n"); */
105  vpr_printf(TIO_MESSAGE_INFO, "\t[--allow_unrelated_clustering on|off]\n");
106  /* vpr_printf(TIO_MESSAGE_INFO, "\t[-allow_early_exit on|off]\n");
107  vpr_printf(TIO_MESSAGE_INFO, "\t[-intra_cluster_net_delay <float>] \n");
108  vpr_printf(TIO_MESSAGE_INFO, "\t[-inter_cluster_net_delay <float>] \n"); */
109  vpr_printf(TIO_MESSAGE_INFO,
110  "\t[--connection_driven_clustering on|off] \n");
111  vpr_printf(TIO_MESSAGE_INFO, "\n");
112  vpr_printf(TIO_MESSAGE_INFO, "Placer Options:\n");
113  vpr_printf(TIO_MESSAGE_INFO,
114  "\t[--place_algorithm bounding_box | net_timing_driven | path_timing_driven]\n");
115  vpr_printf(TIO_MESSAGE_INFO, "\t[--init_t <float>] [--exit_t <float>]\n");
116  vpr_printf(TIO_MESSAGE_INFO,
117  "\t[--alpha_t <float>] [--inner_num <float>] [--seed <int>]\n");
118  vpr_printf(TIO_MESSAGE_INFO, "\t[--place_cost_exp <float>]\n");
119  vpr_printf(TIO_MESSAGE_INFO, "\t[--place_chan_width <int>] \n");
120  vpr_printf(TIO_MESSAGE_INFO, "\t[--fix_pins random | <file.pads>]\n");
121  vpr_printf(TIO_MESSAGE_INFO, "\t[--enable_timing_computations on | off]\n");
122  vpr_printf(TIO_MESSAGE_INFO, "\t[--block_dist <int>]\n");
123  vpr_printf(TIO_MESSAGE_INFO, "\n");
124  vpr_printf(TIO_MESSAGE_INFO,
125  "Placement Options Valid Only for Timing-Driven Placement:\n");
126  vpr_printf(TIO_MESSAGE_INFO, "\t[--timing_tradeoff <float>]\n");
127  vpr_printf(TIO_MESSAGE_INFO, "\t[--recompute_crit_iter <int>]\n");
128  vpr_printf(TIO_MESSAGE_INFO, "\t[--inner_loop_recompute_divider <int>]\n");
129  vpr_printf(TIO_MESSAGE_INFO, "\t[--td_place_exp_first <float>]\n");
130  vpr_printf(TIO_MESSAGE_INFO, "\t[--td_place_exp_last <float>]\n");
131  vpr_printf(TIO_MESSAGE_INFO, "\n");
132  vpr_printf(TIO_MESSAGE_INFO,
133  "Router Options: [-max_router_iterations <int>] [-bb_factor <int>]\n");
134  vpr_printf(TIO_MESSAGE_INFO,
135  "\t[--initial_pres_fac <float>] [--pres_fac_mult <float>]\n");
136  vpr_printf(TIO_MESSAGE_INFO,
137  "\t[--acc_fac <float>] [--first_iter_pres_fac <float>]\n");
138  vpr_printf(TIO_MESSAGE_INFO,
139  "\t[--bend_cost <float>] [--route_type global | detailed]\n");
140  vpr_printf(TIO_MESSAGE_INFO,
141  "\t[--verify_binary_search] [--route_chan_width <int>]\n");
142  vpr_printf(TIO_MESSAGE_INFO,
143  "\t[--router_algorithm breadth_first | timing_driven]\n");
144  vpr_printf(TIO_MESSAGE_INFO,
145  "\t[--base_cost_type intrinsic_delay | delay_normalized | demand_only]\n");
146  vpr_printf(TIO_MESSAGE_INFO, "\n");
147  vpr_printf(TIO_MESSAGE_INFO,
148  "Routing options valid only for timing-driven routing:\n");
149  vpr_printf(TIO_MESSAGE_INFO,
150  "\t[--astar_fac <float>] [--max_criticality <float>]\n");
151  vpr_printf(TIO_MESSAGE_INFO, "\t[--criticality_exp <float>]\n");
152  vpr_printf(TIO_MESSAGE_INFO, "\n");
153 }
messagelogger vpr_printf
Definition: util.c:17

+ Here is the caller graph for this function:

void vpr_read_and_process_blif ( INP char *  blif_file,
INP boolean  sweep_hanging_nets_and_inputs,
INP t_model user_models,
INP t_model library_models,
boolean  read_activity_file,
char *  activity_file 
)

Definition at line 839 of file vpr_api.c.

842  {
843  read_and_process_blif(blif_file, sweep_hanging_nets_and_inputs, user_models,
844  library_models, read_activity_file, activity_file);
845 }
void read_and_process_blif(char *blif_file, boolean sweep_hanging_nets_and_inputs, t_model *user_models, t_model *library_models, boolean read_activity_file, char *activity_file)
Definition: read_blif.c:1765

+ Here is the call graph for this function:

void vpr_read_options ( INP int  argc,
INP char **  argv,
OUTP t_options options 
)

Definition at line 799 of file vpr_api.c.

799  {
800  ReadOptions(argc, argv, options);
801 }
void ReadOptions(INP int argc, INP char **argv, OUTP t_options *Options)
Definition: ReadOptions.c:239

+ Here is the call graph for this function:

t_trace* vpr_resync_post_route_netlist_to_TI_CLAY_v1_architecture ( INP const t_arch arch)

Definition at line 865 of file vpr_api.c.

866  {
867  t_trace *trace;
868 
869  /* Map post-routed traces to clb_nets and block */
871 
872  /* Resolve logically equivalent inputs */
874 
875  /* Finalize traceback */
880  }
881  return trace;
882 }
static t_trace * alloc_and_load_final_routing_trace()
Definition: vpr_api.c:910
boolean getEchoEnabled(void)
Definition: ReadOptions.c:67
static void clay_logical_equivalence_handling(const t_arch *arch)
Definition: vpr_api.c:1180
static void resync_post_route_netlist()
Definition: vpr_api.c:1138
boolean isEchoFileEnabled(enum e_echo_files echo_option)
Definition: ReadOptions.c:115
static void print_complete_net_trace(t_trace *trace, const char *file_name)
Definition: vpr_api.c:1045
char * getEchoFileName(enum e_echo_files echo_option)
Definition: ReadOptions.c:122

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 855 of file vpr_api.c.

856  {
857  setOutputFileName(ename, name, default_name);
858 }
void setOutputFileName(enum e_output_files ename, const char *name, const char *default_name)
Definition: ReadOptions.c:186

+ Here is the call graph for this function:

void vpr_setup_vpr ( 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,
t_power_opts PowerOpts 
)

Definition at line 804 of file vpr_api.c.

815  {
816  SetupVPR(Options, TimingEnabled, readArchFile, FileNameOpts, Arch,
817  Operation, user_models, library_models, PackerOpts, PlacerOpts,
818  AnnealSched, RouterOpts, RoutingArch, Segments, Timing,
819  ShowGraphics, GraphPause, PowerOpts);
820 }
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, t_power_opts *PowerOpts)
Definition: SetupVPR.c:38

+ Here is the call graph for this function:

void vpr_show_setup ( INP t_options  options,
INP t_vpr_setup  vpr_setup 
)

Definition at line 847 of file vpr_api.c.

847  {
848  ShowSetup(options, vpr_setup);
849 }
void ShowSetup(INP t_options options, INP t_vpr_setup vpr_setup)
Definition: ShowSetup.c:22

+ Here is the call graph for this function: