-1

I want to initialize Block RAM with text file which contain ASCII data like "AGCCT", Is there any idea how can I do this? I am able to initialize BRAM with file which contain binary or hexadecimal data but I don not know how to initialize it with ASCII file. I want to implement this code on FPGA so I need to use syntax which is synthesizable.

Elnaz
  • 21
  • 5

1 Answers1

0

I think converting ASCII to hex/binary file and then use of $readmemb or $readmemh would serve your purpose.

reg [3:0] memory [15:0] ;
initial begin
  $readmemb("data.bin", memory) ;
end
Karan Shah
  • 1,912
  • 1
  • 29
  • 42