花了一些时间来弄清楚如何做到这一点,所以我想我会发布它。
我们希望将其他数据存储在内部Flash中,以便稍后通过内部
电路使用Impact进行访问。
事实证明,如果您将数据转换为.mem文件格式,则可以轻松完成此操作。
只需将@addr放在文件的开头(我将其设置为000000),然后将十六进制格式的字节行放入。
这是一个ASCII文件。二进制文件不可用。
Mem文件看起来像这样:(你可以在每一行的开头都有一个地址但是它不是针对Impact的)
@ 000000
12 34 56 78 A5 DF ......
30 59 30 28 94 83 ....
等等
获得.mem格式的数据后,使用这样的行从命令行运行Promgen:
promgen -w -p mcs -c FF -ooutfile -s 1024 -u 0 infile.bit -bd datafile.mem 0C0000 -spi
(Promgen包含在freeISE webpack中。无需任何选项即可运行它以获取可用选项列表以及每个选项的含义)
这将生成一个MCS(扩展Intel Hex)文件作为输出,然后可以使用Impact将其加载到
FPGA中。
多个-bd选项可用于将多个文件插入.mcs文件中从内部读取数据有点儿
因为您需要考虑页面大小不是256字节,所以很棘手。
位置0C0000是绝对地址
SPI Flash,所以要查找从内部访问数据的页面地址,你必须除以264(在XCS3AN700芯片的情况下)。
一旦你看到它怎么做,这一切都很容易。
我在网上的任何地方都找不到这些信息。
希望它可以帮到某人。
短发
以上来自于谷歌翻译
以下为原文
Took me a while to figure out how to do this, so I thought I would post it. We wanted to store other data in internal Flash, to be accessed later by internal circuitry, using Impact. Turns out you can do this easily if you get your data into .mem file format. Just put @addr at the start of the file (I set it to 000000), then lines of bytes in
hex format. This is an ASCII file. Binary files are not usable. Mem file looks like this: (You can have an address at the start of every line but it's not nec for Impact)
@000000
12 34 56 78 A5 DF ...
30 59 30 28 94 83 ....
etc
Once you have your data in .mem format, use a line like this to run Promgen from a command line:
promgen –w –p mcs –c FF –o outfile –s 1024 –u 0 infile.bit –bd datafile.mem 0C0000 –spi
(Promgen is included with the free ISE webpack. Run it
without any options to get a list of the available options and what each means)
This will generate an MCS (Extended Intel Hex) file as the output, which can then be loaded into the FPGA using Impact.
Multiple -bd options can be used to insert multiple files into the .mcs file Reading the data from inside is a little
tricky as you need to take into account the page size not being 256 bytes. The location 0C0000 is an absolute address into
the SPI Flash, so to find the page address to access the data from inside you have to divide by 264 (in the case of the XCS3AN700 chip).
It's all pretty easy once you see how to do it. I just had trouble finding this info anywhere on the web.
Hope it helps someone.
Bob
0