-
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
Question: how do you handle relating error messages to the original systemverilog source code? #194
Comments
If there are errors in the SystemVerilog source, my intention is for either sv2v to produce a useful error, or for the error to be visible in a reasonable downstream tool like Yosys. Although there is not currently an "automated" way to "convert" the source positions in downstream errors, sv2v does leave source position traces and some other information in the generated output when run in verbose mode. These can be used to relate errors to the original SystemVerilog source. |
@hughperkins Has your question been fully addressed? |
You've technically answered the question. I kind of would like to create a request to automatically relate error messages back to the original sv. Although, I suppose you could argue that:
|
So, in practice, circling around, it is easily possible to inadvertently construct programs which pass through |
Yosys has the ability to read (* src = "test.v:24.1-30.10" *)
module top(a, b);
(* src = "test.v:25.8-25.9" *)
input a;
wire a;
(* src = "test.v:26.9-26.10" *)
output b;
wire b;
assign b = a;
endmodule Seeing as the trace statements are already generating something similar to this, how hard would it be to add ability for sv2v to generate these attributes? Alternatively there is `line in verilog which should potentially have better support by other tools (the src attribute is yosys specific afaik) but is more intended for simply copying and pasting lines, not the shifting of content that can occur in sv2v due to the ast representation. It would be quite nice if source line numbers could be preserved for things like symbiyosys that references failing assertions by their |
Question: how do you handle relating error messages to the original systemverilog source code?
Like, an issue I find with using generators (of which, this project is generating verilog, given systemverilog), is that one gets error messages in the generated language, not in the language one is actually writing code in. This basically forces one to read the generated code, and have to work with the generated code.
An example of a possible solution could be a tool which takes an error in the generated verilog, and converts it into an appropriate message for the original systemverilog code. For example, during verilog generation, the original line numbers and so on could be stored somehow/somewhere, and then could be read by such a tool.
Just wondering what approach is being used for sv2v?
The text was updated successfully, but these errors were encountered: