Skip to content

Building and running

The C++ Kathryn builds with CMake into a single executable, Kathryn. You run it by handing it one argument — the path to a parameter file — and the front end decides what to do from a key inside that file. This page covers the build, the testType values you can use, and where output lands.

From the repository root, the Readme.md build recipe is:

Terminal window
mkdir build && cd build
cmake -DBUILD_RIDECORE=OFF ..
make -j

CMakeLists.txt declares the project as C++17 and globs the source tree into a single Kathryn executable target — main.cpp, src/kathryn.cpp, and every .cpp under src/abstract, src/application, src/frontEnd, src/model, src/sim, src/gen, src/test, src/util, src/example, src/params, and src/lib:

add_executable(Kathryn
main.cpp
src/kathryn.cpp
${SRC_ABS} ${SRC_APP} ${SRC_FED} ${SRC_MODEL}
${SRC_SIM} ${SRC_GEN} ${SRC_TEST} ${SRC_UTIL}
${SRC_EXAMPLE} ${SRC_PARAM} ${SRC_LIB}
${SRC_MODEL_COMPILE}
${SRC_RIDE_SIM}
)

The build also injects KATHRYN_PROJ_FOLD_PATH (the source directory) as a compile definition, so the tool can locate project-relative paths at runtime.

main.cpp is deliberately small. It reads the parameter file named by the first command-line argument, then calls start(params):

int main(int argc, char* argv[]) {
if (argc < 2){
std::cout << "there is no argument value" << std::endl;
}
auto params = readParamKathryn(argv[1]);
/***** model and simulation start here*/
start(params);
}

So a run looks like:

Terminal window
./Kathryn ../params/smParams

See Parameters for the full parameter-file format; every path key expects a trailing /, per the sample files.

The parameter file’s testType key selects the built-in scenario. These are the accepted values:

testTypeWhat it runs
testSimpleThe auto-simulation suite (what the smParams sample uses)
testO3SimThe out-of-order (O3) example simulation
testKrideSimThe Kride CPU simulation
testRideSimThe reference RIDECORE simulation — needs BUILD_RIDECORE=ON
testKrideRideCombSimThe Kride-versus-RIDECORE co-simulation — needs BUILD_RIDECORE=ON
testGenVerilog generation for the built-in generation example
testGenO3Verilog generation for the O3 design

Any other value prints there is no command to test system and exits.

flowchart LR
    P["Parameter file<br/>testType = ..."] --> K["./Kathryn"]
    K --> SIM["Simulation run<br/>.vcd + .prof"]
    K --> GEN["Generation run<br/>.v"]

Simulation scenarios write a .vcd waveform and a .prof ZEP profiler report; generation scenarios write a .v Verilog file. In the shipped params files everything lands under the repository’s KOut/ directory. These are the keys that control those output files:

KeyScenarioEffect
prefixsimulationOutput directory the run writes its .vcd/.prof results into
vcdFile / profFilesimulationExplicit destination paths for the waveform and profiler report
buildSimModesimulationWhich simulator JIT stages run — g/c/r = generate / compile / run
genFoldergenerationOutput folder for the generated Verilog
topFileNamegenerationBase name of the emitted top .v file
topModNamegenerationVerilog module name of the top module

See Parameters for the full key reference and the catalog of shipped params files.

The two RIDECORE scenarios only work when the tool was built with cmake -DBUILD_RIDECORE=ON (requires Verilator and the populated extSim/ridecore submodule); otherwise they print RIDE simulation is not enabled. Please build with BUILD_RIDECORE=ON.

  • Quickstart: the blink sample — the smallest complete design plus simulation, walked through line by line.
  • Parameters — the full parameter-file format and every key the front end reads.