3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 06:03:23 +00:00

Added warning for use of 'z' constants in HDL

This commit is contained in:
Clifford Wolf 2014-11-14 19:59:50 +01:00
parent 4e5350b409
commit 87333f3ae2
3 changed files with 14 additions and 6 deletions

View file

@ -132,8 +132,16 @@ static void my_strtobin(std::vector<RTLIL::State> &data, const char *str, int le
}
// convert the verilog code for a constant to an AST node
AstNode *VERILOG_FRONTEND::const2ast(std::string code, char case_type)
AstNode *VERILOG_FRONTEND::const2ast(std::string code, char case_type, bool warn_z)
{
if (warn_z) {
AstNode *ret = const2ast(code, case_type);
if (std::find(ret->bits.begin(), ret->bits.end(), RTLIL::State::Sz) != ret->bits.end())
log_warning("Yosys does not support tri-state logic at the moment. (%s:%d)\n",
current_filename.c_str(), frontend_verilog_yyget_lineno());
return ret;
}
const char *str = code.c_str();
// Strings