Reputation: 31
I need to instantiate some modules whose requirements pop up during the procedural block.But I am not allowed to instantiate inside the procedural block.Where else should I instantiate these modules so that I could access them in the procedural block.
I just need 1 instantiation and so I am not using generate statement.I am simply instantiating it using ...Center data_cent(.clk(clk),.dummy_4(dummy_6));
But upon checking the syntax it gives an error stating " data_cent is not a task". I am unable to figure out the problem. I would be glad if some one could help.
Upvotes: 0
Views: 2689
Reputation: 111
From your description, I can think of two possibilities:
Upvotes: -1
Reputation: 62019
You can instantiate it inside a module, but outside of any procedural blocks. If you want to access internal nets of your subinstance, you can use hierarchical specifiers. For example, if your instance contains an internal net named foo
:
module top;
Center data_cent(.clk(clk),.dummy_4(dummy_6));
initial begin
$display(data_cent.foo);
end
endmodule
SystemVerilog also offers the bind
construct.
Upvotes: 1