Skip to content

Commit 12e2895

Browse files
authored
Merge pull request #735 from os-fpga/match_internal_pin_with_row
pin_c: match internal_pin with PT row
2 parents c2664c9 + 782830e commit 12e2895

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

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 = "pln0242";
1+
static const char* _pln_VERSION_STR = "pln0243";
22

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

planning/src/pin_loc/pcf_place.cpp

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,39 @@ bool PinPlacer::write_dot_place(const PcCsvReader& csv) {
747747
internalPin.clear();
748748
if (cmdObj.hasInternalPin()) {
749749
internalPin = cmdObj.internalPin_;
750-
// gbox_rows = csv.get_gbox_rows(device_pin_name);
751-
// if (not gbox_rows.empty()) {
752-
// // search internalPin among gbox_rows
753-
// }
750+
gbox_rows = csv.get_gbox_rows(device_pin_name);
751+
if (not gbox_rows.empty()) {
752+
row_num = -1;
753+
// search internalPin among gbox_rows
754+
for (uint gbr : gbox_rows) {
755+
const PcCsvReader::BCD& gbRow = csv.getBCD(gbr);
756+
if (gbRow.fullchipName_ == internalPin) {
757+
row_num = gbr + 2;
758+
break;
759+
}
760+
}
761+
if (row_num > 1) {
762+
if (tr >= 4) {
763+
lprintf("infered row_num= %i from gbox: %s internal_pin: %s\n",
764+
row_num, device_pin_name.c_str(), internalPin.c_str());
765+
}
766+
} else {
767+
flush_out(true);
768+
flush_out(true);
769+
string ers = str::concat("did not find PT row matching internal_pin: ", internalPin);
770+
CERROR << ers << ": <" << device_pin_name << ">" << endl;
771+
OUT_ERROR << ers << ": <" << device_pin_name << ">" << endl;
772+
flush_out(true);
773+
774+
out_file << "\n=== Error happened, .place file is incomplete\n"
775+
<< "=== ERROR:" << ers
776+
<< ": <" << udes_pin_name
777+
<< "> device_pin_name: " << device_pin_name
778+
<< " internal_pin: " << internalPin
779+
<< "\n\n";
780+
return false;
781+
}
782+
}
754783
}
755784

756785
const char* direction = "INPUT";
@@ -772,7 +801,7 @@ bool PinPlacer::write_dot_place(const PcCsvReader& csv) {
772801
XYZ xyz;
773802

774803
if (row_num > 1) {
775-
// pt_row was explicitely passed in .pcf
804+
// pt_row was explicitely passed in .pcf or infered from internal_pin
776805
uint row_idx = row_num - 2;
777806
if (row_idx < csv.numRows()) {
778807
const PcCsvReader::BCD& bb = csv.getBCD(row_idx);

0 commit comments

Comments
 (0)