Never use $display and `uvm_info to debug SystemVerilog again.
The icecream_sv utility makes it easier to inspect variables, expressions, and program flow with minimal syntax. Inspired by the IceCream
project, icecream_sv
aims to bring the simplicity and convenience of those tools to the SystemVerilog world. icecream_sv is available under the MIT License and can be used without restriction in both open-source and commercial applications.
To use icecream_sv
, simply include and import the icecream_pkg.sv
file in your project's build flow.
To debug with icecream_sv
, use the IC
macros anywhere in your SystemVerilog code:
module my_module;
initial begin
// Example usage of icecream_sv
int value = 10;
byte char = "A";
string str = "ICECREAM for SV";
`IC; // This will print this line number and file name
`IC_HEX(value); // This will print the variable name and its value in hex format
`IC_DEC(value); // This will print the variable name and its value in dec format
`IC_CHAR(char); // This will print ASCII and HEX for char_var variable
`IC_STR(str); // This will print string_var string
$finish;
end // initial begin
endmodule: my_module
Output:
IC_SV:: @0 Line:29 File:../test_icecream.sv
IC_SV:: @0 value(a)
IC_SV:: @0 value(10)
IC_SV:: @0 char(41),(A)
IC_SV:: @0 str(ICECREAM for SV)
- Change directory to
test/<simulator>
- Run
make
NOTE: The test is available only for Verilator currently.
- API specification is available here.
- Easy Inspection: Quickly print variable names and their values without repetitive code.
- Minimal Syntax: Use the
IC
macros for everything, keeping your debug code clean and concise. - Flexible: Works with any SystemVerilog data type.
- Contributions to
icecream_sv
are welcome! Whether it's adding new features, fixing bugs, or improving documentation, feel free to fork the repository and submit a pull request. - Please report bugs to the Issues page.
Please contact us at [email protected]
icecream_sv
is released under the MIT License. See the LICENSE file for more details.
- Inspired by
IceCream
protects:
https://github.com/gruns/icecream
Delicious IceCream
should be enjoyed in every language.
- Dart: icecream
- Rust: icecream-rs
- Node.js: node-icecream
- C++: IceCream-Cpp
- C99: icecream-c
- PHP: icecream-php
- Go: icecream-go
- Ruby: Ricecream
- Java: icecream-java
- R: icecream
- Lua: icecream-lua
- Clojure(Script): icecream-cljc
- Bash: IceCream-Bash