Skip to main content

Kratos runtime for debugging

Project description

Kratos Debugger Runtime

This is the runtime library required to debug Kratos hardware designs. You need a C++17 compatible compiler, such as g++-8 to compile the library.

How to use Kratos-Runtime

The following instruction is based on Linux and tested against Verilator and ncsim.

$ git clone https://github.com/Kuree/kratos-runtime
$ cd kratos-runtime
$ git submodule update --init --recursive
$ mkdir build
$ cd ./build
$ cmake ..
$ make -j

After that, you can find the library as build/src/libkratos-runtime.so. You can either copy that library to any place you like or simply use symbolic link.

Generate Kratos-Runtime debug database for your design

When calling verilog() function, you can supply another argument called debug_db_filename to specify the location where kratos can output the debug files,

verilog(design, debug_db_filename="debug.db")

Using Kratos-runtime with Verilator

Once you have compiled the shared library, you can ask verialtor to link your test bench with kratos-runtime. Before you do that, since we need to read the internal signals, we need to inject verilator specific info via a pass:

_kratos.passes.insert_verilator_public(design.internal_generator)

_kratos is the namespace for native C++ binding, you can use it via import _kratos.

When invoking the verilator command, you need to specify the kratos runtime name as well as --vpi switch, for instance:

verilator --cc design.sv test_tb.sv libkratos-runtime.so --vpi --exe

You can symbolic link libkratos-runtime.so inside obj_dir so that the linker and find it easily.

Once the test bench is compiled, you need to use LD_LIBRARY_PATH to let the system to load, such as

$ LD_LIBRARY_PATH=./obj_dir/ ./obj_dir/Vtest

Or you can let the linker to fix the shared library path in the verilator, which is beyond the scope of this tutorial.

Using kratos-runtime with Ncsim

Ncsim is much easier to use than verilator. Once you have the design, simply tell the simulator that you want to load the vpi and dpi library, such as

irun test_tb.sv test.sv -sv_lib libkratos-runtime.so -loadvpi libkratos-runtime.so:initialize_runtime_vpi -access +r

-access +r is necessary to allow the runtime to read out simulation variables.

What to do after launch the simulation

You can now use any debugger that's compatible with the Kratos debug protocol. Kratos has provide an open-source version of debugger extension inside VS Code. You can install it here and use it to debug your design.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

kratos_runtime-0.0.1-cp37-cp37m-manylinux1_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.7m

kratos_runtime-0.0.1-cp36-cp36m-manylinux1_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.6m

kratos_runtime-0.0.1-cp35-cp35m-manylinux1_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.5m

File details

Details for the file kratos_runtime-0.0.1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: kratos_runtime-0.0.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for kratos_runtime-0.0.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 08b91b3cfcf8abdb4790e678e67a5dea66b1b68f5916b55e74c8fd777ed0deae
MD5 ea3c8920b06e9d647fab1b64df16d63a
BLAKE2b-256 64934db5792d79e517f4ec6bca276f70e9356837cda1a11dba89cfc11ef1fba8

See more details on using hashes here.

File details

Details for the file kratos_runtime-0.0.1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: kratos_runtime-0.0.1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for kratos_runtime-0.0.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 45bab65c14cd5bc7dd4692627acd7436dbc2d39148893e1970b4faed7ff85de5
MD5 ae4016cfca8f3a90d017d518a9f6a255
BLAKE2b-256 aa32dacb9cb464a790a5ff4fe492685fc4080936edf33710758a0ebe3782d584

See more details on using hashes here.

File details

Details for the file kratos_runtime-0.0.1-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: kratos_runtime-0.0.1-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for kratos_runtime-0.0.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c116e4c70025ca50e3e356c215f72d7a35c55ae5929bb66690b33da1c6f40663
MD5 ebdb067d07d905a50a740853810f9a7b
BLAKE2b-256 d2efc31dbd1bb3aa1e554b6aefb93466ce67c1aee0668c168a55415fa003e9a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page