ivl: Casting vectors to strings.

This commit is contained in:
Maciej Suminski 2014-11-07 15:31:56 +01:00
parent b2deae7ba9
commit c3a318f14e
1 changed files with 13 additions and 0 deletions

View File

@ -2494,6 +2494,19 @@ NetExpr* PECastType::elaborate_expr(Design*des, NetScope*scope,
}
}
else if(dynamic_cast<const string_type_t*>(target_)) {
if(base_->expr_type() == IVL_VT_STRING)
return expr; // no conversion
if((base_->expr_type() != IVL_VT_BOOL) &&
(base_->expr_type() != IVL_VT_LOGIC)) {
cerr << get_fileline() << ": cannot be casted to string." << endl;
ivl_assert(*this, false);
}
return expr;
}
cerr << get_fileline() << ": sorry: I don't know how to cast expression." << endl;
ivl_assert(*this, false);