Skip to content

Commit 6137fb2

Browse files
committed
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-verilog-to-routing into openfpga_update
2 parents d13d30c + 7599927 commit 6137fb2

File tree

72 files changed

+806
-3637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+806
-3637
lines changed

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VP
4343
#Allow the user to decide whether to compile the server module
4444
option(VPR_USE_SERVER "Specify whether vpr enables the server mode" ON)
4545

46-
#Allow the user to enable/disable VPR analytic placement
47-
#VPR option --enable_analytic_placer is also required for Analytic Placement
48-
option(VPR_ANALYTIC_PLACE "Enable analytic placement in VPR." ON)
4946
option(VPR_ENABLE_INTERCHANGE "Enable FPGA interchange." ON)
5047
option(VPR_ENABLE_NOC_SAT_ROUTING "Enable NoC SAT routing." OFF)
5148

libs/libarchfpga/src/physical_types.cpp

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,71 @@ const t_port* t_logical_block_type::get_port_by_pin(int pin) const {
252252
return nullptr;
253253
}
254254

255-
/**
255+
/*
256+
* t_pb_type
257+
*/
258+
259+
int t_pb_type::get_max_primitives() const {
260+
int max_size;
261+
262+
if (modes == nullptr) {
263+
max_size = 1;
264+
} else {
265+
max_size = 0;
266+
int temp_size = 0;
267+
for (int i = 0; i < num_modes; i++) {
268+
for (int j = 0; j < modes[i].num_pb_type_children; j++) {
269+
temp_size += modes[i].pb_type_children[j].num_pb * modes[i].pb_type_children[j].get_max_primitives();
270+
}
271+
if (temp_size > max_size) {
272+
max_size = temp_size;
273+
}
274+
}
275+
}
276+
277+
return max_size;
278+
}
279+
280+
/* finds maximum number of nets that can be contained in pb_type, this is bounded by the number of driving pins */
281+
int t_pb_type::get_max_nets() const {
282+
int max_nets;
283+
if (modes == nullptr) {
284+
max_nets = num_output_pins;
285+
} else {
286+
max_nets = 0;
287+
288+
for (int i = 0; i < num_modes; i++) {
289+
int temp_nets = 0;
290+
for (int j = 0; j < modes[i].num_pb_type_children; j++) {
291+
temp_nets += modes[i].pb_type_children[j].num_pb * modes[i].pb_type_children[j].get_max_nets();
292+
}
293+
294+
if (temp_nets > max_nets) {
295+
max_nets = temp_nets;
296+
}
297+
}
298+
}
299+
300+
if (is_root()) {
301+
max_nets += num_input_pins + num_output_pins + num_clock_pins;
302+
}
303+
304+
return max_nets;
305+
}
306+
307+
int t_pb_type::get_max_depth() const {
308+
int max_depth = depth;
309+
310+
for (int i = 0; i < num_modes; i++) {
311+
for (int j = 0; j < modes[i].num_pb_type_children; j++) {
312+
int temp_depth = modes[i].pb_type_children[j].get_max_depth();
313+
max_depth = std::max(max_depth, temp_depth);
314+
}
315+
}
316+
return max_depth;
317+
}
318+
319+
/*
256320
* t_pb_graph_node
257321
*/
258322

libs/libarchfpga/src/physical_types.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,11 @@ struct t_physical_tile_type {
730730
///@brief Is this t_physical_tile_type an empty type?
731731
bool is_empty() const;
732732

733+
///@brief Returns true if the physical tile type can implement either a .input or .output block type
734+
inline bool is_io() const {
735+
return is_input_type || is_output_type;
736+
}
737+
733738
///@brief Returns the relative pin index within a sub tile that corresponds to the pin within the given port and its index in the port
734739
int find_pin(std::string_view port_name, int pin_index_in_port) const;
735740

@@ -1092,6 +1097,10 @@ struct t_pb_type {
10921097
inline bool is_primitive() const {
10931098
return num_modes == 0;
10941099
}
1100+
1101+
int get_max_primitives() const;
1102+
int get_max_depth() const;
1103+
int get_max_nets() const;
10951104
};
10961105

10971106
/** Describes an operational mode of a clustered logic block

libs/libarchfpga/src/physical_types_util.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -637,21 +637,6 @@ bool is_pin_conencted_to_layer(t_physical_tile_type_ptr type, int ipin, int from
637637
return false;
638638
}
639639

640-
// TODO: Remove is_input_type / is_output_type / is_io_type as part of
641-
// https://github.com/verilog-to-routing/vtr-verilog-to-routing/issues/1193
642-
bool is_input_type(t_physical_tile_type_ptr type) {
643-
return type->is_input_type;
644-
}
645-
646-
bool is_output_type(t_physical_tile_type_ptr type) {
647-
return type->is_output_type;
648-
}
649-
650-
bool is_io_type(t_physical_tile_type_ptr type) {
651-
return is_input_type(type)
652-
|| is_output_type(type);
653-
}
654-
655640
std::string block_type_pin_index_to_name(t_physical_tile_type_ptr type, int pin_physical_num, bool is_flat) {
656641
int max_ptc = get_tile_pin_max_ptc(type, is_flat);
657642
VTR_ASSERT(pin_physical_num < max_ptc);

libs/libarchfpga/src/physical_types_util.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,6 @@ bool is_opin(int ipin, t_physical_tile_type_ptr type);
120120
///@brief Returns true if the specified pin is located at "from_layer" and it is connected to "to_layer"
121121
bool is_pin_conencted_to_layer(t_physical_tile_type_ptr type, int ipin, int from_layer, int to_layer, int num_of_avail_layer);
122122

123-
///@brief Returns true if the given physical tile type can implement a .input block type
124-
bool is_input_type(t_physical_tile_type_ptr type);
125-
///@brief Returns true if the given physical tile type can implement a .output block type
126-
bool is_output_type(t_physical_tile_type_ptr type);
127-
///@brief Returns true if the given physical tile type can implement either a .input or .output block type
128-
bool is_io_type(t_physical_tile_type_ptr type);
129-
130123
/**
131124
* @brief Returns the corresponding physical pin based on the input parameters:
132125
*

vpr/CMakeLists.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@ else ()
9191
message(STATUS "Eigen3: Not Found. Some features may be disabled.")
9292
endif (TARGET Eigen3::Eigen)
9393

94-
#VPR_ANALYTIC_PLACE is initialized in the root CMakeLists
95-
# NOTE: This is the cluster-level Analytical Placement which existed before the
96-
# flat Analytical Placement flow.
97-
if(${VPR_ANALYTIC_PLACE})
98-
message(STATUS "VPR Analytic Placement: Requested")
99-
if (TARGET Eigen3::Eigen)
100-
message(STATUS "VPR Analytic Placement dependency (Eigen3): Found")
101-
message(STATUS "VPR Analytic Placement: Enabled")
102-
target_compile_definitions(libvpr PUBLIC -DENABLE_ANALYTIC_PLACE)
103-
else ()
104-
message(STATUS "VPR Analytic Placement dependency (Eigen3): Not Found (Download manually with sudo apt install libeigen3-dev, and rebuild)")
105-
message(STATUS "VPR Analytic Placement: Disabled")
106-
endif(TARGET Eigen3::Eigen)
107-
endif()
108-
10994
if (${VPR_ENABLE_NOC_SAT_ROUTING})
11095
message(STATUS "VPR NoC SAT Routing: Requested")
11196
find_package(ortools CONFIG REQUIRED)

vpr/src/base/SetupVPR.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,6 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts)
701701

702702
PlacerOpts->effort_scaling = Options.place_effort_scaling;
703703
PlacerOpts->timing_update_type = Options.timing_update_type;
704-
PlacerOpts->enable_analytic_placer = Options.enable_analytic_placer;
705704
PlacerOpts->place_static_move_prob = vtr::vector<e_move_type, float>(Options.place_static_move_prob.value().begin(),
706705
Options.place_static_move_prob.value().end());
707706
PlacerOpts->place_high_fanout_net = Options.place_high_fanout_net;

vpr/src/base/ShowSetup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ ClusteredNetlistStats::ClusteredNetlistStats() {
135135
auto logical_block = cluster_ctx.clb_nlist.block_type(blk_id);
136136
auto physical_tile = pick_physical_type(logical_block);
137137
num_blocks_type[logical_block->index]++;
138-
if (is_io_type(physical_tile)) {
138+
if (physical_tile->is_io()) {
139139
for (int j = 0; j < logical_block->pb_type->num_pins; j++) {
140140
int physical_pin = get_physical_pin(physical_tile, logical_block, j);
141141

vpr/src/base/check_netlist.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ static int check_connections_to_global_clb_pins(ClusterNetId net_id, int verbosi
110110
int log_index = cluster_ctx.clb_nlist.pin_logical_index(pin_id);
111111
int pin_index = get_physical_pin(physical_type, logical_type, log_index);
112112

113-
if (physical_type->is_ignored_pin[pin_index] != net_is_ignored
114-
&& !is_io_type(physical_type)) {
113+
if (physical_type->is_ignored_pin[pin_index] != net_is_ignored && !physical_type->is_io()) {
115114
VTR_LOGV_WARN(verbosity > 2,
116115
"Global net '%s' connects to non-global architecture pin '%s' (netlist pin '%s')\n",
117116
cluster_ctx.clb_nlist.net_name(net_id).c_str(),

vpr/src/base/read_options.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,13 +2244,6 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
22442244
.default_value("0")
22452245
.show_in(argparse::ShowIn::HELP_ONLY);
22462246

2247-
place_grp.add_argument(args.enable_analytic_placer, "--enable_analytic_placer")
2248-
.help(
2249-
"Enables the analytic placer. "
2250-
"Once analytic placement is done, the result is passed through the quench phase of the annealing placer for local improvement")
2251-
.default_value("false")
2252-
.show_in(argparse::ShowIn::HELP_ONLY);
2253-
22542247
place_grp.add_argument(args.place_static_move_prob, "--place_static_move_prob")
22552248
.help(
22562249
"The percentage probabilities of different moves in Simulated Annealing placement. "

vpr/src/base/read_options.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ struct t_options {
139139
argparse::ArgValue<int> placement_saves_per_temperature;
140140
argparse::ArgValue<e_place_effort_scaling> place_effort_scaling;
141141
argparse::ArgValue<e_place_delta_delay_algorithm> place_delta_delay_matrix_calculation_method;
142-
argparse::ArgValue<bool> enable_analytic_placer;
143142
argparse::ArgValue<std::vector<float>> place_static_move_prob;
144143
argparse::ArgValue<int> place_high_fanout_net;
145144
argparse::ArgValue<e_place_bounding_box_mode> place_bounding_box_mode;

vpr/src/base/read_route.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static void process_nodes(const Netlist<>& net_list, std::ifstream& fp, ClusterN
296296
/* Verify types and ptc*/
297297
if (tokens[2] == "SOURCE" || tokens[2] == "SINK" || tokens[2] == "OPIN" || tokens[2] == "IPIN") {
298298
const auto& type = device_ctx.grid.get_physical_type({x, y, layer_num});
299-
if (tokens[4 + offset] == "Pad:" && !is_io_type(type)) {
299+
if (tokens[4 + offset] == "Pad:" && !type->is_io()) {
300300
vpr_throw(VPR_ERROR_ROUTE, filename, lineno,
301301
"Node %d is of the wrong type", inode);
302302
}
@@ -319,7 +319,7 @@ static void process_nodes(const Netlist<>& net_list, std::ifstream& fp, ClusterN
319319
if (tokens[6 + offset] != "Switch:") {
320320
/*This is an opin or ipin, process its pin nums*/
321321
auto type = device_ctx.grid.get_physical_type({x, y, layer_num});
322-
if (!is_io_type(type) && (tokens[2] == "IPIN" || tokens[2] == "OPIN")) {
322+
if (!type->is_io() && (tokens[2] == "IPIN" || tokens[2] == "OPIN")) {
323323
int pin_num = rr_graph.node_pin_num(RRNodeId(inode));
324324
int width_offset = device_ctx.grid.get_width_offset({x, y, layer_num});
325325
int height_offset = device_ctx.grid.get_height_offset({x, y, layer_num});
@@ -592,10 +592,13 @@ void print_route(const Netlist<>& net_list,
592592
fprintf(fp, "to (%d,%d,%d) ", rr_graph.node_xhigh(inode),
593593
rr_graph.node_yhigh(inode), layer_num);
594594

595+
t_physical_tile_type_ptr physical_tile = device_ctx.grid.get_physical_type({ilow, jlow, layer_num});
596+
595597
switch (rr_type) {
596598
case e_rr_type::IPIN:
597599
case e_rr_type::OPIN:
598-
if (is_io_type(device_ctx.grid.get_physical_type({ilow, jlow, layer_num}))) {
600+
601+
if (physical_tile->is_io()) {
599602
fprintf(fp, " Pad: ");
600603
} else { /* IO Pad. */
601604
fprintf(fp, " Pin: ");
@@ -609,7 +612,7 @@ void print_route(const Netlist<>& net_list,
609612

610613
case e_rr_type::SOURCE:
611614
case e_rr_type::SINK:
612-
if (is_io_type(device_ctx.grid.get_physical_type({ilow, jlow, layer_num}))) {
615+
if (physical_tile->is_io()) {
613616
fprintf(fp, " Pad: ");
614617
} else { /* IO Pad. */
615618
fprintf(fp, " Class: ");
@@ -629,8 +632,7 @@ void print_route(const Netlist<>& net_list,
629632

630633
fprintf(fp, "%d ", rr_graph.node_ptc_num(inode));
631634

632-
auto physical_tile = device_ctx.grid.get_physical_type({ilow, jlow, layer_num});
633-
if (!is_io_type(physical_tile) && (rr_type == e_rr_type::IPIN || rr_type == e_rr_type::OPIN)) {
635+
if (!physical_tile->is_io() && (rr_type == e_rr_type::IPIN || rr_type == e_rr_type::OPIN)) {
634636
int pin_num = rr_graph.node_pin_num(inode);
635637
int xoffset = device_ctx.grid.get_width_offset({ilow, jlow, layer_num});
636638
int yoffset = device_ctx.grid.get_height_offset({ilow, jlow, layer_num});

vpr/src/base/stats.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,7 @@ void routing_stats(const Netlist<>& net_list,
9191
auto type = device_ctx.grid.get_physical_type({i, j, layer_num});
9292
int width_offset = device_ctx.grid.get_width_offset({i, j, layer_num});
9393
int height_offset = device_ctx.grid.get_height_offset({i, j, layer_num});
94-
if (width_offset == 0
95-
&& height_offset == 0
96-
&& !is_io_type(type)
97-
&& type != device_ctx.EMPTY_PHYSICAL_TILE_TYPE) {
94+
if (width_offset == 0 && height_offset == 0 && !type->is_io() && !type->is_empty()) {
9895
if (type->area == UNDEFINED) {
9996
area += grid_logic_tile_area * type->width * type->height;
10097
} else {
@@ -111,7 +108,7 @@ void routing_stats(const Netlist<>& net_list,
111108
for (ClusterBlockId blk_id : cluster_ctx.clb_nlist.blocks()) {
112109
t_pl_loc block_loc = block_locs[blk_id].loc;
113110
auto type = physical_tile_type(block_loc);
114-
if (!is_io_type(type)) {
111+
if (!type->is_io()) {
115112
if (type->area == UNDEFINED) {
116113
used_area += grid_logic_tile_area * type->width * type->height;
117114
} else {
@@ -473,7 +470,7 @@ void print_lambda() {
473470
t_pl_loc block_loc = block_locs[blk_id].loc;
474471
auto type = physical_tile_type(block_loc);
475472
VTR_ASSERT(type != nullptr);
476-
if (!is_io_type(type)) {
473+
if (!type->is_io()) {
477474
for (int ipin = 0; ipin < type->num_pins; ipin++) {
478475
if (get_pin_type_from_pin_physical_num(type, ipin) == RECEIVER) {
479476
ClusterNetId net_id = cluster_ctx.clb_nlist.block_net(blk_id, ipin);

vpr/src/base/vpr_types.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,14 +1071,6 @@ struct t_placer_opts {
10711071
std::string allowed_tiles_for_delay_model;
10721072

10731073
e_place_delta_delay_algorithm place_delta_delay_matrix_calculation_method;
1074-
1075-
/*
1076-
* @brief enables the analytic placer.
1077-
*
1078-
* Once analytic placement is done, the result is passed through the quench phase
1079-
* of the annealing placer for local improvement
1080-
*/
1081-
bool enable_analytic_placer;
10821074
};
10831075

10841076
/******************************************************************

vpr/src/pack/appack_max_dist_th_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void APPackMaxDistThManager::auto_set_max_distance_thresholds(const std::vector<
100100
// Find which type(s) this logical block type looks like.
101101
bool has_memory = has_memory_pbs(lb_ty.pb_type);
102102
bool is_logic_block_type = (lb_ty.index == logic_block_type->index);
103-
bool is_io_block = is_io_type(pick_physical_type(&lb_ty));
103+
bool is_io_block = pick_physical_type(&lb_ty)->is_io();
104104

105105
// Update the max distance threshold based on the type. If the logical
106106
// block type looks like many block types at the same time (for example

0 commit comments

Comments
 (0)