mirror of https://github.com/YosysHQ/yosys.git
renamed LibertyParer to LibertyParser
This commit is contained in:
parent
c1da7661a5
commit
9a00980129
|
@ -470,7 +470,7 @@ struct DfflibmapPass : public Pass {
|
||||||
FILE *f = fopen(liberty_file.c_str(), "r");
|
FILE *f = fopen(liberty_file.c_str(), "r");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
log_cmd_error("Can't open liberty file `%s': %s\n", liberty_file.c_str(), strerror(errno));
|
log_cmd_error("Can't open liberty file `%s': %s\n", liberty_file.c_str(), strerror(errno));
|
||||||
LibertyParer libparser(f);
|
LibertyParser libparser(f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
find_cell(libparser.ast, "$_DFF_N_", false, false, false, false);
|
find_cell(libparser.ast, "$_DFF_N_", false, false, false, false);
|
||||||
|
|
|
@ -79,7 +79,7 @@ void LibertyAst::dump(FILE *f, std::string indent, std::string path, bool path_o
|
||||||
fprintf(f, " ;\n");
|
fprintf(f, " ;\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int LibertyParer::lexer(std::string &str)
|
int LibertyParser::lexer(std::string &str)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ int LibertyParer::lexer(std::string &str)
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
LibertyAst *LibertyParer::parse()
|
LibertyAst *LibertyParser::parse()
|
||||||
{
|
{
|
||||||
std::string str;
|
std::string str;
|
||||||
|
|
||||||
|
@ -219,14 +219,14 @@ LibertyAst *LibertyParer::parse()
|
||||||
|
|
||||||
#ifndef FILTERLIB
|
#ifndef FILTERLIB
|
||||||
|
|
||||||
void LibertyParer::error()
|
void LibertyParser::error()
|
||||||
{
|
{
|
||||||
log_error("Syntax error in line %d.\n", line);
|
log_error("Syntax error in line %d.\n", line);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
void LibertyParer::error()
|
void LibertyParser::error()
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Syntax error in line %d.\n", line);
|
fprintf(stderr, "Syntax error in line %d.\n", line);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -611,7 +611,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LibertyParer parser(f);
|
LibertyParser parser(f);
|
||||||
if (parser.ast) {
|
if (parser.ast) {
|
||||||
if (flag_verilogsim)
|
if (flag_verilogsim)
|
||||||
gen_verilogsim(parser.ast);
|
gen_verilogsim(parser.ast);
|
||||||
|
|
|
@ -39,13 +39,13 @@ namespace PASS_DFFLIBMAP
|
||||||
static std::set<std::string> whitelist;
|
static std::set<std::string> whitelist;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LibertyParer
|
struct LibertyParser
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int line;
|
int line;
|
||||||
LibertyAst *ast;
|
LibertyAst *ast;
|
||||||
LibertyParer(FILE *f) : f(f), line(1), ast(parse()) {}
|
LibertyParser(FILE *f) : f(f), line(1), ast(parse()) {}
|
||||||
~LibertyParer() { if (ast) delete ast; }
|
~LibertyParser() { if (ast) delete ast; }
|
||||||
int lexer(std::string &str);
|
int lexer(std::string &str);
|
||||||
LibertyAst *parse();
|
LibertyAst *parse();
|
||||||
void error();
|
void error();
|
||||||
|
|
Loading…
Reference in New Issue