Skip to content

Commit a26f328

Browse files
warning message to say why mismatches are ignored
1 parent 0e0c633 commit a26f328

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

vpr/src/base/read_place.cpp

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ void read_place_header(std::ifstream& placement_file,
107107
} else if (tokens[0][0] == '#') {
108108
continue; //Skip commented lines
109109

110-
} else if (tokens.size() == 4
111-
&& tokens[0] == "Netlist_File:"
112-
&& tokens[2] == "Netlist_ID:") {
110+
} else if (tokens.size() == 4 &&
111+
tokens[0] == "Netlist_File:" &&
112+
tokens[2] == "Netlist_ID:") {
113113
//Check that the netlist used to generate this placement matches the one loaded
114114
//
115115
//NOTE: this is an optional check which causes no errors if this line is missing.
@@ -131,20 +131,23 @@ void read_place_header(std::ifstream& placement_file,
131131
place_netlist_file.c_str(), place_netlist_id.c_str(),
132132
net_file, cluster_ctx.clb_nlist.netlist_id().c_str());
133133
if (verify_file_digests) {
134+
msg += " To ignore the packed netlist mismatch, use '--verify_file_digests off' command line option.";
134135
vpr_throw(VPR_ERROR_PLACE_F, place_file, lineno, msg.c_str());
135136
} else {
136137
VTR_LOGF_WARN(place_file, lineno, "%s\n", msg.c_str());
138+
VTR_LOG_WARN("The packed netlist mismatch is ignored because"
139+
"--verify_file_digests command line option is off.");
137140
}
138141
}
139142

140143
seen_netlist_id = true;
141144

142-
} else if (tokens.size() == 7
143-
&& tokens[0] == "Array"
144-
&& tokens[1] == "size:"
145-
&& tokens[3] == "x"
146-
&& tokens[5] == "logic"
147-
&& tokens[6] == "blocks") {
145+
} else if (tokens.size() == 7 &&
146+
tokens[0] == "Array" &&
147+
tokens[1] == "size:" &&
148+
tokens[3] == "x" &&
149+
tokens[5] == "logic" &&
150+
tokens[6] == "blocks") {
148151
//Load the device grid dimensions
149152

150153
size_t place_file_width = vtr::atou(tokens[2]);
@@ -154,9 +157,12 @@ void read_place_header(std::ifstream& placement_file,
154157
"Current FPGA size (%d x %d) is different from size when placement generated (%d x %d)",
155158
grid.width(), grid.height(), place_file_width, place_file_height);
156159
if (verify_file_digests) {
160+
msg += " To ignore this size mismatch, use '--verify_file_digests off' command line option.";
157161
vpr_throw(VPR_ERROR_PLACE_F, place_file, lineno, msg.c_str());
158162
} else {
159163
VTR_LOGF_WARN(place_file, lineno, "%s\n", msg.c_str());
164+
VTR_LOG_WARN("The FPGA size mismatch is ignored because"
165+
"--verify_file_digests command line option is off.");
160166
}
161167
}
162168

@@ -165,14 +171,17 @@ void read_place_header(std::ifstream& placement_file,
165171
} else {
166172
//Unrecognized
167173
auto msg = vtr::string_fmt(
168-
"Invalid line '%s' in placement file header."
174+
"Invalid line '%s' in placement file header. "
169175
"Expected to see netlist filename and device size first.",
170176
line.c_str());
171177

172178
if (verify_file_digests) {
179+
msg += " To ignore this unexpected line, use '--verify_file_digests off' command line option.";
173180
vpr_throw(VPR_ERROR_PLACE_F, place_file, lineno, msg.c_str());
174181
} else {
175182
VTR_LOGF_WARN(place_file, lineno, "%s\n", msg.c_str());
183+
VTR_LOG_WARN("Unexpected line in the placement file header is ignored because"
184+
"--verify_file_digests command line option is off.");
176185
}
177186

178187
if ((tokens.size() == 4 || (tokens.size() > 4 && tokens[4][0] == '#')) ||
@@ -226,7 +235,8 @@ void read_place_body(std::ifstream& placement_file,
226235
} else if (tokens[0][0] == '#') {
227236
continue; //Skip commented lines
228237

229-
} else if ((tokens.size() == 4 || (tokens.size() > 4 && tokens[4][0] == '#')) || (tokens.size() == 5 || (tokens.size() > 5 && tokens[5][0] == '#'))) {
238+
} else if ((tokens.size() == 4 || (tokens.size() > 4 && tokens[4][0] == '#')) ||
239+
(tokens.size() == 5 || (tokens.size() > 5 && tokens[5][0] == '#'))) {
230240
//Load the block location
231241
//
232242
// If the place file corresponds to a 3D architecture, it should contain 5 tokens of actual data, with an optional 6th (commented) token indicating VPR's internal block number.
@@ -276,7 +286,10 @@ void read_place_body(std::ifstream& placement_file,
276286

277287
//Check if block is listed multiple times with conflicting locations in constraints file
278288
if (seen_blocks[blk_id] > 0) {
279-
if (block_x != place_ctx.block_locs[blk_id].loc.x || block_y != place_ctx.block_locs[blk_id].loc.y || sub_tile_index != place_ctx.block_locs[blk_id].loc.sub_tile || block_layer != place_ctx.block_locs[blk_id].loc.layer) {
289+
if (block_x != place_ctx.block_locs[blk_id].loc.x ||
290+
block_y != place_ctx.block_locs[blk_id].loc.y ||
291+
sub_tile_index != place_ctx.block_locs[blk_id].loc.sub_tile ||
292+
block_layer != place_ctx.block_locs[blk_id].loc.layer) {
280293
std::string cluster_name = cluster_ctx.clb_nlist.block_name(blk_id);
281294
VPR_THROW(VPR_ERROR_PLACE,
282295
"The location of cluster %s (#%d) is specified %d times in the constraints file with conflicting locations. \n"

0 commit comments

Comments
 (0)