Detect and make available to t-dll the right shift.

This commit is contained in:
steve 2001-07-07 03:01:37 +00:00
parent 1628045b55
commit fb0c387b12
4 changed files with 51 additions and 10 deletions

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: link_const.cc,v 1.8 2001/02/16 03:27:07 steve Exp $"
#ident "$Id: link_const.cc,v 1.9 2001/07/07 03:01:37 steve Exp $"
#endif
# include "netlist.h"
@ -61,11 +61,8 @@ bool link_drivers_constant(const Link&lnk)
/* If the link is PASSIVE then it doesn't count as a
driver if its initial value is Vz. This is pertinant
because REGs are PASSIVE but can receive values from
procedural assignments. */
if ((cur->get_dir() == Link::PASSIVE)
&& (cur->get_init() == verinum::Vz))
driver if its initial value is Vz. */
if (cur->get_dir() == Link::PASSIVE)
continue;
if (! dynamic_cast<const NetConst*>(cur->get_obj()))
@ -114,6 +111,9 @@ verinum::V driven_value(const Link&lnk)
/*
* $Log: link_const.cc,v $
* Revision 1.9 2001/07/07 03:01:37 steve
* Detect and make available to t-dll the right shift.
*
* Revision 1.8 2001/02/16 03:27:07 steve
* links to root inputs are not constant.
*

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: netlist.cc,v 1.165 2001/07/04 22:59:25 steve Exp $"
#ident "$Id: netlist.cc,v 1.166 2001/07/07 03:01:37 steve Exp $"
#endif
# include <cassert>
@ -321,16 +321,21 @@ NetNet::NetNet(NetScope*s, const string&n, Type t, unsigned npins)
assert(s);
verinum::V init_value = verinum::Vz;
Link::DIR dir = Link::PASSIVE;
switch (t) {
case REG:
case IMPLICIT_REG:
init_value = verinum::Vx;
dir = Link::OUTPUT;
break;
case SUPPLY0:
init_value = verinum::V0;
dir = Link::OUTPUT;
break;
case SUPPLY1:
init_value = verinum::V1;
dir = Link::OUTPUT;
break;
default:
break;
@ -338,6 +343,7 @@ NetNet::NetNet(NetScope*s, const string&n, Type t, unsigned npins)
for (unsigned idx = 0 ; idx < npins ; idx += 1) {
pin(idx).set_name("P", idx);
pin(idx).set_dir(dir);
pin(idx).set_init(init_value);
}
@ -2342,6 +2348,9 @@ const NetProc*NetTaskDef::proc() const
/*
* $Log: netlist.cc,v $
* Revision 1.166 2001/07/07 03:01:37 steve
* Detect and make available to t-dll the right shift.
*
* Revision 1.165 2001/07/04 22:59:25 steve
* handle left shifter in dll output.
*

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.53 2001/07/04 22:59:25 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.54 2001/07/07 03:01:37 steve Exp $"
#endif
# include "t-dll.h"
@ -476,6 +476,7 @@ extern "C" ivl_nexus_t ivl_lpm_data(ivl_lpm_t net, unsigned idx)
return net->u_.arith.a[idx];
case IVL_LPM_SHIFTL:
case IVL_LPM_SHIFTR:
assert(idx < net->u_.shift.width);
return net->u_.shift.d[idx];
@ -564,6 +565,7 @@ extern "C" ivl_nexus_t ivl_lpm_q(ivl_lpm_t net, unsigned idx)
return net->u_.mux.q.pins[idx];
case IVL_LPM_SHIFTL:
case IVL_LPM_SHIFTR:
assert(idx < net->u_.shift.width);
return net->u_.shift.q[idx];
@ -591,6 +593,7 @@ extern "C" ivl_nexus_t ivl_lpm_select(ivl_lpm_t net, unsigned idx)
return net->u_.mux.s.pins[idx];
case IVL_LPM_SHIFTL:
case IVL_LPM_SHIFTR:
assert(idx < net->u_.shift.select);
return net->u_.shift.s[idx];
@ -608,6 +611,7 @@ extern "C" unsigned ivl_lpm_selects(ivl_lpm_t net)
case IVL_LPM_MUX:
return net->u_.mux.swid;
case IVL_LPM_SHIFTL:
case IVL_LPM_SHIFTR:
return net->u_.shift.select;
default:
assert(0);
@ -647,6 +651,7 @@ extern "C" unsigned ivl_lpm_width(ivl_lpm_t net)
case IVL_LPM_SUB:
return net->u_.arith.width;
case IVL_LPM_SHIFTL:
case IVL_LPM_SHIFTR:
return net->u_.shift.width;
default:
assert(0);
@ -1248,6 +1253,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.54 2001/07/07 03:01:37 steve
* Detect and make available to t-dll the right shift.
*
* Revision 1.53 2001/07/04 22:59:25 steve
* handle left shifter in dll output.
*

View File

@ -17,11 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll.cc,v 1.53 2001/07/04 22:59:25 steve Exp $"
#ident "$Id: t-dll.cc,v 1.54 2001/07/07 03:01:37 steve Exp $"
#endif
# include "compiler.h"
# include "t-dll.h"
# include "netmisc.h"
# include <malloc.h>
#if defined(__WIN32__)
@ -703,6 +704,11 @@ void dll_target::lpm_add_sub(const NetAddSub*net)
scope_add_lpm(obj->scope, obj);
}
/*
* The lpm_clshift device represents both left and right shifts,
* depending on what is connected to the Direction pin. We convert
* this device into SHIFTL or SHIFTR devices.
*/
void dll_target::lpm_clshift(const NetCLShift*net)
{
ivl_lpm_t obj = new struct ivl_lpm_s;
@ -712,7 +718,22 @@ void dll_target::lpm_clshift(const NetCLShift*net)
obj->scope = find_scope(des_.root_, net->scope());
assert(obj->scope);
assert(! net->pin_Direction().is_linked());
/* Look at the direction input of the device, and select the
shift direction accordingly. */
if (net->pin_Direction().is_linked()) {
assert( link_drivers_constant(net->pin_Direction()) );
verinum::V dir = driven_value(net->pin_Direction());
switch (dir) {
case verinum::V0:
break;
case verinum::V1:
obj->type = IVL_LPM_SHIFTR;
break;
default:
assert(0);
}
}
obj->u_.shift.width = net->width();
obj->u_.shift.select = net->width_dist();
@ -1439,6 +1460,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.54 2001/07/07 03:01:37 steve
* Detect and make available to t-dll the right shift.
*
* Revision 1.53 2001/07/04 22:59:25 steve
* handle left shifter in dll output.
*