mirror of
https://github.com/verilator/verilator.git
synced 2026-10-05 17:43:31 +02:00
Fix $urandom_range passed variable (#2563).
This commit is contained in:
@@ -11,6 +11,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
||||
|
||||
**** Fix -G dropping public indication (#2561). [Andrew Goessling]
|
||||
|
||||
**** Fix $urandom_range passed variable (#2563). [nanduraj1]
|
||||
|
||||
|
||||
* Verilator 4.100 2020-09-07
|
||||
|
||||
|
||||
@@ -1123,6 +1123,8 @@ private:
|
||||
if (m_vup->prelim()) {
|
||||
nodep->dtypeSetUInt32(); // Says the spec
|
||||
AstNodeDType* expDTypep = nodep->findUInt32DType();
|
||||
userIterateAndNext(nodep->lhsp(), WidthVP(CONTEXT, PRELIM).p());
|
||||
userIterateAndNext(nodep->rhsp(), WidthVP(CONTEXT, PRELIM).p());
|
||||
iterateCheck(nodep, "LHS", nodep->lhsp(), SELF, FINAL, expDTypep, EXTEND_EXP);
|
||||
iterateCheck(nodep, "RHS", nodep->rhsp(), SELF, FINAL, expDTypep, EXTEND_EXP);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@ module t(/*AUTOARG*/);
|
||||
|
||||
// Range
|
||||
for (int test = 0; test < 20; ++test) begin
|
||||
v1 = $urandom_range(0, 2);
|
||||
v1 = 2;
|
||||
v1 = $urandom_range(0, v1);
|
||||
if (v1 != 0 && v1 != 1) $stop;
|
||||
v1 = $urandom_range(2, 0);
|
||||
if (v1 != 0 && v1 != 1) $stop;
|
||||
|
||||
Reference in New Issue
Block a user