Detect flip-flops connected to opads and turn
them into OUTFF devices. Inprove support for the XNF-LCA attribute in the process.
This commit is contained in:
parent
fbf0bf1fb7
commit
8b81d6e416
18
netlist.cc
18
netlist.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: netlist.cc,v 1.87 1999/11/18 03:52:19 steve Exp $"
|
#ident "$Id: netlist.cc,v 1.88 1999/11/19 03:02:25 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include <cassert>
|
# include <cassert>
|
||||||
|
|
@ -77,6 +77,7 @@ ostream& operator<< (ostream&o, NetNet::Type t)
|
||||||
|
|
||||||
void connect(NetObj::Link&l, NetObj::Link&r)
|
void connect(NetObj::Link&l, NetObj::Link&r)
|
||||||
{
|
{
|
||||||
|
assert(&l != &r);
|
||||||
NetObj::Link* cur = &l;
|
NetObj::Link* cur = &l;
|
||||||
do {
|
do {
|
||||||
NetObj::Link*tmp = cur->next_;
|
NetObj::Link*tmp = cur->next_;
|
||||||
|
|
@ -242,6 +243,16 @@ const NetNet* find_link_signal(const NetObj*net, unsigned pin, unsigned&bidx)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NetObj::Link* find_next_output(NetObj::Link*lnk)
|
||||||
|
{
|
||||||
|
for (NetObj::Link*cur = lnk->next_link()
|
||||||
|
; cur != lnk ; cur = cur->next_link())
|
||||||
|
if (cur->get_dir() == NetObj::Link::OUTPUT)
|
||||||
|
return cur;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
NetObj::NetObj(const string&n, unsigned np)
|
NetObj::NetObj(const string&n, unsigned np)
|
||||||
: name_(n), npins_(np), delay1_(0), delay2_(0), delay3_(0), mark_(false)
|
: name_(n), npins_(np), delay1_(0), delay2_(0), delay3_(0), mark_(false)
|
||||||
{
|
{
|
||||||
|
|
@ -2348,6 +2359,11 @@ NetNet* Design::find_signal(bool (*func)(const NetNet*))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: netlist.cc,v $
|
* $Log: netlist.cc,v $
|
||||||
|
* Revision 1.88 1999/11/19 03:02:25 steve
|
||||||
|
* Detect flip-flops connected to opads and turn
|
||||||
|
* them into OUTFF devices. Inprove support for
|
||||||
|
* the XNF-LCA attribute in the process.
|
||||||
|
*
|
||||||
* Revision 1.87 1999/11/18 03:52:19 steve
|
* Revision 1.87 1999/11/18 03:52:19 steve
|
||||||
* Turn NetTmp objects into normal local NetNet objects,
|
* Turn NetTmp objects into normal local NetNet objects,
|
||||||
* and add the nodangle functor to clean up the local
|
* and add the nodangle functor to clean up the local
|
||||||
|
|
|
||||||
10
netlist.h
10
netlist.h
|
|
@ -19,7 +19,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: netlist.h,v 1.89 1999/11/18 03:52:19 steve Exp $"
|
#ident "$Id: netlist.h,v 1.90 1999/11/19 03:02:25 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -1924,6 +1924,9 @@ extern unsigned count_inputs(const NetObj::Link&pin);
|
||||||
extern unsigned count_outputs(const NetObj::Link&pin);
|
extern unsigned count_outputs(const NetObj::Link&pin);
|
||||||
extern unsigned count_signals(const NetObj::Link&pin);
|
extern unsigned count_signals(const NetObj::Link&pin);
|
||||||
|
|
||||||
|
/* Find the next link that is an output into the nexus. */
|
||||||
|
extern NetObj::Link* find_next_output(NetObj::Link*lnk);
|
||||||
|
|
||||||
/* Find the signal connected to the given node pin. There should
|
/* Find the signal connected to the given node pin. There should
|
||||||
always be exactly one signal. The bidx parameter get filled with
|
always be exactly one signal. The bidx parameter get filled with
|
||||||
the signal index of the Net, in case it is a vector. */
|
the signal index of the Net, in case it is a vector. */
|
||||||
|
|
@ -1937,6 +1940,11 @@ extern ostream& operator << (ostream&, NetNet::Type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: netlist.h,v $
|
* $Log: netlist.h,v $
|
||||||
|
* Revision 1.90 1999/11/19 03:02:25 steve
|
||||||
|
* Detect flip-flops connected to opads and turn
|
||||||
|
* them into OUTFF devices. Inprove support for
|
||||||
|
* the XNF-LCA attribute in the process.
|
||||||
|
*
|
||||||
* Revision 1.89 1999/11/18 03:52:19 steve
|
* Revision 1.89 1999/11/18 03:52:19 steve
|
||||||
* Turn NetTmp objects into normal local NetNet objects,
|
* Turn NetTmp objects into normal local NetNet objects,
|
||||||
* and add the nodangle functor to clean up the local
|
* and add the nodangle functor to clean up the local
|
||||||
|
|
|
||||||
28
t-xnf.cc
28
t-xnf.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: t-xnf.cc,v 1.17 1999/11/17 18:52:09 steve Exp $"
|
#ident "$Id: t-xnf.cc,v 1.18 1999/11/19 03:02:25 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XNF BACKEND
|
/* XNF BACKEND
|
||||||
|
|
@ -149,6 +149,12 @@ string target_xnf::choose_sig_name(const NetObj::Link*lnk)
|
||||||
if ((cursig->pin_count() == 1) && (sig->pin_count() > 1))
|
if ((cursig->pin_count() == 1) && (sig->pin_count() > 1))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if ((cursig->pin_count() > 1) && (sig->pin_count() == 1)) {
|
||||||
|
sig = cursig;
|
||||||
|
pin = cur->get_pin();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (cursig->local_flag() && !sig->local_flag())
|
if (cursig->local_flag() && !sig->local_flag())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -219,8 +225,11 @@ void target_xnf::draw_sym_with_lcaname(ostream&os, string lca,
|
||||||
os << "SYM, " << mangle(net->name()) << ", " << lcaname
|
os << "SYM, " << mangle(net->name()) << ", " << lcaname
|
||||||
<< ", LIBVER=2.0.0" << endl;
|
<< ", LIBVER=2.0.0" << endl;
|
||||||
|
|
||||||
for (idx = 0 ; idx < net->pin_count() ; idx += 1)
|
for (idx = 0 ; idx < net->pin_count() ; idx += 1) {
|
||||||
draw_pin(os, scrape_pin_name(lca), net->pin(idx));
|
string usename = scrape_pin_name(lca);
|
||||||
|
if (usename == "") continue;
|
||||||
|
draw_pin(os, usename, net->pin(idx));
|
||||||
|
}
|
||||||
|
|
||||||
os << "END" << endl;
|
os << "END" << endl;
|
||||||
}
|
}
|
||||||
|
|
@ -481,7 +490,13 @@ void target_xnf::lpm_ff(ostream&os, const NetFF*net)
|
||||||
|
|
||||||
// XXXX For now, only support DFF
|
// XXXX For now, only support DFF
|
||||||
assert(type == "DFF");
|
assert(type == "DFF");
|
||||||
// XXXX For now, I do not now how to deal with XNF-LCA attributes.
|
|
||||||
|
string lcaname = net->attribute("XNF-LCA");
|
||||||
|
if (lcaname != "") {
|
||||||
|
draw_sym_with_lcaname(os, lcaname, net);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
assert(net->attribute("XNF-LCA") == "");
|
assert(net->attribute("XNF-LCA") == "");
|
||||||
|
|
||||||
for (unsigned idx = 0 ; idx < net->width() ; idx += 1) {
|
for (unsigned idx = 0 ; idx < net->width() ; idx += 1) {
|
||||||
|
|
@ -638,6 +653,11 @@ extern const struct target tgt_xnf = { "xnf", &target_xnf_obj };
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: t-xnf.cc,v $
|
* $Log: t-xnf.cc,v $
|
||||||
|
* Revision 1.18 1999/11/19 03:02:25 steve
|
||||||
|
* Detect flip-flops connected to opads and turn
|
||||||
|
* them into OUTFF devices. Inprove support for
|
||||||
|
* the XNF-LCA attribute in the process.
|
||||||
|
*
|
||||||
* Revision 1.17 1999/11/17 18:52:09 steve
|
* Revision 1.17 1999/11/17 18:52:09 steve
|
||||||
* Add algorithm for choosing nexus name from attached signals.
|
* Add algorithm for choosing nexus name from attached signals.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
74
xnfio.cc
74
xnfio.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: xnfio.cc,v 1.6 1999/11/18 02:58:37 steve Exp $"
|
#ident "$Id: xnfio.cc,v 1.7 1999/11/19 03:02:25 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "functor.h"
|
# include "functor.h"
|
||||||
|
|
@ -49,7 +49,7 @@ static bool is_a_pad(const NetNet*net)
|
||||||
* really lame to not do the obvious optimization.
|
* really lame to not do the obvious optimization.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void make_obuf(Design*des, NetNet*net)
|
static NetLogic* make_obuf(Design*des, NetNet*net)
|
||||||
{
|
{
|
||||||
assert(net->pin_count() == 1);
|
assert(net->pin_count() == 1);
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@ static void make_obuf(Design*des, NetNet*net)
|
||||||
if (count_outputs(net->pin(0)) <= 0) {
|
if (count_outputs(net->pin(0)) <= 0) {
|
||||||
cerr << net->get_line() << ":warning: No outputs to OPAD: "
|
cerr << net->get_line() << ":warning: No outputs to OPAD: "
|
||||||
<< net->name() << endl;
|
<< net->name() << endl;
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(count_outputs(net->pin(0)) > 0);
|
assert(count_outputs(net->pin(0)) > 0);
|
||||||
|
|
@ -79,7 +79,7 @@ static void make_obuf(Design*des, NetNet*net)
|
||||||
&& (count_outputs(tmp->pin(0)) == 1)
|
&& (count_outputs(tmp->pin(0)) == 1)
|
||||||
&& (idx->get_pin() == 0) ) {
|
&& (idx->get_pin() == 0) ) {
|
||||||
tmp->attribute("XNF-LCA", "OBUF:O,I");
|
tmp->attribute("XNF-LCA", "OBUF:O,I");
|
||||||
return;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to use an existing INV as an OBUF. Certain
|
// Try to use an existing INV as an OBUF. Certain
|
||||||
|
|
@ -92,7 +92,7 @@ static void make_obuf(Design*des, NetNet*net)
|
||||||
&& (count_outputs(tmp->pin(0)) == 1)
|
&& (count_outputs(tmp->pin(0)) == 1)
|
||||||
&& (idx->get_pin() == 0) ) {
|
&& (idx->get_pin() == 0) ) {
|
||||||
tmp->attribute("XNF-LCA", "OBUF:O,~I");
|
tmp->attribute("XNF-LCA", "OBUF:O,~I");
|
||||||
return;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to use an existing bufif1 as an OBUFT. Of course
|
// Try to use an existing bufif1 as an OBUFT. Of course
|
||||||
|
|
@ -104,7 +104,7 @@ static void make_obuf(Design*des, NetNet*net)
|
||||||
&& (count_outputs(tmp->pin(0)) == 1)
|
&& (count_outputs(tmp->pin(0)) == 1)
|
||||||
&& (idx->get_pin() == 0) ) {
|
&& (idx->get_pin() == 0) ) {
|
||||||
tmp->attribute("XNF-LCA", "OBUFT:O,I,~T");
|
tmp->attribute("XNF-LCA", "OBUFT:O,I,~T");
|
||||||
return;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((tmp->type() == NetLogic::BUFIF0)
|
if ((tmp->type() == NetLogic::BUFIF0)
|
||||||
|
|
@ -112,7 +112,7 @@ static void make_obuf(Design*des, NetNet*net)
|
||||||
&& (count_outputs(tmp->pin(0)) == 1)
|
&& (count_outputs(tmp->pin(0)) == 1)
|
||||||
&& (idx->get_pin() == 0) ) {
|
&& (idx->get_pin() == 0) ) {
|
||||||
tmp->attribute("XNF-LCA", "OBUFT:O,I,T");
|
tmp->attribute("XNF-LCA", "OBUFT:O,I,T");
|
||||||
return;
|
return tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,9 +136,53 @@ static void make_obuf(Design*des, NetNet*net)
|
||||||
// this case and create a new signal.
|
// this case and create a new signal.
|
||||||
if (count_signals(buf->pin(1)) == 0) {
|
if (count_signals(buf->pin(1)) == 0) {
|
||||||
NetNet*tmp = new NetNet(des->local_symbol("$"), NetNet::WIRE);
|
NetNet*tmp = new NetNet(des->local_symbol("$"), NetNet::WIRE);
|
||||||
|
tmp->local_flag(true);
|
||||||
connect(buf->pin(1), tmp->pin(0));
|
connect(buf->pin(1), tmp->pin(0));
|
||||||
des->add_signal(tmp);
|
des->add_signal(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void absorb_OFF(Design*des, NetLogic*buf)
|
||||||
|
{
|
||||||
|
/* If the nexus connects is not a simple point-to-point link,
|
||||||
|
then I can't drag it into the IOB. Give up. */
|
||||||
|
if (count_outputs(buf->pin(1)) != 1)
|
||||||
|
return;
|
||||||
|
if (count_inputs(buf->pin(1)) != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
NetObj::Link*drv = find_next_output(&buf->pin(1));
|
||||||
|
assert(drv);
|
||||||
|
|
||||||
|
NetFF*ff = dynamic_cast<NetFF*>(drv->get_obj());
|
||||||
|
if (ff == 0)
|
||||||
|
return;
|
||||||
|
if (ff->width() != 1)
|
||||||
|
return;
|
||||||
|
if (ff->attribute("LPM_FFType") != "DFF")
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Connect the flip-flop output to the buffer output and
|
||||||
|
delete the buffer. The XNF OUTFF can buffer the pin. */
|
||||||
|
connect(ff->pin_Q(0), buf->pin(0));
|
||||||
|
delete buf;
|
||||||
|
|
||||||
|
/* Finally, build up an XNF-LCA value that defines this
|
||||||
|
devices as an OUTFF and gives each pin an XNF name. */
|
||||||
|
char**names = new char*[ff->pin_count()];
|
||||||
|
for (unsigned idx = 0 ; idx < ff->pin_count() ; idx += 1)
|
||||||
|
names[idx] = "";
|
||||||
|
|
||||||
|
names[ff->pin_Clock().get_pin()] = "C";
|
||||||
|
names[ff->pin_Data(0).get_pin()] = "D";
|
||||||
|
names[ff->pin_Q(0).get_pin()] = "Q";
|
||||||
|
string lname = string("OUTFF:") + names[0];
|
||||||
|
for (unsigned idx = 1 ; idx < ff->pin_count() ; idx += 1)
|
||||||
|
lname = lname + "," + names[idx];
|
||||||
|
delete[]names;
|
||||||
|
ff->attribute("XNF-LCA", lname);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void make_ibuf(Design*des, NetNet*net)
|
static void make_ibuf(Design*des, NetNet*net)
|
||||||
|
|
@ -192,6 +236,7 @@ static void make_ibuf(Design*des, NetNet*net)
|
||||||
|
|
||||||
void xnfio_f::signal(Design*des, NetNet*net)
|
void xnfio_f::signal(Design*des, NetNet*net)
|
||||||
{
|
{
|
||||||
|
NetNode*buf;
|
||||||
if (! is_a_pad(net))
|
if (! is_a_pad(net))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -204,9 +249,13 @@ void xnfio_f::signal(Design*des, NetNet*net)
|
||||||
make_ibuf(des, net);
|
make_ibuf(des, net);
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
case 'O':
|
case 'O': {
|
||||||
make_obuf(des, net);
|
NetLogic*buf = make_obuf(des, net);
|
||||||
break;
|
if (buf == 0) break;
|
||||||
|
absorb_OFF(des, buf);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: Only IPAD and OPAD supported. Need to
|
// FIXME: Only IPAD and OPAD supported. Need to
|
||||||
// add support for IOPAD.
|
// add support for IOPAD.
|
||||||
default:
|
default:
|
||||||
|
|
@ -223,6 +272,11 @@ void xnfio(Design*des)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: xnfio.cc,v $
|
* $Log: xnfio.cc,v $
|
||||||
|
* Revision 1.7 1999/11/19 03:02:25 steve
|
||||||
|
* Detect flip-flops connected to opads and turn
|
||||||
|
* them into OUTFF devices. Inprove support for
|
||||||
|
* the XNF-LCA attribute in the process.
|
||||||
|
*
|
||||||
* Revision 1.6 1999/11/18 02:58:37 steve
|
* Revision 1.6 1999/11/18 02:58:37 steve
|
||||||
* Handle (with a warning) unconnected opads.
|
* Handle (with a warning) unconnected opads.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue