Remove dead code related to memories.

This commit is contained in:
steve 2007-01-17 04:39:18 +00:00
parent 91d84e7dc7
commit f5a7ee0736
8 changed files with 40 additions and 304 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: ivl_target.h,v 1.172 2007/01/16 05:44:15 steve Exp $"
#ident "$Id: ivl_target.h,v 1.173 2007/01/17 04:39:18 steve Exp $"
#endif
# include <stdint.h>
@ -258,7 +258,7 @@ typedef enum ivl_lpm_type_e {
IVL_LPM_SHIFTR = 7,
IVL_LPM_SIGN_EXT=27,
IVL_LPM_SUB = 8,
_IVL_LPM_RAM = 9, /* obsolete */
/* IVL_LPM_RAM = 9, / obsolete */
IVL_LPM_UFUNC = 14
} ivl_lpm_type_t;
@ -656,42 +656,7 @@ extern unsigned long ivl_expr_uvalue(ivl_expr_t net);
/* any expression */
extern unsigned ivl_expr_width(ivl_expr_t net);
/*
* Memory.
* Memories are declared in Verilog source as 2 dimensional arrays of
* reg bits. This means that they are simple arrays of vectors. The
* vectors in the array are called "words".
*
* ivl_memory_name (DEPRECATED)
*
* ivl_memory_basename
* This returns the base name of the memory object. The base name
* does not include the name of the scopes that contains the object.
*
* ivl_memory_root
* The root of the memory is the value to add to a calculated
* address to get to a canonical (0-based) address. This value is
* used when external code wishes to access a word. All the
* compiled references to the word within the compiled design are
* converted to canonical form by the compiler.
*
* ivl_memory_size
* ivl_memory_width
* These functions return the dimensions of the memory. The size is
* the number of words in the memory, and the width is the number
* of bits in each word.
*
* ivl_memory_scope
* This returns the scope that contains the memory.
*/
extern const char*ivl_memory_basename(ivl_memory_t net);
extern int ivl_memory_root(ivl_memory_t net);
extern ivl_scope_t ivl_memory_scope(ivl_memory_t net);
extern unsigned ivl_memory_size(ivl_memory_t net);
extern unsigned ivl_memory_width(ivl_memory_t net);
extern ivl_memory_t ivl_expr_memory(ivl_expr_t net);
/* LOGIC
* These types and functions support manipulation of logic gates. The
@ -1147,7 +1112,7 @@ extern const char*ivl_lpm_string(ivl_lpm_t net);
*
* (Should this be combined with ivl_lval_idx? -Ed)
*
* ivl_lval_mem
* ivl_lval_mem (deprecated)
* If the l-value is a memory, this method returns an
* ivl_memory_t that represents that memory. Otherwise, it
* returns 0.
@ -1197,7 +1162,6 @@ extern const char*ivl_lpm_string(ivl_lpm_t net);
extern unsigned ivl_lval_width(ivl_lval_t net);
extern ivl_expr_t ivl_lval_mux(ivl_lval_t net); // XXXX Obsolete?
extern ivl_expr_t ivl_lval_idx(ivl_lval_t net);
extern ivl_memory_t ivl_lval_mem(ivl_lval_t net);
extern ivl_expr_t ivl_lval_part_off(ivl_lval_t net);
extern ivl_signal_t ivl_lval_sig(ivl_lval_t net);
@ -1792,6 +1756,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.173 2007/01/17 04:39:18 steve
* Remove dead code related to memories.
*
* Revision 1.172 2007/01/16 05:44:15 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-api.cc,v 1.138 2007/01/16 05:44:15 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.139 2007/01/17 04:39:18 steve Exp $"
#endif
# include "config.h"
@ -96,33 +96,6 @@ inline static const char *basename(ivl_scope_t scope, const char *inst)
return inst+1;
}
extern "C" const char* ivl_memory_basename(ivl_memory_t net)
{
return net->basename_;
}
extern "C" ivl_scope_t ivl_memory_scope(ivl_memory_t net)
{
assert(net);
return net->scope_;
}
extern "C" int ivl_memory_root(ivl_memory_t net)
{
return net->root_;
}
extern "C" unsigned ivl_memory_size(ivl_memory_t net)
{
return net->size_;
}
extern "C" unsigned ivl_memory_width(ivl_memory_t net)
{
return net->width_;
}
extern "C" ivl_variable_type_t ivl_const_type(ivl_net_const_t net)
{
assert(net);
@ -502,12 +475,6 @@ extern "C" unsigned ivl_expr_width(ivl_expr_t net)
return net->width_;
}
extern "C" ivl_memory_t ivl_expr_memory(ivl_expr_t net)
{
assert(net->type_ == IVL_EX_MEMORY);
return net->u_.memory_.mem_;
}
extern "C" const char* ivl_logic_attr(ivl_net_logic_t net, const char*key)
{
assert(net);
@ -1140,21 +1107,12 @@ extern "C" ivl_expr_t ivl_lval_mux(ivl_lval_t net)
extern "C" ivl_expr_t ivl_lval_idx(ivl_lval_t net)
{
assert(net);
if (net->type_ == IVL_LVAL_MEM)
return net->idx;
if (net->type_ == IVL_LVAL_ARR)
return net->idx;
return 0x0;
}
extern "C" ivl_memory_t ivl_lval_mem(ivl_lval_t net)
{
assert(net);
if (net->type_ == IVL_LVAL_MEM)
return net->n.mem;
return 0x0;
}
extern "C" ivl_expr_t ivl_lval_part_off(ivl_lval_t net)
{
assert(net);
@ -1907,9 +1865,6 @@ extern "C" unsigned ivl_stmt_lwidth(ivl_statement_t net)
case IVL_LVAL_ARR:
sum += ivl_lval_width(cur);
break;
case IVL_LVAL_MEM:
sum += ivl_memory_width(ivl_lval_mem(cur));
break;
default:
assert(0);
}
@ -1992,6 +1947,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.139 2007/01/17 04:39:18 steve
* Remove dead code related to memories.
*
* Revision 1.138 2007/01/16 05:44:15 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory

20
t-dll.h
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.h,v 1.135 2007/01/16 05:44:16 steve Exp $"
#ident "$Id: t-dll.h,v 1.136 2007/01/17 04:39:18 steve Exp $"
#endif
# include "target.h"
@ -376,7 +376,7 @@ struct ivl_lpm_s {
enum ivl_lval_type_t {
IVL_LVAL_REG = 0,
IVL_LVAL_MUX = 1,
IVL_LVAL_MEM = 2, /* Deprecated in favor of LVAL_ARR? */
/* IVL_LVAL_MEM = 2, / Deprecated in favor of LVAL_ARR? */
IVL_LVAL_NET = 3, /* Only force can have NET l-values */
IVL_LVAL_ARR = 4
};
@ -481,19 +481,6 @@ struct ivl_nexus_s {
void*private_data;
};
/*
* Memory.
*/
struct ivl_memory_s {
perm_string basename_;
ivl_scope_t scope_;
unsigned width_;
unsigned signed_ : 1;
unsigned size_;
int root_;
};
/*
* This is the implementation of a parameter. Each scope has a list of
* these.
@ -682,6 +669,9 @@ struct ivl_statement_s {
/*
* $Log: t-dll.h,v $
* Revision 1.136 2007/01/17 04:39:18 steve
* Remove dead code related to memories.
*
* Revision 1.135 2007/01/16 05:44:16 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: draw_vpi.c,v 1.14 2007/01/16 05:44:16 steve Exp $"
#ident "$Id: draw_vpi.c,v 1.15 2007/01/17 04:39:18 steve Exp $"
#endif
# include "vvp_priv.h"
@ -219,13 +219,6 @@ static void draw_vpi_taskfunc_args(const char*call_string,
}
break;
case IVL_EX_MEMORY:
if (!ivl_expr_oper1(expr)) {
fprintf(vvp_out, ", M_%p", ivl_expr_memory(expr)) ;
continue;
}
break;
default:
break;
}
@ -300,6 +293,9 @@ int draw_vpi_rfunc_call(ivl_expr_t fnet)
/*
* $Log: draw_vpi.c,v $
* Revision 1.15 2007/01/17 04:39:18 steve
* Remove dead code related to memories.
*
* Revision 1.14 2007/01/16 05:44:16 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: eval_expr.c,v 1.131 2007/01/16 05:44:16 steve Exp $"
#ident "$Id: eval_expr.c,v 1.132 2007/01/17 04:39:18 steve Exp $"
#endif
# include "vvp_priv.h"
@ -1599,86 +1599,6 @@ static struct vector_info draw_signal_expr(ivl_expr_t exp, unsigned wid,
return res;
}
/*
* Draw code to evaluate a memory word index expression and write the
* value into index register 3. This expression converts the run-time
* calculated value to canonical form that the %load/mv takes.
*/
void draw_memory_index_expr(ivl_memory_t mem, ivl_expr_t ae)
{
int root = ivl_memory_root(mem);
switch (ivl_expr_type(ae)) {
case IVL_EX_NUMBER: {
unsigned nbits = ivl_expr_width(ae);
const char*bits = ivl_expr_bits(ae);
unsigned long v = 0;
int unknown_flag = 0;
unsigned idx;
for (idx = 0 ; idx < nbits ; idx += 1)
switch (bits[idx]) {
case '0':
break;
case '1':
assert(idx < (8*sizeof v));
v |= 1 << idx;
break;
default:
v = ~0UL;
unknown_flag = 1;
break;
}
fprintf(vvp_out, " %%ix/load 3, %lu;\n", v-root);
fprintf(vvp_out, " %%mov 4, %c, 1;\n",
unknown_flag?'1':'0');
break;
}
case IVL_EX_ULONG: {
unsigned v = ivl_expr_uvalue(ae);
fprintf(vvp_out, " %%ix/load 3, %u;\n", v-root);
fprintf(vvp_out, " %%mov 4, 0, 1;\n");
break;
}
default: {
struct vector_info addr = draw_eval_expr(ae, 0);
fprintf(vvp_out, " %%ix/get 3, %u, %u;\n",
addr.base, addr.wid);
clr_vector(addr);
if (root>0)
fprintf(vvp_out, " %%ix/sub 3, %u;\n", root);
break;
}
}
}
static struct vector_info draw_memory_expr(ivl_expr_t exp, unsigned wid)
{
unsigned swid = ivl_expr_width(exp);
ivl_memory_t mem = ivl_expr_memory(exp);
struct vector_info res;
draw_memory_index_expr(mem, ivl_expr_oper1(exp));
if (swid > wid)
swid = wid;
res.base = allocate_vector(wid);
res.wid = wid;
fprintf(vvp_out, " %%load/mv %u, M_%p, %u;\n",
res.base, mem, swid);
/* Pad the signal value with zeros. */
if (swid < wid)
fprintf(vvp_out, " %%mov %u, 0, %u;\n",
res.base+swid, wid-swid);
if (res.base >= 8)
save_expression_lookaside(res.base, exp, wid);
return res;
}
static struct vector_info draw_select_signal(ivl_expr_t sube,
ivl_expr_t bit_idx,
unsigned bit_wid,
@ -2218,10 +2138,6 @@ struct vector_info draw_eval_expr_wid(ivl_expr_t exp, unsigned wid,
res = draw_ternary_expr(exp, wid);
break;
case IVL_EX_MEMORY:
res = draw_memory_expr(exp, wid);
break;
case IVL_EX_SFUNC:
res = draw_sfunc_expr(exp, wid);
break;
@ -2245,6 +2161,9 @@ struct vector_info draw_eval_expr(ivl_expr_t exp, int stuff_ok_flag)
/*
* $Log: eval_expr.c,v $
* Revision 1.132 2007/01/17 04:39:18 steve
* Remove dead code related to memories.
*
* Revision 1.131 2007/01/16 05:44:16 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vvp_priv.h,v 1.41 2007/01/16 05:44:16 steve Exp $"
#ident "$Id: vvp_priv.h,v 1.42 2007/01/17 04:39:18 steve Exp $"
#endif
# include "vvp_config.h"
@ -142,14 +142,6 @@ extern struct vector_info draw_eval_expr_wid(ivl_expr_t exp, unsigned w,
#define STUFF_OK_47 0x0002
#define STUFF_OK_RO 0x0004
/*
* This function draws code to evaluate the index expression exp for
* the memory mem. The result is loaded into index register i3, and
* the flag bit 4 is set to 0 if the numerical value is defined, or 1
* if not.
*/
extern void draw_memory_index_expr(ivl_memory_t mem, ivl_expr_t exp);
/*
* This evaluates an expression and leaves the result in the numbered
* integer index register. It also will set bit-4 to 1 if the value is
@ -252,6 +244,9 @@ extern unsigned thread_count;
/*
* $Log: vvp_priv.h,v $
* Revision 1.42 2007/01/17 04:39:18 steve
* Remove dead code related to memories.
*
* Revision 1.41 2007/01/16 05:44:16 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory

View File

@ -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.127 2007/01/16 05:44:16 steve Exp $"
#ident "$Id: vvp_process.c,v 1.128 2007/01/17 04:39:18 steve Exp $"
#endif
# include "vvp_priv.h"
@ -156,34 +156,6 @@ static void set_to_lvariable(ivl_lval_t lval,
}
}
/*
* This function writes the code to set a vector to a memory word. The
* idx is the thread register that contains the address of the word in
* the memory, and bit is the base of the thread vector. The wid is
* the width of the vector to be written to the word.
*/
static void set_to_memory_word(ivl_lval_t lval, unsigned idx,
unsigned bit, unsigned wid)
{
unsigned skip_set = transient_id++;
ivl_memory_t mem = ivl_lval_mem(lval);
/* Calculate the word part select into index-1 */
if (ivl_lval_part_off(lval)) {
draw_eval_expr_into_integer(ivl_lval_part_off(lval), 1);
fprintf(vvp_out, " %%jmp/1 t_%u, 4;\n", skip_set);
} else {
fprintf(vvp_out, " %%ix/load 1, 0;\n");
}
/* Calculate the memory address into index-3 */
draw_memory_index_expr(mem, ivl_lval_idx(lval));
fprintf(vvp_out, " %%jmp/1 t_%u, 4;\n", skip_set);
fprintf(vvp_out, " %%set/mv M_%p, %u, %u;\n", mem, bit, wid);
fprintf(vvp_out, "t_%u ;\n", skip_set);
}
static void assign_to_array_word(ivl_signal_t lsig, ivl_expr_t word_ix,
unsigned bit, unsigned delay, unsigned width)
{
@ -283,32 +255,6 @@ static void assign_to_lvector(ivl_lval_t lval, unsigned bit,
}
}
static void assign_to_memory_word(ivl_lval_t lval, unsigned bit,
unsigned delay, unsigned wid)
{
unsigned skip_set = transient_id++;
ivl_memory_t mem = ivl_lval_mem(lval);
//assert(wid == ivl_memory_width(mem));
/* Calculate the word part select into index-1 */
if (ivl_lval_part_off(lval)) {
draw_eval_expr_into_integer(ivl_lval_part_off(lval), 1);
fprintf(vvp_out, " %%jmp/1 t_%u, 4;\n", skip_set);
} else {
fprintf(vvp_out, " %%ix/load 1, 0;\n");
}
/* Calculate the memory address into index-3 */
draw_memory_index_expr(mem, ivl_lval_idx(lval));
fprintf(vvp_out, " %%jmp/1 t_%u, 4;\n", skip_set);
/* Load the word/part-select width into index-0 */
fprintf(vvp_out, " %%ix/load 0, %u;\n", wid);
fprintf(vvp_out, " %%assign/mv M_%p, %u, %u;\n", mem, delay, bit);
fprintf(vvp_out, "t_%u ;\n", skip_set);
clear_expression_lookaside();
}
/*
* This is a private function to generate %set code for the
@ -319,7 +265,6 @@ static void assign_to_memory_word(ivl_lval_t lval, unsigned bit,
static void set_vec_to_lval(ivl_statement_t net, struct vector_info res)
{
ivl_lval_t lval;
ivl_memory_t mem;
unsigned wid = res.wid;
unsigned lidx;
@ -331,8 +276,6 @@ static void set_vec_to_lval(ivl_statement_t net, struct vector_info res)
lval = ivl_stmt_lval(net, lidx);
mem = ivl_lval_mem(lval);
/* Reduce bit_limit to the width of this l-value. */
if (bit_limit > ivl_lval_width(lval))
bit_limit = ivl_lval_width(lval);
@ -341,12 +284,7 @@ static void set_vec_to_lval(ivl_statement_t net, struct vector_info res)
bit that this l-value takes. */
bidx = res.base < 4? res.base : (res.base+cur_rbit);
if (mem) {
set_to_memory_word(lval, 3, bidx, bit_limit);
} else {
set_to_lvariable(lval, bidx, bit_limit);
}
set_to_lvariable(lval, bidx, bit_limit);
/* Now we've consumed this many r-value bits for the
current l-value. */
@ -506,7 +444,6 @@ static int show_stmt_assign_nb(ivl_statement_t net)
ivl_lval_t lval;
ivl_expr_t rval = ivl_stmt_rval(net);
ivl_expr_t del = ivl_stmt_delay_expr(net);
ivl_memory_t mem;
ivl_signal_t sig;
unsigned long delay = 0;
@ -537,27 +474,13 @@ static int show_stmt_assign_nb(ivl_statement_t net)
unsigned bit_limit = wid - cur_rbit;
lval = ivl_stmt_lval(net, lidx);
mem = ivl_lval_mem(lval);
if (bit_limit > ivl_lval_width(lval))
bit_limit = ivl_lval_width(lval);
if (mem == 0) {
unsigned bidx;
unsigned bidx;
bidx = res.base < 4? res.base : (res.base+cur_rbit);
assign_to_lvector(lval, bidx, delay, del, bit_limit);
} else {
unsigned bidx;
/* XXXX don't yet know what to do with a
non-constant delay exprssion. */
assert(del == 0);
bidx = res.base < 4? res.base : (res.base+cur_rbit);
assign_to_memory_word(lval, bidx, delay, bit_limit);
}
bidx = res.base < 4? res.base : (res.base+cur_rbit);
assign_to_lvector(lval, bidx, delay, del, bit_limit);
cur_rbit += bit_limit;
@ -1612,6 +1535,9 @@ int draw_func_definition(ivl_scope_t scope)
/*
* $Log: vvp_process.c,v $
* Revision 1.128 2007/01/17 04:39:18 steve
* Remove dead code related to memories.
*
* Revision 1.127 2007/01/16 05:44:16 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vvp_scope.c,v 1.151 2007/01/16 05:44:16 steve Exp $"
#ident "$Id: vvp_scope.c,v 1.152 2007/01/17 04:39:18 steve Exp $"
#endif
# include "vvp_priv.h"
@ -2249,19 +2249,6 @@ static void draw_lpm_in_scope(ivl_lpm_t net)
}
}
static void draw_mem_in_scope(ivl_memory_t net)
{
int root = ivl_memory_root(net);
int last = root + ivl_memory_size(net) - 1;
int msb = ivl_memory_width(net) - 1;
int lsb = 0;
fprintf(vvp_out, "M_%p .mem \"%s\", %u,%u, %u,%u;\n", net,
vvp_mangle_name(ivl_memory_basename(net)),
msb, lsb, root, last);
}
int draw_scope(ivl_scope_t net, ivl_scope_t parent)
{
unsigned idx;
@ -2348,11 +2335,6 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
draw_event_in_scope(event);
}
for (idx = 0 ; idx < ivl_scope_mems(net) ; idx += 1) {
ivl_memory_t mem = ivl_scope_mem(net, idx);
draw_mem_in_scope(mem);
}
for (idx = 0 ; idx < ivl_scope_lpms(net) ; idx += 1) {
ivl_lpm_t lpm = ivl_scope_lpm(net, idx);
draw_lpm_in_scope(lpm);
@ -2370,6 +2352,9 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
/*
* $Log: vvp_scope.c,v $
* Revision 1.152 2007/01/17 04:39:18 steve
* Remove dead code related to memories.
*
* Revision 1.151 2007/01/16 05:44:16 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory