Skip to content

Commit d4c7aee

Browse files
Merge pull request #3144 from verilog-to-routing/strongid_decl_style
Move StrongID tag struct declarations into StrongID template argument
2 parents dc299f9 + 03ebbfc commit d4c7aee

File tree

15 files changed

+27
-63
lines changed

15 files changed

+27
-63
lines changed

libs/libarchfpga/src/logic_types.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ struct t_model {
6262
bool never_prune = false; ///< Don't remove from the netlist even if a block of this type has no output ports used and, therefore, unconnected to the rest of the netlist
6363
};
6464

65-
// Tag for the logical model ID
66-
struct logical_model_id_tag;
6765
// A unique ID that represents a logical model in the architecture.
68-
typedef vtr::StrongId<logical_model_id_tag, size_t> LogicalModelId;
66+
typedef vtr::StrongId<struct logical_model_id_tag, size_t> LogicalModelId;
6967

7068
/**
7169
* @brief A storage class containing all of the logical models in an FPGA

libs/librrgraph/src/base/rr_graph_fwd.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@ class t_rr_graph_storage;
1515

1616
class RRGraph;
1717

18-
struct rr_node_id_tag;
19-
struct rr_edge_id_tag;
20-
struct rr_indexed_data_id_tag;
21-
struct rr_switch_id_tag;
22-
struct rr_segment_id_tag;
23-
struct rc_index_tag;
24-
25-
typedef vtr::StrongId<rr_node_id_tag, uint32_t> RRNodeId;
26-
typedef vtr::StrongId<rr_edge_id_tag, uint32_t> RREdgeId;
27-
typedef vtr::StrongId<rr_indexed_data_id_tag, uint32_t> RRIndexedDataId;
28-
typedef vtr::StrongId<rr_switch_id_tag, uint16_t> RRSwitchId;
29-
typedef vtr::StrongId<rr_segment_id_tag, uint16_t> RRSegmentId;
30-
typedef vtr::StrongId<rc_index_tag, uint16_t> NodeRCIndex;
18+
typedef vtr::StrongId<struct rr_node_id_tag, uint32_t> RRNodeId;
19+
typedef vtr::StrongId<struct rr_edge_id_tag, uint32_t> RREdgeId;
20+
typedef vtr::StrongId<struct rr_indexed_data_id_tag, uint32_t> RRIndexedDataId;
21+
typedef vtr::StrongId<struct rr_switch_id_tag, uint16_t> RRSwitchId;
22+
typedef vtr::StrongId<struct rr_segment_id_tag, uint16_t> RRSegmentId;
23+
typedef vtr::StrongId<struct rc_index_tag, uint16_t> NodeRCIndex;

libs/libvtrutil/test/test_vector.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
#include <ostream>
77

8-
struct test_tag;
9-
typedef vtr::StrongId<test_tag> TestId;
8+
typedef vtr::StrongId<struct test_tag> TestId;
109

1110
std::ostream& operator<<(std::ostream& os, const TestId id);
1211

vpr/src/analytical_place/analytical_solver.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ class PreClusterTimingManager;
3939
* This gives a linearized ID for each of the moveable blocks from 0 to the
4040
* number of moveable blocks.
4141
*/
42-
struct ap_row_id_tag {};
43-
typedef vtr::StrongId<ap_row_id_tag, size_t> APRowId;
42+
typedef vtr::StrongId<struct ap_row_id_tag, size_t> APRowId;
4443

4544
/**
4645
* @brief The Analytical Solver base class

vpr/src/analytical_place/flat_placement_bins.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@
1919
#include "vtr_vector.h"
2020
#include "vtr_vector_map.h"
2121

22-
// The tag for the flat placement bin.
23-
struct flat_placement_bin_tag {};
24-
2522
/**
2623
* @brief A unique ID to a flat placement bin.
2724
*/
28-
typedef vtr::StrongId<flat_placement_bin_tag, size_t> FlatPlacementBinId;
25+
typedef vtr::StrongId<struct flat_placement_bin_tag, size_t> FlatPlacementBinId;
2926

3027
/**
3128
* @brief A container of bins which hold AP blocks and take up space on the FPGA.

vpr/src/analytical_place/full_legalizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ namespace {
9898
/// This is used for putting the molecules in bins for packing.
9999
// FIXME: Bring this into the device_grid.
100100
// - Maybe this can be called DeviceRootTileId or something.
101-
struct device_tile_id_tag {};
102-
typedef vtr::StrongId<device_tile_id_tag, size_t> DeviceTileId;
101+
typedef vtr::StrongId<struct device_tile_id_tag, size_t> DeviceTileId;
103102

104103
/**
105104
* @brief Helper class to place cluster in the AP context.

vpr/src/analytical_place/model_grouper.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@
1818
// Forward declarations.
1919
class Prepacker;
2020

21-
/// @brief Tag for the ModelGroupId
22-
struct model_group_id_tag;
23-
2421
/// @brief A unique ID of a group of models created by the ModelGrouper class.
25-
typedef vtr::StrongId<model_group_id_tag, size_t> ModelGroupId;
22+
typedef vtr::StrongId<struct model_group_id_tag, size_t> ModelGroupId;
2623

2724
/**
2825
* @brief A manager class for grouping together models that must be legalized

vpr/src/analytical_place/partial_legalizer.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,8 @@ class PerPrimitiveDimPrefixSum2D {
340340
vtr::vector<PrimitiveVectorDim, vtr::PrefixSum2D<float>> dim_prefix_sum_;
341341
};
342342

343-
/// @brief Tag for the PrimitiveGroupId
344-
struct primitive_group_id_tag;
345-
346343
/// @brief A unique ID of a group of primitive dims created by the PrimitiveDimGrouper class.
347-
typedef vtr::StrongId<primitive_group_id_tag, size_t> PrimitiveGroupId;
344+
typedef vtr::StrongId<struct primitive_group_id_tag, size_t> PrimitiveGroupId;
348345

349346
/**
350347
* @brief A manager class for grouping together dimensions of the primitive

vpr/src/analytical_place/primitive_vector_fwd.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
#include <cstddef>
1010
#include "vtr_strong_id.h"
1111

12-
/// @brief Tag for the PrimitiveVectorDim
13-
struct primitive_vector_dim_tag;
14-
1512
/// @brief A unique dimension in the PrimtiveVector class.
16-
typedef vtr::StrongId<primitive_vector_dim_tag, size_t> PrimitiveVectorDim;
13+
typedef vtr::StrongId<struct primitive_vector_dim_tag, size_t> PrimitiveVectorDim;
1714

1815
// Forward declaration of the Primitive Vector class.
1916
class PrimitiveVector;

vpr/src/base/netlist.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -939,10 +939,8 @@ class Netlist {
939939
NetId add_net(const std::string name, PinId driver, std::vector<PinId> sinks);
940940

941941
protected: //Protected Base Types
942-
struct string_id_tag;
943-
944942
///@brief A unique identifier for a string in the netlist
945-
typedef vtr::StrongId<string_id_tag> StringId;
943+
typedef vtr::StrongId<struct string_id_tag> StringId;
946944

947945
protected: //Protected Base Members
948946
/*

vpr/src/base/netlist_fwd.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ struct general_pin_id_tag {};
1515
struct general_net_id_tag {};
1616

1717
//A unique identifier for a block/primitive in the atom netlist
18-
typedef vtr::StrongId<general_blk_id_tag> ParentBlockId;
18+
typedef vtr::StrongId<struct general_blk_id_tag> ParentBlockId;
1919

2020
//A unique identifier for a net in the atom netlist
21-
typedef vtr::StrongId<general_port_id_tag> ParentPortId;
21+
typedef vtr::StrongId<struct general_port_id_tag> ParentPortId;
2222

2323
//A unique identifier for a port in the atom netlist
24-
typedef vtr::StrongId<general_pin_id_tag> ParentPinId;
24+
typedef vtr::StrongId<struct general_pin_id_tag> ParentPinId;
2525

2626
//A unique identifier for a pin in the atom netlist
27-
typedef vtr::StrongId<general_net_id_tag> ParentNetId;
27+
typedef vtr::StrongId<struct general_net_id_tag> ParentNetId;
2828

2929
template<typename BlockId, typename PortId, typename PinId, typename NetId>
3030
class Netlist;

vpr/src/base/partition.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@
1515
* with L, T or other shapes can be created with a union of multiple rectangles.
1616
*/
1717

18-
/// @brief Type tag for PartitionId
19-
struct partition_id_tag;
20-
2118
/// @brief A unique identifier for a partition
22-
typedef vtr::StrongId<partition_id_tag> PartitionId;
19+
typedef vtr::StrongId<struct partition_id_tag> PartitionId;
2320

2421
class Partition {
2522
public:

vpr/src/noc/noc_data_types.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,16 @@
88
#include "vtr_strong_id.h"
99

1010
// data types used to index the routers and links within the noc
11-
struct noc_router_id_tag;
12-
struct noc_link_id_tag;
1311

1412
/** Datatype to index routers within the NoC */
15-
typedef vtr::StrongId<noc_router_id_tag, int> NocRouterId;
13+
typedef vtr::StrongId<struct noc_router_id_tag, int> NocRouterId;
1614
/** Datatype to index links within the NoC */
17-
typedef vtr::StrongId<noc_link_id_tag, int> NocLinkId;
15+
typedef vtr::StrongId<struct noc_link_id_tag, int> NocLinkId;
1816

1917
// data type to index traffic flows within the noc
20-
struct noc_traffic_flow_id_tag;
2118

2219
/** Datatype to index traffic flows within the application */
23-
typedef vtr::StrongId<noc_traffic_flow_id_tag, int> NocTrafficFlowId;
20+
typedef vtr::StrongId<struct noc_traffic_flow_id_tag, int> NocTrafficFlowId;
2421

2522
/** Data type to index NoC groups. */
26-
struct noc_group_id_tag;
27-
typedef vtr::StrongId<noc_group_id_tag, int> NocGroupId;
23+
typedef vtr::StrongId<struct noc_group_id_tag, int> NocGroupId;

vpr/src/pack/cluster_legalizer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ struct t_lb_router_data;
3434
// A special ID to identify the legalization clusters. This is separate from the
3535
// ClusterBlockId since this legalizer is not necessarily tied to the Clustered
3636
// netlist, but is used as a sub-routine to it.
37-
struct legalization_cluster_id_tag;
38-
typedef vtr::StrongId<legalization_cluster_id_tag, size_t> LegalizationClusterId;
37+
typedef vtr::StrongId<struct legalization_cluster_id_tag, size_t> LegalizationClusterId;
3938

4039
/**
4140
* @brief Holds information to be shared between molecules that represent the

vpr/src/pack/prepack.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ class LogicalModels;
2323
struct t_logical_block_type;
2424

2525
// A unique ID used to identify a molecule generated by the prepacker.
26-
struct pack_molecule_id_tag;
27-
typedef vtr::StrongId<pack_molecule_id_tag, size_t> PackMoleculeId;
26+
typedef vtr::StrongId<struct pack_molecule_id_tag, size_t> PackMoleculeId;
2827

2928
// A unique ID used to identify a chain of molecules generated by the prepacker.
30-
struct molecule_chain_id_tag;
31-
typedef vtr::StrongId<molecule_chain_id_tag, size_t> MoleculeChainId;
29+
typedef vtr::StrongId<struct molecule_chain_id_tag, size_t> MoleculeChainId;
3230

3331
/**
3432
* @brief Holds general information to be shared between molecules that

0 commit comments

Comments
 (0)