Q
Qingbo
Guest
Hi,
I am given a testbench, and was asked to write the module. However I
don't know a syntax they used in the testbench. Can someone help me on
this? The part of testbench is posted below.
The "UUT.M" is obviously an array of data, but my question is how
should the M be defined in the decoder7 module. Should it be the same
array as M_local_tb, or a reg, or other kind of data types. Please
give me a pointer if you know.
Thank you in advance,
===============================================
decoder7 UUT (Start_tb, Ack_tb, Clk_tb, Reset_tb, res_tb);
task memory_initialization;
input [127:0] M_local_tb;
integer i, j;
begin
for (i=0; i<=15; i = i +1)
for (j=0; j<=7; j = j +1)
UUT.M[j] = M_local_tb[(i*8)+j];
end
endtask
============================================
I am given a testbench, and was asked to write the module. However I
don't know a syntax they used in the testbench. Can someone help me on
this? The part of testbench is posted below.
The "UUT.M" is obviously an array of data, but my question is how
should the M be defined in the decoder7 module. Should it be the same
array as M_local_tb, or a reg, or other kind of data types. Please
give me a pointer if you know.
Thank you in advance,
===============================================
decoder7 UUT (Start_tb, Ack_tb, Clk_tb, Reset_tb, res_tb);
task memory_initialization;
input [127:0] M_local_tb;
integer i, j;
begin
for (i=0; i<=15; i = i +1)
for (j=0; j<=7; j = j +1)
UUT.M[j] = M_local_tb[(i*8)+j];
end
endtask
============================================