8000 Is $bits(interface.port) supported? · Issue #2085 · verilator/verilator · GitHub
[go: up one dir, main page]

Skip to content

Is $bits(interface.port) supported? #2085

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

Closed
nanduraj1 opened this issue Dec 31, 2019 · 2 comments
Closed

Is $bits(interface.port) supported? #2085

nanduraj1 opened this issue Dec 31, 2019 · 2 comments
Labels
area: elaboration Issue involves elaboration phase resolution: duplicate Closed; issue or pull request already exists

Comments

@nanduraj1
Copy link
nanduraj1 commented Dec 31, 2019

Test Code

interface t_if #(
    parameter D_WIDTH=8
);

    logic [D_WIDTH-1:0]  data;

    modport source (output data);
    modport sink   (input  data);
endinterface


module test(
    t_if.sink snk_if
);

    localparam D_WIDTH = $bits(snk_if.data); // This throws error
    // localparam D_WIDTH = snk_if.D_WIDTH; // This Works

endmodule

// Top Module
module t();

    t_if #(.D_WIDTH(64)) snk_if();

    test test_inst(.*);

endmodule

Error

localparam D_WIDTH = $bits(snk_if.data); gives error Parameter-resolved constants must not use dotted references: 'data'

Question

$bits(snk_if.data) works on questa and quartus, but not on verilator. Is this not an unnecessary feature? If so, can it be added easily?

@nanduraj1 nanduraj1 added the new New issue not seen by maintainers label Dec 31, 2019
@nanduraj1 nanduraj1 reopened this Jan 1, 2020
@nndurj
Copy link
Contributor
nndurj commented Jan 1, 2020

Related #1646 , #1593

@wsnyder
Copy link
Member
wsnyder commented Jan 9, 2020

Thanks for the report, as you found, this is a duplicate of #1593.

@wsnyder wsnyder added area: elaboration Issue involves elaboration phase resolution: duplicate Closed; issue or pull request already exists and removed new New issue not seen by maintainers labels Jan 9, 2020
@wsnyder wsnyder closed this as completed Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: elaboration Issue involves elaboration phase resolution: duplicate Closed; issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants
0