diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-09-27 15:14:31 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-09-27 15:14:31 -0700 |
commit | 8f5710c464b2b3b91f0c7f29a9420dcb798be4c5 (patch) | |
tree | 59bde082cba0f8f76e0e297ed57980592df7e73b /frontends/verilog/const2ast.cc | |
parent | f1a206ba03c5b6fba2672754d09cc649a60beeb8 (diff) | |
parent | fd0e3a2c43d96ba31beede9865d5000230029994 (diff) | |
download | yosys-8f5710c464b2b3b91f0c7f29a9420dcb798be4c5.tar.gz yosys-8f5710c464b2b3b91f0c7f29a9420dcb798be4c5.tar.bz2 yosys-8f5710c464b2b3b91f0c7f29a9420dcb798be4c5.zip |
Merge remote-tracking branch 'origin/master' into xaig_dff
Diffstat (limited to 'frontends/verilog/const2ast.cc')
-rw-r--r-- | frontends/verilog/const2ast.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/frontends/verilog/const2ast.cc b/frontends/verilog/const2ast.cc index 4bf5b1cf5..49281f7e7 100644 --- a/frontends/verilog/const2ast.cc +++ b/frontends/verilog/const2ast.cc @@ -85,10 +85,8 @@ static void my_strtobin(std::vector<RTLIL::State> &data, const char *str, int le digits.push_back(10 + *str - 'A'); else if (*str == 'x' || *str == 'X') digits.push_back(0xf0); - else if (*str == 'z' || *str == 'Z') + else if (*str == 'z' || *str == 'Z' || *str == '?') digits.push_back(0xf1); - else if (*str == '?') - digits.push_back(0xf2); str++; } @@ -112,8 +110,6 @@ static void my_strtobin(std::vector<RTLIL::State> &data, const char *str, int le data.push_back(case_type == 'x' ? RTLIL::Sa : RTLIL::Sx); else if (*it == 0xf1) data.push_back(case_type == 'x' || case_type == 'z' ? RTLIL::Sa : RTLIL::Sz); - else if (*it == 0xf2) - data.push_back(RTLIL::Sa); else data.push_back((*it & bitmask) ? State::S1 : State::S0); } @@ -199,13 +195,13 @@ AstNode *VERILOG_FRONTEND::const2ast(std::string code, char case_type, bool warn if (str == endptr) len_in_bits = -1; - // The "<bits>'s?[bodhBODH]<digits>" syntax + // The "<bits>'[sS]?[bodhBODH]<digits>" syntax if (*endptr == '\'') { std::vector<RTLIL::State> data; bool is_signed = false; bool is_unsized = len_in_bits < 0; - if (*(endptr+1) == 's') { + if (*(endptr+1) == 's' || *(endptr+1) == 'S') { is_signed = true; endptr++; } |