ISE中调用Block Memory Generator实现rom?
一、.coe文件的格式
;This .COE file specifies the contents for a block memory of depth=256, and width=8.
memory_initialization_radix=16;
memory_initialization_vector =
00,
01,
02,
03,
04,
……
FC,
FD,
FE,
FF;
二、.coe文件的生成matlab代码样例
clear;
clc;
fid = fopen('c:/cos_coe.txt','w'); % 生成TXT文件
fprintf( fid, 'memory_initialization_radix=10;\n');%生成索引
fprintf( fid, 'memory_initialization_vector =\n' );
for a = 0:15
for b = 0:15
addr = a*16+b;
fprintf(fid,'%X;\n',addr);%量化数据格式,具体说明见前面,注意其中的逗号!
end
end
fclose(fid);