Verilog to Routing - VPR
Functions
vpr_api.h File Reference

General API for VPR. More...

#include <vector>
#include "physical_types.h"
#include "vpr_types.h"
#include "read_options.h"
#include "globals.h"
#include "read_xml_arch_file.h"
#include "vpr_utils.h"
#include "place_macro.h"
#include "timing_info_fwd.h"
#include "echo_files.h"
#include "RoutingDelayCalculator.h"
#include "vpr_error.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 (const int argc, const char **argv, t_options *options, t_vpr_setup *vpr_setup, t_arch *arch)
 Initialize VPR. More...
 
void vpr_initialize_logging ()
 
void vpr_init_with_options (const t_options *options, t_vpr_setup *vpr_setup, t_arch *arch)
 Initialize VPR with options. More...
 
bool vpr_flow (t_vpr_setup &vpr_setup, t_arch &arch)
 
bool vpr_pack_flow (t_vpr_setup &vpr_setup, const t_arch &arch)
 Perform, load or skip the packing stage. More...
 
bool vpr_pack (t_vpr_setup &vpr_setup, const t_arch &arch)
 Perform packing. More...
 
void vpr_load_packing (t_vpr_setup &vpr_setup, const t_arch &arch)
 Loads a previous packing. More...
 
bool vpr_place_flow (t_vpr_setup &vpr_setup, const t_arch &arch)
 Perform, load or skip the placement stage. More...
 
void vpr_place (t_vpr_setup &vpr_setup, const t_arch &arch)
 Perform placement. More...
 
void vpr_load_placement (t_vpr_setup &vpr_setup, const t_arch &arch)
 
RouteStatus vpr_route_flow (t_vpr_setup &vpr_setup, const t_arch &arch)
 Perform, load or skip the routing stage. More...
 
RouteStatus vpr_route_fixed_W (t_vpr_setup &vpr_setup, const t_arch &arch, int fixed_channel_width, std::shared_ptr< SetupHoldTimingInfo > timing_info, std::shared_ptr< RoutingDelayCalculator > delay_calc, ClbNetPinsMatrix< float > &net_delay)
 Perform routing at a fixed channel width) More...
 
RouteStatus vpr_route_min_W (t_vpr_setup &vpr_setup, const t_arch &arch, std::shared_ptr< SetupHoldTimingInfo > timing_info, std::shared_ptr< RoutingDelayCalculator > delay_calc, ClbNetPinsMatrix< float > &net_delay)
 Perform routing to find the minimum channel width. More...
 
RouteStatus vpr_load_routing (t_vpr_setup &vpr_setup, const t_arch &arch, int fixed_channel_width, std::shared_ptr< SetupHoldTimingInfo > timing_info, ClbNetPinsMatrix< float > &net_delay)
 Loads a previous routing. More...
 
bool vpr_analysis_flow (t_vpr_setup &vpr_setup, const t_arch &Arch, const RouteStatus &route_status)
 Perform or skips the analysis stage. More...
 
void vpr_analysis (t_vpr_setup &vpr_setup, const t_arch &Arch, const RouteStatus &route_status)
 Perform post-implementation analysis. More...
 
void vpr_create_device (t_vpr_setup &vpr_setup, const t_arch &Arch)
 Create the device (grid + rr graph) More...
 
void vpr_create_device_grid (const t_vpr_setup &vpr_setup, const t_arch &Arch)
 Create the device grid. More...
 
void vpr_create_rr_graph (t_vpr_setup &vpr_setup, const t_arch &arch, int chan_width)
 Create routing graph at specified channel width. More...
 
void vpr_init_graphics (const t_vpr_setup &vpr_setup, const t_arch &arch)
 
void vpr_close_graphics (const t_vpr_setup &vpr_setup)
 
void vpr_setup_clock_networks (t_vpr_setup &vpr_setup, const t_arch &Arch)
 
void vpr_free_vpr_data_structures (t_arch &Arch, t_vpr_setup &vpr_setup)
 
void vpr_free_all (t_arch &Arch, t_vpr_setup &vpr_setup)
 
void vpr_print_title ()
 Display general VPR information. More...
 
void vpr_print_args (int argc, const char **argv)
 
void vpr_read_options (const int argc, const char **argv, t_options *options)
 Read in user options. More...
 
void vpr_setup_vpr (t_options *Options, const bool TimingEnabled, const bool readArchFile, t_file_name_opts *FileNameOpts, t_arch *Arch, t_model **user_models, t_model **library_models, t_netlist_opts *NetlistOpts, t_packer_opts *PackerOpts, t_placer_opts *PlacerOpts, t_annealing_sched *AnnealSched, t_router_opts *RouterOpts, t_analysis_opts *AnalysisOpts, t_det_routing_arch *RoutingArch, std::vector< t_lb_type_rr_node > **PackerRRGraph, std::vector< t_segment_inf > &Segments, t_timing_inf *Timing, bool *ShowGraphics, int *GraphPause, bool *SaveGraphics, std::string *GraphicsCommands, t_power_opts *PowerOpts)
 Read in arch and circuit. More...
 
void vpr_check_arch (const t_arch &Arch)
 Check inputs are reasonable. More...
 
void vpr_check_setup (const t_packer_opts &PackerOpts, const t_placer_opts &PlacerOpts, const t_router_opts &RouterOpts, const t_det_routing_arch &RoutingArch, const std::vector< t_segment_inf > &Segments, const t_timing_inf &Timing, const t_chan_width_dist &Chans)
 Verify settings don't conflict or otherwise not make sense. More...
 
void vpr_show_setup (const t_vpr_setup &vpr_setup)
 Show current setup. More...
 
void vpr_power_estimation (const t_vpr_setup &vpr_setup, const t_arch &Arch, const SetupTimingInfo &timing_info, const RouteStatus &route_status)
 Pperforms power estimation. More...
 
void vpr_alloc_and_load_output_file_names (const char *default_name)
 Output file names management. More...
 
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)
 
void vpr_print_error (const VprError &vpr_error)
 Prints user file or internal errors for VPR. More...
 

Detailed Description

General API for VPR.

Author
Jason Luu
Date
June 21, 2012

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.

Function Documentation

◆ vpr_alloc_and_load_output_file_names()

void vpr_alloc_and_load_output_file_names ( const char *  default_name)

Output file names management.

◆ vpr_analysis()

void vpr_analysis ( t_vpr_setup vpr_setup,
const t_arch &  Arch,
const RouteStatus route_status 
)

Perform post-implementation analysis.

◆ vpr_analysis_flow()

bool vpr_analysis_flow ( t_vpr_setup vpr_setup,
const t_arch &  Arch,
const RouteStatus route_status 
)

Perform or skips the analysis stage.

◆ vpr_check_arch()

void vpr_check_arch ( const t_arch &  Arch)

Check inputs are reasonable.

◆ vpr_check_setup()

void vpr_check_setup ( const t_packer_opts PackerOpts,
const t_placer_opts PlacerOpts,
const t_router_opts RouterOpts,
const t_det_routing_arch RoutingArch,
const std::vector< t_segment_inf > &  Segments,
const t_timing_inf Timing,
const t_chan_width_dist &  Chans 
)

Verify settings don't conflict or otherwise not make sense.

◆ vpr_close_graphics()

void vpr_close_graphics ( const t_vpr_setup vpr_setup)

◆ vpr_create_device()

void vpr_create_device ( t_vpr_setup vpr_setup,
const t_arch &  Arch 
)

Create the device (grid + rr graph)

◆ vpr_create_device_grid()

void vpr_create_device_grid ( const t_vpr_setup vpr_setup,
const t_arch &  Arch 
)

Create the device grid.

Create the device grid.

Depends on num_clbs, pins_per_clb

◆ vpr_create_rr_graph()

void vpr_create_rr_graph ( t_vpr_setup vpr_setup,
const t_arch &  arch,
int  chan_width 
)

Create routing graph at specified channel width.

◆ vpr_flow()

bool vpr_flow ( t_vpr_setup vpr_setup,
t_arch &  arch 
)

◆ vpr_free_all()

void vpr_free_all ( t_arch &  Arch,
t_vpr_setup vpr_setup 
)

◆ vpr_free_vpr_data_structures()

void vpr_free_vpr_data_structures ( t_arch &  Arch,
t_vpr_setup vpr_setup 
)

◆ vpr_get_output_file_name()

char* vpr_get_output_file_name ( enum e_output_files  ename)

◆ vpr_init()

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

Initialize VPR.

  1. Read Options
  2. Read Arch
  3. Read Circuit
  4. Sanity check all three

◆ vpr_init_graphics()

void vpr_init_graphics ( const t_vpr_setup vpr_setup,
const t_arch &  arch 
)

◆ vpr_init_with_options()

void vpr_init_with_options ( const t_options options,
t_vpr_setup vpr_setup,
t_arch *  arch 
)

Initialize VPR with options.

  1. Read Arch
  2. Read Circuit
  3. Sanity check all three

◆ vpr_initialize_logging()

void vpr_initialize_logging ( )

◆ vpr_load_packing()

void vpr_load_packing ( t_vpr_setup vpr_setup,
const t_arch &  arch 
)

Loads a previous packing.

◆ vpr_load_placement()

void vpr_load_placement ( t_vpr_setup vpr_setup,
const t_arch &  arch 
)

Loads a previous placement

◆ vpr_load_routing()

RouteStatus vpr_load_routing ( t_vpr_setup vpr_setup,
const t_arch &  arch,
int  fixed_channel_width,
std::shared_ptr< SetupHoldTimingInfo >  timing_info,
ClbNetPinsMatrix< float > &  net_delay 
)

Loads a previous routing.

◆ vpr_pack()

bool vpr_pack ( t_vpr_setup vpr_setup,
const t_arch &  arch 
)

Perform packing.

◆ vpr_pack_flow()

bool vpr_pack_flow ( t_vpr_setup vpr_setup,
const t_arch &  arch 
)

Perform, load or skip the packing stage.

◆ vpr_place()

void vpr_place ( t_vpr_setup vpr_setup,
const t_arch &  arch 
)

Perform placement.

◆ vpr_place_flow()

bool vpr_place_flow ( t_vpr_setup vpr_setup,
const t_arch &  arch 
)

Perform, load or skip the placement stage.

◆ vpr_power_estimation()

void vpr_power_estimation ( const t_vpr_setup vpr_setup,
const t_arch &  Arch,
const SetupTimingInfo &  timing_info,
const RouteStatus route_status 
)

Pperforms power estimation.

It relies on the placement/routing results, as well as the critical path. Power estimation can be performed as part of a full or partial flow. More information on the power estimation functions of VPR can be found here: http://docs.verilogtorouting.org/en/latest/vtr/power_estimation/

◆ vpr_print_args()

void vpr_print_args ( int  argc,
const char **  argv 
)

◆ vpr_print_error()

void vpr_print_error ( const VprError &  vpr_error)

Prints user file or internal errors for VPR.

◆ vpr_print_title()

void vpr_print_title ( )

Display general VPR information.

◆ vpr_read_options()

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

Read in user options.

◆ vpr_route_fixed_W()

RouteStatus vpr_route_fixed_W ( t_vpr_setup vpr_setup,
const t_arch &  arch,
int  fixed_channel_width,
std::shared_ptr< SetupHoldTimingInfo >  timing_info,
std::shared_ptr< RoutingDelayCalculator >  delay_calc,
ClbNetPinsMatrix< float > &  net_delay 
)

Perform routing at a fixed channel width)

◆ vpr_route_flow()

RouteStatus vpr_route_flow ( t_vpr_setup vpr_setup,
const t_arch &  arch 
)

Perform, load or skip the routing stage.

◆ vpr_route_min_W()

RouteStatus vpr_route_min_W ( t_vpr_setup vpr_setup,
const t_arch &  arch,
std::shared_ptr< SetupHoldTimingInfo >  timing_info,
std::shared_ptr< RoutingDelayCalculator >  delay_calc,
ClbNetPinsMatrix< float > &  net_delay 
)

Perform routing to find the minimum channel width.

◆ vpr_set_output_file_name()

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

◆ vpr_setup_clock_networks()

void vpr_setup_clock_networks ( t_vpr_setup vpr_setup,
const t_arch &  Arch 
)

◆ vpr_setup_vpr()

void vpr_setup_vpr ( t_options Options,
const bool  TimingEnabled,
const bool  readArchFile,
t_file_name_opts FileNameOpts,
t_arch *  Arch,
t_model **  user_models,
t_model **  library_models,
t_netlist_opts NetlistOpts,
t_packer_opts PackerOpts,
t_placer_opts PlacerOpts,
t_annealing_sched AnnealSched,
t_router_opts RouterOpts,
t_analysis_opts AnalysisOpts,
t_det_routing_arch RoutingArch,
std::vector< t_lb_type_rr_node > **  PackerRRGraph,
std::vector< t_segment_inf > &  Segments,
t_timing_inf Timing,
bool *  ShowGraphics,
int *  GraphPause,
bool *  SaveGraphics,
std::string *  GraphicsCommands,
t_power_opts PowerOpts 
)

Read in arch and circuit.

◆ vpr_show_setup()

void vpr_show_setup ( const t_vpr_setup vpr_setup)

Show current setup.