From 89d1125979aa26e076923e00b445f21c12df8ac8 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 3 Nov 2014 16:56:12 +0100 Subject: [PATCH] ivl: Bit selection using variables in strings. --- elab_expr.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/elab_expr.cc b/elab_expr.cc index 84a0ab502..78a45cb20 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -5004,6 +5004,18 @@ NetExpr* PEIdent::elaborate_expr_net_bit_(Design*des, NetScope*scope, return res; } + if (net->sig()->data_type() == IVL_VT_STRING) { + // Special case: This is a select of a string. + // This should be interpreted as a byte select. + if (debug_elaborate) { + cerr << get_fileline() << ": debug: " + << "Bit select of a string becomes NetESelect." << endl; + } + NetESelect*res = new NetESelect(net, mux, 8); + res->set_line(*net); + return res; + } + // Non-constant bit select? punt and make a subsignal // device to mux the bit in the net. This is a fairly // complicated task because we need to generate