Fix class extend parameter dot case (#3926)

This commit is contained in:
Ryszard Rozak 2023-02-02 23:59:47 +01:00 committed by GitHub
parent 0e955d503e
commit 33468fa0e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -2440,13 +2440,13 @@ private:
}
}
}
const bool unresolvedClass = m_ds.m_unresolvedClass;
if (start) {
m_ds = lastStates;
} else {
const bool unresolvedClass = m_ds.m_unresolvedClass;
m_ds.m_dotp = lastStates.m_dotp;
m_ds.m_unresolvedClass |= unresolvedClass;
}
m_ds.m_unresolvedClass |= unresolvedClass;
}
void visit(AstSenItem* nodep) override {
VL_RESTORER(m_inSens);

View File

@ -81,6 +81,15 @@ class ClsParam #(type T);
typedef T param_t;
endclass
class ClsWithParamField;
int m_field = Sum#(int)::sum;
int m_queue[$];
function int get(int index);
return m_queue[index];
endfunction
endclass
module t (/*AUTOARG*/);
Cls c12;
@ -93,6 +102,7 @@ module t (/*AUTOARG*/);
SelfRefClassIntParam src1;
SelfRefClassIntParam::self_int_t src10;
IntQueue qi;
ClsWithParamField cls_param_field;
int arr [1:0] = '{1, 2};
initial begin
c12 = new;
@ -105,6 +115,7 @@ module t (/*AUTOARG*/);
src1 = new;
src10 = new;
qi = new;
cls_param_field = new;
if (Cls#()::PBASE != 12) $stop;
if (Cls#(4)::PBASE != 4) $stop;
if (Cls8_t::PBASE != 8) $stop;
@ -153,6 +164,9 @@ module t (/*AUTOARG*/);
if (ClsParam#(ClsStatic)::param_t::x != 1) $stop;
if (ClsParam#(ClsStatic)::param_t::get_2() != 2) $stop;
cls_param_field.m_queue = '{1, 5, 7};
if (cls_param_field.get(2) != 7) $stop;
$write("*-* All Finished *-*\n");
$finish;
end