From 89314d47722da52f70731899e5d9fc0a31f9b6a9 Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 4 Aug 2002 18:28:14 +0000 Subject: [PATCH] Do not use hierarchical names of memories to generate vvp labels. -tdll target does not used hierarchical name string to look up the memory objects in the design. --- design_dump.cc | 10 ++++++++-- ivl_target.h | 28 +++++++++++++++++++++++--- net_assign.cc | 10 ++++++++-- netlist.cc | 19 +++++++++++++++--- netlist.h | 14 +++++++++---- syn-rules.y | 4 ++-- t-dll-expr.cc | 10 ++++++++-- t-dll-proc.cc | 12 ++++++++--- t-dll.cc | 46 ++++++++++++++++--------------------------- t-dll.h | 10 ++++++++-- tgt-vvp/eval_expr.c | 15 ++++++++++---- tgt-vvp/vvp_priv.h | 13 +++++++++++- tgt-vvp/vvp_process.c | 14 +++++++++---- tgt-vvp/vvp_scope.c | 22 ++++++++++++++++++--- 14 files changed, 163 insertions(+), 64 deletions(-) diff --git a/design_dump.cc b/design_dump.cc index 97a3ae4d0..16f5b1220 100644 --- a/design_dump.cc +++ b/design_dump.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: design_dump.cc,v 1.129 2002/06/19 04:20:03 steve Exp $" +#ident "$Id: design_dump.cc,v 1.130 2002/08/04 18:28:14 steve Exp $" #endif # include "config.h" @@ -442,7 +442,7 @@ void NetAssign_::dump_lval(ostream&o) const // Is there an obvious way to flag memories in the dump // as different from the _real_ bit mux case? // o << "**memory**"; - o << mem_->name().c_str() << "["; + o << mem_->name() << "["; if (bmux_) o << *bmux_; else o << "**oops**"; o << "]"; @@ -984,6 +984,12 @@ void Design::dump(ostream&o) const /* * $Log: design_dump.cc,v $ + * Revision 1.130 2002/08/04 18:28:14 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.129 2002/06/19 04:20:03 steve * Remove NetTmp and add NetSubnet class. * diff --git a/ivl_target.h b/ivl_target.h index bc8cbc4ac..5cdf59d26 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: ivl_target.h,v 1.101 2002/07/05 21:26:17 steve Exp $" +#ident "$Id: ivl_target.h,v 1.102 2002/08/04 18:28:14 steve Exp $" #endif #ifdef __cplusplus @@ -461,6 +461,14 @@ extern unsigned ivl_expr_width(ivl_expr_t net); /* * Memory. * + * 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_size + * ivl_memory_width */ extern const char*ivl_memory_name(ivl_memory_t net); @@ -898,13 +906,21 @@ extern const char* ivl_scope_tname(ivl_scope_t net); * ivl_signal_type * Return the type of the signal, i.e., reg, wire, tri0, etc. * - * ivl_signal_name + * ivl_signal_name (DEPRECATED) * This function returns the fully scoped hierarchical name for the * signal. The name refers to the entire vector that is the signal. * + * NOTE: This function is deprecated. The heirarchical name is too + * vague a construct when escaped names can have . characters in + * them. Do no use this function in new code, it will disappear. + * * ivl_signal_basename * This function returns the name of the signal, without the scope - * information. This is the tail of the signal name. + * information. This is the tail of the signal name. Since Verilog + * has an escape syntax, this name can contain any ASCII + * characters, except NULL or white space. The leading \ and + * trailing ' ' of escaped names in Verilog source are not part of + * the name, so not included here. * * ivl_signal_attr * Icarus Verilog supports attaching attributes to signals, with @@ -1056,6 +1072,12 @@ _END_DECL /* * $Log: ivl_target.h,v $ + * Revision 1.102 2002/08/04 18:28:14 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.101 2002/07/05 21:26:17 steve * Avoid emitting to vvp local net symbols. * diff --git a/net_assign.cc b/net_assign.cc index 796fd5e38..8a525644c 100644 --- a/net_assign.cc +++ b/net_assign.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: net_assign.cc,v 1.13 2002/07/02 03:02:57 steve Exp $" +#ident "$Id: net_assign.cc,v 1.14 2002/08/04 18:28:15 steve Exp $" #endif # include "config.h" @@ -95,7 +95,7 @@ const char*NetAssign_::name() const if (sig_) { return sig_->name(); } else if (mem_) { - return mem_->name().c_str(); + return mem_->name(); } else { return ""; } @@ -241,6 +241,12 @@ NetAssignNB::~NetAssignNB() /* * $Log: net_assign.cc,v $ + * Revision 1.14 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.13 2002/07/02 03:02:57 steve * Change the signal to a net when assignments go away. * diff --git a/netlist.cc b/netlist.cc index 29168c7b5..7dcffb781 100644 --- a/netlist.cc +++ b/netlist.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: netlist.cc,v 1.195 2002/07/28 23:58:44 steve Exp $" +#ident "$Id: netlist.cc,v 1.196 2002/08/04 18:28:15 steve Exp $" #endif # include "config.h" @@ -1964,7 +1964,7 @@ NetEMemory::~NetEMemory() { } -const string& NetEMemory::name() const +const string NetEMemory::name() const { return mem_->name(); } @@ -1975,8 +1975,9 @@ const NetExpr* NetEMemory::index() const } NetMemory::NetMemory(NetScope*sc, const string&n, long w, long s, long e) -: name_(n), width_(w), idxh_(s), idxl_(e), ram_list_(0), scope_(sc) +: width_(w), idxh_(s), idxl_(e), ram_list_(0), scope_(sc) { + name_ = strdup(n.c_str()); scope_->add_memory(this); } @@ -1984,6 +1985,7 @@ NetMemory::~NetMemory() { assert(scope_); scope_->rem_memory(this); + free(name_); } unsigned NetMemory::count() const @@ -1994,6 +1996,11 @@ unsigned NetMemory::count() const return idxh_ - idxl_ + 1; } +const char* NetMemory::name() const +{ + return name_; +} + unsigned NetMemory::index_to_address(long idx) const { if (idxh_ < idxl_) @@ -2304,6 +2311,12 @@ const NetProc*NetTaskDef::proc() const /* * $Log: netlist.cc,v $ + * Revision 1.196 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.195 2002/07/28 23:58:44 steve * Fix NetBlock destructor to delete substatements. * diff --git a/netlist.h b/netlist.h index 24c438b52..5d9b4518e 100644 --- a/netlist.h +++ b/netlist.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: netlist.h,v 1.254 2002/07/29 00:00:28 steve Exp $" +#ident "$Id: netlist.h,v 1.255 2002/08/04 18:28:15 steve Exp $" #endif /* @@ -672,7 +672,7 @@ class NetMemory { NetMemory(NetScope*sc, const string&n, long w, long s, long e); ~NetMemory(); - const string&name() const { return name_; } + const char*name() const; // This is the width (in bits) of a single memory position. unsigned width() const { return width_; } @@ -691,7 +691,7 @@ class NetMemory { void dump(ostream&o, unsigned lm) const; private: - string name_; + char* name_; unsigned width_; long idxh_; long idxl_; @@ -2602,7 +2602,7 @@ class NetEMemory : public NetExpr { NetEMemory(NetMemory*mem, NetExpr*idx =0); virtual ~NetEMemory(); - const string& name () const; + const string name () const; const NetExpr* index() const; virtual bool set_width(unsigned); @@ -3006,6 +3006,12 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.255 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.254 2002/07/29 00:00:28 steve * Asynchronous synthesis of sequential blocks. * diff --git a/syn-rules.y b/syn-rules.y index 43ef430e2..ee0bbac0f 100644 --- a/syn-rules.y +++ b/syn-rules.y @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: syn-rules.y,v 1.22 2002/06/25 01:33:22 steve Exp $" +#ident "$Id: syn-rules.y,v 1.23 2002/08/04 18:28:15 steve Exp $" #endif # include "config.h" @@ -203,7 +203,7 @@ static void make_DFF_CE(Design*des, NetProcTop*top, NetEvWait*wclk, } else if (a->mem()) { NetMemory *m=a->mem(); NetNet *adr = a->bmux()->synthesize(des); - NetRamDq*ram = new NetRamDq(top->scope(), m->name().c_str(), + NetRamDq*ram = new NetRamDq(top->scope(), m->name(), m, adr->pin_count()); hookup_RAMDQ(ram, d, adr, pclk, ce, a, rval_pinoffset); des->add_node(ram); diff --git a/t-dll-expr.cc b/t-dll-expr.cc index 3677ac237..ef4a34962 100644 --- a/t-dll-expr.cc +++ b/t-dll-expr.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) & !defined(macintosh) -#ident "$Id: t-dll-expr.cc,v 1.26 2002/06/16 20:39:12 steve Exp $" +#ident "$Id: t-dll-expr.cc,v 1.27 2002/08/04 18:28:15 steve Exp $" #endif # include "config.h" @@ -164,7 +164,7 @@ void dll_target::expr_memory(const NetEMemory*net) cur->type_ = IVL_EX_MEMORY; cur->width_= net->expr_width(); cur->signed_ = net->has_sign()? 1 : 0; - cur->u_.memory_.mem_ = lookup_memory_(net->memory()); + cur->u_.memory_.mem_ = find_memory(des_, net->memory()); cur->u_.memory_.idx_ = expr_; expr_ = cur; @@ -458,6 +458,12 @@ void dll_target::expr_unary(const NetEUnary*net) /* * $Log: t-dll-expr.cc,v $ + * Revision 1.27 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.26 2002/06/16 20:39:12 steve * Normalize run-time index expressions for bit selects * diff --git a/t-dll-proc.cc b/t-dll-proc.cc index 67e69b6b2..9e5f2c0e2 100644 --- a/t-dll-proc.cc +++ b/t-dll-proc.cc @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll-proc.cc,v 1.49 2002/06/16 20:39:12 steve Exp $" +#ident "$Id: t-dll-proc.cc,v 1.50 2002/08/04 18:28:15 steve Exp $" #endif # include "config.h" @@ -166,7 +166,7 @@ void dll_target::proc_assign(const NetAssign*net) } else { assert(asn->mem()); cur->type_ = IVL_LVAL_MEM; - cur->n.mem = lookup_memory_(asn->mem()); + cur->n.mem = find_memory(des_, asn->mem()); assert(cur->n.mem); cur->width_ = ivl_memory_width(cur->n.mem); @@ -232,7 +232,7 @@ void dll_target::proc_assign_nb(const NetAssignNB*net) } else { assert(asn->mem()); cur->type_ = IVL_LVAL_MEM; - cur->n.mem = lookup_memory_(asn->mem()); + cur->n.mem = find_memory(des_, asn->mem()); assert(cur->n.mem); cur->width_ = ivl_memory_width(cur->n.mem); @@ -786,6 +786,12 @@ void dll_target::proc_while(const NetWhile*net) /* * $Log: t-dll-proc.cc,v $ + * Revision 1.50 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.49 2002/06/16 20:39:12 steve * Normalize run-time index expressions for bit selects * diff --git a/t-dll.cc b/t-dll.cc index 8cbf2ff08..4d1165a88 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll.cc,v 1.91 2002/07/24 16:21:52 steve Exp $" +#ident "$Id: t-dll.cc,v 1.92 2002/08/04 18:28:15 steve Exp $" #endif # include "config.h" @@ -232,40 +232,22 @@ ivl_signal_t dll_target::find_signal(ivl_design_s &des, const NetNet*net) * NetMemory object. The search works by looking for the parent scope, * then scanning the parent scope for the NetMemory object. */ -static ivl_memory_t find_memory(ivl_scope_t root, const NetMemory*cur) +ivl_memory_t dll_target::find_memory(ivl_design_s &des, const NetMemory*net) { - ivl_scope_t tmp; - ivl_memory_t mem ; + ivl_scope_t scope = find_scope(des, net->scope()); + assert(scope); - if (!root) - return 0; + const char*nname = net->name(); - for (unsigned i = 0; i < ivl_scope_mems(root); i++) { - mem = ivl_scope_mem(root, i); - if (!strcmp(ivl_memory_name(mem), cur->name().c_str())) - return mem; + for (unsigned idx = 0 ; idx < scope->nmem_ ; idx += 1) { + if (strcmp(scope->mem_[idx]->name_, nname) == 0) + return scope->mem_[idx]; } - mem = find_memory(root->child_, cur); - if (mem) - return mem; - - mem = find_memory(root->sibling_, cur); - if (mem) - return mem; - + assert(0); return 0; } -ivl_memory_t dll_target::lookup_memory_(const NetMemory*cur) -{ - unsigned i; - ivl_memory_t mem = NULL; - for (i = 0; i < des_.nroots_ && mem == NULL; i++) - mem = find_memory(des_.roots_[i], cur); - return mem; -} - static ivl_nexus_t nexus_sig_make(ivl_signal_t net, unsigned pin) { ivl_nexus_t tmp = new struct ivl_nexus_s; @@ -942,7 +924,7 @@ void dll_target::udp(const NetUDP*net) void dll_target::memory(const NetMemory*net) { ivl_memory_t obj = new struct ivl_memory_s; - obj->name_ = strdup(net->name().c_str()); + obj->name_ = strdup(net->name()); obj->scope_ = find_scope(des_, net->scope()); obj->width_ = net->width(); obj->signed_ = 0; @@ -1408,7 +1390,7 @@ void dll_target::lpm_ram_dq(const NetRamDq*net) ivl_lpm_t obj = new struct ivl_lpm_s; obj->type = IVL_LPM_RAM; obj->name = strdup(net->name()); - obj->u_.ff.mem = lookup_memory_(net->mem()); + obj->u_.ff.mem = find_memory(des_, net->mem()); assert(obj->u_.ff.mem); obj->scope = find_scope(des_, net->mem()->scope()); assert(obj->scope); @@ -1959,6 +1941,12 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj }; /* * $Log: t-dll.cc,v $ + * Revision 1.92 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.91 2002/07/24 16:21:52 steve * Verbose messages. * diff --git a/t-dll.h b/t-dll.h index 3182042b7..776819804 100644 --- a/t-dll.h +++ b/t-dll.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: t-dll.h,v 1.87 2002/07/05 21:26:17 steve Exp $" +#ident "$Id: t-dll.h,v 1.88 2002/08/04 18:28:15 steve Exp $" #endif # include "target.h" @@ -139,13 +139,13 @@ struct dll_target : public target_t, public expr_scan_t { void expr_signal(const NetESignal*); ivl_scope_t lookup_scope_(const NetScope*scope); - ivl_memory_t lookup_memory_(const NetMemory*mem); static ivl_attribute_s* fill_in_attributes(const Attrib*net); private: static ivl_scope_t find_scope(ivl_design_s &des, const NetScope*cur); static ivl_signal_t find_signal(ivl_design_s &des, const NetNet*net); + static ivl_memory_t find_memory(ivl_design_s &des, const NetMemory*net); void add_root(ivl_design_s &des_, const NetScope *s); void sub_off_from_expr_(long); @@ -611,6 +611,12 @@ struct ivl_statement_s { /* * $Log: t-dll.h,v $ + * Revision 1.88 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.87 2002/07/05 21:26:17 steve * Avoid emitting to vvp local net symbols. * diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index bc7e87745..57d990361 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -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.66 2002/08/03 22:30:48 steve Exp $" +#ident "$Id: eval_expr.c,v 1.67 2002/08/04 18:28:15 steve Exp $" #endif # include "vvp_priv.h" @@ -1162,10 +1162,11 @@ static struct vector_info draw_memory_expr(ivl_expr_t exp, unsigned wid) { unsigned swid = ivl_expr_width(exp); const char*name = ivl_expr_name(exp); + ivl_memory_t mem = ivl_expr_memory(exp); struct vector_info res; unsigned idx; - draw_memory_index_expr(ivl_expr_memory(exp), ivl_expr_oper1(exp)); + draw_memory_index_expr(mem, ivl_expr_oper1(exp)); if (swid > wid) swid = wid; @@ -1177,7 +1178,7 @@ static struct vector_info draw_memory_expr(ivl_expr_t exp, unsigned wid) if (idx) fprintf(vvp_out, " %%ix/add 3, 1;\n"); fprintf(vvp_out, " %%load/m %u, M_%s;\n", - res.base+idx, vvp_mangle_id(name)); + res.base+idx, vvp_memory_label(mem)); } /* Pad the signal value with zeros. */ @@ -1384,7 +1385,7 @@ static struct vector_info draw_sfunc_expr(ivl_expr_t exp, unsigned wid) case IVL_EX_MEMORY: if (!ivl_expr_oper1(expr)) { fprintf(vvp_out, ", M_%s", - vvp_mangle_id(ivl_expr_name(expr))); + vvp_memory_label(ivl_expr_memory(expr))); continue; } break; @@ -1726,6 +1727,12 @@ struct vector_info draw_eval_expr(ivl_expr_t exp) /* * $Log: eval_expr.c,v $ + * Revision 1.67 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.66 2002/08/03 22:30:48 steve * Eliminate use of ivl_signal_name for signal labels. * diff --git a/tgt-vvp/vvp_priv.h b/tgt-vvp/vvp_priv.h index 7f3db6e05..555651870 100644 --- a/tgt-vvp/vvp_priv.h +++ b/tgt-vvp/vvp_priv.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: vvp_priv.h,v 1.16 2002/08/03 22:30:48 steve Exp $" +#ident "$Id: vvp_priv.h,v 1.17 2002/08/04 18:28:15 steve Exp $" #endif # include "ivl_target.h" @@ -43,6 +43,11 @@ extern const char *vvp_mangle_name(const char *); */ extern const char* vvp_signal_label(ivl_signal_t sig); +/* + * This generates a label string for a memory. + */ +extern const char* vvp_memory_label(ivl_memory_t mem); + /* * This function draws a process (initial or always) into the output * file. It normally returns 0, but returns !0 of there is some sort @@ -103,6 +108,12 @@ extern unsigned thread_count; /* * $Log: vvp_priv.h,v $ + * Revision 1.17 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.16 2002/08/03 22:30:48 steve * Eliminate use of ivl_signal_name for signal labels. * diff --git a/tgt-vvp/vvp_process.c b/tgt-vvp/vvp_process.c index 5a15c0058..b424986fe 100644 --- a/tgt-vvp/vvp_process.c +++ b/tgt-vvp/vvp_process.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: vvp_process.c,v 1.60 2002/08/03 22:30:48 steve Exp $" +#ident "$Id: vvp_process.c,v 1.61 2002/08/04 18:28:15 steve Exp $" #endif # include "vvp_priv.h" @@ -89,7 +89,7 @@ static void set_to_memory(ivl_memory_t mem, unsigned idx, unsigned bit) if (idx) fprintf(vvp_out, " %%ix/add 3, 1;\n"); fprintf(vvp_out, " %%set/m M_%s, %u;\n", - vvp_mangle_id(ivl_memory_name(mem)), bit); + vvp_memory_label(mem), bit); } /* @@ -122,7 +122,7 @@ static void assign_to_memory(ivl_memory_t mem, unsigned idx, if (idx) fprintf(vvp_out, " %%ix/add 3, 1;\n"); fprintf(vvp_out, " %%assign/m M_%s, %u, %u;\n", - vvp_mangle_id(ivl_memory_name(mem)), delay, bit); + vvp_memory_label(mem), delay, bit); } static void calculate_into_x0(ivl_expr_t expr) @@ -1001,7 +1001,7 @@ static int show_system_task_call(ivl_statement_t net) case IVL_EX_MEMORY: if (!ivl_expr_oper1(expr)) { fprintf(vvp_out, ", M_%s", - vvp_mangle_id(ivl_expr_name(expr))); + vvp_memory_label(ivl_expr_memory(expr))); continue; } break; @@ -1221,6 +1221,12 @@ int draw_func_definition(ivl_scope_t scope) /* * $Log: vvp_process.c,v $ + * Revision 1.61 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.60 2002/08/03 22:30:48 steve * Eliminate use of ivl_signal_name for signal labels. * diff --git a/tgt-vvp/vvp_scope.c b/tgt-vvp/vvp_scope.c index 9a3a0be56..7d6b62ee4 100644 --- a/tgt-vvp/vvp_scope.c +++ b/tgt-vvp/vvp_scope.c @@ -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.75 2002/08/03 22:30:48 steve Exp $" +#ident "$Id: vvp_scope.c,v 1.76 2002/08/04 18:28:15 steve Exp $" #endif # include "vvp_priv.h" @@ -139,6 +139,16 @@ const char* vvp_signal_label(ivl_signal_t sig) return buf; } +/* + * This makes a string suitable for use as a label for memories. + */ +const char* vvp_memory_label(ivl_memory_t mem) +{ + static char buf[32]; + sprintf(buf, "$%p", mem); + return buf; +} + ivl_signal_type_t signal_type_of_nexus(ivl_nexus_t nex) { unsigned idx; @@ -1045,7 +1055,7 @@ inline static void draw_lpm_ram(ivl_lpm_t net) vvp_mangle_id(ivl_lpm_name(net))); fprintf(vvp_out, " M_%s, %d,0, %d,\n ", - vvp_mangle_id(ivl_memory_name(mem)), + vvp_memory_label(mem), width-1, awidth); @@ -1395,7 +1405,7 @@ static void draw_mem_in_scope(ivl_memory_t net) int msb = ivl_memory_width(net) - 1; int lsb = 0; fprintf(vvp_out, "M_%s .mem \"%s\", %u,%u, %u,%u;\n", - vvp_mangle_id(ivl_memory_name(net)), + vvp_memory_label(net), vvp_mangle_name(ivl_memory_basename(net)), msb, lsb, root, last); } @@ -1478,6 +1488,12 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent) /* * $Log: vvp_scope.c,v $ + * Revision 1.76 2002/08/04 18:28:15 steve + * Do not use hierarchical names of memories to + * generate vvp labels. -tdll target does not + * used hierarchical name string to look up the + * memory objects in the design. + * * Revision 1.75 2002/08/03 22:30:48 steve * Eliminate use of ivl_signal_name for signal labels. *