Skip to content

Commit bcbbc0d

Browse files
authored
Merge pull request #841 from os-fpga/checker_fix_EDA3230
blif checker fix EDA-3230
2 parents 793b9ff + 439aee6 commit bcbbc0d

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
lines changed

planning/src/RS/rsCheck.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ bool do_check_blif(CStr cfn) {
6868
ls << "----- #inputs= " << numInp << endl;
6969
ls << "----- #outputs= " << numOut << endl;
7070
ls << "----- #LUTs= " << bfile.countLUTs() << endl;
71+
ls << "----- #LUT1= " << bfile.typeHist(prim::LUT1) << endl;
72+
ls << "----- #LUT5= " << bfile.typeHist(prim::LUT5) << endl;
73+
ls << "----- #LUT6= " << bfile.typeHist(prim::LUT6) << endl;
7174
ls << "----- #FFs= " << bfile.countFFs() << endl;
7275
{
7376
uint nIBUF = 0, nOBUF = 0, nCBUF = 0;

planning/src/file_io/pln_Fio.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace fio {
1818
using namespace pln;
1919
using namespace std;
2020

21-
static constexpr uint32_t fio_MAX_STACK_USE = 1048576; // 1 MiB
21+
static constexpr uint32_t fio_MAX_STACK_USE = 2097152; // 2 MiB
2222

2323
Info::Info(CStr nm) noexcept {
2424
if (!nm) return;
@@ -1211,7 +1211,7 @@ bool LineReader::makeLines(bool cutComments, bool cutNL) noexcept {
12111211
return false;
12121212
}
12131213

1214-
static constexpr size_t MAX_BUF_sz = 67108860; // 64 MB
1214+
static constexpr size_t MAX_BUF_sz = 134217720; // 128 MB
12151215

12161216
static inline CStr trim_left(CStr p) noexcept {
12171217
if (p && *p)

planning/src/file_io/pln_blif_file.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,12 @@ bool BLIF_file::checkBlif() noexcept {
390390
flush_out(true);
391391
}
392392

393+
// confirm that all fab node have output:
394+
// for (const BNode* fab_nd : fabricNodes_) {
395+
// assert(fab_nd);
396+
// assert(not fab_nd->out_.empty());
397+
// }
398+
393399
bool link_ok = linkNodes();
394400
if (not link_ok) {
395401
string tmp = err_msg_;
@@ -1017,10 +1023,10 @@ bool BLIF_file::createNodes() noexcept {
10171023
if (not hasLines() or lsz < 3) return false;
10181024
if (lsz >= UINT_MAX) return false;
10191025

1020-
nodePool_.reserve(2 * lsz + 8);
1026+
nodePool_.reserve(4 * lsz + 8);
10211027
nodePool_.emplace_back(); // put a fake node
10221028

1023-
char buf[2048] = {};
1029+
char buf[4096] = {};
10241030
vector<string> V;
10251031
V.reserve(16);
10261032
inputs_lnum_ = outputs_lnum_ = 0;
@@ -1111,9 +1117,9 @@ bool BLIF_file::createNodes() noexcept {
11111117
BNode& nd = nodePool_[i];
11121118
if (nd.kw_ != ".subckt" and nd.kw_ != ".gate")
11131119
continue;
1114-
if (nd.data_.size() < 4)
1120+
if (nd.data_.size() < 3)
11151121
continue;
1116-
if (nd.is_IBUF() or nd.is_OBUF())
1122+
if (nd.is_IBUF() or nd.is_OBUF() or nd.is_LUT())
11171123
continue;
11181124
assert(!nd.is_mog_);
11191125

@@ -1150,7 +1156,7 @@ bool BLIF_file::createNodes() noexcept {
11501156
nn = numNodes();
11511157
assert(nn);
11521158

1153-
fabricNodes_.reserve(nn);
1159+
fabricNodes_.reserve(nn + 4);
11541160

11551161
// -- finish and index nodes:
11561162
for (uint i = 1; i <= nn; i++) {
@@ -1172,9 +1178,11 @@ bool BLIF_file::createNodes() noexcept {
11721178
}
11731179
if (nd.kw_ == ".subckt" or nd.kw_ == ".gate") {
11741180
if (nd.data_.size() > 1) {
1181+
if (nd.lnum_ == 47)
1182+
lputs8();
11751183
const string& last = nd.data_.back();
11761184
size_t llen = last.length();
1177-
if (!last.empty() and llen < 2047) {
1185+
if (!last.empty() and llen < 4095) {
11781186
// replace '=' by 'space' and tokenize:
11791187
::strcpy(buf, last.c_str());
11801188
for (uint k = 0; k < llen; k++) {
@@ -1453,6 +1461,7 @@ bool BLIF_file::linkNodes() noexcept {
14531461
assert(fab_nd);
14541462
BNode& nd = *fab_nd;
14551463
if (nd.out_.empty()) {
1464+
//lputs8();
14561465
err_msg_ = str::concat("incomplete fabric cell: ", nd.kw_);
14571466
if (!nd.data_.empty()) {
14581467
err_msg_ += str::concat(" ", nd.data_.front());

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

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

planning/src/pin_loc/read_ports.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@ bool PinPlacer::BlifReader::read_blif(const string& blif_fn, bool& checked_ok) n
11221122
checked_ok ? "PASS" : "FAIL");
11231123
lprintf("------ END pinc_check_blif: %s\n", cfn);
11241124
flush_out(true);
1125+
//assert(checked_ok);
11251126
}
11261127

11271128
bool rd_ok = bfile.readBlif();

0 commit comments

Comments
 (0)