mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-23 06:16:47 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4af0acb3be | ||
|
|
8435774c26 | ||
|
|
6172748c65 | ||
|
|
ca0ae9040a | ||
|
|
d9cdbde3f6 | ||
|
|
307a97116f | ||
|
|
83d2c6dfd1 |
+13
-6
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: elab_net.cc,v 1.138 2004/10/04 03:09:38 steve Exp $"
|
||||
#ident "$Id: elab_net.cc,v 1.138.2.1 2005/01/29 00:18:23 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
@@ -1312,21 +1312,25 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
|
||||
unsigned repeat = 1;
|
||||
|
||||
if (repeat_) {
|
||||
verinum*rep = repeat_->eval_const(des, scope);
|
||||
if (rep == 0) {
|
||||
NetExpr*etmp = elab_and_eval(des, scope, repeat_);
|
||||
assert(etmp);
|
||||
NetEConst*erep = dynamic_cast<NetEConst*>(etmp);
|
||||
|
||||
if (erep == 0) {
|
||||
cerr << get_line() << ": internal error: Unable to "
|
||||
<< "evaluate constant repeat expression." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
repeat = rep->as_ulong();
|
||||
repeat = erep->value().as_ulong();
|
||||
delete etmp;
|
||||
|
||||
if (repeat == 0) {
|
||||
cerr << get_line() << ": error: Invalid repeat value."
|
||||
cerr << get_line() << ": error: Concatenation epeat "
|
||||
"may not be 0."
|
||||
<< endl;
|
||||
des->errors += 1;
|
||||
delete rep;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -2513,6 +2517,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
|
||||
|
||||
/*
|
||||
* $Log: elab_net.cc,v $
|
||||
* Revision 1.138.2.1 2005/01/29 00:18:23 steve
|
||||
* Fix evaluate of constants in netlist concatenation repeats.
|
||||
*
|
||||
* Revision 1.138 2004/10/04 03:09:38 steve
|
||||
* Fix excessive error message.
|
||||
*
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
PKG="IVLver"
|
||||
NAME="verilog"
|
||||
ARCH="sparc"
|
||||
VERSION="0.7"
|
||||
VERSION="0.8"
|
||||
CATEGORY="application"
|
||||
VENDOR="Icarus.com"
|
||||
EMAIL="[email protected]"
|
||||
|
||||
@@ -4,6 +4,7 @@ f none bin/iverilog 0755 bin bin
|
||||
f none bin/iverilog-vpi 0755 bin bin
|
||||
f none bin/vvp 0755 bin bin
|
||||
d none include 0755 bin bin
|
||||
f none include/_pli_types.h 0644 bin bin
|
||||
f none include/acc_user.h 0644 bin bin
|
||||
f none include/ivl_target.h 0644 bin bin
|
||||
f none include/veriuser.h 0644 bin bin
|
||||
@@ -11,12 +12,21 @@ f none include/vpi_user.h 0644 bin bin
|
||||
d none lib 0755 bin bin
|
||||
d none lib/ivl 0755 bin bin
|
||||
f none lib/ivl/fpga.tgt 0644 bin bin
|
||||
f none lib/ivl/fpga.conf 0644 bin bin
|
||||
f none lib/ivl/fpga-s.conf 0644 bin bin
|
||||
f none lib/ivl/iverilog.conf 0644 bin bin
|
||||
f none lib/ivl/ivl 0755 bin bin
|
||||
f none lib/ivl/ivlpp 0755 bin bin
|
||||
f none lib/ivl/null.tgt 0644 bin bin
|
||||
f none lib/ivl/null.conf 0644 bin bin
|
||||
f none lib/ivl/null-s.conf 0644 bin bin
|
||||
f none lib/ivl/system.vpi 0644 bin bin
|
||||
f none lib/ivl/system.sft 0644 bin bin
|
||||
f none lib/ivl/vvp.tgt 0644 bin bin
|
||||
f none lib/ivl/vvp.conf 0644 bin bin
|
||||
f none lib/ivl/vvp-s.conf 0644 bin bin
|
||||
f none lib/ivl/xnf.conf 0644 bin bin
|
||||
f none lib/ivl/xnf-s.conf 0644 bin bin
|
||||
f none lib/libveriuser.a 0644 bin bin
|
||||
f none lib/libvpi.a 0644 bin bin
|
||||
d none man 0755 bin bin
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
functor:synth2
|
||||
functor:synth
|
||||
functor:syn-rules
|
||||
functor:cprop
|
||||
functor:nodangle
|
||||
-t:dll
|
||||
@@ -0,0 +1,3 @@
|
||||
functor:cprop
|
||||
functor:nodangle
|
||||
-t:dll
|
||||
+37
-8
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: vvp_process.c,v 1.93 2004/10/04 01:10:57 steve Exp $"
|
||||
#ident "$Id: vvp_process.c,v 1.93.2.2 2005/01/28 18:29:29 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vvp_priv.h"
|
||||
@@ -161,18 +161,39 @@ static void assign_to_memory(ivl_memory_t mem, unsigned idx,
|
||||
* This function, in addition to setting the value into index 0, sets
|
||||
* bit 4 to 1 if the value is unknown.
|
||||
*/
|
||||
void draw_eval_expr_into_integer(ivl_expr_t expr, unsigned ix)
|
||||
{
|
||||
struct vector_info vec;
|
||||
int word;
|
||||
|
||||
switch (ivl_expr_value(expr)) {
|
||||
|
||||
case IVL_VT_VECTOR:
|
||||
vec = draw_eval_expr(expr, 0);
|
||||
fprintf(vvp_out, " %%ix/get %u, %u, %u;\n",
|
||||
ix, vec.base, vec.wid);
|
||||
clr_vector(vec);
|
||||
break;
|
||||
|
||||
case IVL_VT_REAL:
|
||||
word = draw_eval_real(expr);
|
||||
clr_word(word);
|
||||
fprintf(vvp_out, " %%cvt/ir %u, %u;\n", ix, word);
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
static void calculate_into_x0(ivl_expr_t expr)
|
||||
{
|
||||
struct vector_info vec = draw_eval_expr(expr, 0);
|
||||
fprintf(vvp_out, " %%ix/get 0, %u, %u;\n", vec.base, vec.wid);
|
||||
clr_vector(vec);
|
||||
draw_eval_expr_into_integer(expr, 0);
|
||||
}
|
||||
|
||||
static void calculate_into_x1(ivl_expr_t expr)
|
||||
{
|
||||
struct vector_info vec = draw_eval_expr(expr, 0);
|
||||
fprintf(vvp_out, " %%ix/get 1, %u, %u;\n", vec.base, vec.wid);
|
||||
clr_vector(vec);
|
||||
draw_eval_expr_into_integer(expr, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -429,7 +450,7 @@ static int show_stmt_assign(ivl_statement_t net)
|
||||
* This function handles the case of non-blocking assign to word
|
||||
* variables such as real, i.e:
|
||||
*
|
||||
* read foo;
|
||||
* real foo;
|
||||
* foo <= 1.0;
|
||||
*
|
||||
* In this case we know (by Verilog syntax) that there is only exactly
|
||||
@@ -467,6 +488,8 @@ static int show_stmt_assign_nb_var(ivl_statement_t net)
|
||||
fprintf(vvp_out, " %%assign/wr W_%s, %lu, %u;\n",
|
||||
vvp_word_label(var), delay, word);
|
||||
|
||||
clr_word(word);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1626,6 +1649,12 @@ int draw_func_definition(ivl_scope_t scope)
|
||||
|
||||
/*
|
||||
* $Log: vvp_process.c,v $
|
||||
* Revision 1.93.2.2 2005/01/28 18:29:29 steve
|
||||
* Add ability to compile real values into index registers.
|
||||
*
|
||||
* Revision 1.93.2.1 2004/12/12 04:25:10 steve
|
||||
* Fix leak of word registers in code generator.
|
||||
*
|
||||
* Revision 1.93 2004/10/04 01:10:57 steve
|
||||
* Clean up spurious trailing white space.
|
||||
*
|
||||
|
||||
+26
-18
@@ -655,8 +655,8 @@ if((lt)&&(lt->numfacs))
|
||||
lt->zfacname_predec_size = lt->zpackcount;
|
||||
|
||||
gzclose(lt->zhandle);
|
||||
fseek(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftell(lt->handle);
|
||||
fseeko(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftello(lt->handle);
|
||||
lt->zfacname_size = lt->position - lt->zfacname_size;
|
||||
|
||||
lt->zhandle = gzdopen(dup(fileno(lt->handle)), "wb9");
|
||||
@@ -681,8 +681,8 @@ if((lt)&&(lt->numfacs))
|
||||
}
|
||||
|
||||
gzclose(lt->zhandle);
|
||||
fseek(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftell(lt->handle);
|
||||
fseeko(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftello(lt->handle);
|
||||
lt->zfacgeometry_size = lt->position - lt->facgeometry_offset;
|
||||
|
||||
if(is_interlaced_trace)
|
||||
@@ -696,8 +696,8 @@ if((lt)&&(lt->numfacs))
|
||||
}
|
||||
|
||||
gzclose(lt->zhandle); lt->zhandle = NULL;
|
||||
fseek(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftell(lt->handle);
|
||||
fseeko(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftello(lt->handle);
|
||||
lt->zsync_table_size = lt->position - lt->sync_table_offset;
|
||||
}
|
||||
}
|
||||
@@ -706,7 +706,7 @@ if((lt)&&(lt->numfacs))
|
||||
|
||||
|
||||
/*
|
||||
* initialize the trace and get back and lt context
|
||||
* initialize the trace and get back an lt context
|
||||
*/
|
||||
struct lt_trace *lt_init(const char *name)
|
||||
{
|
||||
@@ -1002,8 +1002,8 @@ for(i=0;i<lt->num_dict_entries;i++)
|
||||
}
|
||||
|
||||
gzclose(lt->zhandle);
|
||||
fseek(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftell(lt->handle);
|
||||
fseeko(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftello(lt->handle);
|
||||
lt->zdictionary_size = lt->position - lt->zdictionary_size;
|
||||
|
||||
free(lt->sorted_dict); lt->sorted_dict = NULL;
|
||||
@@ -1057,8 +1057,8 @@ if(lt)
|
||||
case LT_ZMODE_BZIP2: BZ2_bzclose(lt->zhandle); break;
|
||||
}
|
||||
lt->zhandle = NULL;
|
||||
fseek(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftell(lt->handle);
|
||||
fseeko(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftello(lt->handle);
|
||||
|
||||
lt_set_zmode(lt, LT_ZMODE_NONE);
|
||||
lt->zchg_table_size = lt->position - lt->change_field_offset;
|
||||
@@ -1132,8 +1132,8 @@ if(lt)
|
||||
}
|
||||
|
||||
gzclose(lt->zhandle); lt->zhandle = NULL;
|
||||
fseek(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftell(lt->handle);
|
||||
fseeko(lt->handle, 0L, SEEK_END);
|
||||
lt->position=ftello(lt->handle);
|
||||
lt->ztime_table_size = lt->position - lt->ztime_table_size;
|
||||
}
|
||||
|
||||
@@ -1609,7 +1609,7 @@ int i;
|
||||
|
||||
len--;
|
||||
|
||||
for(i=0;i<len;i++)
|
||||
for(i=0;i<=len;i++)
|
||||
{
|
||||
*(p++) = '0' | ((value & (1<<(len-i)))!=0);
|
||||
}
|
||||
@@ -1642,11 +1642,15 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
|
||||
if((len>1)&&(len<=32))
|
||||
{
|
||||
int ivalue = value;
|
||||
int delta1, delta2;
|
||||
s->clk_mask <<= 1;
|
||||
s->clk_mask |= 1;
|
||||
|
||||
if(((s->clk_mask&0x1f)==0x1f) && ((ivalue - s->clk_prevval1)==(s->clk_prevval1 - s->clk_prevval3)) &&
|
||||
((s->clk_prevval - s->clk_prevval2)==(s->clk_prevval2 - s->clk_prevval4)))
|
||||
if( ((s->clk_mask&0x1f)==0x1f) &&
|
||||
( (delta1=(ivalue - s->clk_prevval1) & lt_optimask[s->len]) == ((s->clk_prevval1 - s->clk_prevval3) & lt_optimask[s->len]) ) &&
|
||||
( (delta2=(s->clk_prevval - s->clk_prevval2) & lt_optimask[s->len]) == ((s->clk_prevval2 - s->clk_prevval4) & lt_optimask[s->len]) ) &&
|
||||
( (delta1==delta2) || ((!delta1)&&(!delta2)) )
|
||||
)
|
||||
{
|
||||
if(s->clk_prevtrans==ULLDescriptor(~0))
|
||||
{
|
||||
@@ -2247,6 +2251,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
|
||||
int ivalue = 0;
|
||||
int i;
|
||||
char *pnt = value;
|
||||
int delta1, delta2;
|
||||
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
@@ -2271,8 +2276,11 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
|
||||
s->clk_mask <<= 1;
|
||||
s->clk_mask |= legal;
|
||||
|
||||
if(((s->clk_mask&0x1f)==0x1f) && ((ivalue - s->clk_prevval1)==(s->clk_prevval1 - s->clk_prevval3)) &&
|
||||
((s->clk_prevval - s->clk_prevval2)==(s->clk_prevval2 - s->clk_prevval4)))
|
||||
if( ((s->clk_mask&0x1f)==0x1f) &&
|
||||
( (delta1=(ivalue - s->clk_prevval1) & lt_optimask[s->len]) == ((s->clk_prevval1 - s->clk_prevval3) & lt_optimask[s->len]) ) &&
|
||||
( (delta2=(s->clk_prevval - s->clk_prevval2) & lt_optimask[s->len]) == ((s->clk_prevval2 - s->clk_prevval4) & lt_optimask[s->len]) ) &&
|
||||
( (delta1==delta2) || ((!delta1)&&(!delta2)) )
|
||||
)
|
||||
{
|
||||
if(s->clk_prevtrans==ULLDescriptor(~0))
|
||||
{
|
||||
|
||||
+17
-15
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: sys_fileio.c,v 1.5 2004/08/24 16:16:23 steve Exp $"
|
||||
#ident "$Id: sys_fileio.c,v 1.5.2.1 2005/01/01 20:07:41 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vpi_user.h"
|
||||
@@ -52,28 +52,16 @@ static int sys_fopen_calltf(char *name)
|
||||
argv = 0;
|
||||
}
|
||||
|
||||
if (! is_constant(item)) {
|
||||
vpi_printf("ERROR: %s parameter must be a constant\n", name);
|
||||
vpi_free_object(argv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (vpi_get(vpiConstType, item) != vpiStringConst) {
|
||||
vpi_printf("ERROR: %s parameter must be a string.\n", name);
|
||||
vpi_free_object(argv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (mode) {
|
||||
if (! is_constant(mode)) {
|
||||
vpi_printf("ERROR: %s parameter must be a constant\n", name);
|
||||
vpi_free_object(argv);
|
||||
if (argv) vpi_free_object(argv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (vpi_get(vpiConstType, mode) != vpiStringConst) {
|
||||
vpi_printf("ERROR: %s parameter must be a string.\n", name);
|
||||
vpi_free_object(argv);
|
||||
if (argv) vpi_free_object(argv);
|
||||
return 0;
|
||||
}
|
||||
value.format = vpiStringVal;
|
||||
@@ -81,9 +69,20 @@ static int sys_fopen_calltf(char *name)
|
||||
mode_string = strdup(value.value.str);
|
||||
}
|
||||
|
||||
/* Get the string form of the file name from the file name
|
||||
argument. */
|
||||
value.format = vpiStringVal;
|
||||
vpi_get_value(item, &value);
|
||||
|
||||
if ((value.format != vpiStringVal) || !value.value.str) {
|
||||
vpi_printf("ERROR: %s: File name argument (type=%d)"
|
||||
" does not have a string value\n",
|
||||
name, vpi_get(vpiType, item));
|
||||
if (mode) free(mode_string);
|
||||
if (argv) vpi_free_object(argv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
value.format = vpiIntVal;
|
||||
if (mode) {
|
||||
value.value.integer = vpi_fopen(value.value.str, mode_string);
|
||||
@@ -480,6 +479,9 @@ void sys_fileio_register()
|
||||
|
||||
/*
|
||||
* $Log: sys_fileio.c,v $
|
||||
* Revision 1.5.2.1 2005/01/01 20:07:41 steve
|
||||
* More robust handling of file name argument to $fopen.
|
||||
*
|
||||
* Revision 1.5 2004/08/24 16:16:23 steve
|
||||
* Fix read count passed to fgets.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user