Replace supply nets with wires connected to pullup/down supply devices.

This commit is contained in:
steve 2005-02-13 01:15:07 +00:00
parent 97e0723bd1
commit 1d7235b4f1
5 changed files with 74 additions and 43 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_sig.cc,v 1.37 2004/12/11 02:31:25 steve Exp $"
#ident "$Id: elab_sig.cc,v 1.38 2005/02/13 01:15:07 steve Exp $"
#endif
# include "config.h"
@ -609,6 +609,40 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
} else {
/* If the net type is supply0 or supply1, replace it
with a simple wire with a pulldown/pullup with supply
strength. In other words, transform:
supply0 foo;
to:
wire foo;
pulldown #(supply0) (foo);
This reduces the backend burden, and behaves exactly
the same. */
NetLogic*pull = 0;
if (wtype == NetNet::SUPPLY0 || wtype == NetNet::SUPPLY1) {
NetLogic::TYPE pull_type = (wtype==NetNet::SUPPLY1)
? NetLogic::PULLUP
: NetLogic::PULLDOWN;
pull = new NetLogic(scope, scope->local_symbol(),
1, pull_type, wid);
pull->set_line(*this);
pull->pin(0).drive0(Link::SUPPLY);
pull->pin(0).drive1(Link::SUPPLY);
des->add_node(pull);
wtype = NetNet::WIRE;
if (debug_elaborate) {
cerr << get_line() << ": debug: "
<< "Generate a SUPPLY pulldown for the "
<< "supply0 net." << endl;
}
}
perm_string name = lex_strings.make(hname_.peek_tail_name());
if (debug_elaborate) {
cerr << get_line() << ": debug: Create signal "
@ -622,6 +656,9 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
sig->set_signed(get_signed());
sig->set_isint(get_isint());
if (pull)
connect(sig->pin(0), pull->pin(0));
for (unsigned idx = 0 ; idx < nattrib ; idx += 1)
sig->attribute(attrib_list[idx].key, attrib_list[idx].val);
}
@ -629,6 +666,9 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
/*
* $Log: elab_sig.cc,v $
* Revision 1.38 2005/02/13 01:15:07 steve
* Replace supply nets with wires connected to pullup/down supply devices.
*
* Revision 1.37 2004/12/11 02:31:25 steve
* Rework of internals to carry vectors through nexus instead
* of single bits. Make the ivl, tgt-vvp and vvp initial changes

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: ivl_target.h,v 1.140 2005/02/12 06:25:40 steve Exp $"
#ident "$Id: ivl_target.h,v 1.141 2005/02/13 01:15:07 steve Exp $"
#endif
#ifdef __cplusplus
@ -282,15 +282,13 @@ typedef enum ivl_signal_port_e {
are resolved by the core compiler, and integers are converted into
signed registers. */
typedef enum ivl_signal_type_e {
IVL_SIT_NONE = 0,
IVL_SIT_REG,
IVL_SIT_SUPPLY0,
IVL_SIT_SUPPLY1,
IVL_SIT_TRI,
IVL_SIT_TRI0,
IVL_SIT_TRI1,
IVL_SIT_TRIAND,
IVL_SIT_TRIOR
IVL_SIT_NONE = 0,
IVL_SIT_REG = 1,
IVL_SIT_TRI = 4,
IVL_SIT_TRI0 = 5,
IVL_SIT_TRI1 = 6,
IVL_SIT_TRIAND = 7,
IVL_SIT_TRIOR = 8
} ivl_signal_type_t;
/* This is the type code for ivl_statement_t objects. */
@ -661,6 +659,12 @@ extern ivl_memory_t ivl_expr_memory(ivl_expr_t net);
* device has a number of pins that is the number of inputs to a logic
* array of identical gates, and the ivl_logic_width, is the width of
* the vector into each input pin and out of the output pin.
*
* - IVL_LO_PULLUP/IVL_LO_PULLDOWN
* These devices are grouped as logic devices with zero inputs because
* the outputs have the same characteristics as other logic
* devices. They are special only in that they have zero inputs, and
* their drivers typically have strength other then strong.
*/
extern const char* ivl_logic_name(ivl_net_logic_t net);
@ -1500,6 +1504,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.141 2005/02/13 01:15:07 steve
* Replace supply nets with wires connected to pullup/down supply devices.
*
* Revision 1.140 2005/02/12 06:25:40 steve
* Restructure NetMux devices to pass vectors.
* Generate NetMux devices from ternary expressions,

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.cc,v 1.140 2005/02/12 06:25:40 steve Exp $"
#ident "$Id: t-dll.cc,v 1.141 2005/02/13 01:15:07 steve Exp $"
#endif
# include "config.h"
@ -295,10 +295,6 @@ static ivl_nexus_t nexus_sig_make(ivl_signal_t net, unsigned pin)
case IVL_SIT_REG:
drive = IVL_DR_STRONG;
break;
case IVL_SIT_SUPPLY0:
case IVL_SIT_SUPPLY1:
drive = IVL_DR_SUPPLY;
break;
default:
break;
}
@ -320,10 +316,6 @@ static void nexus_sig_add(ivl_nexus_t nex, ivl_signal_t net, unsigned pin)
case IVL_SIT_REG:
drive = IVL_DR_STRONG;
break;
case IVL_SIT_SUPPLY0:
case IVL_SIT_SUPPLY1:
drive = IVL_DR_SUPPLY;
break;
default:
break;
}
@ -2160,12 +2152,13 @@ void dll_target::signal(const NetNet*net)
obj->isint_ = net->get_isint();
break;
/* The SUPPLY0/1 net types are replaced with pulldown/up
by elaborate. They should not make it here. */
case NetNet::SUPPLY0:
obj->type_ = IVL_SIT_SUPPLY0;
assert(0);
break;
case NetNet::SUPPLY1:
obj->type_ = IVL_SIT_SUPPLY1;
assert(0);
break;
case NetNet::TRI:
@ -2229,6 +2222,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.141 2005/02/13 01:15:07 steve
* Replace supply nets with wires connected to pullup/down supply devices.
*
* Revision 1.140 2005/02/12 06:25:40 steve
* Restructure NetMux devices to pass vectors.
* Generate NetMux devices from ternary expressions,

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: stub.c,v 1.109 2005/02/12 22:53:41 steve Exp $"
#ident "$Id: stub.c,v 1.110 2005/02/13 01:15:07 steve Exp $"
#endif
# include "config.h"
@ -817,12 +817,6 @@ static void show_signal(ivl_signal_t net)
case IVL_SIT_TRI1:
type = "tri1";
break;
case IVL_SIT_SUPPLY0:
type = "supply0";
break;
case IVL_SIT_SUPPLY1:
type = "supply1";
break;
default:
break;
}
@ -1117,6 +1111,9 @@ int target_design(ivl_design_t des)
/*
* $Log: stub.c,v $
* Revision 1.110 2005/02/13 01:15:07 steve
* Replace supply nets with wires connected to pullup/down supply devices.
*
* Revision 1.109 2005/02/12 22:53:41 steve
* Check IVL_LPM_MUX configuration.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vvp_scope.c,v 1.118 2005/02/12 22:54:29 steve Exp $"
#ident "$Id: vvp_scope.c,v 1.119 2005/02/13 01:15:07 steve Exp $"
#endif
# include "vvp_priv.h"
@ -646,18 +646,6 @@ const char* draw_net_input(ivl_nexus_t nex)
case IVL_SIT_TRIOR:
resolv_type = "trior";
break;
/* Catch the special cases that the nets are supply
nets. Drive constant values uncomditionally. */
case IVL_SIT_SUPPLY0:
nex_private = "C<su0>";
ivl_nexus_set_private(nex, nex_private);
return nex_private;
case IVL_SIT_SUPPLY1:
nex_private = "C<su1>";
ivl_nexus_set_private(nex, nex_private);
return nex_private;
default:
fprintf(stderr, "vvp.tgt: Unsupported signal type: %u\n", res);
assert(0);
@ -2041,6 +2029,9 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
/*
* $Log: vvp_scope.c,v $
* Revision 1.119 2005/02/13 01:15:07 steve
* Replace supply nets with wires connected to pullup/down supply devices.
*
* Revision 1.118 2005/02/12 22:54:29 steve
* Implement a-b muxes as vector devices
*