VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
vpr/SRC/main.c
Go to the documentation of this file.
1 /**
2  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.
3  VPR then generates a packed, placed, and routed FPGA (in .net, .place, and .route files respectively) that implements the input netlist.
4 
5  This file is where VPR starts execution.
6 
7  Key files in VPR:
8  1. libarchfpga/physical_types.h - Data structures that define the properties of the FPGA architecture
9  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.
10  3. globals.h - Defines the global variables used by VPR.
11  */
12 
13 
14 #include <stdio.h>
15 #include <string.h>
16 #include <assert.h>
17 #include <time.h>
18 
19 #include "vpr_api.h"
20 
21 /**
22  * VPR program
23  * Generate FPGA architecture given architecture description
24  * Pack, place, and route circuit into FPGA architecture
25  * Electrical timing analysis on results
26  *
27  * Overall steps
28  * 1. Initialization
29  * 2. Pack
30  * 3. Place-and-route and timing analysis
31  * 4. Clean up
32  */
33 int main(int argc, char **argv) {
34  t_options Options;
35  t_arch Arch;
36  t_vpr_setup vpr_setup;
37  clock_t entire_flow_begin,entire_flow_end;
38 
39  entire_flow_begin = clock();
40 
41  /* Read options, architecture, and circuit netlist */
42  vpr_init(argc, argv, &Options, &vpr_setup, &Arch);
43 
44  /* If the user requests packing, do packing */
45  if (vpr_setup.PackerOpts.doPacking) {
46  vpr_pack(vpr_setup, Arch);
47  }
48 
49  if (vpr_setup.PlacerOpts.doPlacement || vpr_setup.RouterOpts.doRouting) {
50  vpr_init_pre_place_and_route(vpr_setup, Arch);
51  vpr_place_and_route(vpr_setup, Arch);
52 #if 0
53  if(vpr_setup.RouterOpts.doRouting) {
55  }
56 #endif
57  }
58 
59  if (vpr_setup.PowerOpts.do_power) {
60  vpr_power_estimation(vpr_setup, Arch);
61  }
62 
63  entire_flow_end = clock();
64 
65  #ifdef CLOCKS_PER_SEC
66  vpr_printf(TIO_MESSAGE_INFO, "The entire flow of VPR took %g seconds.\n", (float)(entire_flow_end - entire_flow_begin) / CLOCKS_PER_SEC);
67  #else
68  vpr_printf(TIO_MESSAGE_INFO, "The entire flow of VPR took %g seconds.\n", (float)(entire_flow_end - entire_flow_begin) / CLK_PER_SEC);
69  #endif
70 
71  /* free data structures */
72  vpr_free_all(Arch, Options, vpr_setup);
73 
74  /* Return 0 to single success to scripts */
75  return 0;
76 }
77 
78 
79 
80 
boolean doRouting
Definition: vpr_types.h:712
int main(int argc, char **argv)
Definition: vpr/SRC/main.c:33
boolean doPacking
Definition: vpr_types.h:614
t_power_opts PowerOpts
Definition: vpr_types.h:1048
void vpr_init_pre_place_and_route(INP t_vpr_setup vpr_setup, INP t_arch Arch)
Definition: vpr_api.c:236
boolean do_power
Definition: vpr_types.h:1022
void vpr_pack(INP t_vpr_setup vpr_setup, INP t_arch arch)
Definition: vpr_api.c:372
void vpr_free_all(INOUTP t_arch Arch, INOUTP t_options options, INOUTP t_vpr_setup vpr_setup)
Definition: vpr_api.c:781
t_trace * vpr_resync_post_route_netlist_to_TI_CLAY_v1_architecture(INP const t_arch *arch)
Definition: vpr_api.c:865
struct s_placer_opts PlacerOpts
Definition: vpr_types.h:1039
void vpr_power_estimation(t_vpr_setup vpr_setup, t_arch Arch)
Definition: vpr_api.c:1424
struct s_packer_opts PackerOpts
Definition: vpr_types.h:1038
struct s_router_opts RouterOpts
Definition: vpr_types.h:1041
messagelogger vpr_printf
Definition: util.c:17
void vpr_init(INP int argc, INP char **argv, OUTP t_options *options, OUTP t_vpr_setup *vpr_setup, OUTP t_arch *arch)
Definition: vpr_api.c:161
boolean doPlacement
Definition: vpr_types.h:651
void vpr_place_and_route(INP t_vpr_setup vpr_setup, INP t_arch arch)
Definition: vpr_api.c:426