Skip to content

const member parameter error #8

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
jinjie320621 opened this issue May 28, 2021 · 3 comments
Closed

const member parameter error #8

jinjie320621 opened this issue May 28, 2021 · 3 comments

Comments

@jinjie320621
Copy link

i define one const member parameter (const unsigned int tRCD; ) in class Test (example), class Test is a modular interface. Then use class Test as: Test t_test[10].
After SCT operation, i see the sv_out/.sv file, the code as:
localparam logic [31] tRCD = `d22; //on the top module, because Test is the modular interface

In each t_test[i],I think it should use tRCD the whole 32bit value. But it use as:
//example
t_wait_time = tRCD[i];// i think it shoud be t_wait_time = tRCD here.

Please help me check whether it is a limitation for ScTool? Thanks very much.

@mikhailmoiseev
Copy link
Contributor

mikhailmoiseev commented May 28, 2021

Thank you for feedback, that looks as a bug. Will check and update near days.

As a quick workaround you can use static const instead of const. Also, please consider that array of modular interfaces is not supported yet, but array of pointers to modular interfaces supported. So, I would suggest you to declare the array as

Test*  t_test[10];
...
for (int i = 0; i < 10; ++i) {
     t_test[i] = new Test("Test");
}

@mikhailmoiseev
Copy link
Contributor

This issue has been fixed in 1.3.26. Please check and close if it works for you.

@jinjie320621
Copy link
Author

Issue has been fixed, thanks.

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

No branches or pull requests

2 participants