-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert severity tasks to Verilog #273
Comments
I ran this example through the big 4 to see what the outputs should be: module tb;
initial begin
$info;
$info("%b", 1);
$warning;
$warning("%b", 2);
$error;
$error("%b", 3);
// $fatal;
// $fatal(0, "%b", 4);
// showing results from both fatal calls if each were run individually
end
endmodule VCS
ModelSim
Xcelium
Verilator
(Note that this run required the use of SummaryThis is what I'm thinking: $info(message); $display("[%t] Info: %s", $time, message);
$display("Src File: <PRE_SV2V_FILENAME>:<PRE_SV2V_LINE>, Scope: <PRE_SV2V_SCOPE>");
$display("Sv2v File: <POST_SV2V_FILENAME>:%s, Scope: <POST_SV2V_SCOPE>", "<POST_SV2V_LINE>");
for example:
|
I'm very interested in getting this enhancement in, and greatly appreciate your initiative in filing a PR. Thank you! I think I'm missing an important piece of context: What tools don't support the SystemVerilog severity tasks? I know iverilog and Yosys do. Verilator does, but only in SystemVerilog mode. You've got a good sampling of the commercial simulators here, too. What tool are you using in your flow that doesn't support them? |
As far as I can tell, all commercial tools support the SystemVerilog severity tasks only when in SystemVerilog mode. And I wasn't aware that Yosys had support. So I don't believe that it is crucial for this issue to be completed. Plus, if a tool natively supports SystemVerilog severity tasks, it likely can provide more helpful warnings than what sv2v can offer. But this change would bring sv2v closer to full 1800→1364 conversion. So I would say it is up to you on whether this change should be used. 😃 |
Hello!
SystemVerilog added the system tasks
$fatal
,$error
,$warning
, and$info
(20.10). However, sv2v does not convert them at all, causing Verilog tools to fail. It would be nice to convert them into Verilog-2005 tasks so that they can still be used in pure Verilog tools.This is my interpretation of the LRM:
$error
,$warning
, and$info
should all be turned into$display
.$fatal
should first run a$display
, then run$finish
This is a description of what should go in the
$display
:It could be helpful to have
`__FILE__
and`__LINE__
for both the inputted.sv
file and the outputted.v
file. Verilog-2005 has no`__FILE__
equivalent, but it does have`line
(19.7).I would be happy to look into this if you'd like. :)
The text was updated successfully, but these errors were encountered: