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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1640|回复: 0

[求助] 请问chipyard是怎么读取程序的?

[复制链接]
发表于 2022-4-6 11:02:59 | 显示全部楼层 |阅读模式
50资产
本帖最后由 食物 于 2022-4-6 11:15 编辑

问题场景
chipyard直接Make可以得到一个二进制文件, 我这里是:
simv-chipyard-SmallRocketConfig 或者 simv-chipyard-SmallRocketConfig-debug
采用这个命令就可以运行它并产生反馈:
simv-chipyard-SmallRocketConfig-debug hello.riscv
或者调用Makefile中的
make run-binary-debug CLOCK_PERIOD=10 CONFIG=SmallRocketConfig BINARY=hello.riscv

可以得到正确的运行结果(因为没啥问题所以不用看这段):
Warning-[SIMCR] Simulator is moved or copied or renamed
  Simulator is moved or copied or renamed from the
  '/eda/home/zhfrv/RISCV/chipyard/sims/vcs/simv-chipyard-SmallRocketConfig' to
  '/eda/home/zhf/NTV/RISCV/chipyard/sims/vcs/simv-chipyard-SmallRocketConfig',
  which is unsafe and may incur unexpected simulation result.




Note-[RT_BS] Larger stack needed
  Note: Bumping stack limit from 8192 to 8193 Kbytes.


Chronologic VCS simulator copyright 1991-2016
Contains Synopsys proprietary information.
Compiler version L-2016.06_Full64; Runtime version L-2016.06_Full64;  Apr  6 10:54 2022
[UART] UART0 is here (stdin/stdout).
Hello!
$finish called from file "/eda/home/zhf/NTV/RISCV/chipyard/sims/vcs/generated-src/chipyard.TestHarness.SmallRocketConfig/TestDriver.v", line 158.
$finish at simulation time             41780500
           V C S   S i m u l a t i o n   R e p o r t
Time: 41780500 ps
cpu Time:      2.950 seconds;       Data structure size:   2.7Mb
Wed Apr  6 10:54:19 2022

问题
那么chipyard是怎么把hello.riscv 读取进去,从而开始运行hello.riscv的程序的呢?

尝试
我看了 chipyard/sims/vcs/generated-src/chipyard.TestHarness.SmallRocketConfig/TestDriver.v 里面完全没有涉及二进制文件读取的代码
也看了 chipyard/generators/rocket-chip/src/main/scala/system/TestHarness.scala 里面好像只描述了连接关系,我在其中搜索了 plusarg_reader,找到很多TLMonitor,不知道和我的问题有什么关系。看到了这个文件 chipyard/generators/rocket-chip/bootrom/bootrom.S 里面描述了最开始上电之后的几条指令,但是也不知道和main函数怎么对接起来的。
看到了手册上讲 loads the program binary over a simulated serial line 之后更迷惑了,它是通过什么东西将程序载入DRAM的呢。
image.png

都没有找到答案。



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

本版积分规则

关闭

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

×

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

GMT+8, 2024-4-28 05:50 , Processed in 0.015107 second(s), 6 queries , Gzip On, Redis On.

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