在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2920|回复: 4

[求助] Arstian rom generator 读入的rom code file 如何生成

[复制链接]
发表于 2020-2-4 18:16:55 | 显示全部楼层 |阅读模式
100资产
求助论坛里的各位大佬,楼主最近在使用memory compiler 时遇到点问题,生成rom的时候,需要读入 rom code file 。但是我生成的hex转二进制文件,在读入到memory compiler 生成rom时总会报错。想问这里需要的code file是什么格式的,以及我自己需要导入到rom的hex文件怎么转换到前面的正确格式。谢谢

最佳答案

查看完整内容

我也没试过,但我想可能有2点可以尝试 1、hex文件一般就是个文本文件吧,里面文本的格式是1256efba 2b5decab这样的,应该不是二进制表示的 2、跟你的rom生成的格式有关,deepth*8或者deepth*16或者deepth*8*2需要hex可能是不一样的,需要对应的宽度,比如8位就是ab cd ef,16位就是abcd 01ef这样子。 瞎猜的
发表于 2020-2-4 18:16:56 | 显示全部楼层
我也没试过,但我想可能有2点可以尝试
1、hex文件一般就是个文本文件吧,里面文本的格式是1256efba 2b5decab这样的,应该不是二进制表示的
2、跟你的rom生成的格式有关,deepth*8或者deepth*16或者deepth*8*2需要hex可能是不一样的,需要对应的宽度,比如8位就是ab cd ef,16位就是abcd 01ef这样子。

瞎猜的
发表于 2021-7-14 14:51:55 | 显示全部楼层
请问楼主如何解决的呢?
发表于 2022-5-31 00:22:40 | 显示全部楼层
有没有大侠教一下啊?
发表于 2023-12-4 12:54:16 | 显示全部楼层
本帖最后由 轩辕志瑜 于 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:

截图_2023-12-04_12-52-22.png

For Example:
截图_2023-12-04_12-52-38.png


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, 下载次数: 10 )

gds文件:
RODSHD.gds2.zip (759.76 KB, 下载次数: 3 )

BinToMem.py:
BinToMem.py.txt (1.47 KB, 下载次数: 4 )

Golang版
BinToMem.go.txt (1.63 KB, 下载次数: 2 )

C版
BinToMem.c.txt (2.17 KB, 下载次数: 1 )

Rust版
BinToMem.rs.txt (1.67 KB, 下载次数: 5 )

Java版
BinToMem.java.txt (2.52 KB, 下载次数: 1 )

用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

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /3 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-20 21:59 , Processed in 0.022313 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表