Verilog to Routing - VPR
atom_lookup.h
Go to the documentation of this file.
1 #ifndef ATOM_LOOKUP_H
2 #define ATOM_LOOKUP_H
3 #include "atom_lookup_fwd.h"
4 
5 #include <unordered_map>
6 
7 #include "vtr_bimap.h"
8 #include "vtr_vector_map.h"
9 #include "vtr_range.h"
10 
11 #include "atom_netlist_fwd.h"
12 #include "clustered_netlist_fwd.h"
13 #include "vpr_types.h"
14 #include "tatum/TimingGraphFwd.hpp"
15 
20 class AtomLookup {
21  public:
22  typedef vtr::linear_map<AtomPinId, tatum::NodeId>::const_iterator pin_tnode_iterator;
23 
24  typedef vtr::Range<pin_tnode_iterator> pin_tnode_range;
25 
26  public:
27  /*
28  * PBs
29  */
30 
35  const t_pb* atom_pb(const AtomBlockId blk_id) const;
36 
38  AtomBlockId pb_atom(const t_pb* pb) const;
39 
41  const t_pb_graph_node* atom_pb_graph_node(const AtomBlockId blk_id) const;
42 
48  void set_atom_pb(const AtomBlockId blk_id, const t_pb* pb);
49 
50  /*
51  * PB Pins
52  */
53 
55  const t_pb_graph_pin* atom_pin_pb_graph_pin(AtomPinId atom_pin) const;
56 
58  void set_atom_pin_pb_graph_pin(AtomPinId atom_pin, const t_pb_graph_pin* gpin);
59 
60  /*
61  * Blocks
62  */
63 
65  ClusterBlockId atom_clb(const AtomBlockId blk_id) const;
66 
72  void set_atom_clb(const AtomBlockId blk_id, const ClusterBlockId clb);
73 
74  /*
75  * Nets
76  */
77 
79  AtomNetId atom_net(const ClusterNetId clb_net_index) const;
80 
82  ClusterNetId clb_net(const AtomNetId net_id) const;
83 
89  void set_atom_clb_net(const AtomNetId net_id, const ClusterNetId clb_net_index);
90 
91  /*
92  * Timing Nodes
93  */
94 
96  tatum::NodeId atom_pin_tnode(const AtomPinId pin, BlockTnode block_tnode_type = BlockTnode::EXTERNAL) const;
97 
99  AtomPinId tnode_atom_pin(const tatum::NodeId tnode) const;
100 
103 
105  void set_atom_pin_tnode(const AtomPinId pin, const tatum::NodeId node, BlockTnode block_tnode_type);
106 
107  private: //Types
108  private:
109  vtr::bimap<AtomBlockId, const t_pb*, vtr::linear_map, std::unordered_map> atom_to_pb_;
110 
111  vtr::vector_map<AtomPinId, const t_pb_graph_pin*> atom_pin_to_pb_graph_pin_;
112 
113  vtr::vector_map<AtomBlockId, ClusterBlockId> atom_to_clb_;
114 
115  vtr::bimap<AtomNetId, ClusterNetId, vtr::linear_map, vtr::linear_map> atom_net_to_clb_net_;
116 
117  vtr::linear_map<AtomPinId, tatum::NodeId> atom_pin_tnode_external_;
118  vtr::linear_map<AtomPinId, tatum::NodeId> atom_pin_tnode_internal_;
119  vtr::linear_map<tatum::NodeId, AtomPinId> tnode_atom_pin_;
120 };
121 
122 #endif
vtr::StrongId< atom_net_id_tag > AtomNetId
Definition: atom_netlist_fwd.h:32
void set_atom_clb_net(const AtomNetId net_id, const ClusterNetId clb_net_index)
Sets the bidirectional mapping between an atom net and a clb net.
Definition: atom_lookup.cpp:105
AtomBlockId pb_atom(const t_pb *pb) const
Returns the atom block id associated with pb.
Definition: atom_lookup.cpp:17
vtr::StrongId< atom_pin_id_tag > AtomPinId
Definition: atom_netlist_fwd.h:38
AtomPinId tnode_atom_pin(const tatum::NodeId tnode) const
Returns the atom netlist pin associated with the specified timing graph node.
Definition: atom_lookup.cpp:140
vtr::vector_map< AtomBlockId, ClusterBlockId > atom_to_clb_
Definition: atom_lookup.h:113
This is a core file that defines the major data types used by VPR.
vtr::linear_map< AtomPinId, tatum::NodeId >::const_iterator pin_tnode_iterator
Definition: atom_lookup.h:22
vtr::bimap< AtomNetId, ClusterNetId, vtr::linear_map, vtr::linear_map > atom_net_to_clb_net_
Definition: atom_lookup.h:115
vtr::bimap< AtomBlockId, const t_pb *, vtr::linear_map, std::unordered_map > atom_to_pb_
Definition: atom_lookup.h:109
vtr::linear_map< tatum::NodeId, AtomPinId > tnode_atom_pin_
Definition: atom_lookup.h:119
vtr::vector_map< AtomPinId, const t_pb_graph_pin * > atom_pin_to_pb_graph_pin_
Definition: atom_lookup.h:111
The AtomLookup class describes the mapping between components in the AtomNetlist and other netlists/e...
Definition: atom_lookup.h:20
const t_pb * atom_pb(const AtomBlockId blk_id) const
Returns the leaf pb associated with the atom blk_id.
Definition: atom_lookup.cpp:8
AtomNetId atom_net(const ClusterNetId clb_net_index) const
Returns the atom net id associated with the clb_net_index.
Definition: atom_lookup.cpp:87
void set_atom_pin_tnode(const AtomPinId pin, const tatum::NodeId node, BlockTnode block_tnode_type)
Sets the bi-directional mapping between an atom netlist pin and timing graph node.
Definition: atom_lookup.cpp:158
ClusterBlockId atom_clb(const AtomBlockId blk_id) const
Returns the clb index associated with blk_id.
Definition: atom_lookup.cpp:68
void set_atom_pin_pb_graph_pin(AtomPinId atom_pin, const t_pb_graph_pin *gpin)
Sets the mapping between an atom pin and pb graph pin.
Definition: atom_lookup.cpp:61
vtr::linear_map< AtomPinId, tatum::NodeId > atom_pin_tnode_external_
Definition: atom_lookup.h:117
tatum::NodeId atom_pin_tnode(const AtomPinId pin, BlockTnode block_tnode_type=BlockTnode::EXTERNAL) const
Returns the timing graph node associated with the specified atom netlist pin.
Definition: atom_lookup.cpp:123
vtr::linear_map< AtomPinId, tatum::NodeId > atom_pin_tnode_internal_
Definition: atom_lookup.h:118
A t_pb represents an instance of a clustered block.
Definition: vpr_types.h:288
vtr::Range< pin_tnode_iterator > pin_tnode_range
Definition: atom_lookup.h:24
vtr::StrongId< cluster_net_id_tag > ClusterNetId
A unique identifier for a net in the atom netlist.
Definition: clustered_netlist_fwd.h:23
void set_atom_clb(const AtomBlockId blk_id, const ClusterBlockId clb)
Sets the bidirectional mapping between an atom and clb.
Definition: atom_lookup.cpp:78
AtomLookup::pin_tnode_range atom_pin_tnodes(BlockTnode block_tnode_type) const
Returns a range of all pin to tnode mappingsg of the specified type.
Definition: atom_lookup.cpp:149
const t_pb_graph_pin * atom_pin_pb_graph_pin(AtomPinId atom_pin) const
Returns the pb graph pin associated with the specified atom pin.
Definition: atom_lookup.cpp:54
vtr::StrongId< cluster_block_id_tag > ClusterBlockId
A unique identifier for a block/primitive in the atom netlist.
Definition: clustered_netlist_fwd.h:17
ClusterNetId clb_net(const AtomNetId net_id) const
Returns the clb net index associated with net_id.
Definition: atom_lookup.cpp:96
vtr::StrongId< atom_block_id_tag > AtomBlockId
Definition: atom_netlist_fwd.h:26
void set_atom_pb(const AtomBlockId blk_id, const t_pb *pb)
Sets the bidirectional mapping between an atom and pb.
Definition: atom_lookup.cpp:35
const t_pb_graph_node * atom_pb_graph_node(const AtomBlockId blk_id) const
Conveneince wrapper around atom_pb to access the associated graph node.
Definition: atom_lookup.cpp:26
BlockTnode
Definition: atom_lookup_fwd.h:6