{
int carry = 0;
for (size_t i = 0; i < digits.size(); i++) {
- log_assert(digits[i] < 10);
+ if (digits[i] >= 10)
+ log_error("Invalid use of [a-fxz?] in decimal constant at %s:%d.\n",
+ current_filename.c_str(), get_line_num());
digits[i] += carry * 10;
carry = digits[i] % 2;
digits[i] /= 2;
str++;
}
+ if (base == 10 && GetSize(digits) == 1 && digits.front() >= 0xf0)
+ base = 2;
+
if (base == 10) {
data.clear();
if (len_in_bits < 0) {
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());
+ current_filename.c_str(), get_line_num());
return ret;
}
{
cover("kernel.rtlil.sigspec.parse");
+ AST::current_filename = "input";
+ AST::use_internal_line_num();
+ AST::set_line_num(0);
+
std::vector<std::string> tokens;
sigspec_parse_split(tokens, str, ',');