Pass scope type information to the target module.
This commit is contained in:
parent
66716f5101
commit
a00924089d
2
ivl.def
2
ivl.def
|
|
@ -59,6 +59,8 @@ ivl_scope_lpm
|
||||||
ivl_scope_name
|
ivl_scope_name
|
||||||
ivl_scope_sigs
|
ivl_scope_sigs
|
||||||
ivl_scope_sig
|
ivl_scope_sig
|
||||||
|
ivl_scope_type
|
||||||
|
ivl_scope_tname
|
||||||
|
|
||||||
ivl_signal_attr
|
ivl_signal_attr
|
||||||
ivl_signal_pin
|
ivl_signal_pin
|
||||||
|
|
|
||||||
22
ivl_target.h
22
ivl_target.h
|
|
@ -19,7 +19,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: ivl_target.h,v 1.32 2001/01/15 00:05:39 steve Exp $"
|
#ident "$Id: ivl_target.h,v 1.33 2001/01/15 00:47:01 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
@ -190,6 +190,16 @@ typedef enum ivl_process_type_e {
|
||||||
IVL_PR_ALWAYS = 1
|
IVL_PR_ALWAYS = 1
|
||||||
} ivl_process_type_t;
|
} ivl_process_type_t;
|
||||||
|
|
||||||
|
/* These are the sorts of reasons a scope may come to be. These types
|
||||||
|
are properties of ivl_scope_t objects. */
|
||||||
|
typedef enum ivl_scope_type_e {
|
||||||
|
IVL_SCT_MODULE = 0,
|
||||||
|
IVL_SCT_FUNCTION= 1,
|
||||||
|
IVL_SCT_TASK = 2,
|
||||||
|
IVL_SCT_BEGIN = 3,
|
||||||
|
IVL_SCT_FORK = 4
|
||||||
|
} ivl_scope_type_t;
|
||||||
|
|
||||||
/* Signals (ivl_signal_t) that are ports into the scope that contains
|
/* Signals (ivl_signal_t) that are ports into the scope that contains
|
||||||
them have a port type. Otherwise, they are port IVL_SIP_NONE. */
|
them have a port type. Otherwise, they are port IVL_SIP_NONE. */
|
||||||
typedef enum ivl_signal_port_e {
|
typedef enum ivl_signal_port_e {
|
||||||
|
|
@ -506,6 +516,13 @@ extern ivl_signal_t ivl_nexus_ptr_sig(ivl_nexus_ptr_t net);
|
||||||
* Scopes have 0 or more signals in them. These signals are
|
* Scopes have 0 or more signals in them. These signals are
|
||||||
* anything that can become and ivl_signal_t, include synthetic
|
* anything that can become and ivl_signal_t, include synthetic
|
||||||
* signals generated by the compiler.
|
* signals generated by the compiler.
|
||||||
|
*
|
||||||
|
* ivl_scope_type
|
||||||
|
* ivl_scope_tname
|
||||||
|
* Scopes have a type and a type name. For example, if a scope is
|
||||||
|
* an instance of module foo, its type is IVL_SCT_MODULE and its
|
||||||
|
* type name is "foo". This is different from the instance name
|
||||||
|
* returned by ivl_scope_name above.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern int ivl_scope_children(ivl_scope_t net,
|
extern int ivl_scope_children(ivl_scope_t net,
|
||||||
|
|
@ -648,6 +665,9 @@ _END_DECL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: ivl_target.h,v $
|
* $Log: ivl_target.h,v $
|
||||||
|
* Revision 1.33 2001/01/15 00:47:01 steve
|
||||||
|
* Pass scope type information to the target module.
|
||||||
|
*
|
||||||
* Revision 1.32 2001/01/15 00:05:39 steve
|
* Revision 1.32 2001/01/15 00:05:39 steve
|
||||||
* Add client data pointer for scope and process scanners.
|
* Add client data pointer for scope and process scanners.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
15
pform.cc
15
pform.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: pform.cc,v 1.72 2001/01/14 23:04:56 steve Exp $"
|
#ident "$Id: pform.cc,v 1.73 2001/01/15 00:47:01 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "compiler.h"
|
# include "compiler.h"
|
||||||
|
|
@ -525,15 +525,7 @@ void pform_make_modgates(const string&type,
|
||||||
struct parmvalue_t*overrides,
|
struct parmvalue_t*overrides,
|
||||||
svector<lgate>*gates)
|
svector<lgate>*gates)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
if (overrides && overrides->by_order)
|
|
||||||
for (unsigned idx = 0 ; idx < overrides->by_order->count() ; idx += 1)
|
|
||||||
if (! pform_expression_is_constant((*overrides->by_order)[idx])) {
|
|
||||||
VLerror("error: Parameter override expression"
|
|
||||||
" must be constant.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
for (unsigned idx = 0 ; idx < gates->count() ; idx += 1) {
|
for (unsigned idx = 0 ; idx < gates->count() ; idx += 1) {
|
||||||
lgate cur = (*gates)[idx];
|
lgate cur = (*gates)[idx];
|
||||||
|
|
||||||
|
|
@ -1011,6 +1003,9 @@ int pform_parse(const char*path, map<string,Module*>&modules,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: pform.cc,v $
|
* $Log: pform.cc,v $
|
||||||
|
* Revision 1.73 2001/01/15 00:47:01 steve
|
||||||
|
* Pass scope type information to the target module.
|
||||||
|
*
|
||||||
* Revision 1.72 2001/01/14 23:04:56 steve
|
* Revision 1.72 2001/01/14 23:04:56 steve
|
||||||
* Generalize the evaluation of floating point delays, and
|
* Generalize the evaluation of floating point delays, and
|
||||||
* get it working with delay assignment statements.
|
* get it working with delay assignment statements.
|
||||||
|
|
|
||||||
17
t-dll-api.cc
17
t-dll-api.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: t-dll-api.cc,v 1.20 2001/01/15 00:05:39 steve Exp $"
|
#ident "$Id: t-dll-api.cc,v 1.21 2001/01/15 00:47:02 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "t-dll.h"
|
# include "t-dll.h"
|
||||||
|
|
@ -424,6 +424,18 @@ extern "C" ivl_signal_t ivl_scope_sig(ivl_scope_t net, unsigned idx)
|
||||||
return net->sigs_[idx];
|
return net->sigs_[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" ivl_scope_type_t ivl_scope_type(ivl_scope_t net)
|
||||||
|
{
|
||||||
|
assert(net);
|
||||||
|
return net->type_;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" const char* ivl_scope_tname(ivl_scope_t net)
|
||||||
|
{
|
||||||
|
assert(net);
|
||||||
|
return net->tname_;
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" const char* ivl_signal_attr(ivl_signal_t net, const char*key)
|
extern "C" const char* ivl_signal_attr(ivl_signal_t net, const char*key)
|
||||||
{
|
{
|
||||||
if (net->nattr_ == 0)
|
if (net->nattr_ == 0)
|
||||||
|
|
@ -634,6 +646,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: t-dll-api.cc,v $
|
* $Log: t-dll-api.cc,v $
|
||||||
|
* Revision 1.21 2001/01/15 00:47:02 steve
|
||||||
|
* Pass scope type information to the target module.
|
||||||
|
*
|
||||||
* Revision 1.20 2001/01/15 00:05:39 steve
|
* Revision 1.20 2001/01/15 00:05:39 steve
|
||||||
* Add client data pointer for scope and process scanners.
|
* Add client data pointer for scope and process scanners.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
30
t-dll.cc
30
t-dll.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: t-dll.cc,v 1.25 2001/01/06 06:31:59 steve Exp $"
|
#ident "$Id: t-dll.cc,v 1.26 2001/01/15 00:47:02 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "compiler.h"
|
# include "compiler.h"
|
||||||
|
|
@ -196,6 +196,8 @@ bool dll_target::start_design(const Design*des)
|
||||||
des_.root_->log_ = 0;
|
des_.root_->log_ = 0;
|
||||||
des_.root_->nlpm_ = 0;
|
des_.root_->nlpm_ = 0;
|
||||||
des_.root_->lpm_ = 0;
|
des_.root_->lpm_ = 0;
|
||||||
|
des_.root_->type_ = IVL_SCT_MODULE;
|
||||||
|
des_.root_->tname_ = des_.root_->name_;
|
||||||
|
|
||||||
target_ = (target_design_f)ivl_dlsym(dll_, LU "target_design" TU);
|
target_ = (target_design_f)ivl_dlsym(dll_, LU "target_design" TU);
|
||||||
if (target_ == 0) {
|
if (target_ == 0) {
|
||||||
|
|
@ -463,6 +465,29 @@ void dll_target::scope(const NetScope*net)
|
||||||
scope->nlpm_ = 0;
|
scope->nlpm_ = 0;
|
||||||
scope->lpm_ = 0;
|
scope->lpm_ = 0;
|
||||||
|
|
||||||
|
switch (net->type()) {
|
||||||
|
case NetScope::MODULE:
|
||||||
|
scope->type_ = IVL_SCT_MODULE;
|
||||||
|
scope->tname_ = net->module_name();
|
||||||
|
break;
|
||||||
|
case NetScope::TASK:
|
||||||
|
scope->type_ = IVL_SCT_TASK;
|
||||||
|
scope->tname_ = strdup(net->task_def()->name().c_str());
|
||||||
|
break;
|
||||||
|
case NetScope::FUNC:
|
||||||
|
scope->type_ = IVL_SCT_FUNCTION;
|
||||||
|
scope->tname_ = strdup(net->func_def()->name().c_str());
|
||||||
|
break;
|
||||||
|
case NetScope::BEGIN_END:
|
||||||
|
scope->type_ = IVL_SCT_BEGIN;
|
||||||
|
scope->tname_ = scope->name_;
|
||||||
|
break;
|
||||||
|
case NetScope::FORK_JOIN:
|
||||||
|
scope->type_ = IVL_SCT_FORK;
|
||||||
|
scope->tname_ = scope->name_;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
ivl_scope_t parent = find_scope(des_.root_, net->parent());
|
ivl_scope_t parent = find_scope(des_.root_, net->parent());
|
||||||
assert(parent != 0);
|
assert(parent != 0);
|
||||||
|
|
||||||
|
|
@ -639,6 +664,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: t-dll.cc,v $
|
* $Log: t-dll.cc,v $
|
||||||
|
* Revision 1.26 2001/01/15 00:47:02 steve
|
||||||
|
* Pass scope type information to the target module.
|
||||||
|
*
|
||||||
* Revision 1.25 2001/01/06 06:31:59 steve
|
* Revision 1.25 2001/01/06 06:31:59 steve
|
||||||
* declaration initialization for time variables.
|
* declaration initialization for time variables.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
7
t-dll.h
7
t-dll.h
|
|
@ -19,7 +19,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: t-dll.h,v 1.20 2000/12/15 05:45:25 steve Exp $"
|
#ident "$Id: t-dll.h,v 1.21 2001/01/15 00:47:02 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "target.h"
|
# include "target.h"
|
||||||
|
|
@ -266,6 +266,8 @@ struct ivl_scope_s {
|
||||||
ivl_scope_t child_, sibling_;
|
ivl_scope_t child_, sibling_;
|
||||||
|
|
||||||
char* name_;
|
char* name_;
|
||||||
|
const char* tname_;
|
||||||
|
ivl_scope_type_t type_;
|
||||||
|
|
||||||
unsigned nsigs_;
|
unsigned nsigs_;
|
||||||
ivl_signal_t*sigs_;
|
ivl_signal_t*sigs_;
|
||||||
|
|
@ -363,6 +365,9 @@ struct ivl_statement_s {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: t-dll.h,v $
|
* $Log: t-dll.h,v $
|
||||||
|
* Revision 1.21 2001/01/15 00:47:02 steve
|
||||||
|
* Pass scope type information to the target module.
|
||||||
|
*
|
||||||
* Revision 1.20 2000/12/15 05:45:25 steve
|
* Revision 1.20 2000/12/15 05:45:25 steve
|
||||||
* Autoconfigure the dlopen functions.
|
* Autoconfigure the dlopen functions.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: stub.c,v 1.27 2001/01/15 00:05:39 steve Exp $"
|
#ident "$Id: stub.c,v 1.28 2001/01/15 00:47:02 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -346,8 +346,31 @@ static int show_scope(ivl_scope_t net, void*x)
|
||||||
{
|
{
|
||||||
unsigned idx;
|
unsigned idx;
|
||||||
|
|
||||||
fprintf(out, "scope: %s (%u signals, %u logic)\n", ivl_scope_name(net),
|
fprintf(out, "scope: %s (%u signals, %u logic)",
|
||||||
ivl_scope_sigs(net), ivl_scope_logs(net));
|
ivl_scope_name(net), ivl_scope_sigs(net),
|
||||||
|
ivl_scope_logs(net));
|
||||||
|
|
||||||
|
switch (ivl_scope_type(net)) {
|
||||||
|
case IVL_SCT_MODULE:
|
||||||
|
fprintf(out, " module %s\n", ivl_scope_tname(net));
|
||||||
|
break;
|
||||||
|
case IVL_SCT_FUNCTION:
|
||||||
|
fprintf(out, " function %s\n", ivl_scope_tname(net));
|
||||||
|
break;
|
||||||
|
case IVL_SCT_BEGIN:
|
||||||
|
fprintf(out, " begin : %s\n", ivl_scope_tname(net));
|
||||||
|
break;
|
||||||
|
case IVL_SCT_FORK:
|
||||||
|
fprintf(out, " fork : %s\n", ivl_scope_tname(net));
|
||||||
|
break;
|
||||||
|
case IVL_SCT_TASK:
|
||||||
|
fprintf(out, " task %s\n", ivl_scope_tname(net));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fprintf(out, " type(%u) %s\n", ivl_scope_type(net),
|
||||||
|
ivl_scope_tname(net));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (idx = 0 ; idx < ivl_scope_sigs(net) ; idx += 1)
|
for (idx = 0 ; idx < ivl_scope_sigs(net) ; idx += 1)
|
||||||
show_signal(ivl_scope_sig(net, idx));
|
show_signal(ivl_scope_sig(net, idx));
|
||||||
|
|
@ -392,6 +415,9 @@ DECLARE_CYGWIN_DLL(DllMain);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: stub.c,v $
|
* $Log: stub.c,v $
|
||||||
|
* Revision 1.28 2001/01/15 00:47:02 steve
|
||||||
|
* Pass scope type information to the target module.
|
||||||
|
*
|
||||||
* Revision 1.27 2001/01/15 00:05:39 steve
|
* Revision 1.27 2001/01/15 00:05:39 steve
|
||||||
* Add client data pointer for scope and process scanners.
|
* Add client data pointer for scope and process scanners.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue