Verilog to Routing - VPR
|
#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_iterator > | block_range |
typedef vtr::Range< attr_iterator > | attr_range |
typedef vtr::Range< param_iterator > | param_range |
typedef vtr::Range< net_iterator > | net_range |
typedef vtr::Range< pin_iterator > | pin_range |
typedef vtr::Range< port_iterator > | port_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, StringId > | block_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, StringId > | port_names_ |
vtr::vector_map< PortId, BlockId > | port_blocks_ |
vtr::vector_map< PortId, std::vector< PinId > > | port_pins_ |
vtr::vector_map< PortId, BitIndex > | port_widths_ |
vtr::vector_map< PortId, PortType > | port_types_ |
vtr::vector_map< PinId, PinId > | pin_ids_ |
vtr::vector_map< PinId, PortId > | pin_ports_ |
vtr::vector_map< PinId, BitIndex > | pin_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, StringId > | net_names_ |
vtr::vector_map< NetId, std::vector< PinId > > | net_pins_ |
vtr::vector_map< StringId, StringId > | string_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, StringId > | string_to_string_id_ |
typedef std::unordered_map<std::string, std::string>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::attr_iterator |
typedef vtr::Range<attr_iterator> Netlist< BlockId, PortId, PinId, NetId >::attr_range |
typedef vtr::vector_map<BlockId, BlockId>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::block_iterator |
typedef vtr::Range<block_iterator> Netlist< BlockId, PortId, PinId, NetId >::block_range |
typedef NetlistIdRemapper<BlockId, PortId, PinId, NetId> Netlist< BlockId, PortId, PinId, NetId >::IdRemapper |
typedef vtr::vector_map<NetId, NetId>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::net_iterator |
typedef vtr::Range<net_iterator> Netlist< BlockId, PortId, PinId, NetId >::net_range |
typedef std::unordered_map<std::string, std::string>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::param_iterator |
typedef vtr::Range<param_iterator> Netlist< BlockId, PortId, PinId, NetId >::param_range |
typedef vtr::vector_map<PinId, PinId>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::pin_iterator |
typedef vtr::Range<pin_iterator> Netlist< BlockId, PortId, PinId, NetId >::pin_range |
typedef vtr::vector_map<PortId, PortId>::const_iterator Netlist< BlockId, PortId, PinId, NetId >::port_iterator |
typedef vtr::Range<port_iterator> Netlist< BlockId, PortId, PinId, NetId >::port_range |
|
protected |
A unique identifier for a string in the netlist.
Netlist< BlockId, PortId, PinId, NetId >::Netlist | ( | std::string | name = "" , |
std::string | id = "" |
||
) |
|
virtual |
|
protected |
Create a completely specified net from specified driver and sinks.
name | The name of the net (Note: must not already exist) |
driver | The net's driver pin |
sinks | The net's sink pins |
|
protected |
Updates block cross-references for the specified pin.
|
protected |
Updates net cross-references for the specified pin.
|
protected |
Updates port cross-references for the specified pin.
|
protected |
Updates block cross-references for the specified port.
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.
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.
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.
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.
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.
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.
const std::string& Netlist< BlockId, PortId, PinId, NetId >::block_name | ( | const BlockId | blk_id | ) | const |
Returns the name of the specified block.
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.
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.
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.
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.
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.
block_range Netlist< BlockId, PortId, PinId, NetId >::blocks | ( | ) | const |
Returns a range consisting of all blocks in the netlist.
|
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.
|
protected |
Removes invalid and reorders blocks.
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
|
protected |
Removes invalid and reorders nets.
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
|
protected |
Removes invalid and reorders pins.
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
|
protected |
Removes invalid and reorders ports.
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
IdRemapper Netlist< BlockId, PortId, PinId, NetId >::compress | ( | ) |
Compresses the netlist, removing any invalid and/or unreferenced blocks/ports/pins/nets.
|
protected |
Create or return an existing block in the netlist.
name | The unique name of the block |
|
protected |
Create an empty, or return an existing net in the netlist.
name | The unique name of the net |
|
protected |
Create or return an existing pin in the netlist.
port_id | The port this pin is associated with |
port_bit | The bit index of the pin in the port |
net_id | The net the pin drives/sinks |
pin_type | The type of the pin (driver/sink) |
is_const | Indicates whether the pin holds a constant value (e. g. vcc/gnd) |
|
protected |
Create or return an existing port in the netlist.
blk_id | The block the port is associated with |
name | The name of the port (must match the name of a port in the block's model) |
width | The width (number of bits) of the port |
type | The type of the port (INPUT, OUTPUT, CLOCK) |
|
protected |
Create or return the ID of the specified string.
str | The string whose ID is requested |
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.
name | The name of the block |
|
protected |
Returns the BlockId of the specifed block if it exists or BlockId::INVALID() if not.
name_id | : The block name to look for |
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.
name | The name of the net |
|
protected |
Returns the NetId of the specifed port if it exists or NetId::INVALID() if not.
name_id | The string ID of the net name to look for |
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.
port_id | The ID of the associated port |
port_bit | The bit index of the pin in the port |
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.
name | The name of the pin |
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.
blk_id | The ID of the block who's ports will be checked |
name | The name of the port to look for |
|
protected |
Returns the StringId of the specifed string if it exists or StringId::INVALID() if not.
str | The string to look for |
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)
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)
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
driver_net | The net which includes the driver pin |
sink_net | The target net to be merged into driver_net (must have no driver pin) |
PinId Netlist< BlockId, PortId, PinId, NetId >::net_driver | ( | const NetId | net_id | ) | const |
Returns the (potentially invalid) net driver pin.
BlockId Netlist< BlockId, PortId, PinId, NetId >::net_driver_block | ( | const NetId | net_id | ) | const |
Returns the (potentially invalid) net driver block.
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)
const std::string& Netlist< BlockId, PortId, PinId, NetId >::net_name | ( | const NetId | net_id | ) | const |
Returns the name of the specified net.
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.
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.
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
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.
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.
const std::string& Netlist< BlockId, PortId, PinId, NetId >::netlist_name | ( | ) | const |
Retrieve the name of the netlist.
net_range Netlist< BlockId, PortId, PinId, NetId >::nets | ( | ) | const |
Returns a range consisting of all nets in the netlist.
BlockId Netlist< BlockId, PortId, PinId, NetId >::pin_block | ( | const PinId | pin_id | ) | const |
Returns the block associated with the specified pin.
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)
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.
NetId Netlist< BlockId, PortId, PinId, NetId >::pin_net | ( | const PinId | pin_id | ) | const |
Returns the net associated with the specified pin.
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.
PortId Netlist< BlockId, PortId, PinId, NetId >::pin_port | ( | const PinId | pin_id | ) | const |
Returns the port associated with the specified pin.
BitIndex Netlist< BlockId, PortId, PinId, NetId >::pin_port_bit | ( | const PinId | pin_id | ) | const |
Returns the port bit index associated with the specified pin.
PortType Netlist< BlockId, PortId, PinId, NetId >::pin_port_type | ( | const PinId | pin_id | ) | const |
Returns the port type associated with the specified pin.
PinType Netlist< BlockId, PortId, PinId, NetId >::pin_type | ( | const PinId | pin_id | ) | const |
Returns the type of the specified pin.
pin_range Netlist< BlockId, PortId, PinId, NetId >::pins | ( | ) | const |
Returns a range consisting of all pins in the netlist.
BlockId Netlist< BlockId, PortId, PinId, NetId >::port_block | ( | const PortId | port_id | ) | const |
Returns the block associated with the specified port.
const std::string& Netlist< BlockId, PortId, PinId, NetId >::port_name | ( | const PortId | port_id | ) | const |
Returns the name of the specified port.
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.
port_id | The ID of the associated port |
port_bit | The bit index of the pin in the port |
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.
port_id | The ID of the associated port |
port_bit | The bit index of the pin in the port |
pin_range Netlist< BlockId, PortId, PinId, NetId >::port_pins | ( | const PortId | port_id | ) | const |
Returns the set of valid pins associated with the port.
PortType Netlist< BlockId, PortId, PinId, NetId >::port_type | ( | const PortId | port_id | ) | const |
Returns the type of the specified port.
BitIndex Netlist< BlockId, PortId, PinId, NetId >::port_width | ( | const PortId | port_id | ) | const |
Returns the width (number of bits) in the specified port.
port_range Netlist< BlockId, PortId, PinId, NetId >::ports | ( | ) | const |
Returns a range consisting of all ports in the netlist.
void Netlist< BlockId, PortId, PinId, NetId >::print_stats | ( | ) | const |
Item counts and container info (for debugging)
|
protected |
Re-builds cross-references held by blocks.
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
|
protected |
Re-builds fast look-ups.
|
protected |
Re-builds cross-references held by nets.
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
|
protected |
Re-builds cross-references held by pins.
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
|
protected |
Re-builds cross-references held by ports.
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
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
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.
blk_id | The block to be removed |
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
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.
net_id | The net to be removed |
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
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
net_id | The net from which the pin is to be removed |
pin_id | The pin to be removed from the net |
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
pin_id | The pin_id of the pin to be removed |
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
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
port_id | The ID of the port to be removed |
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
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()
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.
blk_id | The block to which the attribute is attached |
name | The name of the attribute to set |
value | The new value for the specified attribute on the specified block |
void Netlist< BlockId, PortId, PinId, NetId >::set_block_name | ( | const BlockId | blk_id, |
const std::string | new_name | ||
) |
Re-name a block.
blk_id | : The block to be renamed |
new_name | : The new name for the specified block |
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.
blk_id | The block to which the parameter is attached |
name | The name of the parameter to set |
value | The new value for the specified parameter on the specified block |
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.
pin_id | The pin to be marked |
value | The boolean value to set the pin_is_constant attribute |
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.
pin | The pin to add |
pin_type | The type of the pin (i.e. driver or sink) |
net | The net to add the pin to |
|
protected |
|
protectedpure virtual |
Implemented in AtomNetlist, and ClusteredNetlist.
bool Netlist< BlockId, PortId, PinId, NetId >::valid_block_id | ( | BlockId | block_id | ) | const |
bool Netlist< BlockId, PortId, PinId, NetId >::valid_net_id | ( | NetId | net_id | ) | const |
bool Netlist< BlockId, PortId, PinId, NetId >::valid_pin_id | ( | PinId | pin_id | ) | const |
bool Netlist< BlockId, PortId, PinId, NetId >::valid_port_bit | ( | PortId | port_id, |
BitIndex | port_bit | ||
) | const |
bool Netlist< BlockId, PortId, PinId, NetId >::valid_port_id | ( | PortId | port_id | ) | const |
|
protected |
Validates that the specified ID is valid in the current netlist state.
|
protected |
|
protected |
|
protected |
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
|
protected |
|
protected |
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
|
protected |
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
|
protected |
|
protected |
|
protectedpure virtual |
Implemented in ClusteredNetlist, and AtomNetlist.
|
protected |
|
protected |
bool Netlist< BlockId, PortId, PinId, NetId >::verify | ( | ) | const |
Sanity check for internal consistency (throws an exception on failure)
|
protected |
Verify that block invariants hold (i.e. logical consistency)
|
protected |
Verify that fast-lookups are consistent with internal data structures.
|
protected |
|
protected |
|
private |
Attributes of each block
|
private |
Valid block ids
|
private |
|
private |
Name of each block
|
private |
Number of clock pins on each block
|
private |
Clock ports of each block
|
private |
Number of input pins on each block
|
private |
Input ports of each block
|
private |
Number of output pins on each block
|
private |
Output ports of each block
|
private |
Parameters of each block
|
private |
Pins of each block
|
private |
Ports of each block
|
private |
Indicates the netlist has invalid entries from remove_*() functions
|
staticprotected |
|
staticprotected |
|
private |
Valid net ids
|
private |
|
private |
Name of each net
|
private |
Pins associated with each net
|
private |
Unique identifier for the netlist
|
private |
Name of the top-level netlist
|
private |
Valid pin ids
|
private |
Index of the specified pin within it's associated net
Indicates if the pin always keeps a constant value
|
private |
|
private |
Net associated with each pin
|
private |
The pins bit position in the port
|
private |
Type of each pin
|
private |
Block associated with each port
|
private |
Valid port ids
|
private |
Name of each port
|
private |
Pins associated with each port
|
private |
Type of the port (INPUT, OUTPUT, CLOCK)
|
private |
Width (in bits) of each port
|
private |
Valid string ids
|
private |
|
private |
Strings