VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
vpr_api.h
Go to the documentation of this file.
1 /**
2  General API for VPR
3 
4  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.
5  VPR then generates a packed, placed, and routed FPGA (in .net, .place, and .route files respectively) that implements the input netlist
6 
7  Software tools interfacing to VPR should generally call just the functions defined here
8  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
9 
10  General Usage:
11  1. vpr_init
12  2. vpr_pack
13  3. vpr_init_pre_place_and_route
14  4. vpr_place_and_route
15  5. vpr_free_all
16 
17  If you are a new developer, key files to begin understanding this code base are:
18  1. libarchfpga/physical_types.h - Data structures that define the properties of the FPGA architecture
19  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.
20  3. globals.h - Defines the global variables used by VPR.
21 
22  Author: Jason Luu
23  June 21, 2012
24  */
25 
26 #ifndef VPR_API_H
27 #define VPR_API_H
28 
29 #include "physical_types.h"
30 #include "vpr_types.h"
31 #include "ReadOptions.h"
32 #include "OptionTokens.h"
33 #include "globals.h"
34 #include "util.h"
35 #include "read_xml_arch_file.h"
36 #include "vpr_utils.h"
37 
38 /* Main VPR Operations */
39 void vpr_init(INP int argc, INP char **argv, OUTP t_options *options,
40  OUTP t_vpr_setup *vpr_setup, OUTP t_arch *arch);
41 void vpr_pack(INP t_vpr_setup vpr_setup, INP t_arch arch);
43 void vpr_place_and_route(INP t_vpr_setup vpr_setup, INP t_arch arch);
44 void vpr_power_estimation(t_vpr_setup vpr_setup, t_arch Arch);
46  INOUTP t_vpr_setup vpr_setup);
47 void vpr_free_all(INOUTP t_arch Arch, INOUTP t_options options,
48  INOUTP t_vpr_setup vpr_setup);
49 
50 /* Display general info to user */
51 void vpr_print_title(void);
52 void vpr_print_usage(void);
53 
54 /****************************************************************************************************
55  * Advanced functions
56  * Used when you need fine-grained control over VPR that the main VPR operations do not enable
57  ****************************************************************************************************/
58 /* Read in user options */
59 void vpr_read_options(INP int argc, INP char **argv, OUTP t_options * options);
60 /* Read in arch and circuit */
61 void vpr_setup_vpr(INP t_options *Options, INP boolean TimingEnabled,
62  INP boolean readArchFile, OUTP struct s_file_name_opts *FileNameOpts,
63  INOUTP t_arch * Arch, OUTP enum e_operation *Operation,
64  OUTP t_model ** user_models, OUTP t_model ** library_models,
65  OUTP struct s_packer_opts *PackerOpts,
66  OUTP struct s_placer_opts *PlacerOpts,
67  OUTP struct s_annealing_sched *AnnealSched,
68  OUTP struct s_router_opts *RouterOpts,
69  OUTP struct s_det_routing_arch *RoutingArch,
70  OUTP t_segment_inf ** Segments, OUTP t_timing_inf * Timing,
71  OUTP boolean * ShowGraphics, OUTP int *GraphPause,
72  t_power_opts * PowerOpts);
73 /* Check inputs are reasonable */
74 void vpr_check_options(INP t_options Options, INP boolean TimingEnabled);
75 void vpr_check_arch(INP t_arch Arch, INP boolean TimingEnabled);
76 /* Verify settings don't conflict or otherwise not make sense */
77 void vpr_check_setup(INP enum e_operation Operation,
78  INP struct s_placer_opts PlacerOpts,
79  INP struct s_annealing_sched AnnealSched,
80  INP struct s_router_opts RouterOpts,
81  INP struct s_det_routing_arch RoutingArch, INP t_segment_inf * Segments,
82  INP t_timing_inf Timing, INP t_chan_width_dist Chans);
83 /* Read blif file and sweep unused components */
84 void vpr_read_and_process_blif(INP char *blif_file,
85  INP boolean sweep_hanging_nets_and_inputs, INP t_model *user_models,
86  INP t_model *library_models, boolean read_activity_file,
87  char * activity_file);
88 /* Show current setup */
89 void vpr_show_setup(INP t_options options, INP t_vpr_setup vpr_setup);
90 
91 /* Output file names management */
92 void vpr_alloc_and_load_output_file_names(const char* default_name);
93 void vpr_set_output_file_name(enum e_output_files ename, const char *name,
94  const char* default_name);
96 
97 /* resync netlists */
99  INP const t_arch *arch);
100 
101 #endif
void vpr_check_arch(INP t_arch Arch, INP boolean TimingEnabled)
Definition: vpr_api.c:825
char * vpr_get_output_file_name(enum e_output_files ename)
Definition: vpr_api.c:859
void vpr_print_usage(void)
Definition: vpr_api.c:82
void vpr_free_all(INOUTP t_arch Arch, INOUTP t_options options, INOUTP t_vpr_setup vpr_setup)
Definition: vpr_api.c:781
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
#define INOUTP
Definition: util.h:21
void vpr_print_title(void)
Definition: vpr_api.c:70
t_trace * vpr_resync_post_route_netlist_to_TI_CLAY_v1_architecture(INP const t_arch *arch)
Definition: vpr_api.c:865
void vpr_init_pre_place_and_route(INP t_vpr_setup vpr_setup, INP t_arch Arch)
Definition: vpr_api.c:236
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: vpr_api.c:829
e_operation
Definition: vpr_types.h:468
#define INP
Definition: util.h:19
void vpr_alloc_and_load_output_file_names(const char *default_name)
Definition: vpr_api.c:852
void vpr_pack(INP t_vpr_setup vpr_setup, INP t_arch arch)
Definition: vpr_api.c:372
e_output_files
Definition: ReadOptions.h:137
void vpr_show_setup(INP t_options options, INP t_vpr_setup vpr_setup)
Definition: vpr_api.c:847
#define OUTP
Definition: util.h:20
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: vpr_api.c:804
void vpr_power_estimation(t_vpr_setup vpr_setup, t_arch Arch)
Definition: vpr_api.c:1424
void vpr_set_output_file_name(enum e_output_files ename, const char *name, const char *default_name)
Definition: vpr_api.c:855
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: vpr_api.c:839
void vpr_read_options(INP int argc, INP char **argv, OUTP t_options *options)
Definition: vpr_api.c:799
void vpr_place_and_route(INP t_vpr_setup vpr_setup, INP t_arch arch)
Definition: vpr_api.c:426
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
void vpr_check_options(INP t_options Options, INP boolean TimingEnabled)
Definition: vpr_api.c:822