Skip to content

Commit 532674f

Browse files
authored
Merge pull request #834 from os-fpga/prepare_blif_check_in_pin_c
prepare blif check in pin_c
2 parents d0d68c9 + f7a48fa commit 532674f

File tree

7 files changed

+32
-15
lines changed

7 files changed

+32
-15
lines changed

planning/src/file_io/pln_Fio.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ bool MMapReader::makeLines(bool cutComments, bool cutNL) noexcept {
824824
if (buf_[i] == '\n') num_lines_++;
825825
}
826826
if (!num_lines_) {
827-
if (trace() >= 4) {
827+
if (trace() >= 5) {
828828
lputs("MReader::makeLines-1 not_OK: num_lines_ == 0");
829829
}
830830
return false;
@@ -835,7 +835,7 @@ bool MMapReader::makeLines(bool cutComments, bool cutNL) noexcept {
835835
}
836836
} else {
837837
if (!num_lines_) {
838-
if (trace() >= 4) {
838+
if (trace() >= 5) {
839839
lputs("MReader::makeLines-2 not_OK: num_lines_ == 0");
840840
}
841841
return false;
@@ -872,7 +872,7 @@ bool MMapReader::makeLines(bool cutComments, bool cutNL) noexcept {
872872
}
873873
}
874874

875-
if (trace() >= 4) {
875+
if (trace() >= 6) {
876876
lprintf("MReader::makeLines() OK: lines_.size()= %zu num_lines_= %zu\n", lines_.size(), num_lines_);
877877
}
878878

planning/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
static const char* _pln_VERSION_STR = "pln0334";
1+
static const char* _pln_VERSION_STR = "pln0335";
22

33
#include "RS/rsEnv.h"
44
#include "util/pln_log.h"

planning/src/pin_loc/pcf_place.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,13 @@ void PinPlacer::print_summary(const string& csv_name) const {
356356
CStr cmapVal = clk_map_file_.empty() ? "(NONE)" : clk_map_file_.c_str();
357357
lprintf(" clk_map_file : %s\n", cmapVal);
358358

359+
if (::getenv("pinc_dont_check_blif")) {
360+
lprintf(" check BLIF status : (NOT DONE)\n");
361+
} else {
362+
lprintf(" check BLIF status : %s\n",
363+
check_blif_ok_ ? "PASS" : "FAIL");
364+
}
365+
359366
lprintf(" pinc_trace verbosity= %u\n", tr);
360367

361368
if (num_critical_warnings_) {

planning/src/pin_loc/pin_placer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ PinPlacer::~PinPlacer() {
154154

155155
void PinPlacer::resetState() noexcept {
156156
auto_pcf_created_ = false;
157+
check_blif_ok_ = false;
157158
min_pt_row_ = UINT_MAX;
158159
max_pt_row_ = 0;
159160
no_more_inp_bumps_ = false;

planning/src/pin_loc/pin_placer.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ struct PinPlacer {
9292
vector<string> outputs_;
9393

9494
BlifReader() noexcept = default;
95-
BlifReader(const string& f) { read_blif(f); }
96-
bool read_blif(const string& f);
95+
96+
bool read_blif(const string& f, bool& checked_ok) noexcept;
9797

9898
const vector<string>& get_inputs() const noexcept { return inputs_; }
9999
const vector<string>& get_outputs() const noexcept { return outputs_; }
@@ -137,6 +137,7 @@ struct PinPlacer {
137137
bool pin_assign_def_order_ = true;
138138

139139
bool auto_pcf_created_ = false;
140+
bool check_blif_ok_ = false;
140141
string user_pcf_;
141142
string blif_fn_;
142143
string has_edits_;

planning/src/pin_loc/read_ports.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ bool PinPlacer::read_design_ports() {
108108
}
109109
}
110110
BlifReader rd_blif;
111-
if (!rd_blif.read_blif(blif_fn_)) {
111+
check_blif_ok_ = false;
112+
if (!rd_blif.read_blif(blif_fn_, check_blif_ok_)) {
112113
flush_out(true);
113114
err_puts();
114115
CERROR << err_lookup("PORT_INFO_PARSE_ERROR") << endl;
@@ -1080,10 +1081,11 @@ string PinPlacer::translatePinName(const string& pinName, bool is_input) const n
10801081
}
10811082
}
10821083

1083-
bool PinPlacer::BlifReader::read_blif(const string& blif_fn) {
1084+
bool PinPlacer::BlifReader::read_blif(const string& blif_fn, bool& checked_ok) noexcept {
10841085
flush_out(true);
10851086
inputs_.clear();
10861087
outputs_.clear();
1088+
checked_ok = false;
10871089

10881090
CStr cfn = blif_fn.c_str();
10891091
uint16_t tr = ltrace();
@@ -1111,13 +1113,13 @@ bool PinPlacer::BlifReader::read_blif(const string& blif_fn) {
11111113
return false;
11121114
}
11131115

1114-
if (::getenv("pinc_check_blif")) {
1115-
flush_out(true);
1116+
if (0 /* not ::getenv("pinc_dont_check_blif") */ ) {
11161117
lprintf("____ BEGIN pinc_check_blif: %s\n", cfn);
1117-
bool check_blif_ok = do_check_blif(cfn);
1118+
flush_out(true);
1119+
checked_ok = do_check_blif(cfn);
11181120
flush_out(true);
11191121
lprintf(" pinc_check_blif STATUS = %s\n\n",
1120-
check_blif_ok ? "PASS" : "FAIL");
1122+
checked_ok ? "PASS" : "FAIL");
11211123
lprintf("------ END pinc_check_blif: %s\n", cfn);
11221124
flush_out(true);
11231125
}

planning/src/util/nw/Nw_io.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,16 @@ static void be_dot_friendly(char* buf) noexcept {
326326
}
327327
}
328328

329+
// shorten too long names
330+
size_t len = ::strlen(buf);
331+
if (len > 32) {
332+
size_t H = str::hashf(buf);
333+
::sprintf(buf + 28, "_%zX", H);
334+
}
335+
329336
// if buf has . then quote:
330337
if (::strpbrk(buf, ".:/!")) {
331-
lputs1();
332-
size_t len = ::strlen(buf);
338+
len = ::strlen(buf);
333339
buf[len + 1] = 0;
334340
buf[len + 2] = 0;
335341
buf[len + 3] = 0;
@@ -384,7 +390,7 @@ void NW::Node::nprint_dot(ostream& os) const noexcept {
384390

385391
void NW::Edge::eprint_dot(ostream& os, char arrow, const NW& g) const noexcept {
386392
assert(arrow == '>' or arrow == '-');
387-
char buf[2048] = {};
393+
char buf[4100] = {};
388394
const Node& nd1 = g.nodeRef(n1_);
389395
nd1.getName(buf);
390396
be_dot_friendly(buf);

0 commit comments

Comments
 (0)