@@ -16,6 +16,7 @@ unsigned verify_flat_placement_for_packing(const FlatPlacementInfo& flat_placeme
16
16
// for each piece of information.
17
17
if (flat_placement_info.blk_x_pos .size () != atom_netlist.blocks ().size () ||
18
18
flat_placement_info.blk_y_pos .size () != atom_netlist.blocks ().size () ||
19
+ flat_placement_info.blk_layer .size () != atom_netlist.blocks ().size () ||
19
20
flat_placement_info.blk_sub_tile .size () != atom_netlist.blocks ().size () ||
20
21
flat_placement_info.blk_site_idx .size () != atom_netlist.blocks ().size ()) {
21
22
VTR_LOG_ERROR (
@@ -26,14 +27,14 @@ unsigned verify_flat_placement_for_packing(const FlatPlacementInfo& flat_placeme
26
27
return num_errors;
27
28
}
28
29
29
- // 1. Verify that every atom has an x and y position on the device. This is
30
- // the only information we require for the flat placement during packing.
30
+ // 1. Verify that every atom has an (x, y, layer) position on the device.
31
31
//
32
32
// TODO: In the future, we may be able to allow some blocks to have
33
33
// undefined positions.
34
34
for (AtomBlockId blk_id : atom_netlist.blocks ()) {
35
35
if (flat_placement_info.blk_x_pos [blk_id] == FlatPlacementInfo::UNDEFINED_POS ||
36
- flat_placement_info.blk_y_pos [blk_id] == FlatPlacementInfo::UNDEFINED_POS) {
36
+ flat_placement_info.blk_y_pos [blk_id] == FlatPlacementInfo::UNDEFINED_POS ||
37
+ flat_placement_info.blk_layer [blk_id] == FlatPlacementInfo::UNDEFINED_POS) {
37
38
VTR_LOG_ERROR (
38
39
" Atom block %s has an undefined position in the flat placement.\n " ,
39
40
atom_netlist.block_name (blk_id).c_str ());
@@ -49,10 +50,12 @@ unsigned verify_flat_placement_for_packing(const FlatPlacementInfo& flat_placeme
49
50
for (AtomBlockId blk_id : atom_netlist.blocks ()) {
50
51
float blk_x_pos = flat_placement_info.blk_x_pos [blk_id];
51
52
float blk_y_pos = flat_placement_info.blk_y_pos [blk_id];
53
+ float blk_layer = flat_placement_info.blk_layer [blk_id];
52
54
int blk_sub_tile = flat_placement_info.blk_sub_tile [blk_id];
53
55
int blk_site_idx = flat_placement_info.blk_site_idx [blk_id];
54
56
if ((blk_x_pos < 0 .f && blk_x_pos != FlatPlacementInfo::UNDEFINED_POS) ||
55
57
(blk_y_pos < 0 .f && blk_y_pos != FlatPlacementInfo::UNDEFINED_POS) ||
58
+ (blk_layer < 0 .f && blk_layer != FlatPlacementInfo::UNDEFINED_POS) ||
56
59
(blk_sub_tile < 0 && blk_sub_tile != FlatPlacementInfo::UNDEFINED_SUB_TILE) ||
57
60
(blk_site_idx < 0 && blk_site_idx != FlatPlacementInfo::UNDEFINED_SITE_IDX)) {
58
61
VTR_LOG_ERROR (
@@ -71,12 +74,14 @@ unsigned verify_flat_placement_for_packing(const FlatPlacementInfo& flat_placeme
71
74
AtomBlockId root_blk_id = mol->atom_block_ids [mol->root ];
72
75
float root_pos_x = flat_placement_info.blk_x_pos [root_blk_id];
73
76
float root_pos_y = flat_placement_info.blk_y_pos [root_blk_id];
77
+ float root_layer = flat_placement_info.blk_layer [root_blk_id];
74
78
int root_sub_tile = flat_placement_info.blk_sub_tile [root_blk_id];
75
79
for (AtomBlockId mol_blk_id : mol->atom_block_ids ) {
76
80
if (!mol_blk_id.is_valid ())
77
81
continue ;
78
82
if (flat_placement_info.blk_x_pos [mol_blk_id] != root_pos_x ||
79
83
flat_placement_info.blk_y_pos [mol_blk_id] != root_pos_y ||
84
+ flat_placement_info.blk_layer [mol_blk_id] != root_layer ||
80
85
flat_placement_info.blk_sub_tile [mol_blk_id] != root_sub_tile) {
81
86
VTR_LOG_ERROR (
82
87
" Molecule with root atom block %s contains atom block %s "
@@ -89,6 +94,8 @@ unsigned verify_flat_placement_for_packing(const FlatPlacementInfo& flat_placeme
89
94
}
90
95
}
91
96
97
+ // TODO: May want to verify that the layer is all 0 in the case of 2D FPGAs.
98
+
92
99
return num_errors;
93
100
}
94
101
0 commit comments