mirror of
https://github.com/verilator/verilator.git
synced 2026-10-04 17:13:40 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5f0ed9c99 | ||
|
|
2ce30e78a1 | ||
|
|
3b554f4c5b | ||
|
|
cf40fd356f | ||
|
|
8848469bf9 | ||
|
|
4100417f83 | ||
|
|
bd6d743f9c | ||
|
|
857ac24ba7 | ||
|
|
5672b99203 | ||
|
|
3d8de3194c | ||
|
|
8b91a9f898 | ||
|
|
038ee69a96 | ||
|
|
8986d1f16f | ||
|
|
86c8e7b3e6 | ||
|
|
9026118a7c |
@@ -3,6 +3,24 @@ Revision history for Verilator
|
||||
The contributors that suggested a given feature are shown in []. [by ...]
|
||||
indicates the contributor was also the author of the fix; Thanks!
|
||||
|
||||
* Verilator 3.62***
|
||||
|
||||
*** Fixed configure and compiling under Solaris. [Bob Farrell]
|
||||
|
||||
*** When dotted signal lookup fails, help the user by showing known scopes.
|
||||
|
||||
**** Fix dotted references inside generated cells. [David Hewson]
|
||||
|
||||
**** Fix missed split optimization points underneath other re-split blocks.
|
||||
|
||||
* Verilator 3.623 12/05/2006
|
||||
|
||||
*** Add --output-split-cfuncs for accelerating GCC compile. [Eugene Weber]
|
||||
|
||||
**** Fix $signed mis-extending when input has a WIDTH violation. [Eugene Weber]
|
||||
|
||||
**** Add M32 make variable to support -m32 compiles. [Eugene Weber]
|
||||
|
||||
* Verilator 3.622 10/17/2006 Stable
|
||||
|
||||
**** Fix --skip-identical without --debug, broken in 3.621. [Andy Meier]
|
||||
|
||||
+7
-8
@@ -78,7 +78,6 @@ datadir = @datadir@
|
||||
infodir = @infodir@
|
||||
|
||||
# Directory in which to install package specific files
|
||||
# Note this gets coded into v3c/config.h also
|
||||
pkgdatadir = @pkgdatadir@
|
||||
|
||||
#### End of system configuration section. ####
|
||||
@@ -265,16 +264,16 @@ uninstall:
|
||||
-cd $(mandir)/man1 && rm -f $(VL_INST_MAN_FILES)
|
||||
-cd $(bindir) && rm -f $(VL_INST_BIN_FILES)
|
||||
|
||||
# autoheader might not change config.h.in, so touch a stamp file.
|
||||
# autoheader might not change config_build.h.in, so touch a stamp file.
|
||||
IN_WILD := ${srcdir}/*.in ${srcdir}/*/*.in ${srcdir}/*/*/*.in \
|
||||
*.in */*.in */*.in
|
||||
|
||||
${srcdir}/config.h.in: stamp-h.in
|
||||
${srcdir}/stamp-h.in: configure.in $(wildcard $(IN_WILD))
|
||||
${srcdir}/config_build.h.in: stamp-h.in
|
||||
${srcdir}/stamp-h.in: configure.ac $(wildcard $(IN_WILD))
|
||||
cd ${srcdir} && autoheader
|
||||
echo timestamp > ${srcdir}/stamp-h.in
|
||||
config.h: stamp-h
|
||||
stamp-h: config.h.in config.status
|
||||
config_build.h: stamp-h
|
||||
stamp-h: config_build.h.in config.status
|
||||
./config.status
|
||||
Makefile: Makefile.in config.status
|
||||
./config.status
|
||||
@@ -282,7 +281,7 @@ src/Makefile: src/Makefile.in config.status
|
||||
./config.status
|
||||
config.status: configure
|
||||
./config.status --recheck
|
||||
configure: configure.in
|
||||
configure: configure.ac
|
||||
autoconf
|
||||
|
||||
maintainer-clean::
|
||||
@@ -317,7 +316,7 @@ TAGS: $(TAGFILES)
|
||||
######################################################################
|
||||
# Distributions
|
||||
|
||||
DISTCONFIG = src/config.h.in
|
||||
DISTCONFIG = src/config_build.h.in
|
||||
|
||||
DISTTITLE := $(shell sed -e '/DTVERSION/!d' -e 's/[^0-9]*\([0-9.a-z]*\).*/verilator-\1/' -e 's/v/V/' -e q $(DISTCONFIG))
|
||||
DISTNAME := $(shell sed -e '/DTVERSION/!d' -e 's/[^0-9]*\([0-9.a-z]*\).*/verilator-\1/' -e q $(DISTCONFIG))
|
||||
|
||||
+60
-10
@@ -377,9 +377,18 @@ C++ file exceeds the specified number of operations, a new file will be
|
||||
created. In addition, any slow routines will be placed into __Slow files.
|
||||
This accelerates compilation by as optimization can be disabled on the slow
|
||||
routines, and the remaining files can be compiled on parallel machines.
|
||||
Using --output-split should have only a trivial impact on performance.
|
||||
With GCC 3.3 on a 2GHz Opteron, --output-split 20000 will result in
|
||||
splitting into approximately one-minute-compile chunks.
|
||||
|
||||
=item --output-split-cfuncs I<statements>
|
||||
|
||||
Enables splitting functions in the output .cpp/.sp files into multiple
|
||||
functions. When a generated function exceeds the specified number of
|
||||
operations, a new function will be created. With --output-split, this will
|
||||
enable GCC to compile faster, at a small loss in performance that increases
|
||||
with smaller statement values.
|
||||
|
||||
=item --pins64
|
||||
|
||||
Specifies SystemC outputs of 33-64 bits wide should use uint64_t instead of
|
||||
@@ -846,6 +855,30 @@ Lower modules are not pure SystemC code. This is a feature, as using the
|
||||
SystemC pin interconnect scheme everywhere would reduce performance by an
|
||||
order of magnitude.
|
||||
|
||||
=head1 CROSS COMPILATION
|
||||
|
||||
Verilator supports cross-compling Verilated code. This is generally used
|
||||
to run Verilator on a Linux system and produce C++ code that is then compiled
|
||||
on Windows.
|
||||
|
||||
Cross compilation involves up to three different OSes. The build system is
|
||||
where you configured and compiled Verilator, the host system where you run
|
||||
Verilator, and the target system where you compile the Verilated code and
|
||||
run the simulation.
|
||||
|
||||
Currently, Verilator requires the build and host system type to be the
|
||||
same, though the target system type may be different. To support this,
|
||||
./configure and make Verilator on the build system. Then, run Verilator on
|
||||
the host system. Finally, the output of Verilator may be compiled on the
|
||||
different target system.
|
||||
|
||||
To support this, none of the files that Verilator produces will reference
|
||||
any configure generated build-system specific files, such as config.h
|
||||
(which is renamed in Verilator to config_build.h to reduce confusion.) The
|
||||
disadvantage of this approach is that include/verilatedos.h must
|
||||
self-detect the requirements of the target system, rather then using
|
||||
configure.
|
||||
|
||||
=head1 VERILOG 2001 SUPPORT
|
||||
|
||||
Verilator supports the more common Verilog 2001 language features. This
|
||||
@@ -1424,22 +1457,28 @@ simulation which analyzes per-bus:
|
||||
|
||||
This statement needs to be evaluated multiple times, as a change in
|
||||
"shift_in" requires "x" to be computed 3 times before it becomes stable.
|
||||
For significantly better performance, split this into 2 separate signals,
|
||||
and then if necessary generate the original signal:
|
||||
This is because a change in "x" requires "x" itself to change value, which
|
||||
causes the warning.
|
||||
|
||||
wire [2:1] x_21 = x[1:0];
|
||||
wire [0:0] x_0 = shift_in;
|
||||
wire [2:0] x = {x_21, x_0};
|
||||
For significantly better performance, split this into 2 separate signals:
|
||||
|
||||
This logic needs to be evaluated only once. These sort of changes may also
|
||||
speed up your traditional event driven simulator, as it will result in
|
||||
fewer events per cycle.
|
||||
wire [2:0] xout = {x[1:0],shift_in};
|
||||
|
||||
and change all receiving logic to instead receive "xout". Alternatively,
|
||||
change it to
|
||||
|
||||
wire [2:0] x = {xin[1:0],shift_in};
|
||||
|
||||
and change all driving logic to instead drive "xin".
|
||||
|
||||
With this change this assignment needs to be evaluated only once. These
|
||||
sort of changes may also speed up your traditional event driven simulator,
|
||||
as it will result in fewer events per cycle.
|
||||
|
||||
The most complicated UNOPTFLAT path we've seen was due to low bits of a bus
|
||||
being generated from an always statement that consumed high bits of the
|
||||
same bus processed by another series of always blocks. The fix is the
|
||||
same; split it into two separate signals, then create the bus from the two
|
||||
separate signals.
|
||||
same; split it into two separate signals generated from each block.
|
||||
|
||||
The UNOPTFLAT warning may also be due to clock enables, identified from the
|
||||
reported path going through a clock gating cell. To fix these, use the
|
||||
@@ -1596,6 +1635,11 @@ controlled by --assert are disabled.
|
||||
In C++ (non SystemC) code you need to define this function so that the
|
||||
simulator knows the current time. See the "CONNECTING TO C++" examples.
|
||||
|
||||
=item Why do I get "undefined reference to `VL_RAND_RESET_I' or `Verilated::...'"?
|
||||
|
||||
You need to link your compiled Verilated code against the verilated.cpp
|
||||
file found in the include directory of the Verilator kit.
|
||||
|
||||
=item Is the PLI supported?
|
||||
|
||||
No.
|
||||
@@ -1606,6 +1650,12 @@ complex, since Verilator emits standard C++ code, you can simply write your
|
||||
own C++ routines that can access and modify signal values without needing
|
||||
any PLI interface code, and call it with $c("{any_c++_statement}").
|
||||
|
||||
=item How do I make a Verilog module that contain a C++ object?
|
||||
|
||||
You need to add the object to the structure that Verilator creates, then
|
||||
use $c to call a method inside your object. The
|
||||
test_regress/t/t_extend_class files show an example of how to do this.
|
||||
|
||||
=item How do I get faster build times?
|
||||
|
||||
Between GCC 3.0 to 3.3, each compiled progressively slower, thus if you can
|
||||
|
||||
@@ -6,7 +6,7 @@ dnl General Public License or the Perl Artistic License.
|
||||
|
||||
AC_REVISION($Revision$)dnl
|
||||
AC_INIT(src/Verilator.cpp)
|
||||
AC_CONFIG_HEADER(src/config.h)
|
||||
AC_CONFIG_HEADER(src/config_build.h)
|
||||
|
||||
dnl Special Substitutions
|
||||
|
||||
@@ -24,7 +24,7 @@ dnl Checks for libraries.
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADERS(fcntl.h unistd.h sys/file.h sys/time.h sys/un.h math.h stdint.h mingw/stdint.h)
|
||||
AC_CHECK_HEADERS(fcntl.h unistd.h inttypes.h sys/file.h sys/time.h sys/un.h math.h stdint.h mingw/stdint.h)
|
||||
|
||||
dnl Checks for typedefs, structures
|
||||
AC_CHECK_TYPE(size_t,unsigned int)
|
||||
@@ -48,6 +48,9 @@ VPATH += $(VERILATOR_ROOT)/include
|
||||
#OPT = -ggdb -DPRINTINITSTR
|
||||
CPPFLAGS += $(OPT)
|
||||
|
||||
CPPFLAGS += $(M32)
|
||||
LDFLAGS += $(M32)
|
||||
|
||||
# See the benchmarking section of bin/verilator.
|
||||
# Support class optimizations. This includes the tracing and symbol table.
|
||||
# SystemC takes minutes to optimize, thus it is off by default.
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
/// \file
|
||||
/// \brief Verilator: Common include for OS portability (verilated & verilator)
|
||||
///
|
||||
/// This header is used by both verilated code, and the verilator
|
||||
/// program itself Code needed by only one goes into verilated.h or
|
||||
/// config.h.in respectively.
|
||||
/// This header is used by both the Verilator source code (run on the
|
||||
/// build and host system), and the Verilated output (run on the target
|
||||
/// system). Code needed by only the host system goes into
|
||||
/// config_build.h.in, code needed by Verilated code only goes into
|
||||
/// verilated.h, and code needed by both goes here (verilatedos.h).
|
||||
///
|
||||
/// Code available from: http://www.veripool.com/verilator
|
||||
///
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
*.old
|
||||
config.h
|
||||
config_build.h
|
||||
Makefile
|
||||
Makefile_obj
|
||||
.objcache*
|
||||
|
||||
+1
-1
@@ -87,4 +87,4 @@ clean mostlyclean distclean maintainer-clean::
|
||||
-rm -f .objcache*
|
||||
|
||||
distclean maintainer-clean::
|
||||
-rm -f Makefile Makefile_obj
|
||||
-rm -f Makefile Makefile_obj config_build.h
|
||||
|
||||
+3
-4
@@ -28,6 +28,8 @@ CC = @CC@
|
||||
CXX = @CXX@
|
||||
LINK = @CXX@
|
||||
|
||||
LDFLAGS += @LDFLAGS@
|
||||
|
||||
#### End of system configuration section. ####
|
||||
|
||||
VPATH += . $(srcdir)
|
||||
@@ -36,14 +38,12 @@ TGT = ../../verilator_bin
|
||||
#################
|
||||
ifeq ($(VL_DEBUG),)
|
||||
# Optimize
|
||||
LDFLAGS =
|
||||
COPT = -O
|
||||
else
|
||||
# Debug
|
||||
LDFLAGS =
|
||||
COPT = -ggdb -DVL_DEBUG
|
||||
# Debug & Profile:
|
||||
#LDFLAGS = -pg -g
|
||||
#LDFLAGS += -pg -g
|
||||
#COPT = -ggdb -pg -g
|
||||
endif
|
||||
#################
|
||||
@@ -89,7 +89,6 @@ clean mostlyclean distclean maintainer-clean::
|
||||
-rm -f obj_* .objcache*
|
||||
|
||||
distclean maintainer-clean:: clean
|
||||
rm -f Makefile config.h
|
||||
|
||||
maintainer-clean::
|
||||
|
||||
|
||||
+2
-1
@@ -31,7 +31,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3ACTIVE_H_
|
||||
#define _V3ACTIVE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -28,7 +28,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3ACTIVETOP_H_
|
||||
#define _V3ACTIVETOP_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3ASSERT_H_
|
||||
#define _V3ASSERT_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -22,7 +22,8 @@
|
||||
// Attach clocks to each assertion
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3ASSERTPRE_H_
|
||||
#define _V3ASSERTPRE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
@@ -98,6 +98,12 @@ string AstNode::prettyName(const string& namein) {
|
||||
while ((pos=pretty.find("__DOT__")) != string::npos) {
|
||||
pretty.replace(pos, 7, ".");
|
||||
}
|
||||
while ((pos=pretty.find("__BRA__")) != string::npos) {
|
||||
pretty.replace(pos, 7, "[");
|
||||
}
|
||||
while ((pos=pretty.find("__KET__")) != string::npos) {
|
||||
pretty.replace(pos, 7, "]");
|
||||
}
|
||||
while ((pos=pretty.find("__PVT__")) != string::npos) {
|
||||
pretty.replace(pos, 7, "");
|
||||
}
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3AST_H_
|
||||
#define _V3AST_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Number.h"
|
||||
#include <vector>
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <fstream>
|
||||
|
||||
+2
-1
@@ -27,7 +27,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3BEGIN_H_
|
||||
#define _V3BEGIN_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -25,7 +25,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3BRANCH_H_
|
||||
#define _V3BRANCH_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -26,7 +26,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3BROKEN_H_
|
||||
#define _V3BROKEN_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -38,7 +38,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3CASE_H_
|
||||
#define _V3CASE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -42,7 +42,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3CAST_H_
|
||||
#define _V3CAST_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -31,7 +31,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3CHANGED_H_
|
||||
#define _V3CHANGED_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -28,7 +28,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3CLEAN_H_
|
||||
#define _V3CLEAN_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+3
-3
@@ -32,7 +32,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
@@ -364,8 +365,7 @@ private:
|
||||
// Move statements to if
|
||||
m_lastIfp->addIfsp(stmtsp);
|
||||
} else if (nodep->hasSettle()) {
|
||||
// Settlement
|
||||
clearLastSen();
|
||||
// Don't need to: clearLastSen();, as we're adding it to different cfunc
|
||||
// Move statements to function
|
||||
addToSettleLoop(stmtsp);
|
||||
} else {
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3CLOCK_H_
|
||||
#define _V3CLOCK_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -35,7 +35,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3COMBINE_H_
|
||||
#define _V3COMBINE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -25,7 +25,8 @@
|
||||
// If operands are constant, replace this node with constant.
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3CONST_H_
|
||||
#define _V3CONST_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -29,7 +29,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3COVERAGE_H_
|
||||
#define _V3COVERAGE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -24,7 +24,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3DEAD_H_
|
||||
#define _V3DEAD_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -52,7 +52,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3DELAYED_H_
|
||||
#define _V3DELAYED_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -28,7 +28,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3DEPTH_H_
|
||||
#define _V3DEPTH_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -27,7 +27,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3DESCOPE_H_
|
||||
#define _V3DESCOPE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3EMITC_H_
|
||||
#define _V3EMITC_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -22,7 +22,8 @@
|
||||
#ifndef _V3EMITCBASE_H_
|
||||
#define _V3EMITCBASE_H_ 1
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3EMITMK_H_
|
||||
#define _V3EMITMK_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3EMITV_H_
|
||||
#define _V3EMITV_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3ERROR_H_
|
||||
#define _V3ERROR_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
+2
-1
@@ -30,7 +30,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3EXPAND_H_
|
||||
#define _V3EXPAND_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdarg.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3FILE_H_
|
||||
#define _V3FILE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include <stdio.h>
|
||||
#include <stack>
|
||||
|
||||
+2
-1
@@ -26,7 +26,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3GATE_H_
|
||||
#define _V3GATE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -24,7 +24,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3GENCLK_H_
|
||||
#define _V3GENCLK_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -22,7 +22,8 @@
|
||||
#ifndef _V3GLOBAL_H_
|
||||
#define _V3GLOBAL_H_ 1
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <string>
|
||||
|
||||
#include "V3Error.h"
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3GRAPH_H_
|
||||
#define _V3GRAPH_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3List.h"
|
||||
#include <vector>
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3GRAPHALG_H_
|
||||
#define _V3GRAPHALG_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
|
||||
#include "V3Global.h"
|
||||
#include "V3Graph.h"
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3GRAPHDFA_H_
|
||||
#define _V3GRAPHDFA_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <vector>
|
||||
|
||||
#include "V3Global.h"
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -26,7 +26,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3HASHED_H_
|
||||
#define _V3HASHED_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -29,7 +29,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3INLINE_H_
|
||||
#define _V3INLINE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+3
-2
@@ -26,7 +26,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
@@ -200,7 +201,7 @@ private:
|
||||
}
|
||||
|
||||
// Save some time
|
||||
virtual void visit(AstNodeStmt*, AstNUser*) {}
|
||||
virtual void visit(AstNodeMath*, AstNUser*) {}
|
||||
//--------------------
|
||||
// Default: Just iterate
|
||||
virtual void visit(AstNode* nodep, AstNUser*) {
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3INST_H_
|
||||
#define _V3INST_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3LANGUAGEWORDS_H_
|
||||
#define _V3LANGUAGEWORDS_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <map>
|
||||
|
||||
//============================================================================
|
||||
|
||||
+2
-1
@@ -28,7 +28,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3LIFE_H_
|
||||
#define _V3LIFE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -29,7 +29,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3LIFEPOST_H_
|
||||
#define _V3LIFEPOST_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -26,7 +26,8 @@
|
||||
// Link to var they reference
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3LINK_H_
|
||||
#define _V3LINK_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -25,7 +25,8 @@
|
||||
// Link to module that instantiates it
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3LINKCELLS_H_
|
||||
#define _V3LINKCELLS_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+89
-15
@@ -29,7 +29,8 @@
|
||||
// Find appropriate named cell and link to var they reference
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
@@ -81,6 +82,26 @@ public:
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
void errorScopes(AstNode* nodep) {
|
||||
if (!this) { // Silence if we messed it up and aren't debugging
|
||||
if (debug()) nodep->v3fatalSrc("Void pointer; perhaps used null vxp instead of okVxp?");
|
||||
return;
|
||||
}
|
||||
{
|
||||
string scopes;
|
||||
for (NameVtxMap::iterator it = m_nameToVtxMap.begin(); it!=m_nameToVtxMap.end(); ++it) {
|
||||
if (scopes != "") scopes += ", ";
|
||||
scopes += AstNode::prettyName(it->second->cellName());
|
||||
}
|
||||
cerr<<V3Error::msgPrefix()<<" Known scopes under '"<<cellName()<<"': "
|
||||
<<scopes<<endl;
|
||||
}
|
||||
if (debug()) {
|
||||
for (NameVtxMap::iterator it = m_nameToVtxMap.begin(); it!=m_nameToVtxMap.end(); ++it) {
|
||||
UINFO(1,"\t\t KnownScope: "<<it->second->name()<<endl);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class LinkDotCellVertex : public LinkDotBaseVertex {
|
||||
@@ -125,6 +146,27 @@ public:
|
||||
virtual string dotColor() const { return "yellow"; }
|
||||
};
|
||||
|
||||
class LinkDotBeginVertex : public LinkDotBaseVertex {
|
||||
// A fake point in the hierarchy, corresponding to a begin block
|
||||
// After we remove begins these will go away
|
||||
// Note we use the symbol table of the parent, as we want to find variables there
|
||||
// However, cells walk the graph, so cells will appear under the begin itself
|
||||
AstBegin* m_nodep; // Relevant node
|
||||
LinkDotCellVertex* m_symVxp; // Above cell so we can find real symbol table
|
||||
// // (Could walk graph to find it, but that's much slower.)
|
||||
public:
|
||||
LinkDotBeginVertex(V3Graph* graphp, AstBegin* nodep, LinkDotCellVertex* symVxp)
|
||||
: LinkDotBaseVertex(graphp, nodep->name()+"__DOT__")
|
||||
, m_nodep(nodep), m_symVxp(symVxp) {}
|
||||
virtual ~LinkDotBeginVertex() {}
|
||||
// Search up through tree to find the real symbol table.
|
||||
virtual V3SymTable& syms() { return m_symVxp->syms(); }
|
||||
virtual string modName() const { return m_nodep->name(); }
|
||||
virtual string cellName() const { return m_nodep->name(); }
|
||||
virtual string name() const { return (string)("BEG C:")+cellName(); }
|
||||
virtual string dotColor() const { return "blue"; }
|
||||
};
|
||||
|
||||
//######################################################################
|
||||
// LinkDot state, as a visitor of each AstNode
|
||||
|
||||
@@ -194,6 +236,14 @@ public:
|
||||
}
|
||||
return vxp;
|
||||
}
|
||||
LinkDotBeginVertex* insertBegin(LinkDotBaseVertex* abovep, LinkDotCellVertex* cellVxp,
|
||||
AstBegin* nodep) {
|
||||
UINFO(9," INSERTbeg "<<nodep<<endl);
|
||||
LinkDotBeginVertex* vxp = new LinkDotBeginVertex(&m_graph, nodep, cellVxp);
|
||||
new V3GraphEdge(&m_graph, abovep, vxp, 1, false);
|
||||
abovep->insertSubcellName(nodep->name(), vxp);
|
||||
return vxp;
|
||||
}
|
||||
void insertSym(LinkDotCellVertex* abovep, const string& name, AstNode* nodep) {
|
||||
UINFO(9," INSERTsym "<<name<<" "<<nodep<<endl);
|
||||
abovep->syms().insert(name, nodep);
|
||||
@@ -225,12 +275,14 @@ private:
|
||||
return NULL;
|
||||
}
|
||||
public:
|
||||
LinkDotBaseVertex* findDotted(LinkDotBaseVertex* cellVxp, const string& dotname, string& baddot) {
|
||||
LinkDotBaseVertex* findDotted(LinkDotBaseVertex* cellVxp, const string& dotname,
|
||||
string& baddot, LinkDotBaseVertex*& okVxp) {
|
||||
// Given a dotted hiearchy name, return where in scope it is
|
||||
// Note when dotname=="" we just fall through and return cellVxp
|
||||
UINFO(8," dottedFind "<<dotname<<endl);
|
||||
bool firstId = true;
|
||||
string leftname = dotname;
|
||||
okVxp = cellVxp; // So can list bad scopes
|
||||
while (leftname != "") { // foreach dotted part of xref name
|
||||
string::size_type pos;
|
||||
string ident;
|
||||
@@ -242,6 +294,7 @@ public:
|
||||
leftname = "";
|
||||
}
|
||||
baddot = ident; // So user can see where they botched it
|
||||
okVxp = cellVxp;
|
||||
string altIdent = "";
|
||||
if (m_forPrearray) {
|
||||
// Cell foo__[array] before we've expanded arrays is just foo.
|
||||
@@ -353,29 +406,36 @@ private:
|
||||
}
|
||||
virtual void visit(AstCell* nodep, AstNUser*) {
|
||||
UINFO(5," CELL under "<<m_scope<<" is "<<nodep<<endl);
|
||||
// Process XREFs inside pins
|
||||
nodep->iterateChildren(*this);
|
||||
// Recurse in, preserving state
|
||||
string oldscope = m_scope;
|
||||
AstBegin* oldbeginp = m_beginp;
|
||||
LinkDotCellVertex* oldVxp = m_cellVxp;
|
||||
LinkDotBaseVertex* oldInlineVxp = m_inlineVxp;
|
||||
// Where do we add it?
|
||||
LinkDotBaseVertex* aboveVxp = m_cellVxp;
|
||||
LinkDotBaseVertex* aboveVxp = m_inlineVxp;
|
||||
string origname = nodep->prettyName();
|
||||
string::size_type pos;
|
||||
if ((pos = origname.rfind(".")) != string::npos) {
|
||||
// Flattened, find what CellInline it should live under
|
||||
string scope = origname.substr(0,pos);
|
||||
string baddot;
|
||||
aboveVxp = m_statep->findDotted(aboveVxp, scope, baddot);
|
||||
LinkDotBaseVertex* okVxp;
|
||||
aboveVxp = m_statep->findDotted(aboveVxp, scope, baddot, okVxp);
|
||||
if (!aboveVxp) nodep->v3fatalSrc("Can't find cell insertion point at '"<<baddot<<"' in: "<<nodep->prettyName());
|
||||
}
|
||||
{
|
||||
m_scope = m_scope+"."+nodep->name();
|
||||
m_cellVxp = m_statep->insertCell(aboveVxp, m_cellVxp, nodep, m_scope);
|
||||
m_inlineVxp = m_cellVxp;
|
||||
m_beginp = NULL;
|
||||
if (nodep->modp()) nodep->modp()->accept(*this);
|
||||
}
|
||||
m_scope = oldscope;
|
||||
m_beginp = oldbeginp;
|
||||
m_cellVxp = oldVxp;
|
||||
m_inlineVxp = m_cellVxp;
|
||||
m_inlineVxp = oldInlineVxp;
|
||||
}
|
||||
virtual void visit(AstCellInline* nodep, AstNUser*) {
|
||||
UINFO(5," CELLINLINE under "<<m_scope<<" is "<<nodep<<endl);
|
||||
@@ -387,7 +447,8 @@ private:
|
||||
string dotted = dottedname.substr(0, pos);
|
||||
string ident = dottedname.substr(pos+strlen("__DOT__"));
|
||||
string baddot;
|
||||
aboveVxp = m_statep->findDotted(aboveVxp, dotted, baddot);
|
||||
LinkDotBaseVertex* okVxp;
|
||||
aboveVxp = m_statep->findDotted(aboveVxp, dotted, baddot, okVxp);
|
||||
if (!aboveVxp) nodep->v3fatalSrc("Can't find cellinline insertion point at '"<<baddot<<"' in: "<<nodep->prettyName());
|
||||
m_statep->insertInline(aboveVxp, m_cellVxp, nodep, ident);
|
||||
} else { // No __DOT__, just directly underneath
|
||||
@@ -396,10 +457,16 @@ private:
|
||||
}
|
||||
virtual void visit(AstBegin* nodep, AstNUser*) {
|
||||
UINFO(5," "<<nodep<<endl);
|
||||
// We don't pickup variables, but do need to find cells
|
||||
AstBegin* oldbegin = m_beginp;
|
||||
m_beginp = nodep;
|
||||
nodep->iterateChildren(*this);
|
||||
LinkDotBaseVertex* oldVxp = m_inlineVxp;
|
||||
{
|
||||
m_beginp = nodep;
|
||||
// Ignore begin names
|
||||
m_inlineVxp = m_statep->insertBegin(m_inlineVxp, m_cellVxp, nodep);
|
||||
// We don't pickup variables, but do need to find cells
|
||||
nodep->iterateChildren(*this);
|
||||
}
|
||||
m_inlineVxp = oldVxp;
|
||||
m_beginp = oldbegin;
|
||||
}
|
||||
virtual void visit(AstVar* nodep, AstNUser*) {
|
||||
@@ -407,6 +474,8 @@ private:
|
||||
&& !m_beginp // For now, we don't support xrefs into begin blocks
|
||||
&& !nodep->isFuncLocal()) {
|
||||
m_statep->insertSym(m_cellVxp, nodep->name(), nodep);
|
||||
} else {
|
||||
UINFO(9," Not allowing dot refs to: "<<nodep<<endl);
|
||||
}
|
||||
}
|
||||
virtual void visit(AstNodeFTask* nodep, AstNUser*) {
|
||||
@@ -418,7 +487,7 @@ private:
|
||||
}
|
||||
|
||||
// For speed, don't recurse things that can't have cells
|
||||
virtual void visit(AstNodeStmt*, AstNUser*) {}
|
||||
// Note we allow AstNodeStmt's as generates may be under them
|
||||
virtual void visit(AstNodeMath*, AstNUser*) {}
|
||||
virtual void visit(AstNode* nodep, AstNUser*) {
|
||||
// Default: Just iterate
|
||||
@@ -479,9 +548,9 @@ private:
|
||||
nodep->iterateChildren(*this);
|
||||
}
|
||||
// For speed, don't recurse things that can't have scope
|
||||
// Note we allow AstNodeStmt's as generates may be under them
|
||||
virtual void visit(AstCell*, AstNUser*) {}
|
||||
virtual void visit(AstVar*, AstNUser*) {}
|
||||
virtual void visit(AstNodeStmt*, AstNUser*) {}
|
||||
virtual void visit(AstNodeMath*, AstNUser*) {}
|
||||
virtual void visit(AstNode* nodep, AstNUser*) {
|
||||
// Default: Just iterate
|
||||
@@ -544,13 +613,14 @@ private:
|
||||
nodep->varp(NULL); // Module that is not in hiearchy. We'll be dead code eliminating it later.
|
||||
} else {
|
||||
string baddot;
|
||||
LinkDotBaseVertex* okVxp;
|
||||
LinkDotBaseVertex* dotVxp = m_cellVxp; // Start search at current scope
|
||||
if (nodep->inlinedDots()!="") { // Correct for current scope
|
||||
string inl = AstNode::prettyName(nodep->inlinedDots());
|
||||
dotVxp = m_statep->findDotted(dotVxp, inl, baddot);
|
||||
dotVxp = m_statep->findDotted(dotVxp, inl, baddot, okVxp);
|
||||
if (!dotVxp) nodep->v3fatalSrc("Couldn't resolve inlined scope '"<<baddot<<"' in: "<<nodep->inlinedDots());
|
||||
}
|
||||
dotVxp = m_statep->findDotted(dotVxp, nodep->dotted(), baddot); // Maybe NULL
|
||||
dotVxp = m_statep->findDotted(dotVxp, nodep->dotted(), baddot, okVxp); // Maybe NULL
|
||||
if (!m_statep->forScopeCreation()) {
|
||||
AstVar* varp = (m_statep->findSym(dotVxp, nodep->name(), baddot)
|
||||
->castVar()); // maybe NULL
|
||||
@@ -558,6 +628,7 @@ private:
|
||||
UINFO(7," Resolved "<<nodep<<endl); // Also prints varp
|
||||
if (!nodep->varp()) {
|
||||
nodep->v3error("Can't find definition of '"<<baddot<<"' in dotted signal: "<<nodep->dotted()+"."+nodep->prettyName());
|
||||
okVxp->errorScopes(nodep);
|
||||
}
|
||||
} else {
|
||||
string baddot;
|
||||
@@ -565,6 +636,7 @@ private:
|
||||
->castVarScope()); // maybe NULL
|
||||
if (!vscp) {
|
||||
nodep->v3error("Can't find varpin scope of '"<<baddot<<"' in dotted signal: "<<nodep->dotted()+"."+nodep->prettyName());
|
||||
okVxp->errorScopes(nodep);
|
||||
} else {
|
||||
while (vscp->user2p()) { // If V3Inline aliased it, pick up the new signal
|
||||
UINFO(7," Resolved pre-alias "<<vscp<<endl); // Also prints taskp
|
||||
@@ -588,14 +660,15 @@ private:
|
||||
nodep->taskp(NULL); // Module that is not in hiearchy. We'll be dead code eliminating it later.
|
||||
} else {
|
||||
string baddot;
|
||||
LinkDotBaseVertex* okVxp;
|
||||
LinkDotBaseVertex* dotVxp = m_cellVxp; // Start search at current scope
|
||||
if (nodep->inlinedDots()!="") { // Correct for current scope
|
||||
string inl = AstNode::prettyName(nodep->inlinedDots());
|
||||
UINFO(8,"\t\tInlined "<<inl<<endl);
|
||||
dotVxp = m_statep->findDotted(dotVxp, inl, baddot);
|
||||
dotVxp = m_statep->findDotted(dotVxp, inl, baddot, okVxp);
|
||||
if (!dotVxp) nodep->v3fatalSrc("Couldn't resolve inlined scope '"<<baddot<<"' in: "<<nodep->inlinedDots());
|
||||
}
|
||||
dotVxp = m_statep->findDotted(dotVxp, nodep->dotted(), baddot); // Maybe NULL
|
||||
dotVxp = m_statep->findDotted(dotVxp, nodep->dotted(), baddot, okVxp); // Maybe NULL
|
||||
|
||||
AstNodeFTask* taskp = (m_statep->findSym(dotVxp, nodep->name(), baddot)
|
||||
->castNodeFTask()); // maybe NULL
|
||||
@@ -603,6 +676,7 @@ private:
|
||||
UINFO(7," Resolved "<<nodep<<endl); // Also prints taskp
|
||||
if (!nodep->taskp()) {
|
||||
nodep->v3error("Can't find definition of '"<<baddot<<"' in dotted task/function: "<<nodep->dotted()+"."+nodep->prettyName());
|
||||
okVxp->errorScopes(nodep);
|
||||
}
|
||||
}
|
||||
nodep->iterateChildren(*this);
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3LINKDOT_H_
|
||||
#define _V3LINKDOT_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -24,7 +24,8 @@
|
||||
// Create new MODULE TOP with connections to below signals
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3LINKLEVEL_H_
|
||||
#define _V3LINKLEVEL_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
// Convert normal var to FILE* type
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3LINKRESOLVE_H_
|
||||
#define _V3LINKRESOLVE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3LIST_H_
|
||||
#define _V3LIST_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <vector>
|
||||
|
||||
//============================================================================
|
||||
|
||||
+2
-1
@@ -27,7 +27,8 @@
|
||||
//
|
||||
//*************************************************************************
|
||||
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
|
||||
#ifndef _V3LOCALIZE_H_
|
||||
#define _V3LOCALIZE_H_ 1
|
||||
#include "config.h"
|
||||
#include "config_build.h"
|
||||
#include "verilatedos.h"
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user