Verilog to Routing - VPR
Functions | Variables
read_netlist.cpp File Reference

Read a circuit netlist in XML format and populate the netlist data structures for VPR. More...

#include <cstdio>
#include <cstring>
#include <ctime>
#include <map>
#include "pugixml.hpp"
#include "pugixml_loc.hpp"
#include "pugixml_util.hpp"
#include "vtr_assert.h"
#include "vtr_util.h"
#include "vtr_log.h"
#include "vtr_digest.h"
#include "vtr_memory.h"
#include "vtr_token.h"
#include "vpr_types.h"
#include "vpr_error.h"
#include "vpr_utils.h"
#include "hash.h"
#include "globals.h"
#include "atom_netlist.h"
#include "read_xml_util.h"
#include "read_netlist.h"
#include "pb_type_graph.h"
Include dependency graph for read_netlist.cpp:

Functions

static int processPorts (pugi::xml_node Parent, t_pb *pb, t_pb_routes &pb_route, const pugiutil::loc_data &loc_data)
 
static void processPb (pugi::xml_node Parent, const ClusterBlockId index, t_pb *pb, t_pb_routes &pb_route, int *num_primitives, const pugiutil::loc_data &loc_data, ClusteredNetlist *clb_nlist)
 XML parser to populate pb info and to update internal nets of the parent CLB. More...
 
static void processComplexBlock (pugi::xml_node clb_block, const ClusterBlockId index, int *num_primitives, const pugiutil::loc_data &loc_data, ClusteredNetlist *clb_nlist)
 XML parser to populate CLB info and to update nets with the nets of this CLB. More...
 
static int add_net_to_hash (t_hash **nhash, const char *net_name, int *ncount)
 Adds net to hashtable of nets. More...
 
static void load_external_nets_and_cb (ClusteredNetlist &clb_nlist)
 This function updates the nets list and the connections between that list and the complex block. More...
 
static void load_internal_to_block_net_nums (const t_logical_block_type_ptr type, t_pb_routes &pb_route)
 
static void load_atom_index_for_pb_pin (t_pb_routes &pb_route, int ipin)
 
static void mark_constant_generators (const ClusteredNetlist &clb_nlist, int verbosity)
 
static size_t mark_constant_generators_rec (const t_pb *pb, const t_pb_routes &pb_route, int verbosity)
 
static t_pb_routes alloc_pb_route (t_pb_graph_node *pb_graph_node)
 
static void load_atom_pin_mapping (const ClusteredNetlist &clb_nlist)
 Walk through the atom netlist looking up and storing the t_pb_graph_pin associated with each connected AtomPinId. More...
 
static void set_atom_pin_mapping (const ClusteredNetlist &clb_nlist, const AtomBlockId atom_blk, const AtomPortId atom_port, const t_pb_graph_pin *gpin)
 
ClusteredNetlist read_netlist (const char *net_file, const t_arch *arch, bool verify_file_digests, int verbosity)
 Initializes the clb_nlist with info from a netlist. More...
 
template<typename T >
void processAttrsParams (pugi::xml_node Parent, const char *child_name, T &atom_net_range, const pugiutil::loc_data &loc_data)
 This processes a set of key-value pairs in the XML. More...
 

Variables

static const char * netlist_file_name = nullptr
 

Detailed Description

Read a circuit netlist in XML format and populate the netlist data structures for VPR.

Author
Jason Luu
Date
May 2009

Function Documentation

◆ add_net_to_hash()

static int add_net_to_hash ( t_hash **  nhash,
const char *  net_name,
int *  ncount 
)
static

Adds net to hashtable of nets.

If the net is "open", then this is a keyword so do not add it. If the net already exists, increase the count on that net

◆ alloc_pb_route()

static t_pb_routes alloc_pb_route ( t_pb_graph_node *  pb_graph_node)
static

◆ load_atom_index_for_pb_pin()

static void load_atom_index_for_pb_pin ( t_pb_routes pb_route,
int  ipin 
)
static

◆ load_atom_pin_mapping()

static void load_atom_pin_mapping ( const ClusteredNetlist clb_nlist)
static

Walk through the atom netlist looking up and storing the t_pb_graph_pin associated with each connected AtomPinId.

◆ load_external_nets_and_cb()

static void load_external_nets_and_cb ( ClusteredNetlist clb_nlist)
static

This function updates the nets list and the connections between that list and the complex block.

◆ load_internal_to_block_net_nums()

static void load_internal_to_block_net_nums ( const t_logical_block_type_ptr  type,
t_pb_routes pb_route 
)
static

◆ mark_constant_generators()

static void mark_constant_generators ( const ClusteredNetlist clb_nlist,
int  verbosity 
)
static

◆ mark_constant_generators_rec()

static size_t mark_constant_generators_rec ( const t_pb pb,
const t_pb_routes pb_route,
int  verbosity 
)
static

◆ processAttrsParams()

template<typename T >
void processAttrsParams ( pugi::xml_node  Parent,
const char *  child_name,
T &  atom_net_range,
const pugiutil::loc_data &  loc_data 
)

This processes a set of key-value pairs in the XML.

e.g. block attributes or parameters, which must be of the form <attributes><attribute name="attrName">attrValue</attribute> ... </attributes>

◆ processComplexBlock()

static void processComplexBlock ( pugi::xml_node  clb_block,
const ClusterBlockId  index,
int *  num_primitives,
const pugiutil::loc_data &  loc_data,
ClusteredNetlist clb_nlist 
)
static

XML parser to populate CLB info and to update nets with the nets of this CLB.

Parameters
clb_nlistArray of CLBs in the netlist
indexindex of the CLB to allocate and load information into
loc_dataxml location info for error reporting

◆ processPb()

static void processPb ( pugi::xml_node  Parent,
const ClusterBlockId  index,
t_pb pb,
t_pb_routes pb_route,
int *  num_primitives,
const pugiutil::loc_data &  loc_data,
ClusteredNetlist clb_nlist 
)
static

XML parser to populate pb info and to update internal nets of the parent CLB.

Parameters
ParentXML tag for this pb_type
pbphysical block to use
loc_dataxml location info for error reporting

◆ processPorts()

static int processPorts ( pugi::xml_node  Parent,
t_pb pb,
t_pb_routes pb_route,
const pugiutil::loc_data &  loc_data 
)
static

◆ read_netlist()

ClusteredNetlist read_netlist ( const char *  net_file,
const t_arch *  arch,
bool  verify_file_digests,
int  verbosity 
)

Initializes the clb_nlist with info from a netlist.

Parameters
net_fileName of the netlist file to read

◆ set_atom_pin_mapping()

static void set_atom_pin_mapping ( const ClusteredNetlist clb_nlist,
const AtomBlockId  atom_blk,
const AtomPortId  atom_port,
const t_pb_graph_pin *  gpin 
)
static

Variable Documentation

◆ netlist_file_name

const char* netlist_file_name = nullptr
static