mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 05:47:31 +02:00
Add support for structural multiply in t-dll.
Add code generators and vvp support for both structural and behavioral multiply.
This commit is contained in:
+14
-4
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT)
|
||||
#ident "$Id: eval_expr.c,v 1.29 2001/05/24 04:20:10 steve Exp $"
|
||||
#ident "$Id: eval_expr.c,v 1.30 2001/06/16 23:45:05 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vvp_priv.h"
|
||||
@@ -518,12 +518,12 @@ static struct vector_info draw_binary_expr_arith(ivl_expr_t exp, unsigned wid)
|
||||
struct vector_info lv;
|
||||
struct vector_info rv;
|
||||
|
||||
assert(ivl_expr_width(le) == wid);
|
||||
assert(ivl_expr_width(re) == wid);
|
||||
|
||||
lv = draw_eval_expr_wid(le, wid);
|
||||
rv = draw_eval_expr_wid(re, wid);
|
||||
|
||||
assert(lv.wid == wid);
|
||||
assert(rv.wid == wid);
|
||||
|
||||
switch (ivl_expr_opcode(exp)) {
|
||||
case '+':
|
||||
fprintf(vvp_out, " %%add %u, %u, %u;\n", lv.base, rv.base, wid);
|
||||
@@ -533,6 +533,10 @@ static struct vector_info draw_binary_expr_arith(ivl_expr_t exp, unsigned wid)
|
||||
fprintf(vvp_out, " %%sub %u, %u, %u;\n", lv.base, rv.base, wid);
|
||||
break;
|
||||
|
||||
case '*':
|
||||
fprintf(vvp_out, " %%mul %u, %u, %u;\n", lv.base, rv.base, wid);
|
||||
break;
|
||||
|
||||
case '%':
|
||||
fprintf(vvp_out, " %%mod %u, %u, %u;\n", lv.base, rv.base, wid);
|
||||
break;
|
||||
@@ -572,6 +576,7 @@ static struct vector_info draw_binary_expr(ivl_expr_t exp, unsigned wid)
|
||||
|
||||
case '+':
|
||||
case '-':
|
||||
case '*':
|
||||
case '%':
|
||||
rv = draw_binary_expr_arith(exp, wid);
|
||||
break;
|
||||
@@ -1043,6 +1048,11 @@ struct vector_info draw_eval_expr(ivl_expr_t exp)
|
||||
|
||||
/*
|
||||
* $Log: eval_expr.c,v $
|
||||
* Revision 1.30 2001/06/16 23:45:05 steve
|
||||
* Add support for structural multiply in t-dll.
|
||||
* Add code generators and vvp support for both
|
||||
* structural and behavioral multiply.
|
||||
*
|
||||
* Revision 1.29 2001/05/24 04:20:10 steve
|
||||
* Add behavioral modulus.
|
||||
*
|
||||
|
||||
+14
-1
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT)
|
||||
#ident "$Id: vvp_scope.c,v 1.33 2001/06/16 02:41:42 steve Exp $"
|
||||
#ident "$Id: vvp_scope.c,v 1.34 2001/06/16 23:45:05 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vvp_priv.h"
|
||||
@@ -118,6 +118,7 @@ static const char* draw_net_input_drive(ivl_nexus_t nex, ivl_nexus_ptr_t nptr)
|
||||
case IVL_LPM_RAM:
|
||||
case IVL_LPM_ADD:
|
||||
case IVL_LPM_SUB:
|
||||
case IVL_LPM_MULT:
|
||||
for (idx = 0 ; idx < ivl_lpm_width(lpm) ; idx += 1)
|
||||
if (ivl_lpm_q(lpm, idx) == nex) {
|
||||
sprintf(result, "L_%s[%u]",
|
||||
@@ -138,7 +139,10 @@ static const char* draw_net_input_drive(ivl_nexus_t nex, ivl_nexus_ptr_t nptr)
|
||||
|
||||
}
|
||||
|
||||
fprintf(stderr, "internal error: no input to nexus %s\n",
|
||||
ivl_nexus_name(nex));
|
||||
assert(0);
|
||||
return "C<z>";
|
||||
}
|
||||
|
||||
static const char* draw_net_input(ivl_nexus_t nex)
|
||||
@@ -706,6 +710,9 @@ static void draw_lpm_add(ivl_lpm_t net)
|
||||
case IVL_LPM_SUB:
|
||||
type = "sub";
|
||||
break;
|
||||
case IVL_LPM_MULT:
|
||||
type = "mult";
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
@@ -779,6 +786,7 @@ static void draw_lpm_in_scope(ivl_lpm_t net)
|
||||
|
||||
case IVL_LPM_ADD:
|
||||
case IVL_LPM_SUB:
|
||||
case IVL_LPM_MULT:
|
||||
draw_lpm_add(net);
|
||||
return;
|
||||
|
||||
@@ -876,6 +884,11 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
|
||||
|
||||
/*
|
||||
* $Log: vvp_scope.c,v $
|
||||
* Revision 1.34 2001/06/16 23:45:05 steve
|
||||
* Add support for structural multiply in t-dll.
|
||||
* Add code generators and vvp support for both
|
||||
* structural and behavioral multiply.
|
||||
*
|
||||
* Revision 1.33 2001/06/16 02:41:42 steve
|
||||
* Generate code to support memory access in continuous
|
||||
* assignment statements. (Stephan Boettcher)
|
||||
|
||||
Reference in New Issue
Block a user