VHDL, verilog, design, verification, scripts, ...
Email: bknpk@hotmail.com Phone: +972-54-7649119



 

ASIC/FPGA Design and Verification Out Source Services

Conversion from VERILOG READMEMB to INTEL HEX

The following script was written for a project, which needed to initialize some memories. The data was given in VERILOG's READMEMB (XILINX) and was needed to be in INTEL HEX format (ALTERA).
The script is far from being complete i.e. support any input file.
The script can be used as a very good starting point to write your own parser.

  1. Here is an example of what the code does:

  2. input file (readmemb)
    000000000000
    000000100111
    000000100110
    100110100111
    output is intel hex
    1 Start code 1 An ASCII colon, ":".
    2 Byte count 2 The count of the character pairs in the data field.
    3 Address 4 The 2-byte address at which the data field is to be loaded into memory.
    4 Type 2 00, 01, or 02.
    5 Data 0-2n From 0 to n bytes of executable code, or memory loadable data. n is normally 20 hex (32 decimal) or less.
    6 Checksum 2 The least significant byte of the two's complement sum of the values represented by all the pairs of characters in the record except the start code and checksum.
    :020000000000fe
    :020001000027d6
    :020002000026d6
    :0200030009a74b
    :020004000025d5
  3. The script is available at download area Look For mif_b2h.pl
    or download directly from direct link

Home

An extension to the example from cadance of producer consumer.






Search This Site


Feedback This Site




new pages on this site