AR# 11744: CORE Generator - Hints for creating COE files for memory cores (Block Memory, Dist Memory, ROM, RAM, etc.)
CORE Generator - Hints for creating COE files for memory cores (Block Memory, Dist Memory, ROM, RAM, etc.)
This Answer Record contains hints for creating COE files.
For information regarding the correct format of a ".coe" file, please refer to the specific core's data sheet, or see the example ".coe" files in: <XILINX>/coregen/data/ where <XILINX> is the location in which Xilinx Implementation software has been installed. Q. What is the correct way to add comment lines in the ".coe" file for CORE Generator? A. The comments in the ".coe" file should be preceded by a semi-colon (";"). CORE Generator ignores everything in the line that is preceded by ";". Q. As address locations are not specified in the ".coe" file, how do I know which location is first? A. The data in the COE files are read from top to bottom, with location 0 at the top and moving down to depth-1. Use Memory Editor: In ISE 10.1.03, Memory Editor can be accessed from the CORE Generator interface by selecting Tools -> Memory Editor. In ISE 11.1 and later, Memory Editor can be accessed from a script file. Use mem_edit.bat (Windows platforms) or mem_edit (Linux platforms). This script is available in the $XILINX/bin/<OS> directory. The Memory Editor can be used to create COE files in two ways:
Enter your memory data values directly into the Memory Editor GUI and then select File -> Generate -> COE files(s) to create the COE files.
Enter your memory data into Excel (use whatever formulas you need there), export to CSV format, and then Import the CSV into Memory Editor (File -> Import -> CSV file). When a CSV file is imported, Memory Editor prompts you to specify the Memory Depth, Word Width, Data and Address Radix, and Start Address.
After the CSV file has been imported, you should inspect the Memory Content window for accuracy, and then select File -> Generate -> COE files(s) to create the COE files.