Hi, I’ve written a simple testbench to verify that I can pass a value via the command line and retrieve it using sknobs::get_value.
Here is the test code:
module test;
int my_value;
initial begin
$display("[INFO] Reading knob 'my_knob'...");
my_value = sknobs::get_value({".my_value"}, 1);
$display("[INFO] Got knob value: my_knob = %0d", my_value);
end
endmodule
I am using QuestaSim to run this code and check whether I receive the value from the command line. Here are the commands I used:
vlog +acc -sv -dpiheader sknobs.h ./src/verilog/sknobs.sv test.sv
vsim -sv_lib ./x86_64/lib64/libsknobs work.test +my_value=10~20 -c -do "run -all; quit"
However, I am getting the following output, which shows the value is not updated, and I receive the default value instead:
[INFO] Reading knob 'my_knob'...
0:I:sknobs: +.my_value=1
[INFO] Got knob value: my_knob = 1
If I am doing something wrong, please help me identify and correct it. Thank you!