FPGA中BRAM初始化文件格式的总结_ALTERA/XILINX

参考北邮人论坛上的一个帖子,ALTERA有软件支持生成初始化文件,XILINX的还没发现。

引用:http://bbs.byr.cn/#!article/Circuit/13233

http://www.cnblogs.com/dpc525/admin/Files.aspx

 

另附MATLAB脚本生成数据

%author:dpc525
%Create Date:   2012.02.21
%Description: 为XILINX中BRAM生成的ROM产生数据
%两种方法:第一种直接产生数据。第二种把产生的数据写入文件中。

%method one
% for i = 1:2048
% %display([ int2str(i),',']  );
% x = [ int2str(i),',']
% end

%method two
fp = fopen('data.coe', 'w', 'native');

for i = 1:2048
%display([ int2str(i),',']  );
x = [ int2str(i),','];
fwrite(fp, x, 'char');
fprintf(fp,'\n');
end

fclose(fp);

posted on 2012-02-22 16:48  dpc525  阅读(1615)  评论(0编辑  收藏  举报

导航