N
nezhate
Guest
Hi all,
I'm writing a testbench that uses multiples tasks for verification.
One of them has memory as input. it must read data from an external
file. When I run this, I get this error:
"Illegal reference to memory
cannot assign unpacked type to packed type".
I understand that when task executes, it make a local copy of its
inputs. This is as if we wrote mem_a=mem_b. In this way for memories,
we must use index to assign element by element , ie:
while index>0
mem_a[index]=mem_b[index];
what should I do in this case?
The code I use is like this:
module tesbench
.....
.....
parameter filedata="/my_home/data.txt";
reg [m-1:0] mem_b [31:0];
.....
$readmemb(filedata,mem_b);
......
task verification ();
input a;
input b;
input [m-1:0] mem_a [31:0];
.....
.....
endtask
endmodule
I'm writing a testbench that uses multiples tasks for verification.
One of them has memory as input. it must read data from an external
file. When I run this, I get this error:
"Illegal reference to memory
cannot assign unpacked type to packed type".
I understand that when task executes, it make a local copy of its
inputs. This is as if we wrote mem_a=mem_b. In this way for memories,
we must use index to assign element by element , ie:
while index>0
mem_a[index]=mem_b[index];
what should I do in this case?
The code I use is like this:
module tesbench
.....
.....
parameter filedata="/my_home/data.txt";
reg [m-1:0] mem_b [31:0];
.....
$readmemb(filedata,mem_b);
......
task verification ();
input a;
input b;
input [m-1:0] mem_a [31:0];
.....
.....
endtask
endmodule