Verilog to Routing - VPR
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Attributes | Private Attributes
Netlist< BlockId, PortId, PinId, NetId > Class Template Referenceabstract

#include <netlist.h>

Public Types

typedef vtr::vector_map< BlockId, BlockId >::const_iterator block_iterator
 
typedef std::unordered_map< std::string, std::string >::const_iterator attr_iterator
 
typedef std::unordered_map< std::string, std::string >::const_iterator param_iterator
 
typedef vtr::vector_map< NetId, NetId >::const_iterator net_iterator
 
typedef vtr::vector_map< PinId, PinId >::const_iterator pin_iterator
 
typedef vtr::vector_map< PortId, PortId >::const_iterator port_iterator
 
typedef vtr::Range< block_iteratorblock_range
 
typedef vtr::Range< attr_iteratorattr_range
 
typedef vtr::Range< param_iteratorparam_range
 
typedef vtr::Range< net_iteratornet_range
 
typedef vtr::Range< pin_iteratorpin_range
 
typedef vtr::Range< port_iteratorport_range
 
typedef NetlistIdRemapper< BlockId, PortId, PinId, NetId > IdRemapper
 

Public Member Functions

 Netlist (std::string name="", std::string id="")
 
virtual ~Netlist ()
 
const std::string & netlist_name () const
 Retrieve the name of the netlist. More...
 
const std::string & netlist_id () const
 Retrieve the unique identifier for this netlist This is typically a secure digest of the input file. More...
 
bool verify () const
 Sanity check for internal consistency (throws an exception on failure) More...
 
bool is_dirty () const
 Returns true if the netlist has invalid entries due to modifications (e.g. from remove_*() calls) More...
 
bool is_compressed () const
 Returns true if the netlist has no invalid entries due to modifications (e.g. from remove_*() calls) More...
 
void print_stats () const
 Item counts and container info (for debugging) More...
 
const std::string & block_name (const BlockId blk_id) const
 Returns the name of the specified block. More...
 
bool block_is_combinational (const BlockId blk_id) const
 Returns true if the block is purely combinational (i.e. no input clocks and not a primary input. More...
 
attr_range block_attrs (const BlockId blk_id) const
 Returns a range of all attributes associated with the specified block. More...
 
param_range block_params (const BlockId blk_id) const
 Returns a range of all parameters associated with the specified block. More...
 
pin_range block_pins (const BlockId blk_id) const
 Returns a range of all pins associated with the specified block. More...
 
pin_range block_input_pins (const BlockId blk_id) const
 Returns a range of all input pins associated with the specified block. More...
 
pin_range block_output_pins (const BlockId blk_id) const
 Returns a range of all output pins associated with the specified block. More...
 
pin_range block_clock_pins (const BlockId blk_id) const
 Returns a range of all clock pins associated with the specified block. More...
 
port_range block_ports (const BlockId blk_id) const
 Returns a range of all ports associated with the specified block. More...
 
port_range block_input_ports (const BlockId blk_id) const
 Returns a range consisting of the input ports associated with the specified block. More...
 
port_range block_output_ports (const BlockId blk_id) const
 Returns a range consisting of the output ports associated with the specified block. More...
 
port_range block_clock_ports (const BlockId blk_id) const
 Returns a range consisting of the input clock ports associated with the specified block. More...
 
void remove_block (const BlockId blk_id)
 Removes a block from the netlist. This will also remove the associated ports and pins. More...
 
const std::string & port_name (const PortId port_id) const
 Returns the name of the specified port. More...
 
BlockId port_block (const PortId port_id) const
 Returns the block associated with the specified port. More...
 
pin_range port_pins (const PortId port_id) const
 Returns the set of valid pins associated with the port. More...
 
PinId port_pin (const PortId port_id, const BitIndex port_bit) const
 Returns the pin (potentially invalid) associated with the specified port and port bit index. More...
 
NetId port_net (const PortId port_id, const BitIndex port_bit) const
 Returns the net (potentially invalid) associated with the specified port and port bit index. More...
 
BitIndex port_width (const PortId port_id) const
 Returns the width (number of bits) in the specified port. More...
 
PortType port_type (const PortId port_id) const
 Returns the type of the specified port. More...
 
void remove_port (const PortId port_id)
 Removes a port from the netlist. More...
 
std::string pin_name (const PinId pin_id) const
 Returns the constructed name (derived from block and port) for the specified pin. More...
 
PinType pin_type (const PinId pin_id) const
 Returns the type of the specified pin. More...
 
NetId pin_net (const PinId pin_id) const
 Returns the net associated with the specified pin. More...
 
int pin_net_index (const PinId pin_id) const
 Returns the index of the specified pin within it's connected net. More...
 
PortId pin_port (const PinId pin_id) const
 Returns the port associated with the specified pin. More...
 
BitIndex pin_port_bit (const PinId pin_id) const
 Returns the port bit index associated with the specified pin. More...
 
BlockId pin_block (const PinId pin_id) const
 Returns the block associated with the specified pin. More...
 
PortType pin_port_type (const PinId pin_id) const
 Returns the port type associated with the specified pin. More...
 
bool pin_is_constant (const PinId pin_id) const
 Returns true if the pin is a constant (i.e. its value never changes) More...
 
void remove_pin (const PinId pin_id)
 Removes a pin from the netlist. More...
 
const std::string & net_name (const NetId net_id) const
 Returns the name of the specified net. More...
 
pin_range net_pins (const NetId net_id) const
 Returns a range consisting of all the pins in the net (driver and sinks) More...
 
PinId net_pin (const NetId net_id, int net_pin_index) const
 Returns the net_pin_index'th pin of the specified net. More...
 
BlockId net_pin_block (const NetId net_id, int net_pin_index) const
 Returns the block associated with the net_pin_index'th pin of the specified net. More...
 
PinId net_driver (const NetId net_id) const
 Returns the (potentially invalid) net driver pin. More...
 
BlockId net_driver_block (const NetId net_id) const
 Returns the (potentially invalid) net driver block. More...
 
pin_range net_sinks (const NetId net_id) const
 Returns a (potentially empty) range consisting of net's sink pins. More...
 
bool net_is_constant (const NetId net_id) const
 Returns true if the net is driven by a constant pin (i.e. its value never changes) More...
 
void remove_net (const NetId net_id)
 Removes a net from the netlist. More...
 
void remove_net_pin (const NetId net_id, const PinId pin_id)
 Removes a connection betwen a net and pin. More...
 
block_range blocks () const
 Returns a range consisting of all blocks in the netlist. More...
 
port_range ports () const
 Returns a range consisting of all ports in the netlist. More...
 
net_range nets () const
 Returns a range consisting of all nets in the netlist. More...
 
pin_range pins () const
 Returns a range consisting of all pins in the netlist. More...
 
bool valid_block_id (BlockId block_id) const
 
bool valid_port_id (PortId port_id) const
 
bool valid_port_bit (PortId port_id, BitIndex port_bit) const
 
bool valid_pin_id (PinId pin_id) const
 
bool valid_net_id (NetId net_id) const
 
BlockId find_block (const std::string &name) const
 Returns the BlockId of the specified block or BlockId::INVALID() if not found. More...
 
PortId find_port (const BlockId blk_id, const std::string &name) const
 Returns the PortId of the specifed port if it exists or PortId::INVALID() if not. More...
 
NetId find_net (const std::string &name) const
 Returns the NetId of the specified net or NetId::INVALID() if not found. More...
 
PinId find_pin (const PortId port_id, BitIndex port_bit) const
 Returns the PinId of the specified pin or PinId::INVALID() if not found. More...
 
PinId find_pin (const std::string name) const
 Returns the PinId of the specified pin or PinId::INVALID() if not found. More...
 
void set_pin_net (const PinId pin, PinType pin_type, const NetId net)
 Add the specified pin to the specified net as pin_type. More...
 
void set_pin_is_constant (const PinId pin_id, const bool value)
 Mark a pin as being a constant generator. More...
 
void set_block_name (const BlockId blk_id, const std::string new_name)
 Re-name a block. More...
 
void set_block_attr (const BlockId blk_id, const std::string &name, const std::string &value)
 Set a block attribute. More...
 
void set_block_param (const BlockId blk_id, const std::string &name, const std::string &value)
 Set a block parameter. More...
 
void merge_nets (const NetId driver_net, const NetId sink_net)
 Merges sink_net into driver_net. More...
 
IdRemapper remove_and_compress ()
 Wrapper for remove_unused() & compress() More...
 
void remove_unused ()
 This should be called after completing a series of netlist modifications (e.g. removing blocks/ports/pins/nets). More...
 
IdRemapper compress ()
 Compresses the netlist, removing any invalid and/or unreferenced blocks/ports/pins/nets. More...
 

Protected Types

typedef vtr::StrongId< string_id_tag > StringId
 A unique identifier for a string in the netlist. More...
 

Protected Member Functions

BlockId create_block (const std::string name)
 Create or return an existing block in the netlist. More...
 
PortId create_port (const BlockId blk_id, const std::string name, BitIndex width, PortType type)
 Create or return an existing port in the netlist. More...
 
PinId create_pin (const PortId port_id, BitIndex port_bit, const NetId net_id, const PinType pin_type, bool is_const=false)
 Create or return an existing pin in the netlist. More...
 
NetId create_net (const std::string name)
 Create an empty, or return an existing net in the netlist. More...
 
NetId add_net (const std::string name, PinId driver, std::vector< PinId > sinks)
 Create a completely specified net from specified driver and sinks. More...
 
StringId find_string (const std::string &str) const
 Returns the StringId of the specifed string if it exists or StringId::INVALID() if not. More...
 
BlockId find_block (const StringId name_id) const
 Returns the BlockId of the specifed block if it exists or BlockId::INVALID() if not. More...
 
NetId find_net (const StringId name_id) const
 Returns the NetId of the specifed port if it exists or NetId::INVALID() if not. More...
 
StringId create_string (const std::string &str)
 Create or return the ID of the specified string. More...
 
int associate_pin_with_net (const PinId pin_id, const PinType type, const NetId net_id)
 Updates net cross-references for the specified pin. More...
 
void associate_pin_with_port (const PinId pin_id, const PortId port_id)
 Updates port cross-references for the specified pin. More...
 
void associate_pin_with_block (const PinId pin_id, const PortType type, const BlockId blk_id)
 Updates block cross-references for the specified pin. More...
 
void associate_port_with_block (const PortId port_id, const PortType type, const BlockId blk_id)
 Updates block cross-references for the specified port. More...
 
IdRemapper build_id_maps ()
 Builds the new mappings from old to new IDs. More...
 
void clean_blocks (const vtr::vector_map< BlockId, BlockId > &block_id_map)
 Removes invalid and reorders blocks. More...
 
void clean_ports (const vtr::vector_map< PortId, PortId > &port_id_map)
 Removes invalid and reorders ports. More...
 
void clean_pins (const vtr::vector_map< PinId, PinId > &pin_id_map)
 Removes invalid and reorders pins. More...
 
void clean_nets (const vtr::vector_map< NetId, NetId > &net_id_map)
 Removes invalid and reorders nets. More...
 
void rebuild_lookups ()
 Re-builds fast look-ups. More...
 
void rebuild_block_refs (const vtr::vector_map< PinId, PinId > &pin_id_map, const vtr::vector_map< PortId, PortId > &port_id_map)
 Re-builds cross-references held by blocks. More...
 
void rebuild_port_refs (const vtr::vector_map< BlockId, BlockId > &block_id_map, const vtr::vector_map< PinId, PinId > &pin_id_map)
 Re-builds cross-references held by ports. More...
 
void rebuild_pin_refs (const vtr::vector_map< PortId, PortId > &port_id_map, const vtr::vector_map< NetId, NetId > &net_id_map)
 Re-builds cross-references held by pins. More...
 
void rebuild_net_refs (const vtr::vector_map< PinId, PinId > &pin_id_map)
 Re-builds cross-references held by nets. More...
 
void shrink_to_fit ()
 
bool verify_sizes () const
 
bool validate_block_sizes () const
 
bool validate_port_sizes () const
 
bool validate_pin_sizes () const
 
bool validate_net_sizes () const
 
bool validate_string_sizes () const
 
bool verify_refs () const
 
bool validate_block_port_refs () const
 
bool validate_block_pin_refs () const
 
bool validate_port_pin_refs () const
 
bool validate_net_pin_refs () const
 
bool validate_string_refs () const
 
bool verify_block_invariants () const
 Verify that block invariants hold (i.e. logical consistency) More...
 
bool verify_lookups () const
 Verify that fast-lookups are consistent with internal data structures. More...
 
bool valid_string_id (StringId string_id) const
 Validates that the specified ID is valid in the current netlist state. More...
 
virtual void shrink_to_fit_impl ()=0
 
virtual bool validate_block_sizes_impl (size_t num_blocks) const =0
 
virtual bool validate_port_sizes_impl (size_t num_ports) const =0
 
virtual bool validate_pin_sizes_impl (size_t num_pins) const =0
 
virtual bool validate_net_sizes_impl (size_t num_nets) const =0
 
virtual void clean_blocks_impl (const vtr::vector_map< BlockId, BlockId > &block_id_map)=0
 
virtual void clean_ports_impl (const vtr::vector_map< PortId, PortId > &port_id_map)=0
 
virtual void clean_pins_impl (const vtr::vector_map< PinId, PinId > &pin_id_map)=0
 
virtual void clean_nets_impl (const vtr::vector_map< NetId, NetId > &net_id_map)=0
 
virtual void remove_block_impl (const BlockId blk_id)=0
 
virtual void remove_port_impl (const PortId port_id)=0
 
virtual void remove_pin_impl (const PinId pin_id)=0
 
virtual void remove_net_impl (const NetId net_id)=0
 
virtual void rebuild_block_refs_impl (const vtr::vector_map< PinId, PinId > &pin_id_map, const vtr::vector_map< PortId, PortId > &port_id_map)=0
 
virtual void rebuild_port_refs_impl (const vtr::vector_map< BlockId, BlockId > &block_id_map, const vtr::vector_map< PinId, PinId > &pin_id_map)=0
 
virtual void rebuild_pin_refs_impl (const vtr::vector_map< PortId, PortId > &port_id_map, const vtr::vector_map< NetId, NetId > &net_id_map)=0
 
virtual void rebuild_net_refs_impl (const vtr::vector_map< PinId, PinId > &pin_id_map)=0
 

Static Protected Attributes

static constexpr int INVALID_INDEX = -1
 
static constexpr int NET_DRIVER_INDEX = 0
 

Private Attributes

std::string netlist_name_
 
std::string netlist_id_
 
bool dirty_ = false
 
vtr::vector_map< BlockId, BlockId > block_ids_
 
vtr::vector_map< BlockId, StringIdblock_names_
 
vtr::vector_map< BlockId, std::vector< PortId > > block_ports_
 
vtr::vector_map< BlockId, unsigned > block_num_input_ports_
 
vtr::vector_map< BlockId, unsigned > block_num_output_ports_
 
vtr::vector_map< BlockId, unsigned > block_num_clock_ports_
 
vtr::vector_map< BlockId, std::vector< PinId > > block_pins_
 
vtr::vector_map< BlockId, unsigned > block_num_input_pins_
 
vtr::vector_map< BlockId, unsigned > block_num_output_pins_
 
vtr::vector_map< BlockId, unsigned > block_num_clock_pins_
 
vtr::vector_map< BlockId, std::unordered_map< std::string, std::string > > block_params_
 
vtr::vector_map< BlockId, std::unordered_map< std::string, std::string > > block_attrs_
 
vtr::vector_map< PortId, PortId > port_ids_
 
vtr::vector_map< PortId, StringIdport_names_
 
vtr::vector_map< PortId, BlockId > port_blocks_
 
vtr::vector_map< PortId, std::vector< PinId > > port_pins_
 
vtr::vector_map< PortId, BitIndexport_widths_
 
vtr::vector_map< PortId, PortTypeport_types_
 
vtr::vector_map< PinId, PinId > pin_ids_
 
vtr::vector_map< PinId, PortId > pin_ports_
 
vtr::vector_map< PinId, BitIndexpin_port_bits_
 
vtr::vector_map< PinId, NetId > pin_nets_
 
vtr::vector_map< PinId, int > pin_net_indices_
 
vtr::vector_map< PinId, bool > pin_is_constant_
 
vtr::vector_map< NetId, NetId > net_ids_
 
vtr::vector_map< NetId, StringIdnet_names_
 
vtr::vector_map< NetId, std::vector< PinId > > net_pins_
 
vtr::vector_map< StringId, StringIdstring_ids_
 
vtr::vector_map< StringId, std::string > strings_
 
vtr::vector_map< StringId, BlockId > block_name_to_block_id_
 
vtr::vector_map< StringId, NetId > net_name_to_net_id_
 
std::unordered_map< std::string, StringIdstring_to_string_id_
 

Member Typedef Documentation

◆ attr_iterator

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef std::unordered_map<std::string, std::string>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::attr_iterator

◆ attr_range

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::Range<attr_iterator> Netlist< BlockId, PortId, PinId, NetId >::attr_range

◆ block_iterator

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::vector_map<BlockId, BlockId>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::block_iterator

◆ block_range

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::Range<block_iterator> Netlist< BlockId, PortId, PinId, NetId >::block_range

◆ IdRemapper

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef NetlistIdRemapper<BlockId, PortId, PinId, NetId> Netlist< BlockId, PortId, PinId, NetId >::IdRemapper

◆ net_iterator

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::vector_map<NetId, NetId>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::net_iterator

◆ net_range

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::Range<net_iterator> Netlist< BlockId, PortId, PinId, NetId >::net_range

◆ param_iterator

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef std::unordered_map<std::string, std::string>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::param_iterator

◆ param_range

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::Range<param_iterator> Netlist< BlockId, PortId, PinId, NetId >::param_range

◆ pin_iterator

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::vector_map<PinId, PinId>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::pin_iterator

◆ pin_range

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::Range<pin_iterator> Netlist< BlockId, PortId, PinId, NetId >::pin_range

◆ port_iterator

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::vector_map<PortId, PortId>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::port_iterator

◆ port_range

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::Range<port_iterator> Netlist< BlockId, PortId, PinId, NetId >::port_range

◆ StringId

template<typename BlockId, typename PortId, typename PinId, typename NetId>
typedef vtr::StrongId<string_id_tag> Netlist< BlockId, PortId, PinId, NetId >::StringId
protected

A unique identifier for a string in the netlist.

Constructor & Destructor Documentation

◆ Netlist()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
Netlist< BlockId, PortId, PinId, NetId >::Netlist ( std::string  name = "",
std::string  id = "" 
)

◆ ~Netlist()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual Netlist< BlockId, PortId, PinId, NetId >::~Netlist ( )
virtual

Member Function Documentation

◆ add_net()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
NetId Netlist< BlockId, PortId, PinId, NetId >::add_net ( const std::string  name,
PinId  driver,
std::vector< PinId >  sinks 
)
protected

Create a completely specified net from specified driver and sinks.

Parameters
nameThe name of the net (Note: must not already exist)
driverThe net's driver pin
sinksThe net's sink pins

◆ associate_pin_with_block()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::associate_pin_with_block ( const PinId  pin_id,
const PortType  type,
const BlockId  blk_id 
)
protected

Updates block cross-references for the specified pin.

◆ associate_pin_with_net()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
int Netlist< BlockId, PortId, PinId, NetId >::associate_pin_with_net ( const PinId  pin_id,
const PinType  type,
const NetId  net_id 
)
protected

Updates net cross-references for the specified pin.

Returns
Returns the pin's index within the net

◆ associate_pin_with_port()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::associate_pin_with_port ( const PinId  pin_id,
const PortId  port_id 
)
protected

Updates port cross-references for the specified pin.

◆ associate_port_with_block()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::associate_port_with_block ( const PortId  port_id,
const PortType  type,
const BlockId  blk_id 
)
protected

Updates block cross-references for the specified port.

◆ block_attrs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
attr_range Netlist< BlockId, PortId, PinId, NetId >::block_attrs ( const BlockId  blk_id) const

Returns a range of all attributes associated with the specified block.

◆ block_clock_pins()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
pin_range Netlist< BlockId, PortId, PinId, NetId >::block_clock_pins ( const BlockId  blk_id) const

Returns a range of all clock pins associated with the specified block.

◆ block_clock_ports()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
port_range Netlist< BlockId, PortId, PinId, NetId >::block_clock_ports ( const BlockId  blk_id) const

Returns a range consisting of the input clock ports associated with the specified block.

◆ block_input_pins()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
pin_range Netlist< BlockId, PortId, PinId, NetId >::block_input_pins ( const BlockId  blk_id) const

Returns a range of all input pins associated with the specified block.

◆ block_input_ports()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
port_range Netlist< BlockId, PortId, PinId, NetId >::block_input_ports ( const BlockId  blk_id) const

Returns a range consisting of the input ports associated with the specified block.

◆ block_is_combinational()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::block_is_combinational ( const BlockId  blk_id) const

Returns true if the block is purely combinational (i.e. no input clocks and not a primary input.

◆ block_name()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
const std::string& Netlist< BlockId, PortId, PinId, NetId >::block_name ( const BlockId  blk_id) const

Returns the name of the specified block.

◆ block_output_pins()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
pin_range Netlist< BlockId, PortId, PinId, NetId >::block_output_pins ( const BlockId  blk_id) const

Returns a range of all output pins associated with the specified block.

Note
This is typically only data pins, but some blocks (e.g. PLLs) can produce outputs which are clocks.

◆ block_output_ports()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
port_range Netlist< BlockId, PortId, PinId, NetId >::block_output_ports ( const BlockId  blk_id) const

Returns a range consisting of the output ports associated with the specified block.

Note
This is typically only data ports, but some blocks (e.g. PLLs) can produce outputs which are clocks.

◆ block_params()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
param_range Netlist< BlockId, PortId, PinId, NetId >::block_params ( const BlockId  blk_id) const

Returns a range of all parameters associated with the specified block.

◆ block_pins()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
pin_range Netlist< BlockId, PortId, PinId, NetId >::block_pins ( const BlockId  blk_id) const

Returns a range of all pins associated with the specified block.

◆ block_ports()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
port_range Netlist< BlockId, PortId, PinId, NetId >::block_ports ( const BlockId  blk_id) const

Returns a range of all ports associated with the specified block.

◆ blocks()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
block_range Netlist< BlockId, PortId, PinId, NetId >::blocks ( ) const

Returns a range consisting of all blocks in the netlist.

◆ build_id_maps()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
IdRemapper Netlist< BlockId, PortId, PinId, NetId >::build_id_maps ( )
protected

Builds the new mappings from old to new IDs.

The various IdMap's should be initialized with invalid mappings for all current ID's before being called.

◆ clean_blocks()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::clean_blocks ( const vtr::vector_map< BlockId, BlockId > &  block_id_map)
protected

Removes invalid and reorders blocks.

◆ clean_blocks_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::clean_blocks_impl ( const vtr::vector_map< BlockId, BlockId > &  block_id_map)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ clean_nets()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::clean_nets ( const vtr::vector_map< NetId, NetId > &  net_id_map)
protected

Removes invalid and reorders nets.

◆ clean_nets_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::clean_nets_impl ( const vtr::vector_map< NetId, NetId > &  net_id_map)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ clean_pins()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::clean_pins ( const vtr::vector_map< PinId, PinId > &  pin_id_map)
protected

Removes invalid and reorders pins.

◆ clean_pins_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::clean_pins_impl ( const vtr::vector_map< PinId, PinId > &  pin_id_map)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ clean_ports()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::clean_ports ( const vtr::vector_map< PortId, PortId > &  port_id_map)
protected

Removes invalid and reorders ports.

◆ clean_ports_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::clean_ports_impl ( const vtr::vector_map< PortId, PortId > &  port_id_map)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ compress()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
IdRemapper Netlist< BlockId, PortId, PinId, NetId >::compress ( )

Compresses the netlist, removing any invalid and/or unreferenced blocks/ports/pins/nets.

Note
this invalidates all existing IDs!

◆ create_block()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
BlockId Netlist< BlockId, PortId, PinId, NetId >::create_block ( const std::string  name)
protected

Create or return an existing block in the netlist.

Parameters
nameThe unique name of the block

◆ create_net()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
NetId Netlist< BlockId, PortId, PinId, NetId >::create_net ( const std::string  name)
protected

Create an empty, or return an existing net in the netlist.

Parameters
nameThe unique name of the net

◆ create_pin()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PinId Netlist< BlockId, PortId, PinId, NetId >::create_pin ( const PortId  port_id,
BitIndex  port_bit,
const NetId  net_id,
const PinType  pin_type,
bool  is_const = false 
)
protected

Create or return an existing pin in the netlist.

Parameters
port_idThe port this pin is associated with
port_bitThe bit index of the pin in the port
net_idThe net the pin drives/sinks
pin_typeThe type of the pin (driver/sink)
is_constIndicates whether the pin holds a constant value (e. g. vcc/gnd)

◆ create_port()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PortId Netlist< BlockId, PortId, PinId, NetId >::create_port ( const BlockId  blk_id,
const std::string  name,
BitIndex  width,
PortType  type 
)
protected

Create or return an existing port in the netlist.

Parameters
blk_idThe block the port is associated with
nameThe name of the port (must match the name of a port in the block's model)
widthThe width (number of bits) of the port
typeThe type of the port (INPUT, OUTPUT, CLOCK)

◆ create_string()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
StringId Netlist< BlockId, PortId, PinId, NetId >::create_string ( const std::string &  str)
protected

Create or return the ID of the specified string.

Parameters
strThe string whose ID is requested

◆ find_block() [1/2]

template<typename BlockId, typename PortId, typename PinId, typename NetId>
BlockId Netlist< BlockId, PortId, PinId, NetId >::find_block ( const std::string &  name) const

Returns the BlockId of the specified block or BlockId::INVALID() if not found.

Parameters
nameThe name of the block

◆ find_block() [2/2]

template<typename BlockId, typename PortId, typename PinId, typename NetId>
BlockId Netlist< BlockId, PortId, PinId, NetId >::find_block ( const StringId  name_id) const
protected

Returns the BlockId of the specifed block if it exists or BlockId::INVALID() if not.

Parameters
name_id: The block name to look for

◆ find_net() [1/2]

template<typename BlockId, typename PortId, typename PinId, typename NetId>
NetId Netlist< BlockId, PortId, PinId, NetId >::find_net ( const std::string &  name) const

Returns the NetId of the specified net or NetId::INVALID() if not found.

Parameters
nameThe name of the net

◆ find_net() [2/2]

template<typename BlockId, typename PortId, typename PinId, typename NetId>
NetId Netlist< BlockId, PortId, PinId, NetId >::find_net ( const StringId  name_id) const
protected

Returns the NetId of the specifed port if it exists or NetId::INVALID() if not.

Parameters
name_idThe string ID of the net name to look for

◆ find_pin() [1/2]

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PinId Netlist< BlockId, PortId, PinId, NetId >::find_pin ( const PortId  port_id,
BitIndex  port_bit 
) const

Returns the PinId of the specified pin or PinId::INVALID() if not found.

Parameters
port_idThe ID of the associated port
port_bitThe bit index of the pin in the port

◆ find_pin() [2/2]

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PinId Netlist< BlockId, PortId, PinId, NetId >::find_pin ( const std::string  name) const

Returns the PinId of the specified pin or PinId::INVALID() if not found.

Note
This method is SLOW, O(num_pins) – avoid if possible
Parameters
nameThe name of the pin

◆ find_port()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PortId Netlist< BlockId, PortId, PinId, NetId >::find_port ( const BlockId  blk_id,
const std::string &  name 
) const

Returns the PortId of the specifed port if it exists or PortId::INVALID() if not.

Note
This method is typically less efficient than searching by a t_model_port With the overloaded AtomNetlist method
Parameters
blk_idThe ID of the block who's ports will be checked
nameThe name of the port to look for

◆ find_string()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
StringId Netlist< BlockId, PortId, PinId, NetId >::find_string ( const std::string &  str) const
protected

Returns the StringId of the specifed string if it exists or StringId::INVALID() if not.

Parameters
strThe string to look for

◆ is_compressed()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::is_compressed ( ) const

Returns true if the netlist has no invalid entries due to modifications (e.g. from remove_*() calls)

Note
This is a convenience method which is the logical inverse of is_dirty()

◆ is_dirty()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::is_dirty ( ) const

Returns true if the netlist has invalid entries due to modifications (e.g. from remove_*() calls)

◆ merge_nets()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::merge_nets ( const NetId  driver_net,
const NetId  sink_net 
)

Merges sink_net into driver_net.

After merging driver_net will contain all the sinks of sink_net

Parameters
driver_netThe net which includes the driver pin
sink_netThe target net to be merged into driver_net (must have no driver pin)

◆ net_driver()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PinId Netlist< BlockId, PortId, PinId, NetId >::net_driver ( const NetId  net_id) const

Returns the (potentially invalid) net driver pin.

◆ net_driver_block()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
BlockId Netlist< BlockId, PortId, PinId, NetId >::net_driver_block ( const NetId  net_id) const

Returns the (potentially invalid) net driver block.

◆ net_is_constant()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::net_is_constant ( const NetId  net_id) const

Returns true if the net is driven by a constant pin (i.e. its value never changes)

◆ net_name()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
const std::string& Netlist< BlockId, PortId, PinId, NetId >::net_name ( const NetId  net_id) const

Returns the name of the specified net.

◆ net_pin()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PinId Netlist< BlockId, PortId, PinId, NetId >::net_pin ( const NetId  net_id,
int  net_pin_index 
) const

Returns the net_pin_index'th pin of the specified net.

◆ net_pin_block()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
BlockId Netlist< BlockId, PortId, PinId, NetId >::net_pin_block ( const NetId  net_id,
int  net_pin_index 
) const

Returns the block associated with the net_pin_index'th pin of the specified net.

◆ net_pins()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
pin_range Netlist< BlockId, PortId, PinId, NetId >::net_pins ( const NetId  net_id) const

Returns a range consisting of all the pins in the net (driver and sinks)

The first element in the range is the driver (and may be invalid) The remaining elements (potentially none) are the sinks

◆ net_sinks()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
pin_range Netlist< BlockId, PortId, PinId, NetId >::net_sinks ( const NetId  net_id) const

Returns a (potentially empty) range consisting of net's sink pins.

◆ netlist_id()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
const std::string& Netlist< BlockId, PortId, PinId, NetId >::netlist_id ( ) const

Retrieve the unique identifier for this netlist This is typically a secure digest of the input file.

◆ netlist_name()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
const std::string& Netlist< BlockId, PortId, PinId, NetId >::netlist_name ( ) const

Retrieve the name of the netlist.

◆ nets()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
net_range Netlist< BlockId, PortId, PinId, NetId >::nets ( ) const

Returns a range consisting of all nets in the netlist.

◆ pin_block()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
BlockId Netlist< BlockId, PortId, PinId, NetId >::pin_block ( const PinId  pin_id) const

Returns the block associated with the specified pin.

◆ pin_is_constant()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::pin_is_constant ( const PinId  pin_id) const

Returns true if the pin is a constant (i.e. its value never changes)

◆ pin_name()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
std::string Netlist< BlockId, PortId, PinId, NetId >::pin_name ( const PinId  pin_id) const

Returns the constructed name (derived from block and port) for the specified pin.

◆ pin_net()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
NetId Netlist< BlockId, PortId, PinId, NetId >::pin_net ( const PinId  pin_id) const

Returns the net associated with the specified pin.

◆ pin_net_index()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
int Netlist< BlockId, PortId, PinId, NetId >::pin_net_index ( const PinId  pin_id) const

Returns the index of the specified pin within it's connected net.

◆ pin_port()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PortId Netlist< BlockId, PortId, PinId, NetId >::pin_port ( const PinId  pin_id) const

Returns the port associated with the specified pin.

◆ pin_port_bit()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
BitIndex Netlist< BlockId, PortId, PinId, NetId >::pin_port_bit ( const PinId  pin_id) const

Returns the port bit index associated with the specified pin.

◆ pin_port_type()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PortType Netlist< BlockId, PortId, PinId, NetId >::pin_port_type ( const PinId  pin_id) const

Returns the port type associated with the specified pin.

◆ pin_type()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PinType Netlist< BlockId, PortId, PinId, NetId >::pin_type ( const PinId  pin_id) const

Returns the type of the specified pin.

◆ pins()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
pin_range Netlist< BlockId, PortId, PinId, NetId >::pins ( ) const

Returns a range consisting of all pins in the netlist.

◆ port_block()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
BlockId Netlist< BlockId, PortId, PinId, NetId >::port_block ( const PortId  port_id) const

Returns the block associated with the specified port.

◆ port_name()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
const std::string& Netlist< BlockId, PortId, PinId, NetId >::port_name ( const PortId  port_id) const

Returns the name of the specified port.

◆ port_net()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
NetId Netlist< BlockId, PortId, PinId, NetId >::port_net ( const PortId  port_id,
const BitIndex  port_bit 
) const

Returns the net (potentially invalid) associated with the specified port and port bit index.

Parameters
port_idThe ID of the associated port
port_bitThe bit index of the pin in the port

◆ port_pin()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PinId Netlist< BlockId, PortId, PinId, NetId >::port_pin ( const PortId  port_id,
const BitIndex  port_bit 
) const

Returns the pin (potentially invalid) associated with the specified port and port bit index.

Parameters
port_idThe ID of the associated port
port_bitThe bit index of the pin in the port
Note
This function is a synonym for find_pin()

◆ port_pins()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
pin_range Netlist< BlockId, PortId, PinId, NetId >::port_pins ( const PortId  port_id) const

Returns the set of valid pins associated with the port.

◆ port_type()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
PortType Netlist< BlockId, PortId, PinId, NetId >::port_type ( const PortId  port_id) const

Returns the type of the specified port.

◆ port_width()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
BitIndex Netlist< BlockId, PortId, PinId, NetId >::port_width ( const PortId  port_id) const

Returns the width (number of bits) in the specified port.

◆ ports()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
port_range Netlist< BlockId, PortId, PinId, NetId >::ports ( ) const

Returns a range consisting of all ports in the netlist.

◆ print_stats()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::print_stats ( ) const

Item counts and container info (for debugging)

◆ rebuild_block_refs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::rebuild_block_refs ( const vtr::vector_map< PinId, PinId > &  pin_id_map,
const vtr::vector_map< PortId, PortId > &  port_id_map 
)
protected

Re-builds cross-references held by blocks.

◆ rebuild_block_refs_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::rebuild_block_refs_impl ( const vtr::vector_map< PinId, PinId > &  pin_id_map,
const vtr::vector_map< PortId, PortId > &  port_id_map 
)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ rebuild_lookups()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::rebuild_lookups ( )
protected

Re-builds fast look-ups.

◆ rebuild_net_refs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::rebuild_net_refs ( const vtr::vector_map< PinId, PinId > &  pin_id_map)
protected

Re-builds cross-references held by nets.

◆ rebuild_net_refs_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::rebuild_net_refs_impl ( const vtr::vector_map< PinId, PinId > &  pin_id_map)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ rebuild_pin_refs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::rebuild_pin_refs ( const vtr::vector_map< PortId, PortId > &  port_id_map,
const vtr::vector_map< NetId, NetId > &  net_id_map 
)
protected

Re-builds cross-references held by pins.

◆ rebuild_pin_refs_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::rebuild_pin_refs_impl ( const vtr::vector_map< PortId, PortId > &  port_id_map,
const vtr::vector_map< NetId, NetId > &  net_id_map 
)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ rebuild_port_refs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::rebuild_port_refs ( const vtr::vector_map< BlockId, BlockId > &  block_id_map,
const vtr::vector_map< PinId, PinId > &  pin_id_map 
)
protected

Re-builds cross-references held by ports.

◆ rebuild_port_refs_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::rebuild_port_refs_impl ( const vtr::vector_map< BlockId, BlockId > &  block_id_map,
const vtr::vector_map< PinId, PinId > &  pin_id_map 
)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ remove_and_compress()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
IdRemapper Netlist< BlockId, PortId, PinId, NetId >::remove_and_compress ( )

Wrapper for remove_unused() & compress()

This function should be used in the case where a netlist is fully modified

◆ remove_block()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::remove_block ( const BlockId  blk_id)

Removes a block from the netlist. This will also remove the associated ports and pins.

Parameters
blk_idThe block to be removed

◆ remove_block_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::remove_block_impl ( const BlockId  blk_id)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ remove_net()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::remove_net ( const NetId  net_id)

Removes a net from the netlist.

This will mark the net's pins as having no associated.

Parameters
net_idThe net to be removed

◆ remove_net_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::remove_net_impl ( const NetId  net_id)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ remove_net_pin()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::remove_net_pin ( const NetId  net_id,
const PinId  pin_id 
)

Removes a connection betwen a net and pin.

The pin is removed from the net and the pin will be marked as having no associated net

Parameters
net_idThe net from which the pin is to be removed
pin_idThe pin to be removed from the net

◆ remove_pin()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::remove_pin ( const PinId  pin_id)

Removes a pin from the netlist.

The pin is marked invalid, and removed from any assoicated nets

Parameters
pin_idThe pin_id of the pin to be removed

◆ remove_pin_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::remove_pin_impl ( const PinId  pin_id)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ remove_port()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::remove_port ( const PortId  port_id)

Removes a port from the netlist.

The port's pins are also marked invalid and removed from any associated nets

Parameters
port_idThe ID of the port to be removed

◆ remove_port_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::remove_port_impl ( const PortId  port_id)
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ remove_unused()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::remove_unused ( )

This should be called after completing a series of netlist modifications (e.g. removing blocks/ports/pins/nets).

Marks netlist components which have become redundant due to other removals (e.g. ports with only invalid pins) as invalid so they will be destroyed during compress()

◆ set_block_attr()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::set_block_attr ( const BlockId  blk_id,
const std::string &  name,
const std::string &  value 
)

Set a block attribute.

Parameters
blk_idThe block to which the attribute is attached
nameThe name of the attribute to set
valueThe new value for the specified attribute on the specified block

◆ set_block_name()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::set_block_name ( const BlockId  blk_id,
const std::string  new_name 
)

Re-name a block.

Parameters
blk_id: The block to be renamed
new_name: The new name for the specified block

◆ set_block_param()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::set_block_param ( const BlockId  blk_id,
const std::string &  name,
const std::string &  value 
)

Set a block parameter.

Parameters
blk_idThe block to which the parameter is attached
nameThe name of the parameter to set
valueThe new value for the specified parameter on the specified block

◆ set_pin_is_constant()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::set_pin_is_constant ( const PinId  pin_id,
const bool  value 
)

Mark a pin as being a constant generator.

There are some cases where a pin can not be identified as a is constant until after the full netlist has been built; so we expose a way to mark existing pins as constants.

Parameters
pin_idThe pin to be marked
valueThe boolean value to set the pin_is_constant attribute

◆ set_pin_net()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::set_pin_net ( const PinId  pin,
PinType  pin_type,
const NetId  net 
)

Add the specified pin to the specified net as pin_type.

Automatically removes any previous net connection for this pin.

Parameters
pinThe pin to add
pin_typeThe type of the pin (i.e. driver or sink)
netThe net to add the pin to

◆ shrink_to_fit()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
void Netlist< BlockId, PortId, PinId, NetId >::shrink_to_fit ( )
protected

◆ shrink_to_fit_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual void Netlist< BlockId, PortId, PinId, NetId >::shrink_to_fit_impl ( )
protectedpure virtual

Implemented in AtomNetlist, and ClusteredNetlist.

◆ valid_block_id()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::valid_block_id ( BlockId  block_id) const

◆ valid_net_id()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::valid_net_id ( NetId  net_id) const

◆ valid_pin_id()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::valid_pin_id ( PinId  pin_id) const

◆ valid_port_bit()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::valid_port_bit ( PortId  port_id,
BitIndex  port_bit 
) const

◆ valid_port_id()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::valid_port_id ( PortId  port_id) const

◆ valid_string_id()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::valid_string_id ( StringId  string_id) const
protected

Validates that the specified ID is valid in the current netlist state.

◆ validate_block_pin_refs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::validate_block_pin_refs ( ) const
protected

◆ validate_block_port_refs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::validate_block_port_refs ( ) const
protected

◆ validate_block_sizes()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::validate_block_sizes ( ) const
protected

◆ validate_block_sizes_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual bool Netlist< BlockId, PortId, PinId, NetId >::validate_block_sizes_impl ( size_t  num_blocks) const
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ validate_net_pin_refs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::validate_net_pin_refs ( ) const
protected

◆ validate_net_sizes()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::validate_net_sizes ( ) const
protected

◆ validate_net_sizes_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual bool Netlist< BlockId, PortId, PinId, NetId >::validate_net_sizes_impl ( size_t  num_nets) const
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ validate_pin_sizes()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::validate_pin_sizes ( ) const
protected

◆ validate_pin_sizes_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual bool Netlist< BlockId, PortId, PinId, NetId >::validate_pin_sizes_impl ( size_t  num_pins) const
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ validate_port_pin_refs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::validate_port_pin_refs ( ) const
protected

◆ validate_port_sizes()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::validate_port_sizes ( ) const
protected

◆ validate_port_sizes_impl()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
virtual bool Netlist< BlockId, PortId, PinId, NetId >::validate_port_sizes_impl ( size_t  num_ports) const
protectedpure virtual

Implemented in ClusteredNetlist, and AtomNetlist.

◆ validate_string_refs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::validate_string_refs ( ) const
protected

◆ validate_string_sizes()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::validate_string_sizes ( ) const
protected

◆ verify()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::verify ( ) const

Sanity check for internal consistency (throws an exception on failure)

◆ verify_block_invariants()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::verify_block_invariants ( ) const
protected

Verify that block invariants hold (i.e. logical consistency)

◆ verify_lookups()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::verify_lookups ( ) const
protected

Verify that fast-lookups are consistent with internal data structures.

◆ verify_refs()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::verify_refs ( ) const
protected

◆ verify_sizes()

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::verify_sizes ( ) const
protected

Field Documentation

◆ block_attrs_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, std::unordered_map<std::string, std::string> > Netlist< BlockId, PortId, PinId, NetId >::block_attrs_
private

Attributes of each block

◆ block_ids_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, BlockId> Netlist< BlockId, PortId, PinId, NetId >::block_ids_
private

Valid block ids

◆ block_name_to_block_id_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<StringId, BlockId> Netlist< BlockId, PortId, PinId, NetId >::block_name_to_block_id_
private

◆ block_names_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, StringId> Netlist< BlockId, PortId, PinId, NetId >::block_names_
private

Name of each block

◆ block_num_clock_pins_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, unsigned> Netlist< BlockId, PortId, PinId, NetId >::block_num_clock_pins_
private

Number of clock pins on each block

◆ block_num_clock_ports_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, unsigned> Netlist< BlockId, PortId, PinId, NetId >::block_num_clock_ports_
private

Clock ports of each block

◆ block_num_input_pins_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, unsigned> Netlist< BlockId, PortId, PinId, NetId >::block_num_input_pins_
private

Number of input pins on each block

◆ block_num_input_ports_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, unsigned> Netlist< BlockId, PortId, PinId, NetId >::block_num_input_ports_
private

Input ports of each block

◆ block_num_output_pins_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, unsigned> Netlist< BlockId, PortId, PinId, NetId >::block_num_output_pins_
private

Number of output pins on each block

◆ block_num_output_ports_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, unsigned> Netlist< BlockId, PortId, PinId, NetId >::block_num_output_ports_
private

Output ports of each block

◆ block_params_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, std::unordered_map<std::string, std::string> > Netlist< BlockId, PortId, PinId, NetId >::block_params_
private

Parameters of each block

◆ block_pins_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, std::vector<PinId> > Netlist< BlockId, PortId, PinId, NetId >::block_pins_
private

Pins of each block

◆ block_ports_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<BlockId, std::vector<PortId> > Netlist< BlockId, PortId, PinId, NetId >::block_ports_
private

Ports of each block

◆ dirty_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
bool Netlist< BlockId, PortId, PinId, NetId >::dirty_ = false
private

Indicates the netlist has invalid entries from remove_*() functions

◆ INVALID_INDEX

template<typename BlockId, typename PortId, typename PinId, typename NetId>
constexpr int Netlist< BlockId, PortId, PinId, NetId >::INVALID_INDEX = -1
staticprotected

◆ NET_DRIVER_INDEX

template<typename BlockId, typename PortId, typename PinId, typename NetId>
constexpr int Netlist< BlockId, PortId, PinId, NetId >::NET_DRIVER_INDEX = 0
staticprotected

◆ net_ids_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<NetId, NetId> Netlist< BlockId, PortId, PinId, NetId >::net_ids_
private

Valid net ids

◆ net_name_to_net_id_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<StringId, NetId> Netlist< BlockId, PortId, PinId, NetId >::net_name_to_net_id_
private

◆ net_names_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<NetId, StringId> Netlist< BlockId, PortId, PinId, NetId >::net_names_
private

Name of each net

◆ net_pins_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<NetId, std::vector<PinId> > Netlist< BlockId, PortId, PinId, NetId >::net_pins_
private

Pins associated with each net

◆ netlist_id_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
std::string Netlist< BlockId, PortId, PinId, NetId >::netlist_id_
private

Unique identifier for the netlist

◆ netlist_name_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
std::string Netlist< BlockId, PortId, PinId, NetId >::netlist_name_
private

Name of the top-level netlist

◆ pin_ids_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PinId, PinId> Netlist< BlockId, PortId, PinId, NetId >::pin_ids_
private

Valid pin ids

◆ pin_is_constant_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PinId, bool> Netlist< BlockId, PortId, PinId, NetId >::pin_is_constant_
private

Index of the specified pin within it's associated net

Indicates if the pin always keeps a constant value

◆ pin_net_indices_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PinId, int> Netlist< BlockId, PortId, PinId, NetId >::pin_net_indices_
private

◆ pin_nets_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PinId, NetId> Netlist< BlockId, PortId, PinId, NetId >::pin_nets_
private

Net associated with each pin

◆ pin_port_bits_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PinId, BitIndex> Netlist< BlockId, PortId, PinId, NetId >::pin_port_bits_
private

The pins bit position in the port

◆ pin_ports_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PinId, PortId> Netlist< BlockId, PortId, PinId, NetId >::pin_ports_
private

Type of each pin

◆ port_blocks_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PortId, BlockId> Netlist< BlockId, PortId, PinId, NetId >::port_blocks_
private

Block associated with each port

◆ port_ids_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PortId, PortId> Netlist< BlockId, PortId, PinId, NetId >::port_ids_
private

Valid port ids

◆ port_names_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PortId, StringId> Netlist< BlockId, PortId, PinId, NetId >::port_names_
private

Name of each port

◆ port_pins_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PortId, std::vector<PinId> > Netlist< BlockId, PortId, PinId, NetId >::port_pins_
private

Pins associated with each port

◆ port_types_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PortId, PortType> Netlist< BlockId, PortId, PinId, NetId >::port_types_
private

Type of the port (INPUT, OUTPUT, CLOCK)

◆ port_widths_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<PortId, BitIndex> Netlist< BlockId, PortId, PinId, NetId >::port_widths_
private

Width (in bits) of each port

◆ string_ids_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<StringId, StringId> Netlist< BlockId, PortId, PinId, NetId >::string_ids_
private

Valid string ids

◆ string_to_string_id_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
std::unordered_map<std::string, StringId> Netlist< BlockId, PortId, PinId, NetId >::string_to_string_id_
private

◆ strings_

template<typename BlockId, typename PortId, typename PinId, typename NetId>
vtr::vector_map<StringId, std::string> Netlist< BlockId, PortId, PinId, NetId >::strings_
private

Strings


The documentation for this class was generated from the following file: