aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap/libparse.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-11-04 10:08:33 +0100
committerGitHub <noreply@github.com>2018-11-04 10:08:33 +0100
commit68304c6d176e396e068cbe3ac2800ac75091143c (patch)
treea92f295d2f5ee780eb6e8f042817f1a633125e54 /passes/techmap/libparse.cc
parent18a4c1cdacc948ef669678f9e3ac1052aadba1a2 (diff)
parent04cd17969657dc7402d79e054ea390f98e159083 (diff)
downloadyosys-68304c6d176e396e068cbe3ac2800ac75091143c.tar.gz
yosys-68304c6d176e396e068cbe3ac2800ac75091143c.tar.bz2
yosys-68304c6d176e396e068cbe3ac2800ac75091143c.zip
Merge pull request #687 from trcwm/master
Liberty file: error when it contains pin references to non-existing pins
Diffstat (limited to 'passes/techmap/libparse.cc')
-rw-r--r--passes/techmap/libparse.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/passes/techmap/libparse.cc b/passes/techmap/libparse.cc
index d3b1ff02f..bb09117e2 100644
--- a/passes/techmap/libparse.cc
+++ b/passes/techmap/libparse.cc
@@ -159,7 +159,7 @@ int LibertyParser::lexer(std::string &str)
if (c == '\n') {
line++;
- return ';';
+ return 'n';
}
// if (c >= 32 && c < 255)
@@ -175,7 +175,7 @@ LibertyAst *LibertyParser::parse()
int tok = lexer(str);
- while (tok == ';')
+ while (tok == 'n')
tok = lexer(str);
if (tok == '}' || tok < 0)
@@ -194,6 +194,9 @@ LibertyAst *LibertyParser::parse()
if (tok == ';')
break;
+ if (tok == 'n')
+ continue;
+
if (tok == ':' && ast->value.empty()) {
tok = lexer(ast->value);
if (tok != 'v')
@@ -249,14 +252,14 @@ LibertyAst *LibertyParser::parse()
void LibertyParser::error()
{
- log_error("Syntax error in line %d.\n", line);
+ log_error("Syntax error in liberty file on line %d.\n", line);
}
#else
void LibertyParser::error()
{
- fprintf(stderr, "Syntax error in line %d.\n", line);
+ fprintf(stderr, "Syntax error in liberty file on line %d.\n", line);
exit(1);
}