From 48ff3590bc2c5975dd9b2b4d27089e852dbabd63 Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 22 Sep 2000 03:58:30 +0000 Subject: [PATCH] Access to the name of a system task call. --- ivl_target.h | 7 ++++++- netlist.cc | 20 ++++++++++++++++++-- netlist.h | 11 +++++++---- t-dll-api.cc | 17 ++++++++++++++++- t-dll-proc.cc | 6 +++++- t-dll.h | 9 ++++++++- tgt-stub/stub.c | 7 +++++-- 7 files changed, 65 insertions(+), 12 deletions(-) diff --git a/ivl_target.h b/ivl_target.h index 22a8f4228..9d0b6fa53 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.8 2000/09/19 04:15:27 steve Exp $" +#ident "$Id: ivl_target.h,v 1.9 2000/09/22 03:58:30 steve Exp $" #endif #ifdef __cplusplus @@ -192,6 +192,8 @@ extern ivl_statement_t ivl_stmt_cond_false(ivl_statement_t net); extern ivl_statement_t ivl_stmt_cond_true(ivl_statement_t net); /* IVL_ST_DELAY */ extern unsigned long ivl_stmt_delay_val(ivl_statement_t net); + /* IVL_ST_STASK */ +extern const char* ivl_stmt_name(ivl_statement_t net); /* IVL_ST_DELAY, IVL_ST_WAIT, IVL_ST_WHILE */ extern ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net); @@ -301,6 +303,9 @@ _END_DECL /* * $Log: ivl_target.h,v $ + * Revision 1.9 2000/09/22 03:58:30 steve + * Access to the name of a system task call. + * * Revision 1.8 2000/09/19 04:15:27 steve * Introduce the means to get statement types. * diff --git a/netlist.cc b/netlist.cc index e0be0f495..e6c808b2b 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.135 2000/09/02 20:54:20 steve Exp $" +#ident "$Id: netlist.cc,v 1.136 2000/09/22 03:58:30 steve Exp $" #endif # include @@ -1602,8 +1602,10 @@ const NetNet* NetFuncDef::port(unsigned idx) const } NetSTask::NetSTask(const string&na, const svector&pa) -: name_(na), parms_(pa) +: name_(0), parms_(pa) { + name_ = new char[na.length() + 1]; + strcpy(name_, na.c_str()); assert(name_[0] == '$'); } @@ -1612,6 +1614,17 @@ NetSTask::~NetSTask() for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1) delete parms_[idx]; + delete[]name_; +} + +const char*NetSTask::name() const +{ + return name_; +} + +unsigned NetSTask::nparms() const +{ + return parms_.count(); } const NetExpr* NetSTask::parm(unsigned idx) const @@ -2362,6 +2375,9 @@ bool NetUDP::sequ_glob_(string input, char output) /* * $Log: netlist.cc,v $ + * Revision 1.136 2000/09/22 03:58:30 steve + * Access to the name of a system task call. + * * Revision 1.135 2000/09/02 20:54:20 steve * Rearrange NetAssign to make NetAssign_ separate. * diff --git a/netlist.h b/netlist.h index f3034ac1d..7eb0ace68 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.163 2000/09/17 21:26:15 steve Exp $" +#ident "$Id: netlist.h,v 1.164 2000/09/22 03:58:30 steve Exp $" #endif /* @@ -1830,9 +1830,9 @@ class NetSTask : public NetProc { NetSTask(const string&na, const svector&); ~NetSTask(); - const string& name() const { return name_; } + const char* name() const; - unsigned nparms() const { return parms_.count(); } + unsigned nparms() const; const NetExpr* parm(unsigned idx) const; @@ -1840,7 +1840,7 @@ class NetSTask : public NetProc { virtual void dump(ostream&, unsigned ind) const; private: - string name_; + char* name_; svectorparms_; }; @@ -2800,6 +2800,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.164 2000/09/22 03:58:30 steve + * Access to the name of a system task call. + * * Revision 1.163 2000/09/17 21:26:15 steve * Add support for modulus (Eric Aardoom) * diff --git a/t-dll-api.cc b/t-dll-api.cc index 0ae3567da..375178785 100644 --- a/t-dll-api.cc +++ b/t-dll-api.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-api.cc,v 1.2 2000/09/19 04:15:27 steve Exp $" +#ident "$Id: t-dll-api.cc,v 1.3 2000/09/22 03:58:30 steve Exp $" #endif # include "t-dll.h" @@ -121,6 +121,18 @@ extern "C" unsigned long ivl_stmt_delay_val(ivl_statement_t net) return net->u_.delay_.delay_; } +extern "C" const char* ivl_stmt_name(ivl_statement_t net) +{ + switch (net->type_) { + case IVL_ST_STASK: + return net->u_.stask_.name_; + default: + assert(0); + } + + return 0; +} + extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net) { switch (net->type_) { @@ -139,6 +151,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net) /* * $Log: t-dll-api.cc,v $ + * Revision 1.3 2000/09/22 03:58:30 steve + * Access to the name of a system task call. + * * Revision 1.2 2000/09/19 04:15:27 steve * Introduce the means to get statement types. * diff --git a/t-dll-proc.cc b/t-dll-proc.cc index 6240561f3..88c80ba28 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.2 2000/09/19 04:15:27 steve Exp $" +#ident "$Id: t-dll-proc.cc,v 1.3 2000/09/22 03:58:30 steve Exp $" #endif # include "target.h" @@ -200,6 +200,7 @@ void dll_target::proc_stask(const NetSTask*net) assert(stmt_cur_->type_ == IVL_ST_NONE); stmt_cur_->type_ = IVL_ST_STASK; + stmt_cur_->u_.stask_.name_ = strdup(net->name()); } bool dll_target::proc_wait(const NetEvWait*net) @@ -242,6 +243,9 @@ void dll_target::proc_while(const NetWhile*net) /* * $Log: t-dll-proc.cc,v $ + * Revision 1.3 2000/09/22 03:58:30 steve + * Access to the name of a system task call. + * * Revision 1.2 2000/09/19 04:15:27 steve * Introduce the means to get statement types. * diff --git a/t-dll.h b/t-dll.h index ca75c1056..d9379adbc 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.2 2000/09/19 04:15:27 steve Exp $" +#ident "$Id: t-dll.h,v 1.3 2000/09/22 03:58:30 steve Exp $" #endif # include "target.h" @@ -123,6 +123,10 @@ struct ivl_statement_s { ivl_statement_t stmt_; } delayx_; + struct { /* IVL_ST_STASK */ + char* name_; + } stask_; + struct { /* IVL_ST_WAIT */ int cond_; /* XXXX */ ivl_statement_t stmt_; @@ -137,6 +141,9 @@ struct ivl_statement_s { /* * $Log: t-dll.h,v $ + * Revision 1.3 2000/09/22 03:58:30 steve + * Access to the name of a system task call. + * * Revision 1.2 2000/09/19 04:15:27 steve * Introduce the means to get statement types. * diff --git a/tgt-stub/stub.c b/tgt-stub/stub.c index da1a283a7..18ec65039 100644 --- a/tgt-stub/stub.c +++ b/tgt-stub/stub.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: stub.c,v 1.8 2000/09/19 04:15:27 steve Exp $" +#ident "$Id: stub.c,v 1.9 2000/09/22 03:58:30 steve Exp $" #endif /* @@ -162,7 +162,7 @@ static void show_statement(ivl_statement_t net, unsigned ind) break; case IVL_ST_STASK: - fprintf(out, "%*s$?(...);\n", ind, ""); + fprintf(out, "%*s%s(...);\n", ind, "", ivl_stmt_name(net)); break; case IVL_ST_WAIT: @@ -198,6 +198,9 @@ int target_process(ivl_process_t net) /* * $Log: stub.c,v $ + * Revision 1.9 2000/09/22 03:58:30 steve + * Access to the name of a system task call. + * * Revision 1.8 2000/09/19 04:15:27 steve * Introduce the means to get statement types. *