ghazalaz
Newbie level 2
- Joined
- May 1, 2013
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,297
Verilog : how can i use a module as global module?
hi,
i wanna use some 2d array of registers as global in some module and change them sometime , i define them in module named memory like this:
now i want to use these memories in another module (named run) and make changes to them,
i even can't pass them as inout parameter because they're 2d reg array
so what can i do? :-/
how can i initialize and make change to them in any module?
i will be so thankful if anybody can help (please)
hi,
i wanna use some 2d array of registers as global in some module and change them sometime , i define them in module named memory like this:
PHP:
module memory();
reg [31:0]Inst_Mem[31:0];
reg [31:0]Data_Mem[31:0];
reg [31:0]RF[31:0];
reg [5:0]PC;
end module
now i want to use these memories in another module (named run) and make changes to them,
PHP:
module run( input [31:0]Ins );
reg clk;
...
initial begin
clk = 0;
...
end
initial repeat(100)#5 clk = ~clk;
always @(posedge clk)
begin
memory.PC[5:0] = memory.PC + 6'b000001 ;
...
end
endmodule
i even can't pass them as inout parameter because they're 2d reg array
so what can i do? :-/
how can i initialize and make change to them in any module?
i will be so thankful if anybody can help (please)
Last edited: