Fix printf opcode argument mismatches in tgt-vvp (cppcheck)
This commit is contained in:
parent
1a82287f1e
commit
4cd295cbba
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2010 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2002-2012 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
|
|
@ -96,7 +96,7 @@ static void draw_lpm_mux_ab(ivl_lpm_t net, const char*muxz)
|
|||
input[2] = draw_net_input(ivl_lpm_select(net));
|
||||
fprintf(vvp_out, "L_%p%s .functor %s %u", net, dly, muxz, width);
|
||||
if (str0!=IVL_DR_STRONG || str1!=IVL_DR_STRONG)
|
||||
fprintf(vvp_out, " [%u %u]", str0, str1);
|
||||
fprintf(vvp_out, " [%d %d]", str0, str1);
|
||||
fprintf(vvp_out, ", %s", input[0]);
|
||||
fprintf(vvp_out, ", %s", input[1]);
|
||||
fprintf(vvp_out, ", %s", input[2]);
|
||||
|
|
@ -127,15 +127,15 @@ static void draw_lpm_mux_nest(ivl_lpm_t net, const char*muxz)
|
|||
}
|
||||
|
||||
for (level = 1 ; level < swidth-1 ; level += 1) {
|
||||
fprintf(vvp_out, "L_%p/%ds .part %s, %d, 1;\n",
|
||||
fprintf(vvp_out, "L_%p/%us .part %s, %u, 1;\n",
|
||||
net, level, select_input, level);
|
||||
|
||||
for (idx = 0 ; idx < (ivl_lpm_size(net) >> level); idx += 2) {
|
||||
fprintf(vvp_out, "L_%p/%d/%d .functor %s %u",
|
||||
fprintf(vvp_out, "L_%p/%u/%d .functor %s %u",
|
||||
net, level, idx/2, muxz, width);
|
||||
fprintf(vvp_out, ", L_%p/%d/%d", net, level-1, idx+0);
|
||||
fprintf(vvp_out, ", L_%p/%d/%d", net, level-1, idx+1);
|
||||
fprintf(vvp_out, ", L_%p/%ds", net, level);
|
||||
fprintf(vvp_out, ", L_%p/%us", net, level);
|
||||
fprintf(vvp_out, ", C4<>;\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -668,7 +668,7 @@ static void draw_net_input_x(ivl_nexus_t nex,
|
|||
resolv_type = "trior";
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "vvp.tgt: Unsupported signal type: %u\n", res);
|
||||
fprintf(stderr, "vvp.tgt: Unsupported signal type: %d\n", res);
|
||||
assert(0);
|
||||
resolv_type = "tri";
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ void draw_eval_expr_into_integer(ivl_expr_t expr, unsigned ix)
|
|||
|
||||
case IVL_VT_REAL:
|
||||
word = draw_eval_real(expr);
|
||||
fprintf(vvp_out, " %%cvt/sr %u, %u;\n", ix, word);
|
||||
fprintf(vvp_out, " %%cvt/sr %u, %d;\n", ix, word);
|
||||
clr_word(word);
|
||||
break;
|
||||
|
||||
|
|
@ -945,21 +945,21 @@ static struct vector_info draw_binary_expr_le_bool(ivl_expr_t expr,
|
|||
|
||||
switch (ivl_expr_opcode(expr)) {
|
||||
case 'G':
|
||||
fprintf(vvp_out, " %%cmp/w%c %u, %u;\n", s_flag, rw, lw);
|
||||
fprintf(vvp_out, " %%cmp/w%c %d, %d;\n", s_flag, rw, lw);
|
||||
fprintf(vvp_out, " %%or 5, 4, 1;\n");
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
fprintf(vvp_out, " %%cmp/w%c %u, %u;\n", s_flag, lw, rw);
|
||||
fprintf(vvp_out, " %%cmp/w%c %d, %d;\n", s_flag, lw, rw);
|
||||
fprintf(vvp_out, " %%or 5, 4, 1;\n");
|
||||
break;
|
||||
|
||||
case '<':
|
||||
fprintf(vvp_out, " %%cmp/w%c %u, %u;\n", s_flag, lw, rw);
|
||||
fprintf(vvp_out, " %%cmp/w%c %d, %d;\n", s_flag, lw, rw);
|
||||
break;
|
||||
|
||||
case '>':
|
||||
fprintf(vvp_out, " %%cmp/w%c %u, %u;\n", s_flag, rw, lw);
|
||||
fprintf(vvp_out, " %%cmp/w%c %d, %d;\n", s_flag, rw, lw);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -2438,14 +2438,14 @@ static struct vector_info draw_select_array(ivl_expr_t sube,
|
|||
/* We can safely skip the bit index load below if the array word
|
||||
* index is undefined. We need to do this so that the bit index
|
||||
* load does not reset bit 4 to zero by loading a defined value. */
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, 4;\n", thread_count, label);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, 4;\n", thread_count, label);
|
||||
if (ivl_expr_signed(bit_idx)) {
|
||||
fprintf(vvp_out, " %%ix/get/s 0, %u, %u;\n", shiv.base,
|
||||
shiv.wid);
|
||||
} else {
|
||||
fprintf(vvp_out, " %%ix/get 0, %u, %u;\n", shiv.base, shiv.wid);
|
||||
}
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, label);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, label);
|
||||
if (shiv.base >= 8)
|
||||
clr_vector(shiv);
|
||||
|
||||
|
|
@ -2531,7 +2531,7 @@ static struct vector_info draw_select_signal(ivl_expr_t expr,
|
|||
lab_end = local_count++;
|
||||
|
||||
/* If the index is 'bx then we just return 'bx. */
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, 4;\n", thread_count, lab_x);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, 4;\n", thread_count, lab_x);
|
||||
|
||||
use_wid = res.wid;
|
||||
if (use_wid > bit_wid)
|
||||
|
|
@ -2543,10 +2543,10 @@ static struct vector_info draw_select_signal(ivl_expr_t expr,
|
|||
$signed() this may be signed or unsigned (default). */
|
||||
pad_expr_in_place(expr, res, use_wid);
|
||||
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n", thread_count, lab_end);
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_x);
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count, lab_end);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_x);
|
||||
fprintf(vvp_out, " %%mov %u, 2, %u;\n", res.base, res.wid);
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_end);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_end);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
@ -2705,7 +2705,7 @@ static struct vector_info draw_select_unsized_literal(ivl_expr_t expr,
|
|||
clr_vector(shiv);
|
||||
|
||||
/* If we have an undefined index then just produce a 'bx result. */
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, 4;\n", thread_count, lab_x);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, 4;\n", thread_count, lab_x);
|
||||
|
||||
/* If the subv result is a magic constant, then make a copy in
|
||||
writable vector space and work from there instead. */
|
||||
|
|
@ -2737,14 +2737,14 @@ static struct vector_info draw_select_unsized_literal(ivl_expr_t expr,
|
|||
else
|
||||
fprintf(vvp_out, " %%shiftr/i0 %u, %u;\n", subv.base, subv.wid);
|
||||
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n", thread_count, lab_end);
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count, lab_end);
|
||||
|
||||
fprintf(vvp_out, "T_%d.%d ; Return 'bx value\n", thread_count, lab_x);
|
||||
fprintf(vvp_out, "T_%u.%u ; Return 'bx value\n", thread_count, lab_x);
|
||||
fprintf(vvp_out, " %%mov %u, 2, %u;\n", subv.base, wid);
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n", thread_count, lab_end);
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count, lab_end);
|
||||
|
||||
/* DONE */
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_end);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_end);
|
||||
|
||||
if (subv.wid > wid) {
|
||||
res.base = subv.base;
|
||||
|
|
@ -2878,24 +2878,24 @@ static struct vector_info draw_select_expr(ivl_expr_t expr, unsigned wid,
|
|||
lab_l = local_count++;
|
||||
lab_end = local_count++;
|
||||
/* If we have an undefined index then just produce a 'bx result. */
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, 4;\n", thread_count, lab_l);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, 4;\n", thread_count, lab_l);
|
||||
|
||||
cmp = allocate_word();
|
||||
assert(subv.wid >= wid);
|
||||
/* Determine if we need to shift a 'bx into the top. */
|
||||
fprintf(vvp_out, " %%ix/load %u, %u, 0;\n", cmp, subv.wid - wid);
|
||||
fprintf(vvp_out, " %%cmp/ws %u, 0;\n", cmp);
|
||||
fprintf(vvp_out, " %%ix/load %d, %u, 0;\n", cmp, subv.wid - wid);
|
||||
fprintf(vvp_out, " %%cmp/ws %d, 0;\n", cmp);
|
||||
clr_word(cmp);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, 5;\n", thread_count, lab_l);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, 5;\n", thread_count, lab_l);
|
||||
/* Clear the cmp bit if the two values are equal. */
|
||||
fprintf(vvp_out, " %%mov 4, 0, 1;\n");
|
||||
fprintf(vvp_out, " %%shiftr/i0 %u, %u;\n", subv.base, subv.wid);
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n", thread_count, lab_end);
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_l);
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count, lab_end);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_l);
|
||||
/* Multiply by -1. */
|
||||
fprintf(vvp_out, " %%ix/mul 0, %u, %u;\n", 0xFFFFFFFF, 0xFFFFFFFF);
|
||||
fprintf(vvp_out, " %%shiftl/i0 %u, %u;\n", subv.base, subv.wid);
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_end);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_end);
|
||||
|
||||
if (subv.wid > wid) {
|
||||
res.base = subv.base;
|
||||
|
|
@ -3000,7 +3000,7 @@ static struct vector_info draw_ternary_expr(ivl_expr_t expr, unsigned wid)
|
|||
tst.wid = 1;
|
||||
}
|
||||
|
||||
fprintf(vvp_out, " %%jmp/0 T_%d.%d, %u;\n",
|
||||
fprintf(vvp_out, " %%jmp/0 T_%u.%u, %u;\n",
|
||||
thread_count, lab_true, tst.base);
|
||||
|
||||
tru = draw_eval_expr_wid(true_ex, wid, 0);
|
||||
|
|
@ -3017,17 +3017,17 @@ static struct vector_info draw_ternary_expr(ivl_expr_t expr, unsigned wid)
|
|||
tru = tmp;
|
||||
}
|
||||
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, %u;\n",
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, %u;\n",
|
||||
thread_count, lab_out, tst.base);
|
||||
|
||||
clear_expression_lookaside();
|
||||
|
||||
fprintf(vvp_out, "T_%d.%d ; End of true expr.\n",
|
||||
fprintf(vvp_out, "T_%u.%u ; End of true expr.\n",
|
||||
thread_count, lab_true);
|
||||
|
||||
fal = draw_eval_expr_wid(false_ex, wid, 0);
|
||||
|
||||
fprintf(vvp_out, " %%jmp/0 T_%d.%d, %u;\n",
|
||||
fprintf(vvp_out, " %%jmp/0 T_%u.%u, %u;\n",
|
||||
thread_count, lab_false, tst.base);
|
||||
|
||||
fprintf(vvp_out, " ; End of false expr.\n");
|
||||
|
|
@ -3037,15 +3037,15 @@ static struct vector_info draw_ternary_expr(ivl_expr_t expr, unsigned wid)
|
|||
|
||||
fprintf(vvp_out, " %%blend %u, %u, %u; Condition unknown.\n",
|
||||
tru.base, fal.base, wid);
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n",
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n",
|
||||
thread_count, lab_out);
|
||||
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_false);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_false);
|
||||
fprintf(vvp_out, " %%mov %u, %u, %u; Return false value\n",
|
||||
tru.base, fal.base, wid);
|
||||
|
||||
/* This is the out label. */
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_out);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_out);
|
||||
clear_expression_lookaside();
|
||||
|
||||
res = tru;
|
||||
|
|
@ -3488,7 +3488,7 @@ static struct vector_info draw_unary_expr(ivl_expr_t expr, unsigned wid)
|
|||
word = draw_eval_real(sub);
|
||||
res.base = allocate_vector(wid);
|
||||
res.wid = wid;
|
||||
fprintf(vvp_out, " %%cvt/vr %u, %u, %u;\n", res.base, word,
|
||||
fprintf(vvp_out, " %%cvt/vr %u, %d, %u;\n", res.base, word,
|
||||
res.wid);
|
||||
clr_word(word);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -101,46 +101,46 @@ static int draw_binary_real(ivl_expr_t expr)
|
|||
break;
|
||||
|
||||
case 'm': { /* min(l,r) */
|
||||
int lab_out = local_count++;
|
||||
int lab_r = local_count++;
|
||||
unsigned lab_out = local_count++;
|
||||
unsigned lab_r = local_count++;
|
||||
/* If r is NaN, the go out and accept l as result. */
|
||||
fprintf(vvp_out, " %%cmp/wr %d, %d; Is NaN?\n", r, r);
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%d.%d, 4;\n", thread_count,
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%u.%u, 4;\n", thread_count,
|
||||
lab_out);
|
||||
/* If l is NaN, the go out and accept r as result. */
|
||||
fprintf(vvp_out, " %%cmp/wr %d, %d; Is NaN?\n", l, l);
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%d.%d, 4;\n", thread_count,
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%u.%u, 4;\n", thread_count,
|
||||
lab_r);
|
||||
/* If l <= r then go out. */
|
||||
fprintf(vvp_out, " %%cmp/wr %d, %d;\n", r, l);
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%d.%d, 5;\n", thread_count,
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%u.%u, 5;\n", thread_count,
|
||||
lab_out);
|
||||
/* At this point we know we want r as the result. */
|
||||
fprintf(vvp_out, "T_%d.%d %%mov/wr %d, %d;\n", thread_count,
|
||||
fprintf(vvp_out, "T_%u.%u %%mov/wr %d, %d;\n", thread_count,
|
||||
lab_r, l, r);
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_out);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_out);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'M': { /* max(l,r) */
|
||||
int lab_out = local_count++;
|
||||
int lab_r = local_count++;
|
||||
unsigned lab_out = local_count++;
|
||||
unsigned lab_r = local_count++;
|
||||
/* If r is NaN, the go out and accept l as result. */
|
||||
fprintf(vvp_out, " %%cmp/wr %d, %d; Is NaN?\n", r, r);
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%d.%d, 4;\n", thread_count,
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%u.%u, 4;\n", thread_count,
|
||||
lab_out);
|
||||
/* If l is NaN, the go out and accept r as result. */
|
||||
fprintf(vvp_out, " %%cmp/wr %d, %d; Is NaN?\n", l, l);
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%d.%d, 4;\n", thread_count,
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%u.%u, 4;\n", thread_count,
|
||||
lab_r);
|
||||
/* if l >= r then go out. */
|
||||
fprintf(vvp_out, " %%cmp/wr %d, %d;\n", l, r);
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%d.%d, 5;\n", thread_count,
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%u.%u, 5;\n", thread_count,
|
||||
lab_out);
|
||||
|
||||
fprintf(vvp_out, "T_%d.%d %%mov/wr %d, %d;\n", thread_count,
|
||||
fprintf(vvp_out, "T_%u.%u %%mov/wr %d, %d;\n", thread_count,
|
||||
lab_r, l, r);
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_out);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_out);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -407,7 +407,7 @@ static int draw_ternary_real(ivl_expr_t expr)
|
|||
}
|
||||
|
||||
/* Evaluate the true expression second. */
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, %u;\n",
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, %u;\n",
|
||||
thread_count, lab_true, tst.base);
|
||||
|
||||
/* Evaluate the false expression and copy it to the result word. */
|
||||
|
|
@ -415,28 +415,28 @@ static int draw_ternary_real(ivl_expr_t expr)
|
|||
res = allocate_word();
|
||||
fprintf(vvp_out, " %%mov/wr %d, %d;\n", res, fal);
|
||||
clr_word(fal);
|
||||
fprintf(vvp_out, " %%jmp/0 T_%d.%d, %u; End of false expr.\n",
|
||||
fprintf(vvp_out, " %%jmp/0 T_%u.%u, %u; End of false expr.\n",
|
||||
thread_count, lab_out, tst.base);
|
||||
|
||||
/* Evaluate the true expression. */
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_true);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_true);
|
||||
tru = draw_eval_real(true_ex);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, %u; End of true expr.\n",
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, %u; End of true expr.\n",
|
||||
thread_count, lab_move, tst.base);
|
||||
|
||||
/* If the conditional is undefined then blend the real words. */
|
||||
fprintf(vvp_out, " %%blend/wr %d, %d;\n", res, tru);
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d; End of blend\n",
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u; End of blend\n",
|
||||
thread_count, lab_out);
|
||||
|
||||
/* If we only need the true result then copy it to the result word. */
|
||||
fprintf(vvp_out, "T_%d.%d ; Move true result.\n",
|
||||
fprintf(vvp_out, "T_%u.%u ; Move true result.\n",
|
||||
thread_count, lab_move);
|
||||
fprintf(vvp_out, " %%mov/wr %d, %d;\n", res, tru);
|
||||
clr_word(tru);
|
||||
|
||||
/* This is the out label. */
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, lab_out);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_out);
|
||||
|
||||
clr_vector(tst);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
|
|
@ -345,7 +345,7 @@ void show_stmt_file_line(ivl_statement_t net, const char* desc)
|
|||
* should be reported/fixed. */
|
||||
unsigned lineno = ivl_stmt_lineno(net);
|
||||
assert(lineno);
|
||||
fprintf(vvp_out, " %%file_line %d %d \"%s\";\n",
|
||||
fprintf(vvp_out, " %%file_line %d %u \"%s\";\n",
|
||||
ivl_file_table_index(ivl_stmt_file(net)), lineno, desc);
|
||||
}
|
||||
}
|
||||
|
|
@ -410,11 +410,11 @@ static int show_stmt_assign_nb_real(ivl_statement_t net)
|
|||
assert(nevents == 0);
|
||||
int delay_index = allocate_word();
|
||||
draw_eval_expr_into_integer(del, delay_index);
|
||||
fprintf(vvp_out, " %%assign/wr/d v%p_%lu, %d, %u;\n",
|
||||
fprintf(vvp_out, " %%assign/wr/d v%p_%lu, %d, %d;\n",
|
||||
sig, use_word, delay_index, word);
|
||||
clr_word(delay_index);
|
||||
} else if (nevents) {
|
||||
fprintf(vvp_out, " %%assign/wr/e v%p_%lu, %u;\n",
|
||||
fprintf(vvp_out, " %%assign/wr/e v%p_%lu, %d;\n",
|
||||
sig, use_word, word);
|
||||
} else {
|
||||
unsigned long low_d = delay % UINT64_C(0x100000000);
|
||||
|
|
@ -428,11 +428,11 @@ static int show_stmt_assign_nb_real(ivl_statement_t net)
|
|||
int delay_index = allocate_word();
|
||||
fprintf(vvp_out, " %%ix/load %d, %lu, %lu;\n",
|
||||
delay_index, low_d, hig_d);
|
||||
fprintf(vvp_out, " %%assign/wr/d v%p_%lu, %d, %u;\n",
|
||||
fprintf(vvp_out, " %%assign/wr/d v%p_%lu, %d, %d;\n",
|
||||
sig, use_word, delay_index, word);
|
||||
clr_word(delay_index);
|
||||
} else {
|
||||
fprintf(vvp_out, " %%assign/wr v%p_%lu, %lu, %u;\n",
|
||||
fprintf(vvp_out, " %%assign/wr v%p_%lu, %lu, %d;\n",
|
||||
sig, use_word, low_d, word);
|
||||
}
|
||||
}
|
||||
|
|
@ -595,7 +595,7 @@ static int show_stmt_block(ivl_statement_t net, ivl_scope_t sscope)
|
|||
static int show_stmt_block_named(ivl_statement_t net, ivl_scope_t scope)
|
||||
{
|
||||
int rc;
|
||||
int out_id, sub_id;
|
||||
unsigned out_id, sub_id;
|
||||
ivl_scope_t subscope = ivl_stmt_block_scope(net);
|
||||
|
||||
out_id = transient_id++;
|
||||
|
|
@ -665,7 +665,7 @@ static int show_stmt_case(ivl_statement_t net, ivl_scope_t sscope)
|
|||
|
||||
fprintf(vvp_out, " %%cmpi/u %u, %lu, %u;\n",
|
||||
cond.base, imm, cond.wid);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, 6;\n",
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, 6;\n",
|
||||
thread_count, local_base+idx);
|
||||
|
||||
continue;
|
||||
|
|
@ -681,21 +681,21 @@ static int show_stmt_case(ivl_statement_t net, ivl_scope_t sscope)
|
|||
case IVL_ST_CASE:
|
||||
fprintf(vvp_out, " %%cmp/u %u, %u, %u;\n",
|
||||
cond.base, cvec.base, cond.wid);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, 6;\n",
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, 6;\n",
|
||||
thread_count, local_base+idx);
|
||||
break;
|
||||
|
||||
case IVL_ST_CASEX:
|
||||
fprintf(vvp_out, " %%cmp/x %u, %u, %u;\n",
|
||||
cond.base, cvec.base, cond.wid);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, 4;\n",
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, 4;\n",
|
||||
thread_count, local_base+idx);
|
||||
break;
|
||||
|
||||
case IVL_ST_CASEZ:
|
||||
fprintf(vvp_out, " %%cmp/z %u, %u, %u;\n",
|
||||
cond.base, cvec.base, cond.wid);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, 4;\n",
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, 4;\n",
|
||||
thread_count, local_base+idx);
|
||||
break;
|
||||
|
||||
|
|
@ -717,7 +717,7 @@ static int show_stmt_case(ivl_statement_t net, ivl_scope_t sscope)
|
|||
}
|
||||
|
||||
/* Jump to the out of the case. */
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n", thread_count,
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count,
|
||||
local_base+count);
|
||||
|
||||
for (idx = 0 ; idx < count ; idx += 1) {
|
||||
|
|
@ -726,18 +726,18 @@ static int show_stmt_case(ivl_statement_t net, ivl_scope_t sscope)
|
|||
if (idx == default_case)
|
||||
continue;
|
||||
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, local_base+idx);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, local_base+idx);
|
||||
clear_expression_lookaside();
|
||||
rc += show_statement(cst, sscope);
|
||||
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n", thread_count,
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count,
|
||||
local_base+count);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* The out of the case. */
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, local_base+count);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, local_base+count);
|
||||
clear_expression_lookaside();
|
||||
|
||||
return rc;
|
||||
|
|
@ -775,7 +775,7 @@ static int show_stmt_case_r(ivl_statement_t net, ivl_scope_t sscope)
|
|||
cvec = draw_eval_real(cex);
|
||||
|
||||
fprintf(vvp_out, " %%cmp/wr %d, %d;\n", cond, cvec);
|
||||
fprintf(vvp_out, " %%jmp/1 T_%d.%d, 4;\n",
|
||||
fprintf(vvp_out, " %%jmp/1 T_%u.%u, 4;\n",
|
||||
thread_count, local_base+idx);
|
||||
|
||||
/* Done with the guard expression value. */
|
||||
|
|
@ -793,7 +793,7 @@ static int show_stmt_case_r(ivl_statement_t net, ivl_scope_t sscope)
|
|||
}
|
||||
|
||||
/* Jump to the out of the case. */
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n", thread_count,
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count,
|
||||
local_base+count);
|
||||
|
||||
for (idx = 0 ; idx < count ; idx += 1) {
|
||||
|
|
@ -802,18 +802,16 @@ static int show_stmt_case_r(ivl_statement_t net, ivl_scope_t sscope)
|
|||
if (idx == default_case)
|
||||
continue;
|
||||
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, local_base+idx);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, local_base+idx);
|
||||
clear_expression_lookaside();
|
||||
rc += show_statement(cst, sscope);
|
||||
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n", thread_count,
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count,
|
||||
local_base+count);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* The out of the case. */
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, local_base+count);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, local_base+count);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1149,7 +1147,7 @@ static int show_stmt_condit(ivl_statement_t net, ivl_scope_t sscope)
|
|||
lab_false = local_count++;
|
||||
lab_out = local_count++;
|
||||
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%d.%d, %u;\n",
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%u.%u, %u;\n",
|
||||
thread_count, lab_false, cond.base);
|
||||
|
||||
/* Done with the condition expression. */
|
||||
|
|
@ -1161,17 +1159,17 @@ static int show_stmt_condit(ivl_statement_t net, ivl_scope_t sscope)
|
|||
|
||||
|
||||
if (ivl_stmt_cond_false(net)) {
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n", thread_count, lab_out);
|
||||
fprintf(vvp_out, "T_%d.%u ;\n", thread_count, lab_false);
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count, lab_out);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_false);
|
||||
clear_expression_lookaside();
|
||||
|
||||
rc += show_statement(ivl_stmt_cond_false(net), sscope);
|
||||
|
||||
fprintf(vvp_out, "T_%d.%u ;\n", thread_count, lab_out);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_out);
|
||||
clear_expression_lookaside();
|
||||
|
||||
} else {
|
||||
fprintf(vvp_out, "T_%d.%u ;\n", thread_count, lab_false);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, lab_false);
|
||||
clear_expression_lookaside();
|
||||
}
|
||||
|
||||
|
|
@ -1620,7 +1618,7 @@ static int show_stmt_while(ivl_statement_t net, ivl_scope_t sscope)
|
|||
/* Start the loop. The top of the loop starts a basic block
|
||||
because it can be entered from above or from the bottom of
|
||||
the loop. */
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, top_label);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, top_label);
|
||||
clear_expression_lookaside();
|
||||
|
||||
/* Draw the evaluation of the condition expression, and test
|
||||
|
|
@ -1630,7 +1628,7 @@ static int show_stmt_while(ivl_statement_t net, ivl_scope_t sscope)
|
|||
if (cvec.wid > 1)
|
||||
cvec = reduction_or(cvec);
|
||||
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%d.%d, %u;\n",
|
||||
fprintf(vvp_out, " %%jmp/0xz T_%u.%u, %u;\n",
|
||||
thread_count, out_label, cvec.base);
|
||||
if (cvec.base >= 8)
|
||||
clr_vector(cvec);
|
||||
|
|
@ -1640,8 +1638,8 @@ static int show_stmt_while(ivl_statement_t net, ivl_scope_t sscope)
|
|||
|
||||
/* This is the bottom of the loop. branch to the top where the
|
||||
test is repeated, and also draw the out label. */
|
||||
fprintf(vvp_out, " %%jmp T_%d.%d;\n", thread_count, top_label);
|
||||
fprintf(vvp_out, "T_%d.%d ;\n", thread_count, out_label);
|
||||
fprintf(vvp_out, " %%jmp T_%u.%u;\n", thread_count, top_label);
|
||||
fprintf(vvp_out, "T_%u.%u ;\n", thread_count, out_label);
|
||||
clear_expression_lookaside();
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -2166,7 +2164,7 @@ static int show_statement(ivl_statement_t net, ivl_scope_t sscope)
|
|||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "vvp.tgt: Unable to draw statement type %u\n",
|
||||
fprintf(stderr, "vvp.tgt: Unable to draw statement type %d\n",
|
||||
code);
|
||||
rc += 1;
|
||||
break;
|
||||
|
|
@ -2211,7 +2209,7 @@ int draw_process(ivl_process_t net, void*x)
|
|||
|
||||
/* Generate the entry label. Just give the thread a number so
|
||||
that we ar certain the label is unique. */
|
||||
fprintf(vvp_out, "T_%d ;\n", thread_count);
|
||||
fprintf(vvp_out, "T_%u ;\n", thread_count);
|
||||
clear_expression_lookaside();
|
||||
|
||||
/* Draw the contents of the thread. */
|
||||
|
|
@ -2229,7 +2227,7 @@ int draw_process(ivl_process_t net, void*x)
|
|||
break;
|
||||
|
||||
case IVL_PR_ALWAYS:
|
||||
fprintf(vvp_out, " %%jmp T_%d;\n", thread_count);
|
||||
fprintf(vvp_out, " %%jmp T_%u;\n", thread_count);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2240,14 +2238,14 @@ int draw_process(ivl_process_t net, void*x)
|
|||
case IVL_PR_INITIAL:
|
||||
case IVL_PR_ALWAYS:
|
||||
if (push_flag) {
|
||||
fprintf(vvp_out, " .thread T_%d, $push;\n", thread_count);
|
||||
fprintf(vvp_out, " .thread T_%u, $push;\n", thread_count);
|
||||
} else {
|
||||
fprintf(vvp_out, " .thread T_%d;\n", thread_count);
|
||||
fprintf(vvp_out, " .thread T_%u;\n", thread_count);
|
||||
}
|
||||
break;
|
||||
|
||||
case IVL_PR_FINAL:
|
||||
fprintf(vvp_out, " .thread T_%d, $final;\n", thread_count);
|
||||
fprintf(vvp_out, " .thread T_%u, $final;\n", thread_count);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
|
|
@ -785,7 +785,7 @@ static void draw_udp_def(ivl_udp_t udp)
|
|||
|
||||
if (ivl_udp_sequ(udp))
|
||||
fprintf(vvp_out,
|
||||
"UDP_%s .udp/sequ \"%s\", %d, %d",
|
||||
"UDP_%s .udp/sequ \"%s\", %d, %u",
|
||||
vvp_mangle_id(ivl_udp_name(udp)),
|
||||
vvp_mangle_name(ivl_udp_name(udp)),
|
||||
ivl_udp_nin(udp),
|
||||
|
|
@ -1061,7 +1061,7 @@ static void draw_logic_in_scope(ivl_net_logic_t lptr)
|
|||
unsigned inst;
|
||||
for (inst = 0; inst < (unsigned)ninp; inst += 4) {
|
||||
if (ninp > 4)
|
||||
fprintf(vvp_out, "L_%p/%d/%d .functor %s %u",
|
||||
fprintf(vvp_out, "L_%p/%d/%u .functor %s %u",
|
||||
lptr, level, inst, lcasc, vector_width);
|
||||
else {
|
||||
fprintf(vvp_out, "L_%p%s .functor %s %u",
|
||||
|
|
@ -1069,7 +1069,7 @@ static void draw_logic_in_scope(ivl_net_logic_t lptr)
|
|||
ltype, vector_width);
|
||||
|
||||
if (str0 != IVL_DR_STRONG || str1 != IVL_DR_STRONG)
|
||||
fprintf(vvp_out, " [%u %u]", str0, str1);
|
||||
fprintf(vvp_out, " [%d %d]", str0, str1);
|
||||
|
||||
}
|
||||
for (pdx = inst; pdx < (unsigned)ninp && pdx < inst+4 ; pdx += 1) {
|
||||
|
|
@ -2173,7 +2173,7 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
|
|||
unsigned width = ivl_scope_mod_module_port_width(net,idx);
|
||||
if( name == 0 )
|
||||
name = "";
|
||||
fprintf( vvp_out, " .port_info %d %s %u \"%s\"\n",
|
||||
fprintf( vvp_out, " .port_info %u %s %u \"%s\"\n",
|
||||
idx, vvp_port_info_type_str(ptype), width, name );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue