Make logic aware of strength.

This commit is contained in:
steve 2005-04-13 06:35:11 +00:00
parent a3f696cd06
commit 6244dc1194
3 changed files with 58 additions and 4 deletions

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.150 2005/04/08 04:52:31 steve Exp $"
#ident "$Id: ivl_target.h,v 1.151 2005/04/13 06:35:11 steve Exp $"
#endif
#ifdef __cplusplus
@ -676,6 +676,10 @@ extern ivl_memory_t ivl_expr_memory(ivl_expr_t net);
* 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.
*
* The output pin is pin-0. The ivl_logic_driveX functions return the
* drive strengths for the output pin-0, and match the drive values
* stored in the ivl_nexus_ptr_t object for the 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
@ -700,6 +704,8 @@ extern ivl_nexus_t ivl_logic_pin(ivl_net_logic_t net, unsigned pin);
extern unsigned ivl_logic_pins(ivl_net_logic_t net);
extern ivl_udp_t ivl_logic_udp(ivl_net_logic_t net);
extern unsigned ivl_logic_delay(ivl_net_logic_t net, unsigned transition);
extern ivl_drive_t ivl_logic_drive0(ivl_net_logic_t net);
extern ivl_drive_t ivl_logic_drive1(ivl_net_logic_t net);
extern unsigned ivl_logic_width(ivl_net_logic_t net);
/* DEPRECATED */
@ -1636,6 +1642,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.151 2005/04/13 06:35:11 steve
* Make logic aware of strength.
*
* Revision 1.150 2005/04/08 04:52:31 steve
* Make clear that memory addresses are cannonical.
*

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-api.cc,v 1.123 2005/04/06 05:29:08 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.124 2005/04/13 06:35:11 steve Exp $"
#endif
# include "config.h"
@ -521,6 +521,40 @@ extern "C" ivl_attribute_t ivl_logic_attr_val(ivl_net_logic_t net,
return net->attr + idx;
}
extern "C" ivl_drive_t ivl_logic_drive0(ivl_net_logic_t net)
{
ivl_nexus_t nex = ivl_logic_pin(net, 0);
for (unsigned idx = 0 ; idx < ivl_nexus_ptrs(nex) ; idx += 1) {
ivl_nexus_ptr_t cur = ivl_nexus_ptr(nex, idx);
if (ivl_nexus_ptr_log(cur) != net)
continue;
if (ivl_nexus_ptr_pin(cur) != 0)
continue;
return ivl_nexus_ptr_drive0(cur);
}
assert(0);
return 0;
}
extern "C" ivl_drive_t ivl_logic_drive1(ivl_net_logic_t net)
{
ivl_nexus_t nex = ivl_logic_pin(net, 0);
for (unsigned idx = 0 ; idx < ivl_nexus_ptrs(nex) ; idx += 1) {
ivl_nexus_ptr_t cur = ivl_nexus_ptr(nex, idx);
if (ivl_nexus_ptr_log(cur) != net)
continue;
if (ivl_nexus_ptr_pin(cur) != 0)
continue;
return ivl_nexus_ptr_drive1(cur);
}
assert(0);
return 0;
}
extern "C" const char* ivl_logic_name(ivl_net_logic_t net)
{
assert(net);
@ -2004,6 +2038,9 @@ extern "C" ivl_variable_type_t ivl_variable_type(ivl_variable_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.124 2005/04/13 06:35:11 steve
* Make logic aware of strength.
*
* Revision 1.123 2005/04/06 05:29:08 steve
* Rework NetRamDq and IVL_LPM_RAM nodes.
*

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.121 2005/04/06 05:29:09 steve Exp $"
#ident "$Id: stub.c,v 1.122 2005/04/13 06:35:11 steve Exp $"
#endif
# include "config.h"
@ -1081,6 +1081,8 @@ static void show_logic(ivl_net_logic_t net)
{
unsigned npins, idx;
const char*name = ivl_logic_basename(net);
ivl_drive_t drive0 = ivl_logic_drive0(net);
ivl_drive_t drive1 = ivl_logic_drive1(net);
switch (ivl_logic_type(net)) {
case IVL_LO_AND:
@ -1136,7 +1138,10 @@ static void show_logic(ivl_net_logic_t net)
ivl_nexus_t nex = ivl_logic_pin(net, idx);
const char*nexus_name = nex? ivl_nexus_name(nex) : "";
fprintf(out, " %d: %s\n", idx, nexus_name);
fprintf(out, " %d: %s", idx, nexus_name);
if (idx == 0)
fprintf(out, " <drive0/1 = %u/%u>", drive0, drive1);
fprintf(out, "\n");
if (nex == 0) {
if (idx == 0) {
@ -1337,6 +1342,9 @@ int target_design(ivl_design_t des)
/*
* $Log: stub.c,v $
* Revision 1.122 2005/04/13 06:35:11 steve
* Make logic aware of strength.
*
* Revision 1.121 2005/04/06 05:29:09 steve
* Rework NetRamDq and IVL_LPM_RAM nodes.
*