Skip to content

Commit 7ec4a77

Browse files
authored
Merge pull request verilog-to-routing#9 from antmicro/round_robin_packing
round robin packing
2 parents 5e6bb55 + b212588 commit 7ec4a77

File tree

8 files changed

+254
-86
lines changed

8 files changed

+254
-86
lines changed

libs/libarchfpga/src/cad_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ struct t_pack_patterns {
3636

3737
bool is_chain; /* Does this pattern chain across logic blocks */
3838
t_pb_graph_pin *chain_root_pin; /* pointer to logic block input pin that drives this chain from the preceding logic block */
39+
int usage; /* how many atoms have been packed into molecules using this pack pattern */
3940
};
4041

4142
struct t_model_chain_pattern {

vpr/src/base/SetupVPR.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ void SetupPackerOpts(const t_options& Options,
408408
PackerOpts->beta = Options.beta_clustering;
409409
PackerOpts->debug_clustering = Options.debug_clustering;
410410
PackerOpts->enable_pin_feasibility_filter = Options.enable_clustering_pin_feasibility_filter;
411+
PackerOpts->enable_round_robin_prepacking = Options.enable_round_robin_prepacking;
411412
PackerOpts->target_external_pin_util = parse_target_external_pin_util(Options.target_external_pin_util);
412413
PackerOpts->target_device_utilization = Options.target_device_utilization;
413414

vpr/src/base/read_options.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,11 @@ static argparse::ArgumentParser create_arg_parser(std::string prog_name, t_optio
677677
.default_value("on")
678678
.show_in(argparse::ShowIn::HELP_ONLY);
679679

680+
pack_grp.add_argument<bool,ParseOnOff>(args.enable_round_robin_prepacking, "--round_robin_prepacking")
681+
.help("")
682+
.default_value("off")
683+
.show_in(argparse::ShowIn::HELP_ONLY);
684+
680685
pack_grp.add_argument(args.target_external_pin_util, "--target_ext_pin_util")
681686
.help("Sets the external pin utilization target during clustering.\n"
682687
"Value Ranges:\n"

vpr/src/base/read_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct t_options {
6969
argparse::ArgValue<bool> enable_clustering_pin_feasibility_filter;
7070
argparse::ArgValue<std::vector<std::string>> target_external_pin_util;
7171
argparse::ArgValue<bool> debug_clustering;
72+
argparse::ArgValue<bool> enable_round_robin_prepacking;
7273

7374
/* Placement options */
7475
argparse::ArgValue<int> Seed;

vpr/src/base/vpr_types.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -732,16 +732,17 @@ struct t_packer_opts {
732732
float alpha;
733733
float beta;
734734
float inter_cluster_net_delay;
735-
float target_device_utilization;
735+
float target_device_utilization;
736736
bool auto_compute_inter_cluster_net_delay;
737737
bool allow_unrelated_clustering;
738738
bool connection_driven;
739739
bool debug_clustering;
740-
bool enable_pin_feasibility_filter;
741-
t_ext_pin_util_targets target_external_pin_util;
740+
bool enable_pin_feasibility_filter;
741+
bool enable_round_robin_prepacking;
742+
t_ext_pin_util_targets target_external_pin_util;
742743
e_stage_action doPacking;
743744
enum e_packer_algorithm packer_algorithm;
744-
std::string device_layout;
745+
std::string device_layout;
745746
std::string hmetis_input_file;
746747
};
747748

@@ -1162,7 +1163,7 @@ struct t_vpr_setup {
11621163
t_placer_opts PlacerOpts; /* Options for placer */
11631164
t_annealing_sched AnnealSched; /* Placement option annealing schedule */
11641165
t_router_opts RouterOpts; /* router options */
1165-
t_analysis_opts AnalysisOpts; /* Analysis options */
1166+
t_analysis_opts AnalysisOpts; /* Analysis options */
11661167
t_det_routing_arch RoutingArch; /* routing architecture */
11671168
std::vector <t_lb_type_rr_node> *PackerRRGraph;
11681169
t_segment_inf * Segments; /* wires in routing architecture */
@@ -1172,9 +1173,9 @@ struct t_vpr_setup {
11721173
bool gen_netlist_as_blif; /* option to print out post-pack/pre-place netlist as blif */
11731174
int GraphPause; /* user interactiveness graphics option */
11741175
t_power_opts PowerOpts;
1175-
std::string device_layout;
1176-
e_constant_net_method constant_net_method; //How constant nets should be handled
1177-
e_clock_modeling clock_modeling; //How clocks should be handled
1176+
std::string device_layout;
1177+
e_constant_net_method constant_net_method; //How constant nets should be handled
1178+
e_clock_modeling clock_modeling; //How clocks should be handled
11781179
};
11791180

11801181
class RouteStatus {

vpr/src/pack/pack.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,11 @@ void try_pack(t_packer_opts *packer_opts,
9393

9494
vtr::printf_info("Begin prepacking.\n");
9595
list_of_packing_patterns = alloc_and_load_pack_patterns(&num_packing_patterns);
96-
list_of_pack_molecules = alloc_and_load_pack_molecules(list_of_packing_patterns,
96+
list_of_pack_molecules = alloc_and_load_pack_molecules(list_of_packing_patterns,
9797
atom_molecules,
9898
expected_lowest_cost_pb_gnode,
99-
num_packing_patterns);
99+
num_packing_patterns,
100+
packer_opts->enable_round_robin_prepacking);
100101
vtr::printf_info("Finish prepacking.\n");
101102

102103
if(packer_opts->auto_compute_inter_cluster_net_delay) {

0 commit comments

Comments
 (0)