Parse and handle drive strengths of gates to vvp.
This commit is contained in:
parent
1ca6fe5519
commit
4dd5f97a96
7
parse.y
7
parse.y
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: parse.y,v 1.140 2001/12/07 05:03:13 steve Exp $"
|
||||
#ident "$Id: parse.y,v 1.141 2001/12/14 02:05:13 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -36,6 +36,7 @@ extern void lex_end_table();
|
|||
* net_decl_assigns can change them during specific statements.
|
||||
*/
|
||||
static struct str_pair_t decl_strength = { PGate::STRONG, PGate::STRONG };
|
||||
static struct str_pair_t pull_strength = { PGate::PULL, PGate::PULL };
|
||||
%}
|
||||
|
||||
%union {
|
||||
|
|
@ -1260,10 +1261,10 @@ module_item
|
|||
strengths are limited. */
|
||||
|
||||
| K_pullup gate_instance_list ';'
|
||||
{ pform_makegates(PGBuiltin::PULLUP, decl_strength, 0, $2);
|
||||
{ pform_makegates(PGBuiltin::PULLUP, pull_strength, 0, $2);
|
||||
}
|
||||
| K_pulldown gate_instance_list ';'
|
||||
{ pform_makegates(PGBuiltin::PULLDOWN, decl_strength, 0, $2);
|
||||
{ pform_makegates(PGBuiltin::PULLDOWN, pull_strength, 0, $2);
|
||||
}
|
||||
|
||||
| K_pullup '(' dr_strength1 ')' gate_instance_list ';'
|
||||
|
|
|
|||
54
t-dll.cc
54
t-dll.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.cc,v 1.71 2001/12/06 03:11:00 steve Exp $"
|
||||
#ident "$Id: t-dll.cc,v 1.72 2001/12/14 02:05:13 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -247,7 +247,9 @@ static void nexus_sig_add(ivl_nexus_t nex, ivl_signal_t net, unsigned pin)
|
|||
nex->ptrs_[top-1].l.sig= net;
|
||||
}
|
||||
|
||||
static void nexus_log_add(ivl_nexus_t nex, ivl_net_logic_t net, unsigned pin)
|
||||
static ivl_nexus_ptr_t nexus_log_add(ivl_nexus_t nex,
|
||||
ivl_net_logic_t net,
|
||||
unsigned pin)
|
||||
{
|
||||
unsigned top = nex->nptr_ + 1;
|
||||
nex->ptrs_ = (struct ivl_nexus_ptr_s*)
|
||||
|
|
@ -259,6 +261,8 @@ static void nexus_log_add(ivl_nexus_t nex, ivl_net_logic_t net, unsigned pin)
|
|||
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;
|
||||
|
||||
return nex->ptrs_ + top - 1;
|
||||
}
|
||||
|
||||
static void nexus_con_add(ivl_nexus_t nex, ivl_net_const_t net, unsigned pin)
|
||||
|
|
@ -602,11 +606,52 @@ void dll_target::logic(const NetLogic*net)
|
|||
|
||||
obj->npins_ = net->pin_count();
|
||||
obj->pins_ = new ivl_nexus_t[obj->npins_];
|
||||
|
||||
ivl_nexus_ptr_t out_ptr = 0;
|
||||
|
||||
for (unsigned idx = 0 ; idx < obj->npins_ ; idx += 1) {
|
||||
const Nexus*nex = net->pin(idx).nexus();
|
||||
assert(nex->t_cookie());
|
||||
obj->pins_[idx] = (ivl_nexus_t) nex->t_cookie();
|
||||
nexus_log_add(obj->pins_[idx], obj, idx);
|
||||
ivl_nexus_ptr_t tmp = nexus_log_add(obj->pins_[idx], obj, idx);
|
||||
if (idx == 0)
|
||||
out_ptr = tmp;
|
||||
}
|
||||
|
||||
switch (net->pin(0).drive0()) {
|
||||
case Link::HIGHZ:
|
||||
out_ptr->drive0 = IVL_DR_HiZ;
|
||||
break;
|
||||
case Link::WEAK:
|
||||
out_ptr->drive0 = IVL_DR_WEAK;
|
||||
break;
|
||||
case Link::PULL:
|
||||
out_ptr->drive0 = IVL_DR_PULL;
|
||||
break;
|
||||
case Link::STRONG:
|
||||
out_ptr->drive0 = IVL_DR_STRONG;
|
||||
break;
|
||||
case Link::SUPPLY:
|
||||
out_ptr->drive0 = IVL_DR_SUPPLY;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (net->pin(0).drive1()) {
|
||||
case Link::HIGHZ:
|
||||
out_ptr->drive1 = IVL_DR_HiZ;
|
||||
break;
|
||||
case Link::WEAK:
|
||||
out_ptr->drive1 = IVL_DR_WEAK;
|
||||
break;
|
||||
case Link::PULL:
|
||||
out_ptr->drive1 = IVL_DR_PULL;
|
||||
break;
|
||||
case Link::STRONG:
|
||||
out_ptr->drive1 = IVL_DR_STRONG;
|
||||
break;
|
||||
case Link::SUPPLY:
|
||||
out_ptr->drive1 = IVL_DR_SUPPLY;
|
||||
break;
|
||||
}
|
||||
|
||||
assert(net->scope());
|
||||
|
|
@ -1674,6 +1719,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
|
|||
|
||||
/*
|
||||
* $Log: t-dll.cc,v $
|
||||
* Revision 1.72 2001/12/14 02:05:13 steve
|
||||
* Parse and handle drive strengths of gates to vvp.
|
||||
*
|
||||
* Revision 1.71 2001/12/06 03:11:00 steve
|
||||
* Add ivl_logic_delay function to ivl_target.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT)
|
||||
#ident "$Id: vvp_scope.c,v 1.57 2001/12/06 03:31:24 steve Exp $"
|
||||
#ident "$Id: vvp_scope.c,v 1.58 2001/12/14 02:05:13 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vvp_priv.h"
|
||||
|
|
@ -524,6 +524,9 @@ static void draw_logic_in_scope(ivl_net_logic_t lptr)
|
|||
const char*ltype = "?";
|
||||
const char*lcasc = 0x0;
|
||||
char identity_val = '0';
|
||||
|
||||
ivl_drive_t str0, str1;
|
||||
|
||||
int level;
|
||||
int ninp = ivl_logic_pins(lptr) - 1;
|
||||
typedef const char*const_charp;
|
||||
|
|
@ -632,6 +635,21 @@ static void draw_logic_in_scope(ivl_net_logic_t lptr)
|
|||
break;
|
||||
}
|
||||
|
||||
{ ivl_nexus_t nex = ivl_logic_pin(lptr, 0);
|
||||
ivl_nexus_ptr_t nptr = 0;
|
||||
unsigned idx;
|
||||
for (idx = 0 ; idx < ivl_nexus_ptrs(nex) ; idx += 1) {
|
||||
nptr = ivl_nexus_ptr(nex,idx);
|
||||
if (ivl_nexus_ptr_log(nptr) != lptr)
|
||||
continue;
|
||||
if (ivl_nexus_ptr_pin(nptr) != 0)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
str0 = ivl_nexus_ptr_drive0(nptr);
|
||||
str1 = ivl_nexus_ptr_drive1(nptr);
|
||||
}
|
||||
|
||||
if (!lcasc)
|
||||
lcasc = ltype;
|
||||
|
||||
|
|
@ -656,7 +674,12 @@ static void draw_logic_in_scope(ivl_net_logic_t lptr)
|
|||
fprintf(vvp_out, "L_%s .functor %s",
|
||||
vvp_mangle_id(ivl_logic_name(lptr)),
|
||||
ltype);
|
||||
|
||||
draw_delay(lptr);
|
||||
|
||||
if (str0 != IVL_DR_STRONG || str1 != IVL_DR_STRONG)
|
||||
fprintf(vvp_out, " [%u %u]", str0, str1);
|
||||
|
||||
}
|
||||
for (pdx = inst; pdx < ninp && pdx < inst+4 ; pdx += 1) {
|
||||
if (level) {
|
||||
|
|
@ -1235,6 +1258,9 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
|
|||
|
||||
/*
|
||||
* $Log: vvp_scope.c,v $
|
||||
* Revision 1.58 2001/12/14 02:05:13 steve
|
||||
* Parse and handle drive strengths of gates to vvp.
|
||||
*
|
||||
* Revision 1.57 2001/12/06 03:31:24 steve
|
||||
* Support functor delays for gates and UDP devices.
|
||||
* (Stephan Boettcher)
|
||||
|
|
|
|||
Loading…
Reference in New Issue