Skip to content

Commit 56cc313

Browse files
committed
pln: checker: next step in pinGraph creation
1 parent fede5d6 commit 56cc313

File tree

3 files changed

+59
-5
lines changed

3 files changed

+59
-5
lines changed

planning/src/file_io/pln_blif_file.cpp

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ bool BLIF_file::checkBlif() noexcept {
457457
}
458458

459459
// -- write yaml file to check prim-DB:
460-
if (trace_ >= 5) {
460+
if (trace_ >= 7) {
461461
//string written = pr_write_yaml( DFFRE );
462462
//string written = pr_write_yaml( DSP19X2 );
463463
//string written = pr_write_yaml( DSP38 );
@@ -1472,8 +1472,9 @@ bool BLIF_file::checkClockSepar(vector<const Node*>& clocked) noexcept {
14721472
pg_.countClockNodes());
14731473
}
14741474

1475-
if (not pg_.hasClockNodes())
1475+
if (not pg_.hasClockNodes()) {
14761476
return true;
1477+
}
14771478

14781479
// -- paint clock nodes and their incoming edges Red
14791480
for (NW::NI I(pg_); I.valid(); ++I) {
@@ -1580,7 +1581,7 @@ bool BLIF_file::createPinGraph() noexcept {
15801581
uint nid = 0, kid = 0, eid = 0;
15811582
vector<string> INP;
15821583
vector<upair> PAR;
1583-
char nm_buf[512] = {};
1584+
char nm_buf[520] = {};
15841585

15851586
pg2blif_.reserve(2 * nodePool_.size() + 1);
15861587

@@ -1697,6 +1698,59 @@ bool BLIF_file::createPinGraph() noexcept {
16971698
}
16981699
}
16991700

1701+
// -- create pg-nodes for sequential input pins
1702+
vector<const Node*> clocked;
1703+
collectClockedNodes(clocked);
1704+
if (trace_ >= 4)
1705+
lprintf(" createPinGraph: clocked.size()= %zu\n", clocked.size());
1706+
if (not clocked.empty()) {
1707+
for (const Node* cnp : clocked) {
1708+
const Node& cn = *cnp;
1709+
assert(cn.hasPrimType());
1710+
if (cn.ptype_ == prim::CLK_BUF or cn.ptype_ == prim::FCLK_BUF)
1711+
continue;
1712+
lputs9();
1713+
for (uint i = 0; i < cn.inPins_.size(); i++) {
1714+
const string& inp = cn.inPins_[i];
1715+
assert(not inp.empty());
1716+
if (not pr_pin_is_clock(cn.ptype_, inp))
1717+
continue;
1718+
assert(cn.cell_hc_);
1719+
key = hashComb(cn.cell_hc_, inp);
1720+
assert(key);
1721+
assert(not pg_.hasKey(key));
1722+
kid = pg_.insK(key);
1723+
assert(kid);
1724+
pg_.nodeRef(kid).markClk(true);
1725+
1726+
::snprintf(nm_buf, 510, "nd%u_L%u_cn",
1727+
kid, cn.lnum_);
1728+
pg_.setNodeName(kid, nm_buf);
1729+
1730+
pg2blif_.emplace(kid, cn.id_);
1731+
1732+
const string& inet = cn.inSigs_[i];
1733+
assert(not inet.empty());
1734+
const Node* driver = findFabricDriver(cn.id_, inet);
1735+
if (!driver)
1736+
continue;
1737+
1738+
uint64_t qk = hashComb(driver->id_, driver->out_);
1739+
assert(qk);
1740+
uint pid = pg_.insK(qk);
1741+
1742+
::snprintf(nm_buf, 510, "nd%u_L%u_",
1743+
pid, driver->lnum_);
1744+
if (driver->ptype_ == prim::CLK_BUF)
1745+
::strcat(nm_buf, "CBUF");
1746+
pg_.setNodeName(pid, nm_buf);
1747+
1748+
eid = pg_.linK(qk, key);
1749+
assert(eid);
1750+
}
1751+
}
1752+
}
1753+
17001754
pg_.setNwName("pin_graph");
17011755

17021756
// writePinGraph("pin_graph_1.dot");

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

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

planning/src/util/nw/Nw_io.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ uint NW::printDot(ostream& os, CStr nwNm, bool nodeTable, bool noDeg0) const noe
519519

520520
for (cNI I(*this); I.valid(); ++I) {
521521
const Node& ii = *I;
522-
if (noDeg0 and ii.degree() == 0)
522+
if (noDeg0 and ii.degree() == 0 and not ii.isClk())
523523
continue;
524524
ii.nprint_dot(os);
525525
}

0 commit comments

Comments
 (0)