The Designer's Guide to VHDL, 2nd Edition
Peter J. Ashenden
Source Code and Test Benches
archive of source code
tar archive of sources
There is a separate directory for
each chapter, with the directory named ch_cc containing the files
for Chapter cc. In addition the directory named ap_a contains files
for Appendix A. Within each directory (except those for the four case study
chapters) the files are named using the following scheme:
The naming of files for the case studies varies from this scheme and is
typical of schemes that might be used for real design projects. The file
names are based on the VHDL design units they contain. The scheme is:
fg_cc_nn.vhd - code from Figure cc-nn. In some
cases, this is just the code from the figure, with test-bench code being
provided in a separate file. In other cases, test-bench code is included
in the file, and comments distinguish test-bench code from figure code.
pk_cc_nn.vhd - package declarations used to declare types
used in the figure code.
tb_cc_nn.vhd - test-bench code used to exercise the figure
ch_cc_nn.vhd - code from the book other than in figures.
Comments indicate which sections contain each piece of code. In most cases,
test-bench code is included to exercise the code from the book.
index_cc.txt - a manifest of files contained in the directory.
The directory named util contains a VHDL package called stimulus_generators,
which should be analysed into a library called util for use in some of
the test benches. The package provides procedures to generate all possible
stimulus values for vector inputs of various types.
package declaration: package_name.vhdl
package body: package_name-body.vhdl
entity declaration: entity_name.vhdl
architecture body: entity_name-architecture_name.vhdl
configuration declaration: entity_name_description.vhdl, where description
indicates the architecture body or bodies used
In many of the code examples in the book, segments of code are elided,
indicated by ellipsis points (...). Their treatment in the source code
files varies, depending on the reason for elision. If the code is elided
for brevity, the code is included in full in the file. If the code is elided
because it is not relevant to the example, it is also elided in the file.
The file contains the ellipsis points commented out. If the elision results
in syntactically incorrect code, "fix-up" code may be inserted to allow
the file to be analyzed without error. In some cases, test-bench code may
also be inserted.
If you have comments, please send me email at email@example.com.