No need for nobufz.

This commit is contained in:
steve 2000-05-11 01:44:52 +00:00
parent d68339a96a
commit 4f0b0cb8ce
2 changed files with 19 additions and 92 deletions

View File

@ -1,76 +0,0 @@
/*
* Copyright (c) 1998 Stephen Williams (steve@picturel.com)
*
* 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
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: nobufz.cc,v 1.2 2000/02/23 02:56:55 steve Exp $"
#endif
/* NOBUFZ Function
* This function transforms the netlist by removing BUFZ nodes that
* have no obvious effect. The assumption here is that the BUFZ node
* transmits information perfectly in one direction, and not at all in
* the other.
*
* A BUFZ will *not* be eliminated if the output link is connected to
* other outputs. The BUFZ protects its input link from the
* double-driving on its output, so the bufz is not meaningless and
* cannot be removed.
*/
# include "netlist.h"
# include <assert.h>
static bool is_a_bufz_node(const NetNode*obj)
{
return dynamic_cast<const NetBUFZ*>(obj);
}
void nobufz(Design*des)
{
des->clear_node_marks();
while (NetNode*obj = des->find_node(&is_a_bufz_node)) {
NetBUFZ*cur = dynamic_cast<NetBUFZ*>(obj);
assert(cur);
/* If there are more output pins on the output size of
the BUFZ, then the BUFZ has a real effect (it
protects its input side) and cannot be eliminated. */
if (count_outputs(cur->pin(0)) == 1) {
connect(cur->pin(0), cur->pin(1));
delete cur;
} else {
cur->set_mark();
}
}
}
/*
* $Log: nobufz.cc,v $
* Revision 1.2 2000/02/23 02:56:55 steve
* Macintosh compilers do not support ident.
*
* Revision 1.1 1998/12/02 04:37:13 steve
* Add the nobufz function to eliminate bufz objects,
* Object links are marked with direction,
* constant propagation is more careful will wide links,
* Signal folding is aware of attributes, and
* the XNF target can dump UDP objects based on LCA
* attributes.
*
*/

35
vvm.txt
View File

@ -7,25 +7,25 @@ the output program is self contained. It is useful to write a "main"
module that tests a part being designed. This output type is most
useful for batch simulation.
Although none are required, these processing steps are recommended:
nobufz
nodangle
propinit
The iverilog target ``vvm'' generates code that uses the vvm library,
and takes care of compiling the code into an executable program.
So a sample command line to compile a Verilog file to C++ would be:
The vvm library can also be used directly by C++ programmers if
desired, ir order to skip the Verilog compilation step and write
simulations in C++.
ivl -F nobufz -F nodangle -F propinit -t vvm -o foo.cc foo.vl
WRITING SIMULATIONS IN C++/VVM
Once the program is compiled down to C++ code, it needs to be further
compiled and linked into an executable image. The command for doing
this is highly dependent on the system where you use Icarus
Verilog. For Linux, the compile command is typically:
It is possible to write simulations using C++ and the vvm library. The
library classes fairly directly represent hardware devices and signal
values, so writing such a simulation should be relatively obvious. The
library also supports calling VPI modules written to work with Icarus
Verilog. There are routines for loading and interfacing with VPI
modules so that they think you are Verilog.
c++ -rdynamic -o foo foo.cc -lvvm -ldl
On any system, the compiled program requires that the VPI_MODULE_PATH
be set to a ':' separated list of directories to search for vpi files,
the system.vpi file in particular. This is a run time requirement.
The details of the various classes are covered by comments in the
various header files. The core header file is vvm.h, but the header
files vvm_gates.h and vvm_signal.h are also important.
NEXUS, GATES AND DRIVERS
@ -151,8 +151,11 @@ bits are at:
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
$Id: vvm.txt,v 1.5 2000/03/16 19:03:04 steve Exp $
$Id: vvm.txt,v 1.6 2000/05/11 01:44:52 steve Exp $
$Log: vvm.txt,v $
Revision 1.6 2000/05/11 01:44:52 steve
No need for nobufz.
Revision 1.5 2000/03/16 19:03:04 steve
Revise the VVM backend to use nexus objects so that
drivers and resolution functions can be used, and