I am using a DE10-Nano with Quartus Prime to try to implement the following.
I have two modules: Module1 and Module2. Module1 declares a RAM like this:
reg [15:0] RAM[0:24576];
// init RAM 0:8191 with all 1
And then passes a subset of the RAM to Module2:
Module2 Module2 (
// input
.screen_mem(RAM[0:8191]),
);
Module2 shows screen_mem on a monitor to be displayed. Unfortunately above solution does not work, i.e., display goes all black.
But if I try:
reg [15:0] screen_mem[0:8191];
// init screen_mem with all 1
Module2 Module2 (
// input
.screen_mem(screen_mem),
);
This works, i.e., the display properly shows all the white pixels.
If I try to use a simulator, both solutions work.
What am I missing? Why I can't pass a slice of an unpacked array to a submodule? I also tried to use an intermediate wire, but it still doesn't work. Am I missing something?
Thanks,
