diff options
author | Johann Glaser <Johann.Glaser@gmx.at> | 2013-08-20 11:23:59 +0200 |
---|---|---|
committer | Johann Glaser <Johann.Glaser@gmx.at> | 2013-08-20 11:23:59 +0200 |
commit | 6c4cbc03c2bad021c78da85f97bea1ef7c8caea0 (patch) | |
tree | d9bbd545f94d0cb44f6b6b1e9d2e13fc8270f7fc /frontends | |
parent | e3aa0514f22ccdb1b25856ca81462f86f2a5c612 (diff) | |
download | yosys-6c4cbc03c2bad021c78da85f97bea1ef7c8caea0.tar.gz yosys-6c4cbc03c2bad021c78da85f97bea1ef7c8caea0.tar.bz2 yosys-6c4cbc03c2bad021c78da85f97bea1ef7c8caea0.zip |
Added support for notif0/notif1 primitives
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/simplify.cc | 10 | ||||
-rw-r--r-- | frontends/verilog/lexer.l | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 1d381740b..5f0e68677 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -498,7 +498,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage) } children.clear(); - if (str == "bufif0" || str == "bufif1") + if (str == "bufif0" || str == "bufif1" || str == "notif0" || str == "notif1") { if (children_list.size() != 3) log_error("Invalid number of arguments for primitive `%s' at %s:%d!\n", @@ -506,12 +506,16 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage) std::vector<RTLIL::State> z_const(1, RTLIL::State::Sz); + AstNode *mux_input = children_list.at(1); + if (str == "notif0" || str == "notif1") { + mux_input = new AstNode(AST_BIT_NOT, mux_input); + } AstNode *node = new AstNode(AST_TERNARY, children_list.at(2)); if (str == "bufif0") { node->children.push_back(AstNode::mkconst_bits(z_const, false)); - node->children.push_back(children_list.at(1)); + node->children.push_back(mux_input); } else { - node->children.push_back(children_list.at(1)); + node->children.push_back(mux_input); node->children.push_back(AstNode::mkconst_bits(z_const, false)); } diff --git a/frontends/verilog/lexer.l b/frontends/verilog/lexer.l index e873f9d91..bdd01cae5 100644 --- a/frontends/verilog/lexer.l +++ b/frontends/verilog/lexer.l @@ -169,7 +169,7 @@ namespace VERILOG_FRONTEND { } <STRING>. { yymore(); } -and|nand|or|nor|xor|xnor|not|buf|bufif0|bufif1 { +and|nand|or|nor|xor|xnor|not|buf|bufif0|bufif1|notif0|notif1 { frontend_verilog_yylval.string = new std::string(yytext); return TOK_PRIMITIVE; } |