Altera_Forum
Honored Contributor
15 years agoHow to write a testbench which can initialize sub-module?
Hi all,
I need to simulate with the topmodule of my design. But i have to initialize the memory value in the memory sub-module. How can i do that in the testbench in for the top-module? For example if the memory sub-module is named memory. And reg [17:0] ram[0:255] is defined in that module. To initialize the ram values, is it some thing like this? initial begin memory.ram[0]=18'bXXXXXXXXX memory.ram[1]=18'bXXXXXXXXX ...... I tried, but it failed...