E
Evan Lavelle
Guest
Is the code below valid? The line 'a.i = 0' attempts to do an upward
name reference to a variable in another branch of the name tree, but
the reference needs to go one level up, and then one level down.
There are 3 modules here: a single top-level module, 'test', which
instantiates one copy each of 'a' and 'b'. This reference is made from
module scope in b, and tries to access a variable in a, without using
the full hierarchical name.
The LRM doesn't seem very clear on this, but point (b) on p194, on
upward referencing, does say "if found, the item name shall be
resolved from that scope" which implies, to me, that you can start
going down again from the new scope. cver complains that this is an
error, but various other simulators don't.
Thanks -
Evan
==========================================
module a;
reg i;
endmodule
module b;
initial begin
a.i = 0;
c;
end
task c;
$display("hello world!");
endtask
endmodule
module test;
a a();
b b();
endmodule
name reference to a variable in another branch of the name tree, but
the reference needs to go one level up, and then one level down.
There are 3 modules here: a single top-level module, 'test', which
instantiates one copy each of 'a' and 'b'. This reference is made from
module scope in b, and tries to access a variable in a, without using
the full hierarchical name.
The LRM doesn't seem very clear on this, but point (b) on p194, on
upward referencing, does say "if found, the item name shall be
resolved from that scope" which implies, to me, that you can start
going down again from the new scope. cver complains that this is an
error, but various other simulators don't.
Thanks -
Evan
==========================================
module a;
reg i;
endmodule
module b;
initial begin
a.i = 0;
c;
end
task c;
$display("hello world!");
endtask
endmodule
module test;
a a();
b b();
endmodule