Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Timescale with `define macros #19

Closed
sgherbst opened this issue Apr 7, 2020 · 2 comments
Closed

Timescale with `define macros #19

sgherbst opened this issue Apr 7, 2020 · 2 comments
Assignees

Comments

@sgherbst
Copy link

sgherbst commented Apr 7, 2020

Thanks for the awesome work on this project and sv-parser! Just ran across a small issue when using `timescale in combination with `define macros. I'm not sure about what the LRM says about this syntax, but it seems to be supported by some commercial and open-source simulators.

Example:

`define TIME_UNIT 1ns
`define TIME_PRECISION 1ps
`timescale `TIME_UNIT / `TIME_PRECISION
module test;
    initial begin
        #(1.234321ns);
        $display($realtime);
        $finish;
    end
endmodule

Output:

> svlint test.sv
Config file '.svlint.toml' is not found. Enable all rules
Error: parse error
   --> test.sv:3:1
  |
3 | `timescale `TIME_UNIT / `TIME_PRECISION
  | ^
@dalance dalance self-assigned this Apr 7, 2020
@dalance
Copy link
Owner

dalance commented Apr 7, 2020

Thank you for your report.
LRM doesn't say this syntax is valid or invalid.
So I'll fix this parse error.

@DaveMcEwan
Copy link
Contributor

This issue is already raised on sv-parser instead of svlint.
@dalance Would you close this issue?

@dalance dalance closed this as completed Feb 7, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants