From c3a318f14e14b1c217f7fbe145e83889ced985ea Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 7 Nov 2014 15:31:56 +0100 Subject: [PATCH] ivl: Casting vectors to strings. --- elab_expr.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/elab_expr.cc b/elab_expr.cc index b2f812830..fb07e07da 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -2494,6 +2494,19 @@ NetExpr* PECastType::elaborate_expr(Design*des, NetScope*scope, } } + else if(dynamic_cast(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);