Carry drive strengths in the ivl_nexus_ptr_t, and

handle constant devices in targets.'
This commit is contained in:
steve 2001-04-29 23:17:38 +00:00
parent 2a44cf70b1
commit eb71c70c99
5 changed files with 108 additions and 14 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.56 2001/04/29 20:19:10 steve Exp $"
#ident "$Id: ivl_target.h,v 1.57 2001/04/29 23:17:38 steve Exp $"
#endif
#ifdef __cplusplus
@ -143,6 +143,17 @@ typedef struct ivl_statement_s*ivl_statement_t;
* changes and additions to the enumerations.
*/
typedef enum ivl_drive_e {
IVL_DR_HiZ = 0,
IVL_DR_SMALL = 1,
IVL_DR_MEDIUM = 2,
IVL_DR_WEAK = 3,
IVL_DR_LARGE = 4,
IVL_DR_PULL = 5,
IVL_DR_STRONG = 6,
IVL_DR_SUPPLY = 7
} ivl_drive_t;
/* This is the type of an ivl_expr_t object. */
typedef enum ivl_expr_type_e {
IVL_EX_NONE = 0,
@ -538,6 +549,10 @@ extern ivl_nexus_t ivl_lval_pin(ivl_lval_t net, unsigned idx);
* nexus. The problem is that LPM devices do not have a pinout per
* se, the pins all have specific names.
*
* ivl_nexus_ptr_con
* If this is a pointer to a magic constant device, then this
* returns the net_const object.
*
* ivl_nexus_ptr_log
* If the target object is an ivl_net_logic_t, this method returns
* the object. Otherwise, this method returns 0.
@ -555,7 +570,10 @@ extern const char* ivl_nexus_name(ivl_nexus_t net);
extern unsigned ivl_nexus_ptrs(ivl_nexus_t net);
extern ivl_nexus_ptr_t ivl_nexus_ptr(ivl_nexus_t net, unsigned idx);
extern ivl_drive_t ivl_nexus_ptr_drive0(ivl_nexus_ptr_t net);
extern ivl_drive_t ivl_nexus_ptr_drive1(ivl_nexus_ptr_t net);
extern unsigned ivl_nexus_ptr_pin(ivl_nexus_ptr_t net);
extern ivl_net_const_t ivl_nexus_ptr_con(ivl_nexus_ptr_t net);
extern ivl_net_logic_t ivl_nexus_ptr_log(ivl_nexus_ptr_t net);
extern ivl_lpm_t ivl_nexus_ptr_lpm(ivl_nexus_ptr_t net);
extern ivl_signal_t ivl_nexus_ptr_sig(ivl_nexus_ptr_t net);
@ -794,6 +812,10 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.57 2001/04/29 23:17:38 steve
* Carry drive strengths in the ivl_nexus_ptr_t, and
* handle constant devices in targets.'
*
* Revision 1.56 2001/04/29 20:19:10 steve
* Add pullup and pulldown devices.
*

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.41 2001/04/26 05:12:02 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.42 2001/04/29 23:17:38 steve Exp $"
#endif
# include "t-dll.h"
@ -550,12 +550,33 @@ extern "C" ivl_nexus_ptr_t ivl_nexus_ptr(ivl_nexus_t net, unsigned idx)
return net->ptrs_ + idx;
}
extern "C" ivl_drive_t ivl_nexus_ptr_drive0(ivl_nexus_ptr_t net)
{
assert(net);
return (ivl_drive_t)(net->drive0);
}
extern "C" ivl_drive_t ivl_nexus_ptr_drive1(ivl_nexus_ptr_t net)
{
assert(net);
return (ivl_drive_t)(net->drive1);
}
extern "C" unsigned ivl_nexus_ptr_pin(ivl_nexus_ptr_t net)
{
assert(net);
return net->pin_;
}
extern "C" ivl_net_const_t ivl_nexus_ptr_con(ivl_nexus_ptr_t net)
{
if (net == 0)
return 0;
if (net->type_ != __NEXUS_PTR_CON)
return 0;
return net->l.con;
}
extern "C" ivl_net_logic_t ivl_nexus_ptr_log(ivl_nexus_ptr_t net)
{
if (net == 0)
@ -1033,6 +1054,10 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.42 2001/04/29 23:17:38 steve
* Carry drive strengths in the ivl_nexus_ptr_t, and
* handle constant devices in targets.'
*
* Revision 1.41 2001/04/26 05:12:02 steve
* Implement simple MUXZ for ?: operators.
*

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.37 2001/04/29 20:19:10 steve Exp $"
#ident "$Id: t-dll.cc,v 1.38 2001/04/29 23:17:38 steve Exp $"
#endif
# include "compiler.h"
@ -89,9 +89,11 @@ static ivl_nexus_t nexus_sig_make(ivl_signal_t net, unsigned pin)
tmp->nptr_ = 1;
tmp->ptrs_ = (struct ivl_nexus_ptr_s*)
malloc(sizeof(struct ivl_nexus_ptr_s));
tmp->ptrs_[0].pin_ = pin;
tmp->ptrs_[0].type_ = __NEXUS_PTR_SIG;
tmp->ptrs_[0].l.sig = net;
tmp->ptrs_[0].pin_ = pin;
tmp->ptrs_[0].type_ = __NEXUS_PTR_SIG;
tmp->ptrs_[0].drive0 = IVL_DR_HiZ;
tmp->ptrs_[0].drive1 = IVL_DR_HiZ;
tmp->ptrs_[0].l.sig = net;
return tmp;
}
@ -103,6 +105,8 @@ static void nexus_sig_add(ivl_nexus_t nex, ivl_signal_t net, unsigned pin)
nex->nptr_ = top;
nex->ptrs_[top-1].type_= __NEXUS_PTR_SIG;
nex->ptrs_[top-1].drive0 = IVL_DR_HiZ;
nex->ptrs_[top-1].drive1 = IVL_DR_HiZ;
nex->ptrs_[top-1].pin_ = pin;
nex->ptrs_[top-1].l.sig= net;
}
@ -115,6 +119,8 @@ static void nexus_log_add(ivl_nexus_t nex, ivl_net_logic_t net, unsigned pin)
nex->nptr_ = top;
nex->ptrs_[top-1].type_= __NEXUS_PTR_LOG;
nex->ptrs_[top-1].drive0 = (pin == 0)? IVL_DR_STRONG : IVL_DR_HiZ;
nex->ptrs_[top-1].drive1 = (pin == 0)? IVL_DR_STRONG : IVL_DR_HiZ;
nex->ptrs_[top-1].pin_ = pin;
nex->ptrs_[top-1].l.log= net;
}
@ -127,6 +133,8 @@ static void nexus_con_add(ivl_nexus_t nex, ivl_net_const_t net, unsigned pin)
nex->nptr_ = top;
nex->ptrs_[top-1].type_= __NEXUS_PTR_CON;
nex->ptrs_[top-1].drive0 = IVL_DR_STRONG;
nex->ptrs_[top-1].drive1 = IVL_DR_STRONG;
nex->ptrs_[top-1].pin_ = pin;
nex->ptrs_[top-1].l.con= net;
}
@ -885,6 +893,10 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.38 2001/04/29 23:17:38 steve
* Carry drive strengths in the ivl_nexus_ptr_t, and
* handle constant devices in targets.'
*
* Revision 1.37 2001/04/29 20:19:10 steve
* Add pullup and pulldown devices.
*

15
t-dll.h
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.40 2001/04/26 05:12:02 steve Exp $"
#ident "$Id: t-dll.h,v 1.41 2001/04/29 23:17:38 steve Exp $"
#endif
# include "target.h"
@ -295,10 +295,19 @@ struct ivl_udp_s {
* The ivl_nexus_t is a single-bit link of some number of pins of
* devices. the __nexus_ptr structure is a helper that actually does
* the pointing.
*
* The type_ member specifies which of the object pointers in the
* union are valid.
*
* The drive01 members gives the strength of the drive that the device
* is applying to the nexus, with 0 HiZ and 3 supply. If the pin is an
* input to the device, then the drives are both HiZ.
*/
struct ivl_nexus_ptr_s {
unsigned pin_ :24;
unsigned type_ : 8;
unsigned drive0 : 3;
unsigned drive1 : 3;
union {
ivl_signal_t sig; /* type 0 */
ivl_net_logic_t log; /* type 1 */
@ -468,6 +477,10 @@ struct ivl_statement_s {
/*
* $Log: t-dll.h,v $
* Revision 1.41 2001/04/29 23:17:38 steve
* Carry drive strengths in the ivl_nexus_ptr_t, and
* handle constant devices in targets.'
*
* Revision 1.40 2001/04/26 05:12:02 steve
* Implement simple MUXZ for ?: operators.
*

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.38 2001/04/26 05:12:02 steve Exp $"
#ident "$Id: stub.c,v 1.39 2001/04/29 23:17:38 steve Exp $"
#endif
/*
@ -382,26 +382,44 @@ static void show_signal(ivl_signal_t net)
fprintf(out, " [%u]: nexus=%s\n", pin, ivl_nexus_name(nex));
for (idx = 0 ; idx < ivl_nexus_ptrs(nex) ; idx += 1) {
ivl_net_const_t con;
ivl_net_logic_t log;
ivl_lpm_t lpm;
ivl_signal_t sig;
ivl_nexus_ptr_t ptr = ivl_nexus_ptr(nex, idx);
static const char* str_tab[8] = {
"HiZ", "small", "medium", "weak",
"large", "pull", "strong", "supply"};
const char*dr0 = str_tab[ivl_nexus_ptr_drive0(ptr)];
const char*dr1 = str_tab[ivl_nexus_ptr_drive1(ptr)];
if ((sig = ivl_nexus_ptr_sig(ptr))) {
fprintf(out, " %s[%u]\n",
fprintf(out, " %s[%u] (%s0, %s1)\n",
ivl_signal_name(sig),
ivl_nexus_ptr_pin(ptr));
ivl_nexus_ptr_pin(ptr), dr0, dr1);
} else if ((log = ivl_nexus_ptr_log(ptr))) {
fprintf(out, " %s[%u]\n",
fprintf(out, " %s[%u] (%s0, %s1)\n",
ivl_logic_name(log),
ivl_nexus_ptr_pin(ptr));
ivl_nexus_ptr_pin(ptr), dr0, dr1);
} else if ((lpm = ivl_nexus_ptr_lpm(ptr))) {
fprintf(out, " LPM %s\n", ivl_lpm_name(lpm));
fprintf(out, " LPM %s (%s0, %s1)\n",
ivl_lpm_name(lpm), dr0, dr1);
} else if ((con = ivl_nexus_ptr_con(ptr))) {
const char*bits = ivl_const_bits(con);
unsigned pin = ivl_nexus_ptr_pin(ptr);
fprintf(out, " const-%c (%s0, %s1)\n",
bits[pin], dr0, dr1);
} else {
fprintf(out, " ?[%u]\n", ivl_nexus_ptr_pin(ptr));
fprintf(out, " ?[%u] (%s0, %s1)\n",
ivl_nexus_ptr_pin(ptr), dr0, dr1);
}
}
}
@ -530,6 +548,10 @@ DECLARE_CYGWIN_DLL(DllMain);
/*
* $Log: stub.c,v $
* Revision 1.39 2001/04/29 23:17:38 steve
* Carry drive strengths in the ivl_nexus_ptr_t, and
* handle constant devices in targets.'
*
* Revision 1.38 2001/04/26 05:12:02 steve
* Implement simple MUXZ for ?: operators.
*