This is a VS Code Extension for debugging hardware generated by Kratos. It
supports step, continue, and breakpoints.
To use it, you have to enable the debug database dump when you call
verilog() function in Kratos:
verilog(design, debug_db_filename="debug.db")
This will dump a database file called debug.db in your current working
directory.
Using Kratos VS Code Debugger Extension
Install the extension in VS Code. You can search kratos-vscode in the extension page.
Compile kratos-runtime, which can be obtained from here.
Start your favorite Verilog simulator:
For Verilator, make sure you enable --vpi, put initialize_runtime()
before your test bench. For details see here. You also need to inject
Verilator-specific debug info as a pass before producing your design files:
Open your working directory where you generate the design as well as the
debug database
Run Debug (or press F5) and choose Kratos
Enter your debug file name, e.g., debug.db
You can now debug the kratos design as if debugging software!
Using Module Viewer
Once you're in the debugging session, open the command prompt (or pressing
F1), then type Kratos. You will see an option of Kratos module
viewer. Once you open it, you can see the visualization of all different
modules in different hierarchy.
Here is a list of available actions you can take on the module viewer:
Hover mouse on any module will show the full name.
Double click a module will "zoom in" into that instance scope
Double click the empty background will bring you one level back in the hierarchy.
Click Break on Clock Edge: On will disable the break on clock edge.