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

Fix Type Change of nodep->bitp() in Constraints with String-Indexed Assoc-Arr #5727

Open
YilouWang opened this issue Jan 10, 2025 · 0 comments · May be fixed by #5841
Open

Fix Type Change of nodep->bitp() in Constraints with String-Indexed Assoc-Arr #5727

YilouWang opened this issue Jan 10, 2025 · 0 comments · May be fixed by #5841
Assignees
Labels
area: randomization Issue involves randomization/constraints status: assigned Issue is assigned to someone to work on

Comments

@YilouWang
Copy link
Member

When dealing with associative arrays using strings as indices, like the example below:

class AssocArrayIntegral;
    rand int str_index [string];

    constraint c1{ 
        foreach (str_index[i]) str_index[i] > 10;  // nodep->bitp() would be VARREF, instead of CVTPACKSTRING
    }
    constraint c2 {
        str_index["key1"] == 100;
    }
    
    ...
endclass

Depending on the constraint expression (whether it is within a foreach loop or not), the type of nodep->bitp() in V3Randomize.cpp changes. This causes issues with handling the width of the string index properly.

We are currently addressing this issue, and a fix will be pushed soon.

@YilouWang YilouWang added status: assigned Issue is assigned to someone to work on area: randomization Issue involves randomization/constraints labels Jan 10, 2025
@YilouWang YilouWang self-assigned this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: randomization Issue involves randomization/constraints status: assigned Issue is assigned to someone to work on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant