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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 4318|回复: 3

[求助] 请教RISCV Boom的bootrom问题

[复制链接]
发表于 2017-10-9 13:49:38 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
请教各位大大,我用RocketchipGenerator生成boom核的cpu,连接了AXI、X2P和UART简单跑一下,生成CPU之前我改过了bootrom,代码如下:



  1. li s0, DRAM_BASE
  2.   csrr a0, mhartid
  3. //  la a1, _dtb
  4.   jr s0
  5.   .word 0
  6.   .word 0



复制代码
运行时jr s0没有执行,前面两条都执行了,请问各位这是为什么呀,本人菜鸟,跪谢!!!

////////////////////////////////////////////////////////////////////////////////////////////////
后来我查看了RocketchipGenerator中生成bootrom的相关代码:




  1. object GenerateBootROM {
  2.   def apply(p: Parameters, address: BigInt, configString: String) = {
  3.     val romdata = Files.readAllBytes(Paths.get(p(BootROMFile)))
  4.     val rom = ByteBuffer.wrap(romdata)

  5.     rom.order(ByteOrder.LITTLE_ENDIAN)

  6.     require(address == address.toInt)
  7.     val configStringAddr = address.toInt + rom.capacity
  8.     //require(rom.getInt(12) == 0,
  9.     //  "Config string address position should not be occupied by code")
  10.     //rom.putInt(12, configStringAddr)
  11.     rom.array() ++ (configString.getBytes.toSeq)
  12.   }
  13. }



复制代码


请问被注释掉的三行是什么意思呢?因为这三行会把我自己改动的bootrom内容覆盖掉,所以注释掉了,这个和跳转指令不执行有关系吗?
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
原本的bootrom代码是这样子的:




  1. .text
  2. .global _start
  3. _start:
  4.   // This boot ROM doesn't know about any boot devices, so it just spins,
  5.   // waiting for the debugger to load a program and change the PC.
  6.   j _start // reset vector
  7.   .word 0 // reserved
  8.   .word 0 // reserved
  9.   .word 0 // pointer to config string
  10.   .word 0 // default trap vector
  11.   .word 0
  12.   .word 0
  13.   .word 0



复制代码
发表于 2018-1-9 18:30:51 | 显示全部楼层
解决了,谢谢
发表于 2018-5-2 10:22:33 | 显示全部楼层
楼主你好,可不可以把你的boot file 发给我呢?我的邮箱403220475@qq.com
还有可否请你给我讲解一下RISC-V的boot 流程?万分感谢~
发表于 2018-12-22 19:19:17 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-4-26 21:32 , Processed in 0.021252 second(s), 6 queries , Gzip On, Redis On.

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