Professional Documents
Culture Documents
2. Incremental compilation use models re-compilation is based on the contents of this single
2.1. Single-user environment directory.
developed for use by a team of designers. The ASIC's modules in a design are detected and catalogued by
are used in two designs. Each design is tested VCS.
independently by a suite of test benches. The Figure 2 gives an overview of the VCS
pre-compiled code for the library modules gets architecture, with focus on incremental compilation.
generated into the respective libraries through the VCS first performs a preliminary compilation on the
following command sequence: Verilog source. Based on this, a Global Analysis (GA)
$ vcs -Mdir=lib1 Asic1.v of the design is conducted to resolve inter-module
$ vcs -Mdir=lib2 Asic2.v dependencies, and to perform global optimizations. At
$ vcs -Mdir=lib3 Asic3.v the end of GA, the Incremental Compilation phase
analyzes incremental-specific data from the previous
$ vcs -Mdir=lib4 Asic4.v
run. First, relevant token changes in the Verilog source
The libraries can then be shared through are detected. Next, inter-module dependencies
commands such as: (determined through GA) are used to propagate the
$ vcs -Mlib=lib1:lib2:lib3:lib4 \ effect of the changes to other modules in the design
Asic1.v Asic3.v Design1.v TB1.1.v hierarchy. This results in exact determination of the
$ vcs -Mlib=lib1:lib2:lib3:lib4 \ modules for which code needs to be re-generated in the
Asic1.v Asic3.v Design1.v TB1.2.v current run.
The -Mlib option tells VCS to look in the The three code generation styles (C code, assembly
colon-separated list of libraries for pre-compiled code. code, and object code) are taken into account in making
In the first -Mlib command above, the code for the two re-compilation decisions. Incremental compilation then
ASIC’s get picked up from lib1 and lib3 issues directives to the code generator, to generate code
respectively. The other two libraries, though specified, for the appropriate modules. No new code is generated
remain unused. The code for Design1.v and for modules that do not need re-compilation.
TB1.1.v get compiled into csrc, since they are not Incremental compilation also writes out new
available in any of the libraries. incremental data, for use in subsequent runs.
In the second -Mlib command, the code for Section 3.2 discusses the exact nature of
Design1.v is picked up from the current csrc, inter-module dependencies in Verilog HDL. The global
where it was generated during the previous run. The dependencies which simultaneously affect multiple
ASIC's are picked up from their appropriate libraries, as modules are described in Section 3.3.
before. The test bench TB1.2.v needs to be compiled,
because it was not compiled before. But none of the
other modules in the overall design need to be
re-compiled (except as necessitated by certain
inter-module dependencies -- see Section 3.2).
3. Approach
3.1. Architecture
As defined by the Verilog HDL, VCS treats each
Verilog module or UDP as an independent design unit,
with well-defined communication to other design units
through ports. The exception to this communication
scheme is when the design contains hierarchical
references from one module to another, which needs
special treatment. These inter-dependencies between the
Incremental Compilation in the VCS Environment
Compilation
Global Analysis
Incremental
Compilation
Directives to
Code Generator
Code Generation
the parent's body. This introduces a special type of and to re-use the generated code for shared portions of
inter-module interaction that affects incremental the design.
compilation. This optimization is transparent to the
user. But since such inlining alters the design hierar- 5. Future scope
chy for code generation, re-compilation decisions for Incremental compilation is an area of continuous
an inlined child module affect those of the improvement in VCS. Enhancements are made to
non-inlined ancestor module. handle evolving user requirements, and to support new
3.3. Global dependencies capabilities in VCS. We also identify design
methodologies that are able to take full advantage of
Several global dependencies also come into play VCS's architecture.
in influencing the re-compilation decisions of
For instance, if disk space is not a scarce resource,
incremental compilation.
it is possible to keep architecture-specific copies of
1. Command-line options: Changes in command-line generated code around, and move back and forth
options can result in changes to generated code. For between architectures without the need to re-compile
instance, global flags such as ‘+nospecify’ will the design from scratch. As another example, in the
affect a whole suite of modules sharing the relevant -Mlib context, when an ASIC is used within multiple
property (the occurrence of ‘specify’ blocks, in test benches, the latter may make hierarchical references
this case). into portions of the ASIC. These references serve to
2. Compiler directives: Altering a compiler directive either probe signals or to modify their values during
can affect the code generated for several modules. For simulation. In this situation, one can introduce the
instance, changing the timescale/precision for the notion of an ASIC Shell, which will in effect provide a
design will affect all modules within the scope of that one-module interface to all the test benches, for all of
change. Incremental compilation has to handle such their hierarchical references. The Shell “insulates” the
changes. rest of the ASIC from the chain reaction in
3. Platform dependence: VCS supports Verilog simula- re-compilation that is inherent to changes in hierarchical
tion on many platforms (such SunOS, Solaris, HP, references. Sometimes, existing designs can be modified
NT, etc.). Moving between platforms will naturally to replace hierarchical references with port references,
result in re-compilation of the entire design. to provide similar benefits.
4. Performance results
The performance figures in Table 1 were obtained
from running an internal benchmark design.They
illustrate the speed-ups and space savings that can be
derived through the use of incremental compilation.
The design consists of 563 modules. It has 372337
lines of Verilog source (8.2 megabytes). The first VCS
run was a full compilation, which took 12 minutes and
19 seconds to compile. Subsequent runs involved
changes to a portion of the design. The table
demonstrates the significant savings in re-compilation
time through incremental compilation.
The use of Shared Incremental Compilation
augments these savings, by its ability to share modules
Incremental Compilation in the VCS Environment
2 0 0 01:04 08.66%
3 5 7 02:12 17.86%
4 11 17 02:26 21.11%
6. Summary References
VCS's approach to Incremental Compilation offers [LRM] “IEEE Standard Hardware Description Language
the user the advantages of minimal compilation time Based on the Verilog(R) Hardware Description Language”,
during design development while providing fast IEEE Standard 1364-1995.
simulation performance. VCS's Incremental [VCS] “VCS/VCSi & XVCS/XPOST, Version 4.0”, July,
Compilation has been fine-tuned to provide optimal 1997. Copyright, Viewlogic Systems, Inc.
performance for designs specified in Verilog HDL. Our
results quantify the impact of incremental compilation
in typical development scenarios, and demonstrate the
superiority of this approach in Verilog compiled code
simulation.
Acknowledgments
Several members of Viewlogic's engineering and
customer support teams have been instrumental in
testing and improving this capability, during its
development. We are grateful to one and all of them. We
would especially like to thank Eric Zhao, Raghu
Srigiriraju, and Riyaz Puthiyapurayil for their help with
the Incremental Compilation design and development.
Our special thanks go to Phil McGee for his help in
preparing the final draft of this paper.