Skip to content

Commit 0807adc

Browse files
authored
Merge pull request #910 from os-fpga/checker_allow_dangling_CARRY_outputs_E3235
checker: allow dangling CARRY outputs EDA-3235
2 parents 2d5a7a3 + 55a8358 commit 0807adc

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

planning/src/RS/rsCheck.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,15 @@ bool do_check_blif(CStr cfn,
106106

107107
ls << "-----\n";
108108
{
109-
uint nISERD = 0, nDSP38 = 0, nDSP19X = 0, nTDP_RAM36K = 0, nTDP_RAM18K = 0;
110-
bfile.countMOGs(nISERD, nDSP38, nDSP19X, nTDP_RAM36K, nTDP_RAM18K);
109+
uint nISERD = 0, nDSP38 = 0, nDSP19X = 0,
110+
nTDP_RAM36K = 0, nTDP_RAM18K = 0, nCARRY = 0;
111+
bfile.countMOGs(nISERD, nDSP38, nDSP19X, nTDP_RAM36K, nTDP_RAM18K, nCARRY);
111112
ls << "----- #I_SERDES= " << nISERD << endl;
112113
ls << "----- #DSP19X= " << nDSP19X << endl;
113114
ls << "----- #DSP38= " << nDSP38 << endl;
114115
ls << "----- #TDP_RAM36K= " << nTDP_RAM36K << endl;
115116
ls << "----- #TDP_RAM18KX2= " << nTDP_RAM18K << endl;
117+
ls << "----- #CARRY= " << nCARRY << endl;
116118
}
117119
ls << "-----\n";
118120
ls << "----- PinGraph: " << bfile.pinGraphFile_ << endl;

planning/src/file_io/pln_blif_file.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ uint BLIF_file::printNodes(std::ostream& os) const noexcept {
619619
return n;
620620
}
621621

622-
os << "--- nodes (" << n << ") :" << endl;
622+
os << "----- nodes (" << n << ") :" << endl;
623623
for (uint i = 1; i <= n; i++) {
624624
const BNode& nd = nodePool_[i];
625625
CStr pts = nd.cPrimType();
@@ -641,7 +641,8 @@ uint BLIF_file::printNodes(std::ostream& os) const noexcept {
641641
prnArray(os, A, sz, " ");
642642
}
643643

644-
if (trace_ >= 5) {
644+
bool hasSigs = bool(nd.inPins_.size()) or bool(nd.inSigs_.size());
645+
if (trace_ >= 5 and hasSigs) {
645646
const string* A = nd.inPins_.data();
646647
size_t sz = nd.inPins_.size();
647648
os_printf(os, " ##inPins=%zu ", sz);
@@ -819,9 +820,10 @@ void BLIF_file::countBUFs(uint& nIBUF, uint& nOBUF, uint& nCBUF) const noexcept
819820

820821
void BLIF_file::countMOGs(uint& nISERD,
821822
uint& nDSP38, uint& nDSP19,
822-
uint& nRAM36, uint& nRAM18
823+
uint& nRAM36, uint& nRAM18,
824+
uint& nCARRY
823825
) const noexcept {
824-
nISERD = nDSP38 = nDSP19 = nRAM36 = nRAM18 = 0;
826+
nISERD = nDSP38 = nDSP19 = nRAM36 = nRAM18 = nCARRY = 0;
825827
uint nn = numNodes();
826828
if (nn == 0)
827829
return;
@@ -851,6 +853,10 @@ void BLIF_file::countMOGs(uint& nISERD,
851853
}
852854
if (pt == TDP_RAM18KX2) {
853855
nRAM18++;
856+
continue;
857+
}
858+
if (pt == CARRY) {
859+
nCARRY++;
854860
}
855861
}
856862
}
@@ -1815,7 +1821,7 @@ bool BLIF_file::linkNodes() noexcept {
18151821
int pinIndex = -1;
18161822
BNode* par = findFabricParent(nd.id_, nd.out_, pinIndex);
18171823
if (!par) {
1818-
if (nd.is_RAM() or nd.is_DSP()) {
1824+
if (nd.is_RAM() or nd.is_DSP() or nd.is_CARRY()) {
18191825
const string& net = nd.out_;
18201826
uint rid = nd.realId(*this);
18211827
BNode& realNd = bnodeRef(rid);
@@ -1826,7 +1832,7 @@ bool BLIF_file::linkNodes() noexcept {
18261832
assert(dataTerm < int64_t(realData.size()));
18271833
if (dataTerm < 0)
18281834
continue;
1829-
// RAM or DSP output bits may be unused
1835+
// RAM or DSP or CARRY output bits may be unused
18301836
if (trace_ >= 4) {
18311837
lprintf("skipping dangling cell output issue for %s at line %u\n",
18321838
realNd.cPrimType(), realNd.lnum_);
@@ -2293,10 +2299,8 @@ bool BLIF_file::createPinGraph() noexcept {
22932299
// lputs3();
22942300
kid = pg_.findNode(key);
22952301
if (kid) {
2296-
if (trace_ >= 8) {
2297-
lprintf("\t\t ___ found nid %u '%s' for key %zu",
2298-
kid, pg_.cnodeName(kid), key);
2299-
}
2302+
lprintf("\t\t ___ found nid %u '%s' for key %zu",
2303+
kid, pg_.cnodeName(kid), key);
23002304
}
23012305
else {
23022306
kid = pg_.insK(key);

planning/src/file_io/pln_blif_file.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ struct BLIF_file : public fio::MMapReader
201201
bool is_clockLess_DSP() const noexcept {
202202
return isClockLess_ and prim::pr_is_DSP(ptype_);
203203
}
204+
bool is_CARRY() const noexcept {
205+
return ptype_ == prim::CARRY;
206+
}
204207

205208
bool canDriveClockNode() const noexcept {
206209
return isTopInput() or is_CLK_BUF() or ptype_ == prim::I_SERDES;
@@ -322,7 +325,7 @@ struct BLIF_file : public fio::MMapReader
322325
void countBUFs(uint& nIBUF, uint& nOBUF, uint& nCBUF) const noexcept;
323326

324327
void countMOGs(uint& nISERD, uint& nDSP38, uint& nDSP19X,
325-
uint& nRAM36, uint& nRAM18) const noexcept;
328+
uint& nRAM36, uint& nRAM18, uint& nCARRY) const noexcept;
326329

327330
uint typeHist(prim::Prim_t t) const noexcept { return typeHistogram_[t]; }
328331

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

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

0 commit comments

Comments
 (0)