Skip to content

Commit b997d1a

Browse files
Merge branch 'master' into fixed_channel_parse_fix
2 parents d978c06 + d4c7aee commit b997d1a

File tree

20 files changed

+82
-66
lines changed

20 files changed

+82
-66
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/global_placer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ static void print_placement_stats(const PartialPlacement& p_placement,
127127
FlatPlacementDensityManager& density_manager,
128128
const PreClusterTimingManager& pre_cluster_timing_manager) {
129129
// Print the placement HPWL
130-
VTR_LOG("\tPlacement HPWL: %f\n", p_placement.get_hpwl(ap_netlist));
130+
VTR_LOG("\tPlacement objective HPWL: %f\n", p_placement.get_hpwl(ap_netlist));
131+
VTR_LOG("\tPlacement estimated wirelength: %u\n", p_placement.estimate_post_placement_wirelength(ap_netlist));
131132

132133
// Print the timing information.
133134
if (pre_cluster_timing_manager.is_valid()) {

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/partial_placement.cpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,48 @@ double PartialPlacement::get_hpwl(const APNetlist& netlist) const {
3333
return hpwl;
3434
}
3535

36+
double PartialPlacement::estimate_post_placement_wirelength(const APNetlist& netlist) const {
37+
// Go through each net and calculate the half-perimeter wirelength. Since
38+
// we want to estimate the post-placement wirelength, we do not want the
39+
// flat placement positions of the blocks. Instead we compute the HPWL over
40+
// the tiles that the flat placement is placing the blocks over.
41+
unsigned total_hpwl = 0;
42+
for (APNetId net_id : netlist.nets()) {
43+
// Note: Other wirelength estimates in VTR ignore global nets; however
44+
// it is not known if a net is global or not until packing is
45+
// complete. For now, we just approximate post-placement wirelength
46+
// using the HPWL (in tile space).
47+
// TODO: The reason we do not know what nets are ignored / global is
48+
// because the pin on the tile that the net connects to is what
49+
// decides if a net is global / ignored for place and route. Since
50+
// we have not packed anything yet, we do not know what pin each
51+
// net will go to; however, we can probably get a good idea based
52+
// on some properties of the net and the tile its going to / from.
53+
// Should investigate this to get a better estimate of wirelength.
54+
double min_x = std::numeric_limits<unsigned>::max();
55+
double max_x = std::numeric_limits<unsigned>::lowest();
56+
double min_y = std::numeric_limits<unsigned>::max();
57+
double max_y = std::numeric_limits<unsigned>::lowest();
58+
for (APPinId pin_id : netlist.net_pins(net_id)) {
59+
APBlockId blk_id = netlist.pin_block(pin_id);
60+
min_x = std::min(min_x, block_x_locs[blk_id]);
61+
max_x = std::max(max_x, block_x_locs[blk_id]);
62+
min_y = std::min(min_y, block_y_locs[blk_id]);
63+
max_y = std::max(max_y, block_y_locs[blk_id]);
64+
}
65+
VTR_ASSERT_SAFE(max_x >= min_x && max_y >= min_y);
66+
67+
// Floor the positions to get the x and y coordinates of the tiles each
68+
// block belongs to.
69+
unsigned tile_dx = std::floor(max_x) - std::floor(min_x);
70+
unsigned tile_dy = std::floor(max_y) - std::floor(min_y);
71+
72+
total_hpwl += tile_dx + tile_dy;
73+
}
74+
75+
return total_hpwl;
76+
}
77+
3678
bool PartialPlacement::verify_locs(const APNetlist& netlist,
3779
size_t grid_width,
3880
size_t grid_height) const {

vpr/src/analytical_place/partial_placement.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ struct PartialPlacement {
145145
*/
146146
double get_hpwl(const APNetlist& netlist) const;
147147

148+
/**
149+
* @brief Estimate the wirelength of the current placement assuming that all
150+
* blocks will be placed exactly where they are in the partial placement.
151+
*
152+
* NOTE: This is an underestimate of the actual wirelength mainly due to
153+
* the placement not being legalized yet.
154+
*/
155+
double estimate_post_placement_wirelength(const APNetlist& netlist) const;
156+
148157
/**
149158
* @brief Verify the block_x_locs and block_y_locs vectors
150159
*

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

vtr_flow/parse/qor_config/qor_ap_fixed_chan_width.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# channel width.
33

44
vpr_status;output.txt;vpr_status=(.*)
5-
post_gp_hpwl;vpr.out;\s*Placement HPWL: (.*)
5+
post_gp_hpwl;vpr.out;\s*Placement estimated wirelength: (.*)
66
post_fl_hpwl;vpr.out;Initial placement BB estimate of wirelength: (.*)
77
post_dp_hpwl;vpr.out;BB estimate of min-dist \(placement\) wire length: (.*)
88
total_wirelength;vpr.out;\s*Total wirelength: (\d+)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
arch circuit script_params vtr_flow_elapsed_time vtr_max_mem_stage vtr_max_mem error odin_synth_time max_odin_mem parmys_synth_time max_parmys_mem abc_depth abc_synth_time abc_cec_time abc_sec_time max_abc_mem ace_time max_ace_mem num_clb num_io num_memories num_mult vpr_status vpr_revision vpr_build_info vpr_compiler vpr_compiled hostname rundir max_vpr_mem num_primary_inputs num_primary_outputs num_pre_packed_nets num_pre_packed_blocks num_netlist_clocks num_post_packed_nets num_post_packed_blocks device_width device_height device_grid_tiles device_limiting_resources device_name pack_mem pack_time initial_placed_wirelength_est placed_wirelength_est total_swap accepted_swap rejected_swap aborted_swap place_mem place_time place_quench_time initial_placed_CPD_est placed_CPD_est placed_setup_TNS_est placed_setup_WNS_est placed_geomean_nonvirtual_intradomain_critical_path_delay_est place_delay_matrix_lookup_time place_quench_timing_analysis_time place_quench_sta_time place_total_timing_analysis_time place_total_sta_time ap_mem ap_time ap_full_legalizer_mem ap_full_legalizer_time min_chan_width routed_wirelength min_chan_width_route_success_iteration logic_block_area_total logic_block_area_used min_chan_width_routing_area_total min_chan_width_routing_area_per_tile min_chan_width_route_time min_chan_width_total_timing_analysis_time min_chan_width_total_sta_time crit_path_num_rr_graph_nodes crit_path_num_rr_graph_edges crit_path_collapsed_nodes crit_path_routed_wirelength crit_path_route_success_iteration crit_path_total_nets_routed crit_path_total_connections_routed crit_path_total_heap_pushes crit_path_total_heap_pops critical_path_delay geomean_nonvirtual_intradomain_critical_path_delay setup_TNS setup_WNS hold_TNS hold_WNS crit_path_routing_area_total crit_path_routing_area_per_tile router_lookahead_computation_time crit_path_route_time crit_path_create_rr_graph_time crit_path_create_intra_cluster_rr_graph_time crit_path_tile_lookahead_computation_time crit_path_router_lookahead_computation_time crit_path_total_timing_analysis_time crit_path_total_sta_time
2-
7series_BRAM_DSP_carry.xml stereovision3.v common 4.67 vpr 71.88 MiB -1 -1 0.35 24184 5 0.11 -1 -1 32616 -1 -1 -1 11 0 -1 success v8.0.0-13078-g2957e2731 release IPO VTR_ASSERT_LEVEL=2 GNU 13.3.0 on Linux-6.8.0-60-generic x86_64 2025-06-16T18:49:38 betzgrp-wintermute /home/pooladam/vtr-verilog-to-routing 73604 11 2 303 283 2 114 35 7 7 49 CLB auto 32.5 MiB 1.56 569.025 404 890 113 545 232 71.9 MiB 0.02 0.00 3.1717 3.1717 -181.811 -3.1717 2.89952 0.16 0.000410323 0.000358804 0.00972892 0.00889236 -1 -1 -1 -1 44 515 16 1.34735e+06 1.18567e+06 177202. 3616.36 1.30 0.156453 0.134936 6848 92556 -1 373 9 263 823 105258 48434 2.83816 2.83244 -218.271 -2.83816 -2.452 -0.04 257836. 5261.96 0.04 0.03 0.08 -1 -1 0.04 0.017287 0.0159941
2+
7series_BRAM_DSP_carry.xml stereovision3.v common 5.34 vpr 74.72 MiB -1 -1 0.36 34424 5 0.10 -1 -1 36444 -1 -1 -1 11 0 -1 success v8.0.0-13075-g071b36c3f release VTR_ASSERT_LEVEL=3 GNU 13.3.0 on Linux-6.8.0-58-generic x86_64 2025-06-16T21:07:45 srivatsan-Precision-Tower-5810 /home/alex/vtr-verilog-to-routing 76512 11 2 303 283 2 114 35 7 7 49 CLB auto 35.3 MiB 1.64 569.025 404 890 113 545 232 74.7 MiB 0.02 0.00 3.1717 3.1717 -181.811 -3.1717 2.89952 0.27 0.00043783 0.000361293 0.0101279 0.00875535 -1 -1 -1 -1 44 529 20 1.34735e+06 1.18567e+06 177202. 3616.36 1.77 0.144934 0.119762 6848 92556 -1 373 9 263 823 105258 48434 2.83816 2.83244 -218.271 -2.83816 -2.452 -0.04 257836. 5261.96 0.06 0.03 0.13 -1 -1 0.06 0.0166581 0.0151597

0 commit comments

Comments
 (0)