diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-05-28 17:42:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-28 17:42:16 +0200 |
commit | 8e647901ef6ea484bfe41628f258c53590ae4114 (patch) | |
tree | bf7e482b1bf628c39cf81ac89622e67bbd9bfb08 /frontends/ast | |
parent | 49d641d97f98526484d4ea7021f6ed15584fa4c9 (diff) | |
parent | ba2185ead89fdb6afeec6043ab18f2e045d80247 (diff) | |
download | yosys-8e647901ef6ea484bfe41628f258c53590ae4114.tar.gz yosys-8e647901ef6ea484bfe41628f258c53590ae4114.tar.bz2 yosys-8e647901ef6ea484bfe41628f258c53590ae4114.zip |
Merge pull request #1050 from YosysHQ/clifford/wandwor
Refactored wand/wor support
Diffstat (limited to 'frontends/ast')
-rw-r--r-- | frontends/ast/ast.cc | 2 | ||||
-rw-r--r-- | frontends/ast/ast.h | 2 | ||||
-rw-r--r-- | frontends/ast/genrtlil.cc | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 29e175c15..83993eea9 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -194,6 +194,8 @@ AstNode::AstNode(AstNodeType type, AstNode *child1, AstNode *child2, AstNode *ch is_logic = false; is_signed = false; is_string = false; + is_wand = false; + is_wor = false; is_unsized = false; was_checked = false; range_valid = false; diff --git a/frontends/ast/ast.h b/frontends/ast/ast.h index f90e683ad..46d482f1a 100644 --- a/frontends/ast/ast.h +++ b/frontends/ast/ast.h @@ -173,7 +173,7 @@ namespace AST // node content - most of it is unused in most node types std::string str; std::vector<RTLIL::State> bits; - bool is_input, is_output, is_reg, is_logic, is_signed, is_string, range_valid, range_swapped, was_checked, is_unsized; + bool is_input, is_output, is_reg, is_logic, is_signed, is_string, is_wand, is_wor, range_valid, range_swapped, was_checked, is_unsized; int port_id, range_left, range_right; uint32_t integer; double realvalue; diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc index 382b865a4..d2651c9aa 100644 --- a/frontends/ast/genrtlil.cc +++ b/frontends/ast/genrtlil.cc @@ -920,6 +920,9 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint) log_file_error(filename, linenum, "Attribute `%s' with non-constant value!\n", attr.first.c_str()); wire->attributes[attr.first] = attr.second->asAttrConst(); } + + if (is_wand) wire->set_bool_attribute("\\wand"); + if (is_wor) wire->set_bool_attribute("\\wor"); } break; |