Access to the name of a system task call.

This commit is contained in:
steve 2000-09-22 03:58:30 +00:00
parent 9067c91656
commit 48ff3590bc
7 changed files with 65 additions and 12 deletions

View File

@ -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.
*

View File

@ -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 <cassert>
@ -1602,8 +1602,10 @@ const NetNet* NetFuncDef::port(unsigned idx) const
}
NetSTask::NetSTask(const string&na, const svector<NetExpr*>&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.
*

View File

@ -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<NetExpr*>&);
~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_;
svector<NetExpr*>parms_;
};
@ -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)
*

View File

@ -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.
*

View File

@ -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.
*

View File

@ -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.
*

View File

@ -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.
*