Fix bit selections under parameterized classes (#4210)
This commit is contained in:
parent
729f8b9334
commit
9da3aacd08
|
|
@ -2779,6 +2779,8 @@ private:
|
||||||
// may be true only in the first stage of linking.
|
// may be true only in the first stage of linking.
|
||||||
// Mark that the Dot statement can't be resolved.
|
// Mark that the Dot statement can't be resolved.
|
||||||
m_ds.m_unresolvedClass = true;
|
m_ds.m_unresolvedClass = true;
|
||||||
|
// If the symbol was a scope name, it would be resolved.
|
||||||
|
if (m_ds.m_dotPos == DP_SCOPE) m_ds.m_dotPos = DP_MEMBER;
|
||||||
} else {
|
} else {
|
||||||
// Cells/interfaces can't be implicit
|
// Cells/interfaces can't be implicit
|
||||||
const bool isCell = foundp ? VN_IS(foundp->nodep(), Cell) : false;
|
const bool isCell = foundp ? VN_IS(foundp->nodep(), Cell) : false;
|
||||||
|
|
@ -3173,6 +3175,11 @@ private:
|
||||||
void visit(AstSelBit* nodep) override {
|
void visit(AstSelBit* nodep) override {
|
||||||
if (nodep->user3SetOnce()) return;
|
if (nodep->user3SetOnce()) return;
|
||||||
iterateAndNextNull(nodep->fromp());
|
iterateAndNextNull(nodep->fromp());
|
||||||
|
if (m_ds.m_unresolvedClass) {
|
||||||
|
UASSERT_OBJ(m_ds.m_dotPos != DP_SCOPE, nodep,
|
||||||
|
"Object of unresolved class on scope position in dotted reference");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (m_ds.m_dotPos
|
if (m_ds.m_dotPos
|
||||||
== DP_SCOPE) { // Already under dot, so this is {modulepart} DOT {modulepart}
|
== DP_SCOPE) { // Already under dot, so this is {modulepart} DOT {modulepart}
|
||||||
UINFO(9, " deferring until after a V3Param pass: " << nodep << endl);
|
UINFO(9, " deferring until after a V3Param pass: " << nodep << endl);
|
||||||
|
|
|
||||||
|
|
@ -63,12 +63,23 @@ module t (/*AUTOARG*/
|
||||||
endfunction
|
endfunction
|
||||||
endclass
|
endclass
|
||||||
|
|
||||||
|
class FooDict;
|
||||||
|
Foo q[int];
|
||||||
|
endclass
|
||||||
|
|
||||||
|
class ExtendFooDict#(type BASE=FooDict) extends BASE;
|
||||||
|
function int get_x_of_item(int i);
|
||||||
|
return q[i].x;
|
||||||
|
endfunction
|
||||||
|
endclass
|
||||||
|
|
||||||
Bar #() bar_foo_i;
|
Bar #() bar_foo_i;
|
||||||
Bar #(Baz) bar_baz_i;
|
Bar #(Baz) bar_baz_i;
|
||||||
ExtendBar extend_bar_i;
|
ExtendBar extend_bar_i;
|
||||||
ExtendBar1 extend_bar1_i;
|
ExtendBar1 extend_bar1_i;
|
||||||
ExtendBarBaz extend_bar_baz_i;
|
ExtendBarBaz extend_bar_baz_i;
|
||||||
ExtendExtendBar extend_extend_bar_i;
|
ExtendExtendBar extend_extend_bar_i;
|
||||||
|
ExtendFooDict extend_foo_dict_i;
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
bar_foo_i = new;
|
bar_foo_i = new;
|
||||||
|
|
@ -77,18 +88,26 @@ module t (/*AUTOARG*/
|
||||||
extend_bar1_i = new;
|
extend_bar1_i = new;
|
||||||
extend_bar_baz_i = new;
|
extend_bar_baz_i = new;
|
||||||
extend_extend_bar_i = new;
|
extend_extend_bar_i = new;
|
||||||
if (bar_foo_i.get_x() == 1 && bar_foo_i.get_3() == 3 &&
|
extend_foo_dict_i = new;
|
||||||
bar_baz_i.get_x() == 2 && bar_baz_i.get_4() == 4 &&
|
extend_foo_dict_i.q[1] = new;
|
||||||
extend_bar_i.get_x() == 1 && extend_bar_i.get_6() == 6 &&
|
|
||||||
extend_bar_i.get_x() == 1 && extend_bar_i.get_6() == 6 &&
|
if (bar_foo_i.get_x() != 1) $stop;
|
||||||
extend_bar1_i.get_x() == 1 && extend_bar1_i.get_6() == 6 &&
|
if (bar_foo_i.get_3() != 3) $stop;
|
||||||
extend_bar_baz_i.get_x() == 2 && extend_bar_baz_i.get_8() == 8 &&
|
if (bar_baz_i.get_x() != 2) $stop;
|
||||||
extend_extend_bar_i.get_x() == 1 && extend_extend_bar_i.get_12() == 12) begin
|
if (bar_baz_i.get_4() != 4) $stop;
|
||||||
$write("*-* All Finished *-*\n");
|
if (extend_bar_i.get_x() != 1) $stop;
|
||||||
$finish;
|
if (extend_bar_i.get_6() != 6) $stop;
|
||||||
end
|
if (extend_bar_i.get_x() != 1) $stop;
|
||||||
else begin
|
if (extend_bar_i.get_6() != 6) $stop;
|
||||||
$stop;
|
if (extend_bar1_i.get_x() != 1) $stop;
|
||||||
end
|
if (extend_bar1_i.get_6() != 6) $stop;
|
||||||
|
if (extend_bar_baz_i.get_x() != 2) $stop;
|
||||||
|
if (extend_bar_baz_i.get_8() != 8) $stop;
|
||||||
|
if (extend_extend_bar_i.get_x() != 1) $stop;
|
||||||
|
if (extend_extend_bar_i.get_12() != 12) $stop;
|
||||||
|
if (extend_foo_dict_i.get_x_of_item(1) != 1) $stop;
|
||||||
|
|
||||||
|
$write("*-* All Finished *-*\n");
|
||||||
|
$finish;
|
||||||
end
|
end
|
||||||
endmodule
|
endmodule
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue