Skip to content

Commit 61b2a79

Browse files
committed
Updated documentation and code according to the review comments
Signed-off-by: Maciej Kurc <[email protected]>
1 parent 1f26a37 commit 61b2a79

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

doc/src/vpr/file_formats.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,13 @@ For example:
411411
.param multiplier 0.50
412412
.param power 001101
413413
414-
Would set the parameters ``feedback``, ``multipleir`` and ``power`` of the above ``pll`` ``.subckt`` to ``"internal"``, ``0.50`` and ``001101`` respectively.
414+
Would set the parameters ``feedback``, ``multiplier`` and ``power`` of the above ``pll`` ``.subckt`` to ``"internal"``, ``0.50`` and ``001101`` respectively.
415415

416416
Interpretation of parameter values is out of scope of the BLIF format extension.
417417

418418
``.param`` statements propagate to ``<parameter>`` elements in the packed netlist.
419419

420-
Paramerer values propagate also to post-route Verilog netlist. Strings and real numbers are passed directly while binary words are prepended with the ``<N>'b`` prefix where ``N`` denotes a binary word length.
420+
Paramerer values propagate also to the post-route Verilog netlist, if it is generated. Strings and real numbers are passed directly while binary words are prepended with the ``<N>'b`` prefix where ``N`` denotes a binary word length.
421421

422422
.attr
423423
~~~~~

vpr/src/base/read_blif.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <sstream>
2121
#include <unordered_set>
2222
#include <cctype> //std::isdigit
23+
#include <algorithm>
2324

2425
#include "blifparse.hpp"
2526
#include "atom_netlist.h"
@@ -719,7 +720,7 @@ bool is_binary_param(const std::string& param) {
719720
}
720721

721722
bool is_real_param(const std::string& param) {
722-
const std::string chars = "012345678.";
723+
const std::string real_chars = "0123456789.";
723724

724725
/* Must be non-empty */
725726
if (param.empty()) {
@@ -728,11 +729,16 @@ bool is_real_param(const std::string& param) {
728729

729730
/* The string mustn't contain any other chars that the expected ones */
730731
for (size_t i = 0; i < param.length(); ++i) {
731-
if (chars.find(param[i]) == std::string::npos) {
732+
if (real_chars.find(param[i]) == std::string::npos) {
732733
return false;
733734
}
734735
}
735736

737+
/* There must only be a single dot */
738+
if (std::count(param.begin(), param.end(), '.') != 1) {
739+
return false;
740+
}
741+
736742
/* This is a real number param */
737743
return true;
738744
}

0 commit comments

Comments
 (0)