Include constants in nexus targets.

This commit is contained in:
steve 2000-10-13 03:39:27 +00:00
parent 588966320f
commit 52b649cd5e
3 changed files with 31 additions and 16 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.18 2000/10/08 04:01:54 steve Exp $"
#ident "$Id: ivl_target.h,v 1.19 2000/10/13 03:39:27 steve Exp $"
#endif
#ifdef __cplusplus
@ -386,7 +386,7 @@ typedef int (*start_design_f)(ivl_design_t des);
typedef void (*end_design_f)(ivl_design_t des);
/* target_net_const
/* target_net_const (optional)
The "target_net_const" function is called for structural constant
values that appear in the design. */
@ -453,6 +453,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.19 2000/10/13 03:39:27 steve
* Include constants in nexus targets.
*
* Revision 1.18 2000/10/08 04:01:54 steve
* Back pointers in the nexus objects into the devices
* that point to it.

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.cc,v 1.13 2000/10/08 04:01:55 steve Exp $"
#ident "$Id: t-dll.cc,v 1.14 2000/10/13 03:39:27 steve Exp $"
#endif
# include "compiler.h"
@ -86,6 +86,19 @@ static void nexus_log_add(ivl_nexus_t nex, ivl_net_logic_t net, unsigned pin)
nex->ptrs_[top-1].l.log= net;
}
static void nexus_con_add(ivl_nexus_t nex, ivl_net_const_t net, unsigned pin)
{
unsigned top = nex->nptr_ + 1;
nex->ptrs_ = (struct __nexus_ptr*)
realloc(nex->ptrs_, top * sizeof(struct __nexus_ptr));
nex->nptr_ = top;
nex->ptrs_[top-1].type_= __NEXUS_PTR_CON;
nex->ptrs_[top-1].pin_ = pin;
nex->ptrs_[top-1].l.con= net;
}
void scope_add_logic(ivl_scope_t scope, ivl_net_logic_t net)
{
if (scope->nlog_ == 0) {
@ -200,9 +213,6 @@ bool dll_target::bufz(const NetBUFZ*net)
if (net_logic_) {
(net_logic_)(net->name(), obj);
} else {
cerr << dll_path_ << ": internal error: target DLL lacks "
<< "target_net_logic function." << endl;
}
return true;
@ -265,9 +275,6 @@ void dll_target::logic(const NetLogic*net)
if (net_logic_) {
(net_logic_)(net->name(), obj);
} else {
cerr << dll_path_ << ": internal error: target DLL lacks "
<< "target_net_logic function." << endl;
}
}
@ -310,6 +317,7 @@ bool dll_target::net_const(const NetConst*net)
const Nexus*nex = net->pin(0).nexus();
assert(nex->t_cookie());
obj->n.pin_ = (ivl_nexus_t) nex->t_cookie();
nexus_con_add(obj->n.pin_, obj, 0);
} else {
obj->n.pins_ = new ivl_nexus_t[obj->width_];
@ -317,6 +325,7 @@ bool dll_target::net_const(const NetConst*net)
const Nexus*nex = net->pin(idx).nexus();
assert(nex->t_cookie());
obj->n.pins_[idx] = (ivl_nexus_t) nex->t_cookie();
nexus_con_add(obj->n.pins_[idx], obj, idx);
}
}
@ -324,14 +333,9 @@ bool dll_target::net_const(const NetConst*net)
if (net_const_) {
int rc = (net_const_)(net->name(), obj);
return rc == 0;
} else {
cerr << dll_path_ << ": internal error: target DLL lacks "
<< "target_net_const function." << endl;
return false;
}
return false;
return true;
}
void dll_target::net_probe(const NetEvProbe*net)
@ -547,6 +551,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.14 2000/10/13 03:39:27 steve
* Include constants in nexus targets.
*
* Revision 1.13 2000/10/08 04:01:55 steve
* Back pointers in the nexus objects into the devices
* that point to it.

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.11 2000/10/08 04:01:55 steve Exp $"
#ident "$Id: t-dll.h,v 1.12 2000/10/13 03:39:27 steve Exp $"
#endif
# include "target.h"
@ -176,10 +176,12 @@ struct __nexus_ptr {
union {
ivl_signal_t sig; /* type 0 */
ivl_net_logic_t log; /* type 1 */
ivl_net_const_t con; /* type 2 */
} l;
};
# define __NEXUS_PTR_SIG 0
# define __NEXUS_PTR_LOG 1
# define __NEXUS_PTR_CON 2
struct ivl_nexus_s {
unsigned nptr_;
@ -298,6 +300,9 @@ struct ivl_statement_s {
/*
* $Log: t-dll.h,v $
* Revision 1.12 2000/10/13 03:39:27 steve
* Include constants in nexus targets.
*
* Revision 1.11 2000/10/08 04:01:55 steve
* Back pointers in the nexus objects into the devices
* that point to it.