Skip to content

Commit 2d959d8

Browse files
add a 3D constraint file where are atoms are locked down
1 parent 9849395 commit 2d959d8

File tree

5 files changed

+92828
-86024
lines changed

5 files changed

+92828
-86024
lines changed

vpr/src/base/read_options.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,20 +2146,20 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
21462146

21472147
place_grp.add_argument(args.place_constraint_expand, "--place_constraint_expand")
21482148
.help(
2149-
"The value used to decide how much to expand the floorplan constraint region when writing"
2150-
"a floorplan constraint XML file. Takes in an integer value from zero to infinity."
2151-
"If the value is zero, the block stays at the same x, y location. If it is"
2152-
"greater than zero the constraint region expands by the specified value in each direction."
2153-
"For example, if 1 was specified, a block at the x, y location (1, 1) would have a constraint region"
2149+
"The value used to decide how much to expand the floorplan constraint region when writing "
2150+
"a floorplan constraint XML file. Takes in an integer value from zero to infinity. "
2151+
"If the value is zero, the block stays at the same x, y location. If it is "
2152+
"greater than zero the constraint region expands by the specified value in each direction. "
2153+
"For example, if 1 was specified, a block at the x, y location (1, 1) would have a constraint region "
21542154
"of 2x2 centered around (1, 1), from (0, 0) to (2, 2).")
21552155
.default_value("0")
21562156
.show_in(argparse::ShowIn::HELP_ONLY);
21572157

21582158
place_grp.add_argument<bool, ParseOnOff>(args.place_constraint_subtile, "--place_constraint_subtile")
21592159
.help(
2160-
"The bool used to say whether to print subtile constraints when printing a floorplan constraints XML file."
2161-
"If it is off, no subtile locations are specified when printing the floorplan constraints."
2162-
"If it is on, the floorplan constraints are printed with the subtiles from current placement.")
2160+
"The bool used to say whether to print subtile constraints when printing a floorplan constraints XML file. "
2161+
"If it is off, no subtile locations are specified when printing the floorplan constraints. "
2162+
"If it is on, the floorplan constraints are printed with the subtiles from current placement. ")
21632163
.default_value("off")
21642164
.show_in(argparse::ShowIn::HELP_ONLY);
21652165

vpr/src/base/vpr_constraints_writer.cpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,22 @@
1212
#include "globals.h"
1313
#include "pugixml.hpp"
1414
#include "pugixml_util.hpp"
15-
#include "echo_files.h"
1615
#include "clustered_netlist_utils.h"
1716

1817
#include <fstream>
1918
#include "vpr_constraints_writer.h"
2019
#include "region.h"
2120
#include "re_cluster_util.h"
2221

22+
/**
23+
* @brief Create a partition with the given name and a single region.
24+
*
25+
* @param part_name The name of the partition to be created.
26+
* @param region The region that the partition covers.
27+
* @return A newly created partition with the giver name and region.
28+
*/
29+
static Partition create_partition(const std::string& part_name, const Region& region);
30+
2331
void write_vpr_floorplan_constraints(const char* file_name, int expand, bool subtile, int horizontal_partitions, int vertical_partitions) {
2432
VprConstraints constraints;
2533

@@ -54,7 +62,7 @@ void setup_vpr_floorplan_constraints_one_loc(VprConstraints& constraints, int ex
5462
* The PartitionRegion will be the location of the block in current placement, modified by the expansion factor.
5563
* The subtile can also optionally be set in the PartitionRegion, based on the value passed in by the user.
5664
*/
57-
for (auto blk_id : cluster_ctx.clb_nlist.blocks()) {
65+
for (ClusterBlockId blk_id : cluster_ctx.clb_nlist.blocks()) {
5866
const std::string& part_name = cluster_ctx.clb_nlist.block_name(blk_id);
5967
PartitionId partid(part_id);
6068

@@ -190,23 +198,26 @@ void setup_vpr_floorplan_constraints_cutpoints(VprConstraints& constraints, int
190198

191199
int num_partitions = 0;
192200
for (const auto& [region, atoms] : region_atoms) {
193-
Partition part;
194201
PartitionId partid(num_partitions);
195202
std::string part_name = "Part" + std::to_string(num_partitions);
196-
create_partition(part, part_name, region);
203+
Partition part = create_partition(part_name, region);
197204
constraints.mutable_place_constraints().add_partition(part);
198205

199-
for (auto blk_id : atoms) {
206+
for (AtomBlockId blk_id : atoms) {
200207
constraints.mutable_place_constraints().add_constrained_atom(blk_id, partid);
201208
}
202209

203210
num_partitions++;
204211
}
205212
}
206213

207-
void create_partition(Partition& part, const std::string& part_name, const Region& region) {
214+
static Partition create_partition(const std::string& part_name, const Region& region) {
215+
Partition part;
216+
208217
part.set_name(part_name);
209218
PartitionRegion part_pr;
210219
part_pr.set_partition_region({region});
211220
part.set_part_region(part_pr);
221+
222+
return part;
212223
}

vpr/src/base/vpr_constraints_writer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,4 @@ void setup_vpr_floorplan_constraints_one_loc(VprConstraints& constraints, int ex
6464
*/
6565
void setup_vpr_floorplan_constraints_cutpoints(VprConstraints& constraints, int horizontal_cutpoints, int vertical_cutpoints);
6666

67-
void create_partition(Partition& part, const std::string& part_name, const Region& region);
68-
6967
#endif /* VPR_SRC_BASE_VPR_CONSTRAINTS_WRITER_H_ */

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan_3d/config/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ script_params_common =-starting_stage vpr --route_chan_width 300 --max_router_it
2828
script_params_list_add = -sdc_file sdc/samples/neuron_stratixiv_arch_timing.sdc -read_vpr_constraints tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan_3d/one_big_partition.xml
2929
script_params_list_add = -sdc_file sdc/samples/neuron_stratixiv_arch_timing.sdc -read_vpr_constraints tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan_3d/half_blocks_right_left.xml
3030
script_params_list_add = -sdc_file sdc/samples/neuron_stratixiv_arch_timing.sdc -read_vpr_constraints tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan_3d/half_blocks_up_down.xml
31-
script_params_list_add = -sdc_file sdc/samples/neuron_stratixiv_arch_timing.sdc -read_vpr_constraints tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan_3d/three_partitionregion_multiregion.xml
31+
script_params_list_add = -sdc_file sdc/samples/neuron_stratixiv_arch_timing.sdc -read_vpr_constraints tasks/regression_tests/vtr_reg_nightly_test5/vpr_tight_floorplan_3d/locked_down.xml

0 commit comments

Comments
 (0)