Change the net expression cast from 'i' to 'v'

Icarus uses 'i' in the net expressions for a cast to integer. Replacing
it with 'v' would free the character 'i' that can be used for increment
operators. This changes cast operators to become 'v', '2', and 'r'.

Signed-off-by: Prasad Joshi <prasad@canopusconsultancy.com>
Suggested-by: Cary R. <cygcary@yahoo.com>
This commit is contained in:
Prasad Joshi 2011-08-06 23:27:39 +01:00 committed by Stephen Williams
parent 5fc1a9c9e0
commit 6a40d9edaa
7 changed files with 7 additions and 7 deletions

View File

@ -2231,7 +2231,7 @@ static NetExpr*elaborate_delay_expr(PExpr*expr, Design*des, NetScope*scope)
dex->set_line(*expr);
// Cast this part of the expression to an integer.
dex = new NetECast('i', dex, 64, false);
dex = new NetECast('v', dex, 64, false);
dex->set_line(*expr);
// Now scale the integer value.

View File

@ -976,7 +976,7 @@ NetNet* NetECast::synthesize(Design*des, NetScope*scope, NetExpr*root)
if (isig == 0) return 0;
switch (op()) {
case 'i':
case 'v':
isig = cast_to_int4(des, scope, isig, isig->vector_width());
break;
case 'r':

View File

@ -2431,7 +2431,7 @@ ivl_variable_type_t NetECast::expr_type() const
{
ivl_variable_type_t ret;
switch (op_) {
case 'i':
case 'v':
ret = IVL_VT_LOGIC;
break;
case 'r':

View File

@ -503,7 +503,7 @@ static void emit_expr_unary(ivl_scope_t scope, ivl_expr_t expr, unsigned wid)
fprintf(vlog_out, ")");
break;
case '2':
case 'i':
case 'v':
case 'r':
/* A cast is a noop. */
emit_expr(scope, ivl_expr_oper1(expr), wid);

View File

@ -240,7 +240,7 @@ void emit_scaled_delayx(ivl_scope_t scope, ivl_expr_t expr, unsigned is_stmt)
* integer cast. */
tmp_expr = ivl_expr_oper1(expr);
if ((ivl_expr_type(tmp_expr) != IVL_EX_UNARY) ||
(ivl_expr_opcode(tmp_expr) != 'i')) {
(ivl_expr_opcode(tmp_expr) != 'v')) {
fprintf(vlog_out, "<invalid>");
fprintf(stderr, "%s:%u: vlog95 error: Real time "
"value does not have a cast to "

View File

@ -3151,7 +3151,7 @@ static struct vector_info draw_unary_expr(ivl_expr_t expr, unsigned wid)
}
break;
case 'i': /* Cast a real value to an integer. */
case 'v': /* Cast a real value to an integer. */
assert(ivl_expr_value(sub) == IVL_VT_REAL);
word = draw_eval_real(sub);
res.base = allocate_vector(wid);

View File

@ -488,7 +488,7 @@ static int draw_unary_real(ivl_expr_t expr)
return sub;
}
if (ivl_expr_opcode(expr) == 'i') { /* Handled in eval_expr.c. */
if (ivl_expr_opcode(expr) == 'v') { /* Handled in eval_expr.c. */
fprintf(stderr, "vvp.tgt error: real -> integer cast in real "
"context.\n");
assert(0);