CMake is the build system used by Kosim. Kosim is built by running in kosim/src dir : $ ./build.shThe directory structure of kosim includes the following types of dirs: - - main : where the final lib imported by python script is generated
- - examples : where the examples are located; currently examples form systemc, scv and Doulos TLM2.0 examples are present
- - lib_dir : where specific libs will be build (e.g. hierarchy_scanner. generic_cpu, etc)
CMake uses the CMakeLists.txt files to generate the Makefiles needed for building the project. The main CMakeLists.txt is located in kosim/src dir and contains info like: - project name
- build type (debug, release)
- include and link directory paths to the used libs (e.g. systemc, scv, TLM)
- a list of all directories the CMake will recurse into
The examples and lib_dir kind of directories contain each a CMakeLists.txt that specifies: - the path to the headers that need to be included
- the name of the the lib generated and the source files that are part of the lib
The subdirectories of main directory contain each a CMakeLists.txt that specifies: - the path to the headers that need to be included
- path to extra libs needed
- the name of the the lib generated and the source files that are part of the lib
- the names of the extra libraries used
The script build.sh does the following actions: - exports environment variables related to include and libraries paths
- calls python scripts related to program options feature
- calls cmake/make commands to clean and build the system
How to run a testOnce the system was properly build, the simple_fifo example can be run: $ cd kosim/src/main/sc/simple_fifo $ python simple_fifo.py
Once the framework is built using build.sh script, as long as only the source files are modified, the library affected can be build using the commands make and/or make clean. The script build.sh must be called only if new files or other changes in the directory structure happened so that new Makefiles are generated to reflect the changes. |