I have a SV printing task that concatenates some input strings and prints a message. This code works on Cadence's tools, but when I tried porting to iverilog
, I get compile errors.
task Error (
input string msg,
input string name = ""
);
begin
$timeformat(-9, 2, " ns", 12);
name = (name.len() > 0) ? {_ModuleName(name), ": "} : "";
$display(" Error: at %0t: %0s%0s", $time, name, msg);
end
endtask
And the error message:
error: Data types string and bool of ternary do not match.
I guess this may be unsupported by tools, but I could not find an exact reference on this. I suspect strings concatenation may not work as I expect, but again - hard to find info on concatenation supported by iverilog
.
# iverilog -v
Icarus Verilog version 12.0 (stable) (s20221226-238-g9e4c4d546)