1
\$\begingroup\$

I have a bin file which contains 8-bit space seperated binary data and I want to load it in memory. In simulation it works fine, the readmemoryb command loads data in reg memory. Is there any way to burn that data in FPGA memory since I want to show that data on nexys 4 board as well

\$\endgroup\$
2
  • \$\begingroup\$ You need to specify the type of FPGA in your question and also the type of memory to be used. \$\endgroup\$ Feb 7, 2019 at 13:31
  • \$\begingroup\$ A Nexys 4 uses an Artix-7, a Xilinx device. See Vivado Design Suite User Guide: Synthesis Chapter 4 Initializing RAM Contents, Specifying RAM Initial Contents in an External Data File. \$\endgroup\$
    – user8352
    Feb 7, 2019 at 17:45

1 Answer 1

2
\$\begingroup\$

You need to convert your data into one of the supported formats for memory initialization. Then you can specify the file when you configure the RAM.

A .mif file for an Intel FPGA, for example, looks like this:

DEPTH = 32;            % Memory depth and width are required   %
                       % DEPTH is the number of addresses      %
WIDTH = 14;            % WIDTH is the number of bits of data per word %
%  DEPTH and WIDTH should be entered as decimal numbers        %

ADDRESS_RADIX = HEX;   % Address and value radixes are required  %
DATA_RADIX = HEX;      % Enter BIN, DEC, HEX, OCT, or UNS; unless  %
                       % otherwise specified, radixes = HEX    %
-- Specify values for addresses, which can be single address or range
CONTENT
BEGIN
[0..F]: 3FFF;   % Range--Every address from 0 to F = 3FFF  %
6     : F;      % Single address--Address 6 = F %
8     : F E 5;  % Range starting from specific address %
                % Addr[8] = F, Addr[9] = E, Addr[A] = 5 %
--
END;

source

\$\endgroup\$
2
  • \$\begingroup\$ Yes, except that the asker neglected to mention that their board uses a Xilinx chip. \$\endgroup\$ Feb 7, 2019 at 13:32
  • \$\begingroup\$ @ChrisStratton that’s why I said for example. \$\endgroup\$
    – user110971
    Feb 7, 2019 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.