|
| 1 | +=============== |
| 2 | +Netlist mapping |
| 3 | +=============== |
| 4 | +As shown in the previous section, there are multiple levels of abstraction (multiple netlists) in VPR which are the ClusteredNetlist and the AtomNetlist. To fully use these netlists, we provide some functions to map between them. |
| 5 | + |
| 6 | +In this section, we will state how to map between the atom and clustered netlists. |
| 7 | + |
| 8 | +Block Id |
| 9 | +-------- |
| 10 | + |
| 11 | +Atom block Id to Cluster block Id |
| 12 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 13 | +To get the block Id of a cluster in the ClusteredNetlist from the block Id of one of its atoms in the AtomNetlist: |
| 14 | + |
| 15 | +* Using AtomLookUp class |
| 16 | + |
| 17 | +.. code-block:: cpp |
| 18 | +
|
| 19 | + ClusterBlockId clb_index = g_vpr_ctx.atom().lookup.atom_clb(atom_blk_id); |
| 20 | +
|
| 21 | +
|
| 22 | +* Using re_cluster_util.h helper functions |
| 23 | + |
| 24 | +.. code-block:: cpp |
| 25 | +
|
| 26 | + ClusterBlockId clb_index = atom_to_cluster(atom_blk_id); |
| 27 | +
|
| 28 | +
|
| 29 | +Cluster block Id to Atom block Id |
| 30 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 31 | +To get the block Ids of all the atoms in the AtomNetlist that are packed in one cluster block in ClusteredNetlist: |
| 32 | + |
| 33 | +* Using ClusterAtomLookup class |
| 34 | + |
| 35 | +.. code-block:: cpp |
| 36 | +
|
| 37 | + ClusterAtomsLookup cluster_lookup; |
| 38 | + std::vector<AtomBlockId> atom_ids = cluster_lookup.atoms_in_cluster(clb_index); |
| 39 | +
|
| 40 | +* Using re_cluster_util.h helper functions |
| 41 | + |
| 42 | +.. code-block:: cpp |
| 43 | +
|
| 44 | + std::vector<AtomBlockId> atom_ids = cluster_to_atoms(clb_index); |
| 45 | +
|
| 46 | +
|
| 47 | +Net Id |
| 48 | +------ |
| 49 | + |
| 50 | +Atom net Id to Cluster net Id |
| 51 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 52 | +To get the net Id in the ClusteredNetlist from its Id in the AtomNetlist, use AtomLookup class as follows |
| 53 | + |
| 54 | +.. code-block:: cpp |
| 55 | +
|
| 56 | + ClusterNetId clb_net = g_vpr_ctx.atom().lookup.clb_net(atom_net); |
| 57 | +
|
| 58 | +
|
| 59 | +Cluster net Id to Atom net Id |
| 60 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 61 | +To get the net Id in the AtomNetlist from its Id in the ClusteredNetlist, use AtomLookup class as follows |
| 62 | + |
| 63 | +.. code-block:: cpp |
| 64 | +
|
| 65 | + ClusterNetId atom_net = g_vpr_ctx.atom().lookup.atom_net(clb_net); |
0 commit comments