本帖最后由 轩辕志瑜 于 2023-12-5 08:59 编辑
工具文档里提到 ROM Code file 要求的格式:
ROM Code File
The ROM Code file defines the physical data of the ROM. An Artisan format ROM code file must
be provided for each generated instance. The format has the following requirements:
■ The ROM code file can contain only the characters 0 and 1
■ The line number in the code file is equivalent to (address - 1) in the ROM instance
■ Each character of a line corresponds to the bits of a word
■ Column 1 is the most-significant bit (MSB) and column n is the least-significant bit (LSB)
☞ The address and data range from m (most-significant) to 0 (least significant).
Lines and columns for a file range from n (most-significant) to 1 (least
significant).
The following shows a ROM code file for a 32 × 16 ROM:
For Example:
The ROM code file format is required for behavioral or physical views such as Verilog, VHDL,
Fastscan, Sunrise, GDSII, and LVS Netlist. When generating these views, the GUI checks for a
valid ROM code file, and issues an error message if a ROM code file does not exist or is invalid.
If a view requires a ROM code file, the GUI creates a properly formatted, view-specific ROM code
file for the corresponding view. For example, in the GUI, if the ROM code file is source.rcf, the
instance name is ROM2Kx16, and a Verilog view is generated, then ROM2Kx16.v and
ROM2Kx16_verilog.rcf is created with the proper Verilog format.
给你个能生成gdsii的ROM Code File和生成后的gdsii文件, ROM Code File文件内容是随机生成的。gdsii 生成参数为工具默认的。
ROM Code File:
romcode_4096x32.rcf.txt
(132 KB, 下载次数: 20 )
gds文件:
RODSHD.gds2.zip
(759.76 KB, 下载次数: 8 )
BinToMem.py:
BinToMem.py.txt
(1.47 KB, 下载次数: 11 )
Golang版
BinToMem.go.txt
(1.63 KB, 下载次数: 4 )
C版
BinToMem.c.txt
(2.17 KB, 下载次数: 8 )
Rust版
BinToMem.rs.txt
(1.67 KB, 下载次数: 6 )
Java版
BinToMem.java.txt
(2.52 KB, 下载次数: 3 )
用bin文件生成ROM Code File可以用github上tastynoob兄弟的ritter-soc项目里的 BinToMem.py
文件地址: https://github.com/tastynoob/rit ... irmware/BinToMem.py
流程:
先编译firmware项目生成elf格式的文件然后用 `objcopy -O binary 文件名.elf 文件名.bin` 生成bin格式文件,
之后再用 BinToMem.py 生成 ROM Code File
|