1998-11-04 00:28:49 +01:00
|
|
|
/*
|
2000-02-23 03:56:53 +01:00
|
|
|
* Copyright (c) 1998-2000 Stephen Williams (steve@icarus.com)
|
1998-11-04 00:28:49 +01:00
|
|
|
*
|
|
|
|
|
* This source code is free software; you can redistribute it
|
|
|
|
|
* and/or modify it in source code form under the terms of the GNU
|
|
|
|
|
* General Public License as published by the Free Software
|
|
|
|
|
* Foundation; either version 2 of the License, or (at your option)
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
|
|
|
*/
|
2000-02-23 03:56:53 +01:00
|
|
|
#if !defined(WINNT) && !defined(macintosh)
|
2000-12-10 07:41:59 +01:00
|
|
|
#ident "$Id: design_dump.cc,v 1.106 2000/12/10 06:41:59 steve Exp $"
|
1998-11-04 00:28:49 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This file contains all the dump methods of the netlist classes.
|
|
|
|
|
*/
|
|
|
|
|
# include <typeinfo>
|
|
|
|
|
# include <iostream>
|
|
|
|
|
# include <iomanip>
|
|
|
|
|
# include "netlist.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static ostream& operator<< (ostream&o, NetBlock::Type t)
|
|
|
|
|
{
|
|
|
|
|
switch (t) {
|
|
|
|
|
case NetBlock::SEQU:
|
|
|
|
|
o << "begin";
|
|
|
|
|
break;
|
|
|
|
|
case NetBlock::PARA:
|
|
|
|
|
o << "fork";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return o;
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-07 06:37:55 +02:00
|
|
|
ostream& operator << (ostream&o, Link::strength_t str)
|
|
|
|
|
{
|
|
|
|
|
switch (str) {
|
|
|
|
|
case Link::HIGHZ:
|
|
|
|
|
o << "highz";
|
|
|
|
|
break;
|
|
|
|
|
case Link::WEAK:
|
|
|
|
|
o << "weak";
|
|
|
|
|
break;
|
|
|
|
|
case Link::PULL:
|
|
|
|
|
o << "pull";
|
|
|
|
|
break;
|
|
|
|
|
case Link::STRONG:
|
|
|
|
|
o << "strong";
|
|
|
|
|
break;
|
|
|
|
|
case Link::SUPPLY:
|
|
|
|
|
o << "supply";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
assert(0);
|
|
|
|
|
}
|
|
|
|
|
return o;
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
/* Dump a net. This can be a wire or register. */
|
|
|
|
|
void NetNet::dump_net(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << type() << ": " << name() << "[" <<
|
|
|
|
|
pin_count() << "]";
|
|
|
|
|
if (local_flag_)
|
|
|
|
|
o << " (local)";
|
2000-04-28 23:00:28 +02:00
|
|
|
o << " (eref=" << get_eref() << ")";
|
2000-10-07 01:46:50 +02:00
|
|
|
if (scope())
|
|
|
|
|
o << " scope=" << scope()->name();
|
1999-08-01 18:34:50 +02:00
|
|
|
o << " #(" << rise_time() << "," << fall_time() << "," <<
|
|
|
|
|
decay_time() << ") init=";
|
1998-12-20 03:05:41 +01:00
|
|
|
for (unsigned idx = pin_count() ; idx > 0 ; idx -= 1)
|
2000-07-14 08:12:56 +02:00
|
|
|
o << pin(idx-1).get_init();
|
|
|
|
|
|
|
|
|
|
o << " (";
|
|
|
|
|
for (unsigned idx = pin_count() ; idx > 0 ; idx -= 1)
|
|
|
|
|
o << pin(idx-1).nexus()->get_init();
|
|
|
|
|
o << ")" << endl;
|
2000-04-28 23:00:28 +02:00
|
|
|
|
|
|
|
|
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
|
|
|
|
|
if (! pin(idx).is_linked())
|
|
|
|
|
continue;
|
|
|
|
|
|
2000-06-25 21:59:41 +02:00
|
|
|
const Nexus*nex = pin(idx).nexus();
|
|
|
|
|
o << setw(ind+4) << "" << "[" << idx << "]: " << nex
|
|
|
|
|
<< " " << nex->name() << endl;
|
2000-04-28 23:00:28 +02:00
|
|
|
}
|
1998-11-23 01:20:22 +01:00
|
|
|
dump_obj_attr(o, ind+4);
|
1998-11-04 00:28:49 +01:00
|
|
|
}
|
|
|
|
|
|
1999-04-19 03:59:36 +02:00
|
|
|
void NetMemory::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << name_ << "[" << width_ << "] " <<
|
|
|
|
|
"[" << idxh_ << ":" << idxl_ << "]" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
/* Dump a NetNode and its pins. Dump what I know about the netnode on
|
|
|
|
|
the first line, then list all the pins, with the name of the
|
|
|
|
|
connected signal. */
|
|
|
|
|
void NetNode::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "node: ";
|
1999-08-01 18:34:50 +02:00
|
|
|
o << typeid(*this).name() << " #(" << rise_time()
|
|
|
|
|
<< "," << fall_time() << "," << decay_time() << ") " << name()
|
1998-11-04 00:28:49 +01:00
|
|
|
<< endl;
|
|
|
|
|
|
|
|
|
|
dump_node_pins(o, ind+4);
|
1998-11-23 01:20:22 +01:00
|
|
|
dump_obj_attr(o, ind+4);
|
1998-11-04 00:28:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* This is the generic dumping of all the signals connected to each
|
|
|
|
|
pin of the object. The "this" object is not printed, only the
|
|
|
|
|
signals connected to this. */
|
|
|
|
|
void NetObj::dump_node_pins(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
|
1999-10-31 05:11:27 +01:00
|
|
|
o << setw(ind) << "" << idx << " " << pin(idx).get_name()
|
|
|
|
|
<< "<" << pin(idx).get_inst() << ">";
|
|
|
|
|
|
1998-12-02 05:37:13 +01:00
|
|
|
switch (pin(idx).get_dir()) {
|
|
|
|
|
case Link::PASSIVE:
|
|
|
|
|
o << " p";
|
|
|
|
|
break;
|
|
|
|
|
case Link::INPUT:
|
|
|
|
|
o << " I";
|
|
|
|
|
break;
|
|
|
|
|
case Link::OUTPUT:
|
|
|
|
|
o << " O";
|
|
|
|
|
break;
|
|
|
|
|
}
|
2000-05-07 06:37:55 +02:00
|
|
|
|
|
|
|
|
o << " (" << pin(idx).drive0() << "0 "
|
2000-06-25 21:59:41 +02:00
|
|
|
<< pin(idx).drive1() << "1): ";
|
1998-11-04 00:28:49 +01:00
|
|
|
|
2000-06-25 21:59:41 +02:00
|
|
|
if (pin(idx).is_linked()) {
|
|
|
|
|
const Nexus*nex = pin(idx).nexus();
|
|
|
|
|
o << nex << " " << nex->name();
|
1998-11-04 00:28:49 +01:00
|
|
|
}
|
|
|
|
|
o << endl;
|
2000-06-25 21:59:41 +02:00
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-23 01:20:22 +01:00
|
|
|
void NetObj::dump_obj_attr(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
2000-12-04 18:37:03 +01:00
|
|
|
unsigned idx;
|
|
|
|
|
for (idx = 0 ; idx < attributes_.size() ; idx += 1) {
|
|
|
|
|
o << setw(ind) << "" << attributes_.key(idx) << " = \"" <<
|
|
|
|
|
attributes_.value(idx) << "\"" << endl;
|
1998-11-23 01:20:22 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1999-09-03 06:28:38 +02:00
|
|
|
void NetAddSub::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "Adder (NetAddSub): " << name() << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
1999-10-31 21:08:24 +01:00
|
|
|
dump_obj_attr(o, ind+4);
|
1999-09-03 06:28:38 +02:00
|
|
|
}
|
|
|
|
|
|
2000-05-12 01:37:26 +02:00
|
|
|
void NetCAssign::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "Procedural continuous assign (NetCAssign): "
|
|
|
|
|
<< name() << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-14 21:24:28 +01:00
|
|
|
void NetCLShift::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "Combinatorial shift (NetCLShift): " <<
|
|
|
|
|
name() << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-15 00:43:45 +01:00
|
|
|
void NetCompare::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
2000-01-13 04:35:35 +01:00
|
|
|
o << setw(ind) << "" << "LPM_COMPARE (NetCompare): " << name() << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-01 23:40:22 +02:00
|
|
|
void NetDivide::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "NET_DIVIDE (NetDivide): " << name() << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-22 06:20:19 +02:00
|
|
|
void NetForce::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "force " << lval_->name() << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
2000-01-13 04:35:35 +01:00
|
|
|
void NetMult::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "LPM_MULT (NetMult): " << name() << endl;
|
1999-11-15 00:43:45 +01:00
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-04 04:53:26 +01:00
|
|
|
void NetMux::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "Multiplexer (NetMux): " << name() << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-02 22:54:20 +02:00
|
|
|
void NetAssign_::dump_node(ostream&o, unsigned ind) const
|
1998-11-04 00:28:49 +01:00
|
|
|
{
|
2000-09-02 22:54:20 +02:00
|
|
|
o << setw(ind) << "" << "Procedural assign (NetAssign_): " << name();
|
1999-10-07 07:25:33 +02:00
|
|
|
if (bmux())
|
|
|
|
|
o << "[" << *bmux() << "]";
|
2000-09-02 22:54:20 +02:00
|
|
|
o << endl;
|
1999-06-06 22:45:38 +02:00
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
void NetBUFZ::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
2000-10-07 21:45:42 +02:00
|
|
|
o << setw(ind) << "" << "NetBUFZ: " << name()
|
2000-12-10 07:41:59 +01:00
|
|
|
<< " scope=" << (scope()? scope()->name() : "")
|
|
|
|
|
<< " delay=(" << rise_time() << "," << fall_time() << "," <<
|
|
|
|
|
decay_time() << ")" << endl;
|
1998-11-04 00:28:49 +01:00
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
1999-10-10 03:59:54 +02:00
|
|
|
void NetCaseCmp::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "case compare === : " << name() << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-09 19:55:33 +01:00
|
|
|
void NetConst::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
1999-12-17 04:38:46 +01:00
|
|
|
o << setw(ind) << "" << "constant ";
|
|
|
|
|
for (unsigned idx = pin_count() ; idx > 0 ; idx -= 1)
|
|
|
|
|
o << value_[idx-1];
|
|
|
|
|
o << ": " << name() << endl;
|
1998-11-09 19:55:33 +01:00
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-01 03:07:40 +01:00
|
|
|
void NetFF::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
2000-11-11 01:03:36 +01:00
|
|
|
o << setw(ind) << "" << "LPM_FF: " << name()
|
|
|
|
|
<< " scope=" << (scope()? scope()->name() : "") << endl;
|
|
|
|
|
|
1999-11-01 03:07:40 +01:00
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
void NetLogic::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "logic: ";
|
|
|
|
|
switch (type_) {
|
|
|
|
|
case AND:
|
|
|
|
|
o << "and";
|
|
|
|
|
break;
|
1998-12-07 05:53:16 +01:00
|
|
|
case BUF:
|
|
|
|
|
o << "buf";
|
|
|
|
|
break;
|
1999-02-15 03:06:15 +01:00
|
|
|
case BUFIF0:
|
|
|
|
|
o << "bufif0";
|
|
|
|
|
break;
|
|
|
|
|
case BUFIF1:
|
|
|
|
|
o << "bufif1";
|
|
|
|
|
break;
|
1998-11-04 00:28:49 +01:00
|
|
|
case NAND:
|
|
|
|
|
o << "nand";
|
|
|
|
|
break;
|
2000-11-11 02:52:09 +01:00
|
|
|
case NMOS:
|
|
|
|
|
o << "nmos";
|
|
|
|
|
break;
|
1998-11-04 00:28:49 +01:00
|
|
|
case NOR:
|
|
|
|
|
o << "nor";
|
|
|
|
|
break;
|
|
|
|
|
case NOT:
|
|
|
|
|
o << "not";
|
|
|
|
|
break;
|
2000-11-11 02:52:09 +01:00
|
|
|
case NOTIF0:
|
|
|
|
|
o << "notif0";
|
|
|
|
|
break;
|
|
|
|
|
case NOTIF1:
|
|
|
|
|
o << "notif1";
|
|
|
|
|
break;
|
1998-11-04 00:28:49 +01:00
|
|
|
case OR:
|
|
|
|
|
o << "or";
|
|
|
|
|
break;
|
2000-11-11 02:52:09 +01:00
|
|
|
case RNMOS:
|
|
|
|
|
o << "rnmos";
|
|
|
|
|
break;
|
|
|
|
|
case RPMOS:
|
|
|
|
|
o << "rpmos";
|
|
|
|
|
break;
|
|
|
|
|
case PMOS:
|
|
|
|
|
o << "pmos";
|
|
|
|
|
break;
|
1998-11-09 19:55:33 +01:00
|
|
|
case XNOR:
|
|
|
|
|
o << "xnor";
|
|
|
|
|
break;
|
1998-11-04 00:28:49 +01:00
|
|
|
case XOR:
|
|
|
|
|
o << "xor";
|
|
|
|
|
break;
|
|
|
|
|
}
|
1999-08-01 18:34:50 +02:00
|
|
|
o << " #(" << rise_time()
|
|
|
|
|
<< "," << fall_time() << "," << decay_time() << ") " << name()
|
2000-10-07 21:45:42 +02:00
|
|
|
<< " scope=" << (scope()? scope()->name() : "")
|
1998-11-04 00:28:49 +01:00
|
|
|
<< endl;
|
|
|
|
|
|
|
|
|
|
dump_node_pins(o, ind+4);
|
1998-12-01 01:42:13 +01:00
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-17 23:26:15 +02:00
|
|
|
void NetModulo::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "NET_MODULO (NetModulo): " << name() << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-21 01:13:08 +01:00
|
|
|
void NetRamDq::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "LPM_RAM_DQ (" << mem_->name() << "): "
|
|
|
|
|
<< name() << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-03 04:12:51 +02:00
|
|
|
void NetTaskDef::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "task " << name_ << ";" << endl;
|
1999-07-24 04:11:19 +02:00
|
|
|
|
|
|
|
|
for (unsigned idx = 0 ; idx < ports_.count() ; idx += 1) {
|
|
|
|
|
o << setw(ind+4) << "";
|
|
|
|
|
switch (ports_[idx]->port_type()) {
|
|
|
|
|
case NetNet::PINPUT:
|
|
|
|
|
o << "input ";
|
|
|
|
|
break;
|
|
|
|
|
case NetNet::POUTPUT:
|
|
|
|
|
o << "output ";
|
|
|
|
|
break;
|
|
|
|
|
case NetNet::PINOUT:
|
|
|
|
|
o << "input ";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
o << "NOT_A_PORT ";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
o << ports_[idx]->name() << ";" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-03 04:12:51 +02:00
|
|
|
proc_->dump(o, ind+4);
|
1999-07-24 04:11:19 +02:00
|
|
|
|
1999-07-03 04:12:51 +02:00
|
|
|
o << setw(ind) << "" << "endtask" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
1998-12-14 03:01:34 +01:00
|
|
|
void NetUDP::dump_sequ_(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
string tmp = "";
|
|
|
|
|
for (unsigned idx = 0 ; idx < ind ; idx += 1)
|
|
|
|
|
tmp += " ";
|
|
|
|
|
|
1999-08-01 18:34:50 +02:00
|
|
|
o << tmp << "Sequential UDP" << " #(" << rise_time() <<
|
|
|
|
|
"," << fall_time() << "," << decay_time() << ") " << name() <<
|
1998-12-14 03:01:34 +01:00
|
|
|
endl;
|
|
|
|
|
|
|
|
|
|
for (FSM_::const_iterator ent = fsm_.begin()
|
|
|
|
|
; ent != fsm_.end() ; ent++) {
|
|
|
|
|
o << setw(ind+6) << "" << (*ent).first << " -->";
|
|
|
|
|
|
|
|
|
|
state_t_*st = (*ent).second;
|
|
|
|
|
assert((*ent).first[0] == st->out);
|
|
|
|
|
for (unsigned idx = 1 ; idx < pin_count() ; idx += 1) {
|
|
|
|
|
string tmp = (*ent).first;
|
|
|
|
|
if (st->pins[idx].zer) {
|
|
|
|
|
tmp[0] = st->pins[idx].zer->out;
|
|
|
|
|
tmp[idx] = '0';
|
|
|
|
|
o << " " << tmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (st->pins[idx].one) {
|
|
|
|
|
tmp[0] = st->pins[idx].one->out;
|
|
|
|
|
tmp[idx] = '1';
|
|
|
|
|
o << " " << tmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (st->pins[idx].xxx) {
|
|
|
|
|
tmp[0] = st->pins[idx].xxx->out;
|
|
|
|
|
tmp[idx] = 'x';
|
|
|
|
|
o << " " << tmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
o << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
o << setw(ind+6) << "" << "initial value == " << init_ << endl;
|
|
|
|
|
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NetUDP::dump_comb_(ostream&o, unsigned ind) const
|
1998-12-01 01:42:13 +01:00
|
|
|
{
|
2000-03-29 06:37:10 +02:00
|
|
|
assert(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NetUDP::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
2000-11-04 07:36:24 +01:00
|
|
|
if (is_sequential())
|
2000-03-29 06:37:10 +02:00
|
|
|
dump_sequ_(o, ind);
|
|
|
|
|
else
|
|
|
|
|
dump_comb_(o, ind);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NetUDP_COMB::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "Combinational primitive: ";
|
1999-08-01 18:34:50 +02:00
|
|
|
o << " #(" << rise_time() << "," << fall_time() << "," << decay_time() <<
|
1998-12-01 01:42:13 +01:00
|
|
|
") " << name() << endl;
|
|
|
|
|
|
2000-03-29 06:37:10 +02:00
|
|
|
for (map<string,char>::const_iterator ent = cm_.begin()
|
1999-11-04 02:12:41 +01:00
|
|
|
; ent != cm_.end() ; ent++) {
|
|
|
|
|
o << setw(ind+6) << "" << (*ent).first << " --> " <<
|
|
|
|
|
(*ent).second << endl;
|
|
|
|
|
}
|
|
|
|
|
|
1998-12-01 01:42:13 +01:00
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
1998-11-04 00:28:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NetProcTop::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
switch (type_) {
|
|
|
|
|
case NetProcTop::KINITIAL:
|
2000-10-28 02:51:41 +02:00
|
|
|
o << "initial /* " << get_line() << " in "
|
|
|
|
|
<< scope_->name() << " */" << endl;
|
1998-11-04 00:28:49 +01:00
|
|
|
break;
|
|
|
|
|
case NetProcTop::KALWAYS:
|
2000-10-28 02:51:41 +02:00
|
|
|
o << "always /* " << get_line() << " in "
|
|
|
|
|
<< scope_->name() << " */" << endl;
|
1998-11-04 00:28:49 +01:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
statement_->dump(o, ind+2);
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-10 04:18:16 +02:00
|
|
|
void NetAssignBase::dump_lval(ostream&o) const
|
|
|
|
|
{
|
|
|
|
|
o << "" << "{" << lval_->name();
|
|
|
|
|
if (lval_->bmux())
|
|
|
|
|
o << "[" << *lval_->bmux() << "]";
|
|
|
|
|
|
|
|
|
|
for (NetAssign_*cur = lval_->more ; cur ; cur = cur->more) {
|
|
|
|
|
o << ", " << cur->name();
|
|
|
|
|
if (cur->bmux())
|
|
|
|
|
o << "[" << *cur->bmux() << "]";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
o << "}";
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
/* Dump an assignment statement */
|
|
|
|
|
void NetAssign::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
1998-11-23 01:20:22 +01:00
|
|
|
o << setw(ind) << "";
|
2000-09-10 04:18:16 +02:00
|
|
|
dump_lval(o);
|
1998-11-23 01:20:22 +01:00
|
|
|
|
2000-09-10 04:18:16 +02:00
|
|
|
o << " = ";
|
|
|
|
|
if (l_val(0)->rise_time())
|
|
|
|
|
o << "#" << l_val(0)->rise_time() << " ";
|
|
|
|
|
o << *rval() << ";" << endl;
|
1998-11-04 00:28:49 +01:00
|
|
|
}
|
|
|
|
|
|
1999-06-06 22:45:38 +02:00
|
|
|
void NetAssignNB::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "";
|
2000-09-10 04:18:16 +02:00
|
|
|
dump_lval(o);
|
1999-06-06 22:45:38 +02:00
|
|
|
|
2000-09-10 04:18:16 +02:00
|
|
|
o << " <= ";
|
|
|
|
|
if (l_val(0)->rise_time())
|
|
|
|
|
o << "#" << l_val(0)->rise_time() << " ";
|
|
|
|
|
o << *rval() << ";" << endl;
|
1999-06-06 22:45:38 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-10 02:16:57 +02:00
|
|
|
void NetAssignMem::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "";
|
|
|
|
|
o << "/* " << get_line() << " */" << endl;
|
|
|
|
|
o << setw(ind) << "";
|
2000-06-13 05:24:48 +02:00
|
|
|
o << memory()->name() << "[" << *index() << "] = ";
|
1999-09-15 03:55:06 +02:00
|
|
|
rval()->dump(o);
|
|
|
|
|
o << ";" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NetAssignMemNB::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "";
|
|
|
|
|
o << "/* " << get_line() << " */" << endl;
|
|
|
|
|
o << setw(ind) << "";
|
2000-06-13 05:24:48 +02:00
|
|
|
o << memory()->name() << "[" << *index() << "] <= ";
|
1999-09-15 03:55:06 +02:00
|
|
|
rval()->dump(o);
|
1999-05-10 02:16:57 +02:00
|
|
|
o << ";" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
/* Dump a block statement */
|
|
|
|
|
void NetBlock::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << type_ << endl;
|
|
|
|
|
|
|
|
|
|
if (last_) {
|
|
|
|
|
const NetProc*cur = last_;
|
|
|
|
|
do {
|
|
|
|
|
cur = cur->next_;
|
|
|
|
|
cur->dump(o, ind+4);
|
|
|
|
|
} while (cur != last_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
o << setw(ind) << "" << "end" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
1999-02-03 05:20:11 +01:00
|
|
|
void NetCase::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
1999-09-29 20:36:02 +02:00
|
|
|
switch (type_) {
|
|
|
|
|
case EQ:
|
|
|
|
|
o << setw(ind) << "" << "case (" << *expr_ << ")" << endl;
|
1999-10-08 04:00:35 +02:00
|
|
|
break;
|
1999-09-29 20:36:02 +02:00
|
|
|
case EQX:
|
|
|
|
|
o << setw(ind) << "" << "casex (" << *expr_ << ")" << endl;
|
1999-10-08 04:00:35 +02:00
|
|
|
break;
|
1999-09-29 20:36:02 +02:00
|
|
|
case EQZ:
|
|
|
|
|
o << setw(ind) << "" << "casez (" << *expr_ << ")" << endl;
|
1999-10-08 04:00:35 +02:00
|
|
|
break;
|
1999-09-29 20:36:02 +02:00
|
|
|
}
|
1999-02-03 05:20:11 +01:00
|
|
|
|
|
|
|
|
for (unsigned idx = 0 ; idx < nitems_ ; idx += 1) {
|
|
|
|
|
o << setw(ind+2) << "";
|
1999-05-30 03:11:46 +02:00
|
|
|
if (items_[idx].guard)
|
|
|
|
|
o << *items_[idx].guard << ":";
|
1999-02-03 05:20:11 +01:00
|
|
|
else
|
|
|
|
|
o << "default:";
|
|
|
|
|
|
|
|
|
|
if (items_[idx].statement) {
|
|
|
|
|
o << endl;
|
|
|
|
|
items_[idx].statement->dump(o, ind+6);
|
|
|
|
|
} else {
|
|
|
|
|
o << " ;" << endl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
o << setw(ind) << "" << "endcase" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-12 01:37:26 +02:00
|
|
|
void NetCAssign::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "cassign " << lval_->name() << " = "
|
|
|
|
|
<< name() << ";" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-07 18:05:05 +01:00
|
|
|
void NetCondit::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "if (";
|
|
|
|
|
expr_->dump(o);
|
|
|
|
|
o << ")" << endl;
|
1999-02-15 03:06:15 +01:00
|
|
|
|
|
|
|
|
if (if_) if_->dump(o, ind+4);
|
|
|
|
|
else o << setw(ind+4) << "" << "/* empty */ ;" << endl;
|
|
|
|
|
|
1998-11-07 18:05:05 +01:00
|
|
|
if (else_) {
|
|
|
|
|
o << setw(ind) << "" << "else" << endl;
|
|
|
|
|
else_->dump(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-12 01:37:26 +02:00
|
|
|
void NetDeassign::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "deassign " << lval_->name() << "; "
|
|
|
|
|
<< "/* " << get_line() << " */" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
2000-07-27 07:13:44 +02:00
|
|
|
void NetDisable::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "disable " << target_->name() << "; "
|
|
|
|
|
<< "/* " << get_line() << " */" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-10 07:26:05 +02:00
|
|
|
void NetEvProbe::dump_node(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "";
|
|
|
|
|
|
|
|
|
|
switch (edge_) {
|
|
|
|
|
case ANYEDGE:
|
|
|
|
|
o << "anyedge ";
|
|
|
|
|
break;
|
|
|
|
|
case POSEDGE:
|
|
|
|
|
o << "posedge ";
|
|
|
|
|
break;
|
|
|
|
|
case NEGEDGE:
|
|
|
|
|
o << "negedge ";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
o << setw(ind) << "" << "-> " << event_->full_name() << "; " << endl;
|
|
|
|
|
dump_node_pins(o, ind+4);
|
|
|
|
|
dump_obj_attr(o, ind+4);
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-04 05:20:15 +02:00
|
|
|
void NetEvTrig::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "-> " << event_->name() << "; "
|
|
|
|
|
<< "// " << get_line() << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NetEvWait::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
2000-04-12 06:23:57 +02:00
|
|
|
assert(nevents() > 0);
|
2000-07-29 05:55:38 +02:00
|
|
|
o << setw(ind) <<"" << "@(" << event(0)->full_name();
|
2000-04-12 06:23:57 +02:00
|
|
|
|
|
|
|
|
for (unsigned idx = 1 ; idx < nevents() ; idx += 1)
|
2000-07-29 05:55:38 +02:00
|
|
|
o << " or " << event(idx)->full_name();
|
2000-04-12 06:23:57 +02:00
|
|
|
|
|
|
|
|
o << ") // " << get_line() << endl;
|
|
|
|
|
|
2000-04-04 05:20:15 +02:00
|
|
|
if (statement_)
|
|
|
|
|
statement_->dump(o, ind+2);
|
|
|
|
|
else
|
|
|
|
|
o << setw(ind+2) << "" << "/* noop */ ;" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-22 06:20:19 +02:00
|
|
|
void NetForce::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "force " << lval_->name() << " = "
|
|
|
|
|
<< name() << ";" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
1999-06-19 23:06:16 +02:00
|
|
|
void NetForever::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "forever" << endl;
|
|
|
|
|
statement_->dump(o, ind+2);
|
|
|
|
|
}
|
|
|
|
|
|
1999-08-26 00:22:41 +02:00
|
|
|
void NetFuncDef::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
2000-03-08 05:36:53 +01:00
|
|
|
o << setw(ind) << "" << "function " << scope_->name() << endl;
|
1999-09-01 22:46:19 +02:00
|
|
|
if (statement_)
|
|
|
|
|
statement_->dump(o, ind+2);
|
|
|
|
|
else
|
|
|
|
|
o << setw(ind+2) << "" << "// NO STATEMENT" << endl;
|
1999-08-26 00:22:41 +02:00
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
void NetPDelay::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
2000-07-07 06:53:53 +02:00
|
|
|
if (expr_) {
|
|
|
|
|
o << setw(ind) << "" << "#" << *expr_;
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
o << setw(ind) << "" << "#" << delay_;
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-05 05:04:46 +02:00
|
|
|
if (statement_) {
|
|
|
|
|
o << endl;
|
|
|
|
|
statement_->dump(o, ind+2);
|
|
|
|
|
} else {
|
|
|
|
|
o << " /* noop */;" << endl;
|
|
|
|
|
}
|
1998-11-04 00:28:49 +01:00
|
|
|
}
|
|
|
|
|
|
2000-04-23 05:45:24 +02:00
|
|
|
void NetRelease::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "release " << lval_->name() << "; "
|
|
|
|
|
<< "/* " << get_line() << " */" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-03 04:12:51 +02:00
|
|
|
void NetRepeat::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "repeat (" << *expr_ << ")" << endl;
|
|
|
|
|
statement_->dump(o, ind+2);
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-24 05:01:58 +01:00
|
|
|
void NetScope::dump(ostream&o) const
|
|
|
|
|
{
|
2000-01-10 02:35:23 +01:00
|
|
|
o << name();
|
1999-11-27 20:07:57 +01:00
|
|
|
switch (type_) {
|
|
|
|
|
case BEGIN_END:
|
|
|
|
|
o << " sequential block";
|
|
|
|
|
break;
|
|
|
|
|
case FORK_JOIN:
|
|
|
|
|
o << " parallel block";
|
|
|
|
|
break;
|
2000-03-08 05:36:53 +01:00
|
|
|
case FUNC:
|
|
|
|
|
o << " function";
|
|
|
|
|
break;
|
1999-11-27 20:07:57 +01:00
|
|
|
case MODULE:
|
|
|
|
|
o << " module";
|
|
|
|
|
break;
|
2000-03-08 05:36:53 +01:00
|
|
|
case TASK:
|
|
|
|
|
o << " task";
|
|
|
|
|
break;
|
1999-11-27 20:07:57 +01:00
|
|
|
}
|
|
|
|
|
o << endl;
|
2000-03-08 05:36:53 +01:00
|
|
|
|
2000-07-23 00:09:03 +02:00
|
|
|
o << " timescale = 10e" << time_unit() << " / 10e"
|
|
|
|
|
<< time_precision() << endl;
|
|
|
|
|
|
2000-03-08 05:36:53 +01:00
|
|
|
/* Dump the parameters for this scope. */
|
|
|
|
|
{
|
|
|
|
|
map<string,NetExpr*>::const_iterator pp;
|
|
|
|
|
for (pp = parameters_.begin()
|
|
|
|
|
; pp != parameters_.end() ; pp ++) {
|
|
|
|
|
o << " parameter " << (*pp).first << " = " <<
|
|
|
|
|
*(*pp).second << ";" << endl;
|
|
|
|
|
}
|
2000-03-12 18:09:40 +01:00
|
|
|
|
|
|
|
|
for (pp = localparams_.begin()
|
|
|
|
|
; pp != localparams_.end() ; pp ++) {
|
|
|
|
|
o << " localparam " << (*pp).first << " = " <<
|
|
|
|
|
*(*pp).second << ";" << endl;
|
|
|
|
|
}
|
2000-03-08 05:36:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Dump the saved defparam assignments here. */
|
|
|
|
|
{
|
|
|
|
|
map<string,NetExpr*>::const_iterator pp;
|
|
|
|
|
for (pp = defparams.begin()
|
|
|
|
|
; pp != defparams.end() ; pp ++ ) {
|
|
|
|
|
o << " defparam " << (*pp).first << " = " <<
|
|
|
|
|
*(*pp).second << ";" << endl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-04 05:20:15 +02:00
|
|
|
/* Dump the events in this scope. */
|
|
|
|
|
for (NetEvent*cur = events_ ; cur ; cur = cur->snext_) {
|
2000-07-29 05:55:38 +02:00
|
|
|
o << " event " << cur->name() << "; nprobe="
|
|
|
|
|
<< cur->nprobe() << " // " << cur->get_line() << endl;
|
2000-04-04 05:20:15 +02:00
|
|
|
}
|
|
|
|
|
|
2000-05-02 02:58:11 +02:00
|
|
|
// Dump the signals,
|
|
|
|
|
if (signals_) {
|
|
|
|
|
NetNet*cur = signals_->sig_next_;
|
|
|
|
|
do {
|
|
|
|
|
cur->dump_net(o, 4);
|
|
|
|
|
cur = cur->sig_next_;
|
|
|
|
|
} while (cur != signals_->sig_next_);
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-02 05:13:30 +02:00
|
|
|
// Dump the memories,
|
|
|
|
|
if (memories_) {
|
|
|
|
|
NetMemory*cur = memories_->snext_;
|
|
|
|
|
do {
|
|
|
|
|
cur->dump(o, 4);
|
|
|
|
|
cur = cur->snext_;
|
|
|
|
|
} while (cur != memories_->snext_);
|
|
|
|
|
}
|
|
|
|
|
|
2000-07-30 20:25:43 +02:00
|
|
|
switch (type_) {
|
|
|
|
|
case FUNC:
|
|
|
|
|
func_def()->dump(o, 4);
|
|
|
|
|
break;
|
|
|
|
|
case TASK:
|
|
|
|
|
task_def()->dump(o, 4);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2000-03-08 05:36:53 +01:00
|
|
|
/* Dump any sub-scopes. */
|
|
|
|
|
for (NetScope*cur = sub_ ; cur ; cur = cur->sib_)
|
|
|
|
|
cur->dump(o);
|
1999-11-24 05:01:58 +01:00
|
|
|
}
|
|
|
|
|
|
1999-07-03 04:12:51 +02:00
|
|
|
void NetSTask::dump(ostream&o, unsigned ind) const
|
1998-11-04 00:28:49 +01:00
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << name_;
|
|
|
|
|
|
1999-07-03 04:12:51 +02:00
|
|
|
if (parms_.count() > 0) {
|
1998-11-04 00:28:49 +01:00
|
|
|
o << "(";
|
1999-05-30 03:11:46 +02:00
|
|
|
if (parms_[0])
|
1998-11-04 00:28:49 +01:00
|
|
|
parms_[0]->dump(o);
|
|
|
|
|
|
1999-07-03 04:12:51 +02:00
|
|
|
for (unsigned idx = 1 ; idx < parms_.count() ; idx += 1) {
|
1998-11-04 00:28:49 +01:00
|
|
|
o << ", ";
|
1999-05-30 03:11:46 +02:00
|
|
|
if (parms_[idx])
|
1998-11-04 00:28:49 +01:00
|
|
|
parms_[idx]->dump(o);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
o << ")";
|
|
|
|
|
}
|
|
|
|
|
o << ";" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-03 04:12:51 +02:00
|
|
|
void NetUTask::dump(ostream&o, unsigned ind) const
|
1999-06-19 23:06:16 +02:00
|
|
|
{
|
1999-07-24 04:11:19 +02:00
|
|
|
o << setw(ind) << "" << task_->name() << ";" << endl;
|
1999-06-19 23:06:16 +02:00
|
|
|
}
|
|
|
|
|
|
1998-11-09 19:55:33 +01:00
|
|
|
void NetWhile::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
1999-05-30 03:11:46 +02:00
|
|
|
o << setw(ind) << "" << "while (" << *cond_ << ")" << endl;
|
1998-11-09 19:55:33 +01:00
|
|
|
proc_->dump(o, ind+3);
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
/* Dump a statement type that someone didn't write a dump for. */
|
|
|
|
|
void NetProc::dump(ostream&o, unsigned ind) const
|
|
|
|
|
{
|
|
|
|
|
o << setw(ind) << "" << "// " << typeid(*this).name() << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Dump an expression that noone wrote a dump method for. */
|
|
|
|
|
void NetExpr::dump(ostream&o) const
|
|
|
|
|
{
|
|
|
|
|
o << "(?)";
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-07 18:05:05 +01:00
|
|
|
void NetEBinary::dump(ostream&o) const
|
|
|
|
|
{
|
|
|
|
|
o << "(";
|
|
|
|
|
left_->dump(o);
|
|
|
|
|
o << ")";
|
|
|
|
|
switch (op_) {
|
|
|
|
|
default:
|
|
|
|
|
o << op_;
|
|
|
|
|
break;
|
1999-03-15 03:43:32 +01:00
|
|
|
case 'a':
|
|
|
|
|
o << "&&";
|
|
|
|
|
break;
|
1999-05-17 06:53:47 +02:00
|
|
|
case 'E':
|
|
|
|
|
o << "===";
|
|
|
|
|
break;
|
1998-11-07 18:05:05 +01:00
|
|
|
case 'e':
|
|
|
|
|
o << "==";
|
|
|
|
|
break;
|
1999-05-17 06:53:47 +02:00
|
|
|
case 'G':
|
|
|
|
|
o << ">=";
|
|
|
|
|
break;
|
|
|
|
|
case 'l':
|
|
|
|
|
o << "<<";
|
|
|
|
|
break;
|
|
|
|
|
case 'L':
|
|
|
|
|
o << "<=";
|
|
|
|
|
break;
|
1998-11-09 19:55:33 +01:00
|
|
|
case 'n':
|
|
|
|
|
o << "!=";
|
|
|
|
|
break;
|
1999-05-17 06:53:47 +02:00
|
|
|
case 'N':
|
|
|
|
|
o << "!==";
|
|
|
|
|
break;
|
1999-03-15 03:43:32 +01:00
|
|
|
case 'o':
|
|
|
|
|
o << "||";
|
|
|
|
|
break;
|
1999-09-30 04:43:01 +02:00
|
|
|
case 'O':
|
|
|
|
|
o << "~|";
|
|
|
|
|
break;
|
1999-05-17 06:53:47 +02:00
|
|
|
case 'r':
|
|
|
|
|
o << ">>";
|
|
|
|
|
break;
|
1999-09-30 04:43:01 +02:00
|
|
|
case 'X':
|
|
|
|
|
o << "~^";
|
|
|
|
|
break;
|
1998-11-07 18:05:05 +01:00
|
|
|
}
|
|
|
|
|
o << "(";
|
|
|
|
|
right_->dump(o);
|
|
|
|
|
o << ")";
|
|
|
|
|
}
|
|
|
|
|
|
1999-06-09 05:00:05 +02:00
|
|
|
void NetEConcat::dump(ostream&o) const
|
|
|
|
|
{
|
1999-09-19 03:06:36 +02:00
|
|
|
if (repeat_ != 1)
|
|
|
|
|
o << repeat_;
|
|
|
|
|
|
1999-09-21 02:13:40 +02:00
|
|
|
if (parms_[0])
|
|
|
|
|
o << "{" << *parms_[0];
|
|
|
|
|
else
|
|
|
|
|
o << "{";
|
|
|
|
|
|
|
|
|
|
for (unsigned idx = 1 ; idx < parms_.count() ; idx += 1) {
|
|
|
|
|
if (parms_[idx])
|
|
|
|
|
o << ", " << *parms_[idx];
|
|
|
|
|
else
|
|
|
|
|
o << ", ";
|
|
|
|
|
}
|
1999-06-09 05:00:05 +02:00
|
|
|
o << "}";
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
void NetEConst::dump(ostream&o) const
|
|
|
|
|
{
|
|
|
|
|
if (value_.is_string())
|
|
|
|
|
o << "\"" << value_.as_string() << "\"";
|
|
|
|
|
else
|
|
|
|
|
o << value_;
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-27 20:07:57 +01:00
|
|
|
void NetEScope::dump(ostream&o) const
|
|
|
|
|
{
|
|
|
|
|
o << "<scope=" << scope_->name() << ">";
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-04 05:37:58 +02:00
|
|
|
void NetESFunc::dump(ostream&o) const
|
|
|
|
|
{
|
2000-05-07 20:20:07 +02:00
|
|
|
o << name_ << "(";
|
|
|
|
|
if (nparms() > 0)
|
|
|
|
|
o << *parm(0);
|
|
|
|
|
for (unsigned idx = 1 ; idx < nparms() ; idx += 1)
|
|
|
|
|
o << ", " << *parm(idx);
|
|
|
|
|
o << ")";
|
2000-05-04 05:37:58 +02:00
|
|
|
}
|
|
|
|
|
|
1998-11-07 18:05:05 +01:00
|
|
|
void NetESignal::dump(ostream&o) const
|
|
|
|
|
{
|
1999-02-08 03:49:56 +01:00
|
|
|
o << name();
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-25 02:44:10 +02:00
|
|
|
void NetESubSignal::dump(ostream&o) const
|
|
|
|
|
{
|
|
|
|
|
sig_->dump(o);
|
|
|
|
|
o << "[";
|
|
|
|
|
idx_->dump(o);
|
|
|
|
|
o << "]";
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-19 03:59:36 +02:00
|
|
|
void NetEMemory::dump(ostream&o) const
|
|
|
|
|
{
|
|
|
|
|
o << mem_->name() << "[";
|
1999-12-12 07:03:14 +01:00
|
|
|
if (idx_) idx_->dump(o);
|
1999-04-19 03:59:36 +02:00
|
|
|
o << "]";
|
|
|
|
|
}
|
|
|
|
|
|
1999-09-20 04:21:10 +02:00
|
|
|
void NetEParam::dump(ostream&o) const
|
|
|
|
|
{
|
2000-03-08 05:36:53 +01:00
|
|
|
o << "<" << scope_->name() << "." << name_ << ">";
|
1999-09-20 04:21:10 +02:00
|
|
|
}
|
|
|
|
|
|
1999-07-17 21:50:59 +02:00
|
|
|
void NetETernary::dump(ostream&o) const
|
|
|
|
|
{
|
1999-11-04 04:53:26 +01:00
|
|
|
o << "(" << *cond_ << ") ? (" << *true_val_ << ") : (" <<
|
|
|
|
|
*false_val_ << ")";
|
1999-07-17 21:50:59 +02:00
|
|
|
}
|
|
|
|
|
|
1999-09-01 00:38:29 +02:00
|
|
|
void NetEUFunc::dump(ostream&o) const
|
|
|
|
|
{
|
|
|
|
|
o << name() << "(";
|
|
|
|
|
assert(parms_.count() > 0);
|
|
|
|
|
parms_[0]->dump(o);
|
|
|
|
|
for (unsigned idx = 1 ; idx < parms_.count() ; idx += 1) {
|
|
|
|
|
o << ", ";
|
|
|
|
|
parms_[idx]->dump(o);
|
|
|
|
|
}
|
|
|
|
|
o << ")";
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
void NetEUnary::dump(ostream&o) const
|
|
|
|
|
{
|
1999-10-05 08:19:46 +02:00
|
|
|
switch (op_) {
|
|
|
|
|
case 'N':
|
|
|
|
|
o << "~|";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
o << op_;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
o << "(";
|
1998-11-04 00:28:49 +01:00
|
|
|
expr_->dump(o);
|
|
|
|
|
o << ")";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Design::dump(ostream&o) const
|
|
|
|
|
{
|
2000-07-23 00:09:03 +02:00
|
|
|
o << "DESIGN TIME PRECISION: 10e" << get_precision() << endl;
|
1999-11-24 05:01:58 +01:00
|
|
|
o << "SCOPES:" << endl;
|
2000-03-08 05:36:53 +01:00
|
|
|
root_scope_->dump(o);
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
o << "ELABORATED NODES:" << endl;
|
|
|
|
|
|
|
|
|
|
// dump the nodes,
|
1999-06-15 07:38:15 +02:00
|
|
|
if (nodes_) {
|
1998-11-04 00:28:49 +01:00
|
|
|
NetNode*cur = nodes_->node_next_;
|
|
|
|
|
do {
|
|
|
|
|
cur->dump_node(o, 0);
|
|
|
|
|
cur = cur->node_next_;
|
|
|
|
|
} while (cur != nodes_->node_next_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
o << "ELABORATED PROCESSES:" << endl;
|
|
|
|
|
|
|
|
|
|
// Dump the processes.
|
|
|
|
|
for (const NetProcTop*idx = procs_ ; idx ; idx = idx->next_)
|
|
|
|
|
idx->dump(o, 0);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* $Log: design_dump.cc,v $
|
2000-12-10 07:41:59 +01:00
|
|
|
* Revision 1.106 2000/12/10 06:41:59 steve
|
|
|
|
|
* Support delays on continuous assignment from idents. (PR#40)
|
|
|
|
|
*
|
2000-12-04 18:37:03 +01:00
|
|
|
* Revision 1.105 2000/12/04 17:37:03 steve
|
|
|
|
|
* Add Attrib class for holding NetObj attributes.
|
|
|
|
|
*
|
2000-11-11 02:52:09 +01:00
|
|
|
* Revision 1.104 2000/11/11 01:52:09 steve
|
|
|
|
|
* change set for support of nmos, pmos, rnmos, rpmos, notif0, and notif1
|
|
|
|
|
* change set to correct behavior of bufif0 and bufif1
|
|
|
|
|
* (Tim Leight)
|
|
|
|
|
*
|
|
|
|
|
* Also includes fix for PR#27
|
|
|
|
|
*
|
2000-11-11 01:03:36 +01:00
|
|
|
* Revision 1.103 2000/11/11 00:03:36 steve
|
|
|
|
|
* Add support for the t-dll backend grabing flip-flops.
|
|
|
|
|
*
|
2000-11-04 07:36:24 +01:00
|
|
|
* Revision 1.102 2000/11/04 06:36:24 steve
|
|
|
|
|
* Apply sequential UDP rework from Stephan Boettcher (PR#39)
|
|
|
|
|
*
|
2000-10-28 02:51:41 +02:00
|
|
|
* Revision 1.101 2000/10/28 00:51:41 steve
|
|
|
|
|
* Add scope to threads in vvm, pass that scope
|
|
|
|
|
* to vpi sysTaskFunc objects, and add vpi calls
|
|
|
|
|
* to access that information.
|
|
|
|
|
*
|
|
|
|
|
* $display displays scope in %m (PR#1)
|
|
|
|
|
*
|
2000-10-07 21:45:42 +02:00
|
|
|
* Revision 1.100 2000/10/07 19:45:42 steve
|
|
|
|
|
* Put logic devices into scopes.
|
|
|
|
|
*
|
2000-10-07 01:46:50 +02:00
|
|
|
* Revision 1.99 2000/10/06 23:46:50 steve
|
|
|
|
|
* ivl_target updates, including more complete
|
|
|
|
|
* handling of ivl_nexus_t objects. Much reduced
|
|
|
|
|
* dependencies on pointers to netlist objects.
|
|
|
|
|
*
|
2000-09-26 03:35:42 +02:00
|
|
|
* Revision 1.98 2000/09/26 01:35:42 steve
|
|
|
|
|
* Remove the obsolete NetEIdent class.
|
|
|
|
|
*
|
2000-09-17 23:26:15 +02:00
|
|
|
* Revision 1.97 2000/09/17 21:26:15 steve
|
|
|
|
|
* Add support for modulus (Eric Aardoom)
|
|
|
|
|
*
|
2000-09-10 04:18:16 +02:00
|
|
|
* Revision 1.96 2000/09/10 02:18:16 steve
|
|
|
|
|
* elaborate complex l-values
|
|
|
|
|
*
|
2000-09-02 22:54:20 +02:00
|
|
|
* Revision 1.95 2000/09/02 20:54:20 steve
|
|
|
|
|
* Rearrange NetAssign to make NetAssign_ separate.
|
|
|
|
|
*
|
2000-07-30 20:25:43 +02:00
|
|
|
* Revision 1.94 2000/07/30 18:25:43 steve
|
|
|
|
|
* Rearrange task and function elaboration so that the
|
|
|
|
|
* NetTaskDef and NetFuncDef functions are created during
|
|
|
|
|
* signal enaboration, and carry these objects in the
|
|
|
|
|
* NetScope class instead of the extra, useless map in
|
|
|
|
|
* the Design class.
|
|
|
|
|
*
|
2000-07-29 05:55:38 +02:00
|
|
|
* Revision 1.93 2000/07/29 03:55:38 steve
|
|
|
|
|
* fix problem coalescing events w/ probes.
|
|
|
|
|
*
|
2000-07-27 07:13:44 +02:00
|
|
|
* Revision 1.92 2000/07/27 05:13:44 steve
|
|
|
|
|
* Support elaboration of disable statements.
|
|
|
|
|
*
|
2000-07-23 00:09:03 +02:00
|
|
|
* Revision 1.91 2000/07/22 22:09:03 steve
|
|
|
|
|
* Parse and elaborate timescale to scopes.
|
|
|
|
|
*
|
2000-07-14 08:12:56 +02:00
|
|
|
* Revision 1.90 2000/07/14 06:12:57 steve
|
|
|
|
|
* Move inital value handling from NetNet to Nexus
|
|
|
|
|
* objects. This allows better propogation of inital
|
|
|
|
|
* values.
|
|
|
|
|
*
|
|
|
|
|
* Clean up constant propagation a bit to account
|
|
|
|
|
* for regs that are not really values.
|
|
|
|
|
*
|
2000-07-07 06:53:53 +02:00
|
|
|
* Revision 1.89 2000/07/07 04:53:53 steve
|
|
|
|
|
* Add support for non-constant delays in delay statements,
|
|
|
|
|
* Support evaluating ! in constant expressions, and
|
|
|
|
|
* move some code from netlist.cc to net_proc.cc.
|
|
|
|
|
*
|
2000-06-25 21:59:41 +02:00
|
|
|
* Revision 1.88 2000/06/25 19:59:42 steve
|
|
|
|
|
* Redesign Links to include the Nexus class that
|
|
|
|
|
* carries properties of the connected set of links.
|
|
|
|
|
*
|
2000-06-25 00:55:19 +02:00
|
|
|
* Revision 1.87 2000/06/24 22:55:19 steve
|
|
|
|
|
* Get rid of useless next_link method.
|
|
|
|
|
*
|
2000-06-13 05:24:48 +02:00
|
|
|
* Revision 1.86 2000/06/13 03:24:48 steve
|
|
|
|
|
* Index in memory assign should be a NetExpr.
|
|
|
|
|
*
|
2000-05-12 01:37:26 +02:00
|
|
|
* Revision 1.85 2000/05/11 23:37:27 steve
|
|
|
|
|
* Add support for procedural continuous assignment.
|
|
|
|
|
*
|
2000-05-07 20:20:07 +02:00
|
|
|
* Revision 1.84 2000/05/07 18:20:07 steve
|
|
|
|
|
* Import MCD support from Stephen Tell, and add
|
|
|
|
|
* system function parameter support to the IVL core.
|
|
|
|
|
*
|
2000-05-07 06:37:55 +02:00
|
|
|
* Revision 1.83 2000/05/07 04:37:56 steve
|
|
|
|
|
* Carry strength values from Verilog source to the
|
|
|
|
|
* pform and netlist for gates.
|
|
|
|
|
*
|
|
|
|
|
* Change vvm constants to use the driver_t to drive
|
|
|
|
|
* a constant value. This works better if there are
|
|
|
|
|
* multiple drivers on a signal.
|
|
|
|
|
*
|
2000-05-04 05:37:58 +02:00
|
|
|
* Revision 1.82 2000/05/04 03:37:58 steve
|
|
|
|
|
* Add infrastructure for system functions, move
|
|
|
|
|
* $time to that structure and add $random.
|
|
|
|
|
*
|
2000-05-02 05:13:30 +02:00
|
|
|
* Revision 1.81 2000/05/02 03:13:30 steve
|
|
|
|
|
* Move memories to the NetScope object.
|
|
|
|
|
*
|
2000-05-02 02:58:11 +02:00
|
|
|
* Revision 1.80 2000/05/02 00:58:11 steve
|
|
|
|
|
* Move signal tables to the NetScope class.
|
|
|
|
|
*
|
2000-04-28 23:00:28 +02:00
|
|
|
* Revision 1.79 2000/04/28 21:00:29 steve
|
|
|
|
|
* Over agressive signal elimination in constant probadation.
|
|
|
|
|
*
|
2000-04-23 05:45:24 +02:00
|
|
|
* Revision 1.78 2000/04/23 03:45:24 steve
|
|
|
|
|
* Add support for the procedural release statement.
|
|
|
|
|
*
|
2000-04-22 06:20:19 +02:00
|
|
|
* Revision 1.77 2000/04/22 04:20:19 steve
|
|
|
|
|
* Add support for force assignment.
|
|
|
|
|
*
|
2000-04-12 22:02:52 +02:00
|
|
|
* Revision 1.76 2000/04/12 20:02:52 steve
|
|
|
|
|
* Finally remove the NetNEvent and NetPEvent classes,
|
|
|
|
|
* Get synthesis working with the NetEvWait class,
|
|
|
|
|
* and get started supporting multiple events in a
|
|
|
|
|
* wait in vvm.
|
1998-11-04 00:28:49 +01:00
|
|
|
*/
|
|
|
|
|
|