Skip to content
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

(Verilog) nMigen should provide better information about original source code locations #293

Closed
Maykeye opened this issue Jan 4, 2020 · 3 comments
Labels

Comments

@Maykeye
Copy link

Maykeye commented Jan 4, 2020

Consider for example this report from yosys

    Unreached cover statement at abc.sv:2402.

If I go there, I'll see

 always @* if (\$cover$en ) cover(\$cover$check );

and I'll have to jump to \$cover$check, maybe even further to variables like \$157.

Instead nMigen should generate

 `line 123 /mnt/e/nmigen/abc.py
 always @* if (\$cover$en ) cover(\$cover$check );

In other words

a) source location should be generated next to cover/assert statements, not just next to their corresponding variable
b) Instead of comments like (* src = "/mnt/e/abc/cde.py:17" *), source locations should be generated with `line so tools like SymbiYosys can point the right location (maybe optionally: verilog95 doesn't describe `line directive, it was added in verilog 2001)

@whitequark
Copy link
Contributor

If you are using SymbiYosys, do not emit Verilog from nMigen. Instead, emit RTLIL from nMigen, which already has far more precise location information than Verilog `line directives can represent even in principle.

@Maykeye
Copy link
Author

Maykeye commented Jan 4, 2020

Doesn't it only works with yosys and its friends? I had not only it in mind, but also vendor specific tools which support verilog and preprocessor directives.

@whitequark
Copy link
Contributor

Doesn't it only works with yosys and its friends?

Correct.

I had not only it in mind, but also vendor specific tools which support verilog and preprocessor directives.

There is little nMigen can do directly here, since it relies on Yosys to emit Verilog. It is possible to improve the Yosys Verilog backend to emit `line directives, but I have no specific plans to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants