Utilities Library
The utilities library defines a set of common headers, macros, functions and classes, that are handy when writing a hardware SOC simulation.
Headers - Commonly used C++ headers - Type definitions - An error exception handling class - always.hpp file is expected to be included by every source file in the simulation. Macros - Code location for debugging - Conditional print out, where the error message string is only created, if the condition is true, but not otherwise, thus saving execution time. Buffer Buffer is a class, that implements a hardware buffer. Command Line Parser Cmdline_Parser is a class, that provides command line parsing functionality. It is implemented as a Singleton, and allows whoever instantiates it to independently process its own command line options. File Handling Functions file_func contains a collection of: - Basic file processing functions, and - Text file parsing functions. Debug Print Control Print_Ctrl_Base is a base class for print-out control classes. Such classes are used to control the print-out of debug messages, during program execution. This is done by defining the conditions upon which print-out is permitted. The conditions are configured on the command line, and in an input text file. Using those conditions in a program, let's the programmer dynamically select which information is shown, helping in debugging and testing of the code. |
|
Safe Vector
Safe_Vector is a template class, that extends C++'s vector class, by adding:
- Boundary checking to element access () op, and
- Error print-out messages, that include the variable name associated with the vector.
Component Testing
Each component of the library has its own accompanying test, for debugging purposes.
How to Build
To compile and build the included code, you first need to define 2 environment variables in your shell:
Component Building
Compile each component or component's test from its source directory, by calling make.
The build is done in a directory related to the selected build type - either debug, release or profile.
By default, make will build the debug version of your code, and place it in the build/debug directory.
To build any other type, add 'BUILT=type' on the command line. E.g., to build the release version of your code, and place it in the build/release directory, do:
make BUILD=release
Library Building
Compile the entire library from its base directory, TOT/simlib, by calling make.
The build is done in a directory related to the selected build type - either debug, release or profile.
By default, make will build the debug version of your library, and place it in the build/debug directory.
To build any other type, add 'BUILT=type' on the command line. E.g., to build the release version of your library, and place it in the build/release directory, do:
make BUILD=release
Distribution
Once the library has been built, it is made available to its users via the include directory.
This directory contains all the header files associated with the functionality of the library, as well as the library file itself (.a file).
Note, that the src directory structure is maintained within the include directory.
You can use a script, e.g.
src/make_dist.cshrc,
to help you copy the appropriate files to the include directory.
Library Testing
The library as a whole, has an accompanying test, TOT/simlib/test/test.cpp , for debugging purposes.
This test is a user of the library, i.e. the test uses the distributed version of the library and its header files, found in the
TOT/simlib/include
directory.
Safe_Vector is a template class, that extends C++'s vector class, by adding:
- Boundary checking to element access () op, and
- Error print-out messages, that include the variable name associated with the vector.
Component Testing
Each component of the library has its own accompanying test, for debugging purposes.
How to Build
To compile and build the included code, you first need to define 2 environment variables in your shell:
- TOT
This is the directory where you extracted the ZIP file.
All code and builds reside here. - MAKEFILES_DIR
This is the directory where the helper Makefiles reside.
In the ZIP file, this directory is called makefiles, and is right under TOT.
Component Building
Compile each component or component's test from its source directory, by calling make.
The build is done in a directory related to the selected build type - either debug, release or profile.
By default, make will build the debug version of your code, and place it in the build/debug directory.
To build any other type, add 'BUILT=type' on the command line. E.g., to build the release version of your code, and place it in the build/release directory, do:
make BUILD=release
Library Building
Compile the entire library from its base directory, TOT/simlib, by calling make.
The build is done in a directory related to the selected build type - either debug, release or profile.
By default, make will build the debug version of your library, and place it in the build/debug directory.
To build any other type, add 'BUILT=type' on the command line. E.g., to build the release version of your library, and place it in the build/release directory, do:
make BUILD=release
Distribution
Once the library has been built, it is made available to its users via the include directory.
This directory contains all the header files associated with the functionality of the library, as well as the library file itself (.a file).
Note, that the src directory structure is maintained within the include directory.
You can use a script, e.g.
src/make_dist.cshrc,
to help you copy the appropriate files to the include directory.
Library Testing
The library as a whole, has an accompanying test, TOT/simlib/test/test.cpp , for debugging purposes.
This test is a user of the library, i.e. the test uses the distributed version of the library and its header files, found in the
TOT/simlib/include
directory.