P
Peng Yu
Guest
Hi,
I tried to use the following code to initialize a ROM.
module my_hardware(/*some ports*/);
/* other code that is synthesizable.
............
*/
//synopsys translate_off
file = $fopen("data/mem.data", "r");
for(i = 0; i < ENTRYS;i = i + 1)
begin
$fscanf(file, "%h %h %h %h", temp_th0, temp_th1, temp_th2,
temp_th3);
thetas[3:0] = temp_th0;
thetas[7:4] = temp_th1;
thetas[11:8] = temp_th2;
thetas[15:12] = temp_th3;
$fscanf(file, "%b", temp1);
endbit = temp1;
$fscanf(file, "%d", temp2);
count_bit = temp2;
end
$fclose(file);
//synopsys translate_on
endmodule
But the initialization code aren't synthesizable. This will cause a
simulation-synthesis mismatch.
Does somebody have some ideas?
Peng
I tried to use the following code to initialize a ROM.
module my_hardware(/*some ports*/);
/* other code that is synthesizable.
............
*/
//synopsys translate_off
file = $fopen("data/mem.data", "r");
for(i = 0; i < ENTRYS;i = i + 1)
begin
$fscanf(file, "%h %h %h %h", temp_th0, temp_th1, temp_th2,
temp_th3);
thetas[3:0] = temp_th0;
thetas[7:4] = temp_th1;
thetas[11:8] = temp_th2;
thetas[15:12] = temp_th3;
$fscanf(file, "%b", temp1);
endbit = temp1;
$fscanf(file, "%d", temp2);
count_bit = temp2;
end
$fclose(file);
//synopsys translate_on
endmodule
But the initialization code aren't synthesizable. This will cause a
simulation-synthesis mismatch.
Does somebody have some ideas?
Peng