Skip to content

Support randomize() on AstMemberSel - #6161

Merged
wsnyder merged 3 commits into
verilator:masterfrom
antmicro:feature/randomize_memsel_support
Jul 10, 2025
Merged

wsnyder merged 3 commits into
verilator:masterfrom
antmicro:feature/randomize_memsel_support

Conversation

@igorosky

@igorosky igorosky commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

Introduction of support for randomize() with with complex expressions containing accessing object members.

Signed-off-by: Igor Zaworski <izaworski@internships.antmicro.com>
@wsnyder

wsnyder commented Jul 8, 2025

Copy link
Copy Markdown
Member

Thanks, I'll review tonight, meantime please rename t_complex_randomize to t_randomize_complex_*, thanks.

Signed-off-by: Igor Zaworski <izaworski@internships.antmicro.com>
Comment thread src/V3LinkDot.cpp Resolved
Comment thread src/V3LinkDot.cpp Outdated
Comment on lines +2650 to +2664
auto getElemDTypep = [](const AstNodeDType* dtypep) {
while (true) {
if (const AstBracketArrayDType* const bracketArrayp
= VN_CAST(dtypep, BracketArrayDType)) {
dtypep = bracketArrayp->childDTypep();
} else if (const AstDynArrayDType* const packArrayDTypep
= VN_CAST(dtypep, DynArrayDType)) {
dtypep = packArrayDTypep->childDTypep();
} else if (const AstQueueDType* const queueDTypep = VN_CAST(dtypep, QueueDType)) {
dtypep = queueDTypep->childDTypep();
} else {
break;
}
}
return dtypep;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer just make a standard function. Use "adtypep" for each variable name inside the if's.

Probably need a ->skipRefp(). Have some of the tests use typedef instead of the types directly to test this.

Comment thread src/V3LinkDot.cpp Resolved
Signed-off-by: Igor Zaworski <izaworski@internships.antmicro.com>
@wsnyder
wsnyder merged commit 31c279a into verilator:master Jul 10, 2025
@igorosky
igorosky deleted the feature/randomize_memsel_support branch July 10, 2025 09:14
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

Successfully merging this pull request may close these issues.

2 participants