Coder Social home page Coder Social logo

xiangshan-doc's Introduction

XiangShan-doc

Documentation for XiangShan

这是香山的官方文档仓库。

  • 香山微结构文档已托管到 ReadTheDocs 平台,欢迎访问 https://xiangshan-doc.readthedocs.io

  • slides 目录下存放了我们的技术汇报,包括 2021 RISC-V **峰会的报告等内容

联系我们 Contact us

邮件列表:xiangshan-all AT ict DOT ac DOT cn

Mailing list: xiangshan-all AT ict DOT ac DOT cn

关注我们

  • 微信公众号:香山开源处理器

wechat

Translations needed

We need to translate most of the documentations to English and other languages. Contributions welcomed!

实习生计划 Interns

欢迎加入开源英才实习生计划(长期有效),具体内容请点击此链接

香山是什么?

2019 年,在**科学院支持下,**科学院计算技术研究所牵头发起“香山”高性能开源 RISC-V 处理器项目,研发出目前国际上性能最高的开源高性能RISC-V处理器核“香山”,在全球最大的开源项目托管平台 GitHub 上获得超过 2500 个星标(Star),形成超过 277 个分支(Fork),成为国际上最受关注的开源硬件项目之一,得到国内外企业的积极支持——16 家企业联合发起开源芯片创新联合体,围绕“香山”进一步联合开发,形成示范应用,加速 RISC-V 生态建设。

我们的目标是成为面向世界的体系结构创新开源平台,服务于工业界、学术界、个人爱好者等的体系结构研究需求。此外,我们希望在香山的开发过程中,探索高性能处理器的敏捷开发流程,建立一套基于开源工具的高性能处理器设计、实现、验证流程,大幅提高处理器开发效率、降低处理器开发门槛。

香山将保持半年左右的微结构迭代周期、流片周期,持续进行微结构创新与敏捷开发方法实践。 香山处理器的正式开发从 2020 年 6 月开始,1e3fad1 是我们第一个提交的哈希值,代码仓库中在此之前的提交均属于 2019 年第一期一生一芯计划产出的果壳处理器。在 2021 年 7 月,香山处理器的第一版(代号雁栖湖)已经投片,在 28nm 的工艺节点下达到 1.3GHz 的频率。目前(2022 年 3 月),香山处理器第二版架构(代号南湖)的 RTL 代码已经冻结,正在进行后端设计验证流程,目标是在 14nm 工艺节点下频率达到 2GHz。我们希望通过持续不断的优化与流片验证,逐步提高香山处理器的 PPA 水平,让香山成为一个开源的工业级别处理器,并成为面向世界的体系结构创新开源平台。

香山处理器将始终坚持开源策略,坚定地开源我们所有的设计、验证、基础工具代码。 我们非常感谢社区对香山的贡献,在硬件设计方面,香山处理器的部分模块设计受到了开源处理器、公开论文等的启发,曾参考了现有的开源 rocket-chip、berkeley-hardfloat、SiFive block-inclusivecache 等代码。我们在 Chisel 开源社区的现有总线工具、浮点运算单元、系统缓存等基础上,修改完善了它们的功能,同时优化了频率、吞吐等性能指标。与此同时,我们非常欢迎社区基于香山进行开发或者使用香山项目的代码。在众多开源协议中,我们选择了木兰宽松许可证第 2 版,希望(1)始终保持香山处理器的开放性,木兰宽松许可证不具有传染性,用户可以放心使用;(2)立足**国内、面向全世界,木兰宽松许可证以中英文双语表述,中英文版本具有同等法律效力。

香山处理器积极地拥抱开源社区,非常欢迎来自社区的贡献。 我们看到,一些开源 RISC-V 处理器项目很少接收外部代码提交,我们理解这一现象背后有观念与技术上的多重原因,如担心开发计划冲突、处理器设计需要兼顾多方面需求、难以评估外部贡献的质量等。对于香山项目来说,在观念方面,我们非常欢迎外部贡献,如提交问题、提交特性需求、提交代码等,每一条意见与建议我们都会认真考虑与评估。举例来说,Chisel 对工业界仍然是一个新东西,如果您更熟悉 Verilog/SystemVerilog、但希望为香山提交代码贡献,我们欢迎您向这个仓库提交 Pull Request。在技术层面,我们希望探索一套评估代码改动质量的流程与工具,由基础流程来确定是否接受一个代码提交。举例来说,我们希望在不久的未来,开放一套更快速、更准确的性能采样框架,来评估一个架构改动带来的性能收益,当代码提交满足不破坏已有的模块性和扩展性、具有较为一定性能收益、具有良好的代码风格等条件时,我们将接收这一代码修改。如果用一句话总结我们的开发者策略,我们非常欢迎任何对香山有益的讨论、问题提交、代码修改等。

除了微结构探索之外,香山项目还希望探索并建立一套高性能处理器的敏捷开发流程。 香山处理器的目标是成为面向世界的体系结构创新开源平台,基础能力、设施、流程的建立是香山处理器长期高质量发展的关键,我们将保持长期稳定的投入,不断努力建立处理器敏捷开发的基础设施、基础流程。在香山项目初期,我们沿用了果壳处理器的开发与验证框架。在香山项目的推进过程中,我们对其进行了大量改进,添加了包括仿真检查点、压缩文件加载、多核验证支持等功能。目前,香山处理器的验证环境相比果壳处理器已有大量改进,丰富的基础工具支撑起了香山这一复杂度量级的敏捷验证流程。此外,UCB 和 Chipyard 框架是我们学习的榜样,我们参考或使用了他们发起的很多开源项目。我们希望,随着香山项目的推进与深入,我们能够推动开源社区的不断进步,与开源社区一道,推动建立高性能处理器的敏捷开发流程与基础设施。

香山处理器的正式开发从 2020 年 6 月开始,经过不到 2 年的努力,我们实现了香山雁栖湖版本的流片,并即将完成南湖版本的流片准备工作。从香山项目参与者的角度,在过去约 2 年的时间中,共有二十多位来自中科院计算所、鹏城实验室、深圳大学、华中科技大学、北京大学等高校和科研单位的老师及同学参与到了香山处理器雁栖湖版本的前端流程中。在项目开始时,香山团队中大多数老师和同学并没有丰富的高性能处理器设计和实现经验,但经过一年在香山项目中的锻炼,大家建立起了对高性能处理器的初步认识。在香山处理器中,包括核心前端、后端、访存流水线、L1 Cache、L2 Cache 对下一致性支持等在内的关键代码均由开发团队从零实现,我们对代码的所有修改历史均在 Git 提交记录中可见。香山处理器的物理设计流程主要由我们在鹏城实验室的后端工程师团队完成。

我们清楚地认识到,香山处理器距离业界主流水平还有很大的差距,比如在很多技术点的方案选择上,我们做的不够好。香山处理器的目标是成为面向世界的体系结构创新开源平台,我们非常欢迎来自业界前辈、高性能处理器爱好者、开源社区等提出建议和意见,只要对香山处理器项目是有益的,我们都会接受并且改进,同时,我们也欢迎并且鼓励更多的人一起加入香山处理器的开发,推动香山项目的持续创新。

推荐关于香山的报道

香山始终坚持实事求是的原则,始终保持建立开源平台、探索敏捷开发的初衷,不希望在宣传上出现任何可能导致误解的内容。

自香山在 2021 年 6 月举办的 RISC-V **峰会上正式发布以来,我们在社交媒体、自媒体、新闻媒体上看到了很多对香山处理器的报道,其中有一些是作者的“自我发挥”,存在误导读者的可能性。为此我们特意创建了一个辟谣专区,用来澄清一些广为流传的误会。

我们推荐以下关于香山处理器的报道,来自于我们的官方发布和科普渠道:

香山的核心理念之一是开源、开放,针对这一话题,我们推荐阅读孙凝晖院士的《论开源精神》

xiangshan-doc's People

Contributors

arielheleneto avatar augustuswilliswang avatar bigwhitedog avatar cebarobot avatar chenguokai avatar cyyself avatar deltazero7 avatar dingiso avatar enjou1224 avatar good-circle avatar huxuan0307 avatar ivyfeather avatar jinyue110 avatar kanehui avatar lemover avatar lingrui98 avatar linjuanz avatar ljwljwljwljw avatar maxpicca-li avatar notlqr avatar poemonsense avatar prjmoriarty avatar rvcoresjw avatar shinezyy avatar tang-haojin avatar wakafa1 avatar wonicon avatar xianfeili avatar xyyy1420 avatar ziyue-zhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xiangshan-doc's Issues

使用rv64ima构建bbl失败

您好,
我尝试使用《Linux Kernel 的构建》教程,构建一个最简的Linux Kernel,修改 riscv-pk的Makefile的--with-arch=rv64imac--with-arch=rv64ima,可是出现了如下报错,接下来我应该如何操作才可以解决这个问题。

RISCV_ROOTFS_HOME=/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs make -C /home/sazc/risc_v/git_source/xs-linux/riscv-rootfs
mkdir -p build
mkdir -p build
dtc -O dtb -I dts -o build/system.dtb dts/system.dts
cd build && /home/sazc/risc_v/git_source/xs-linux/riscv-pk/configure --host=riscv64-unknown-elf --with-payload=/home/sazc/risc_v/git_source/xs-linux/riscv-linux/vmlinux \	
make[1]: Entering directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs'
build/system.dtb: Warning (unit_address_vs_reg): Node /soc/mmc has a reg or ranges property, but no unit name
build/system.dtb: Warning (simple_bus_reg): Node /soc/clint@2000000 simple-bus unit address format error, expected "38000000"
build/system.dtb: Warning (simple_bus_reg): Node /soc/serial@60000000 simple-bus unit address format error, expected "40600000"
build/system.dtb: Warning (simple_bus_reg): Node /soc/mmc simple-bus unit address format error, expected "40002000"
build/system.dtb: Warning (interrupts_property): Missing interrupt-parent for /soc/serial@60000000
make -s -C apps/hello install
make -s -C apps/stream install
make -s -C apps/busybox install
make -s -C apps/redis install
make -s -C apps/dwarf/md5 install
make -s -C apps/dwarf/sort install
make -s -C apps/dwarf/wordcount install
make[2]: Entering directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/hello'
make[2]: Entering directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/stream'
make[2]: Entering directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/busybox'
make[2]: Entering directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/redis'
make[2]: Entering directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/dwarf/md5'
make[2]: Entering directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/dwarf/sort'
make[2]: Entering directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/dwarf/wordcount'
make[2]: Leaving directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/busybox'
make[2]: Leaving directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/redis'
make[2]: Leaving directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/hello'
make[2]: Leaving directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/stream'
make[2]: Leaving directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/dwarf/md5'
make[2]: Leaving directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/dwarf/sort'
make[2]: Leaving directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs/apps/dwarf/wordcount'
make[1]: Leaving directory '/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs'
RISCV_ROOTFS_HOME=/home/sazc/risc_v/git_source/xs-linux/riscv-rootfs make -C /home/sazc/risc_v/git_source/xs-linux/riscv-linux CROSS_COMPILE=riscv64-unknown-linux-gnu- ARCH=riscv vmlinux
make[1]: Entering directory '/home/sazc/risc_v/git_source/xs-linux/riscv-linux'
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: 	
checking build system type... config.sub: missing argument
Try `config.sub --help' for more information.
configure: error: /bin/sh /home/sazc/risc_v/git_source/xs-linux/riscv-pk/scripts/config.sub 	 failed
Makefile:56: recipe for target 'build/Makefile' failed
make: *** [build/Makefile] Error 1
make: *** Waiting for unfinished jobs....
  CALL    scripts/checksyscalls.sh
<stdin>:1335:2: warning: #warning syscall rseq not implemented [-Wcpp]
  CHK     include/generated/compile.h
make[1]: Leaving directory '/home/sazc/risc_v/git_source/xs-linux/riscv-linux'
riscv64-unknown-elf-objdump -d /home/sazc/risc_v/git_source/xs-linux/riscv-linux/vmlinux > ./build/vmlinux.txt

注:

  • 使用默认的构建教程可以构建出正确的bbl,也可以正常仿真执行;
  • 修改Makefile之后我也尝试使用make clean了;

编译链接kernel的BBL时报错

您好,我是根据https://xiangshan-doc.readthedocs.io/zh-cn/latest/tools/linux-kernel-for-xs/ 里的教程来编译链接kernel的BBL
但是报以下错误:
image
查看了pk的makefile后发现此处有关于通过./config进行配置并生成BBL的makefile:
image
发现生成的./build/Makefile中关于编译BBL时使用的CC为本地的gcc而非RV工具链:
image
由此请问BBL的编译是需要在要在pk的makefile某处添加cross_compile的路径吗?或者说需要在RV环境下进行编译?
麻烦解答一下,谢谢!

DRAMSIM3 文档

我在按照DRAMSIM3中的redame进行编译操作 使用cmake .. && make -j4 和 makefile的make all都无法使用,报错信息如下:

/usr/bin/ld: CMakeFiles/dramsim3main.dir/src/main.cc.o: in function `cosim_main()':
main.cc:(.text+0xe92): undefined reference to `ComplexCoDRAMsim3::ComplexCoDRAMsim3(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/dramsim3main.dir/build.make:114:dramsim3main] 错误 1
make[1]: *** [CMakeFiles/Makefile2:112:CMakeFiles/dramsim3main.dir/all] 错误 2

而使用cmake -D COSIM=1 && make -j4编译的话又不会生成.so库文件。目前在xiangshan-doc中没有找到可以参考的操作手册,请问下能否提供一个文档说明如何使用

香山工具链的分支切换问题

工具链文档中提到的 riscv-gcc-experimental-bkp 分支和括号中的fbfa8d9ad496a2d69a38be2c2c3c0dc0956ffb9e是一个吗 ,下载该分支之后还需要再切换到该id下吗

spec_gen.py 中的spec_common文件夹

在spec_gen.py 生成initramfs-spec.txt文件时需要指定spec_common文件夹,这个文件夹怎么生成的?或者在哪里可以下载

  "# SPEC common",
  "dir /spec_common 755 0 0",
  "file /spec_common/before_workload ${SPEC}/before_workload 755 0 0",
  "file /spec_common/trap ${SPEC}/trap_new 755 0 0",
  "",

还有一个问题是如果要生成specCPU2006 所有12个int case的checkpoint,是不是要生成12个initramfs-spec.tx。然后在riscv-linux 中配置不同case的initramfs-spec.txt.。然后生成12个不同的rootfs?
有没有生成specCPU2006 checkpoint的完整的脚本工具?

make rootfsimg error

我在 riscv-rootfs 目录的时候遇到这个问题运行 make rootfsimg
问题如下
In file included from /home/mark/riscv64-linux_2/lib/gcc/riscv64-unknown-linux-gnu/11.1.0/include-fixed/syslimits.h:7,
from /home/mark/riscv64-linux_2/lib/gcc/riscv64-unknown-linux-gnu/11.1.0/include-fixed/limits.h:34,
from include/platform.h:153,
from include/libbb.h:13,
from include/busybox.h:8,
from applets/applets.c:9:
/home/mark/riscv64-linux_2/lib/gcc/riscv64-unknown-linux-gnu/11.1.0/include-fixed/limits.h:203:15: fatal error: limits.h: No such file or directory
203 | #include_next <limits.h> /* recurse down to the real one */
| ^~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.build:198: applets/applets.o] Error 1
make[2]: *** [Makefile:372: applets_dir] Error 2
解决方法如下,在另一位同学的协同下,发现riscv-rootfs/apps/busybox/config文件有个环境变量-“RISCV"没有被提及导致这个问题出现
部分原文如下# Build Options

CONFIG_STATIC is not set

CONFIG_PIE is not set

CONFIG_NOMMU is not set

CONFIG_BUILD_LIBBUSYBOX is not set

CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set

CONFIG_FEATURE_INDIVIDUAL is not set

CONFIG_FEATURE_SHARED_BUSYBOX is not set

CONFIG_CROSS_COMPILER_PREFIX="riscv64-unknown-linux-gnu-"
CONFIG_SYSROOT="${RISCV}/sysroot"
CONFIG_EXTRA_CFLAGS=""
CONFIG_EXTRA_LDFLAGS=""
CONFIG_EXTRA_LDLIBS=""

CONFIG_USE_PORTABLE_CODE is not set

CONFIG_STACK_OPTIMIZATION_386=y

解决方法把RISCV设置为自己编译的工具链的目录。
我的为~/riscv64-linux .(加上sysroot之后是 ~/riscv64-linux/sysroot)
到此问题解决。
下一个问题如下,好像是工具链的版本不兼容,不知道能否提供以下可用的版本号呢?
/home/mark/riscv64-linux_2/lib/gcc/riscv64-unknown-linux-gnu/11.1.0/../../../../riscv64-unknown-linux-gnu/bin/ld: coreutils/lib.a(mktemp.o): in function .L5': mktemp.c:(.text.mktemp_main+0x88): warning: the use of mktemp' is dangerous, better use mkstemp' or mkdtemp'
/home/mark/riscv64-linux_2/lib/gcc/riscv64-unknown-linux-gnu/11.1.0/../../../../riscv64-unknown-linux-gnu/bin/ld: util-linux/lib.a(rdate.o): in function .L6': rdate.c:(.text.rdate_main+0xd0): undefined reference to stime'
/home/mark/riscv64-linux_2/lib/gcc/riscv64-unknown-linux-gnu/11.1.0/../../../../riscv64-unknown-linux-gnu/bin/ld: coreutils/lib.a(date.o): in function .L12': date.c:(.text.date_main+0x1a0): undefined reference to stime'
collect2: error: ld returned 1 exit status
Note: if build needs additional libraries, put them in CONFIG_EXTRA_LDLIBS.
Example: CONFIG_EXTRA_LDLIBS="pthread dl tirpc audit pam"
make[2]: *** [Makefile:718: busybox_unstripped] Error 1
make[1]: *** [Makefile:12: /home/mark/xs/linux_kernel/riscv-rootfs/apps/busybox/build/busybox] Error 2
make: [Makefile:11: apps/busybox] Error 2 (ignored)
make -s -C apps/redis install

关于编译Linux Kernel时Assembler messages报错 invalid -march= option: `rv64imac' / Error: unrecognized opcode, extension `zicsr' required

跟着https://xiangshan-doc.readthedocs.io/zh_CN/latest/tools/linux-kernel-for-xs/#5-linux-kernal的流程编译Linux Kernel
在“构建BBL并链接Kernel”的步骤,运行make -j出现如下报错:

zhantong@ubuntu:/XiangShan/riscv-pk$ make clean
rm -rf build
zhantong@ubuntu:
/XiangShan/riscv-pk$ make -j
RISCV_ROOTFS_HOME=/home/zhantong/XiangShan/riscv-rootfs make -C /home/zhantong/XiangShan/riscv-rootfs
mkdir -p build
mkdir -p build
dtc -O dtb -I dts -o build/system.dtb dts/system.dts
make[1]: 进入目录“/home/zhantong/XiangShan/riscv-rootfs”
cd build && /home/zhantong/XiangShan/riscv-pk/configure --host=riscv64-unknown-elf --with-payload=/home/zhantong/XiangShan/riscv-linux/vmlinux --with-arch=rv64gc --enable-logo
make -s -C apps/hello install
dts/platform.dtsi:19.16-22.7: Warning (unit_address_vs_reg): /soc/mmc: node has a reg or ranges property, but no unit name
dts/platform.dtsi:5.21-11.5: Warning (simple_bus_reg): /soc/clint@2000000: simple-bus unit address format error, expected "38000000"
dts/platform.dtsi:12.24-18.5: Warning (simple_bus_reg): /soc/serial@60000000: simple-bus unit address format error, expected "40600000"
dts/platform.dtsi:19.16-22.7: Warning (simple_bus_reg): /soc/mmc: simple-bus unit address format error, expected "40002000"
dts/platform.dtsi:12.24-18.5: Warning (interrupts_property): /soc/serial@60000000: Missing interrupt-parent
make -s -C apps/stream install
make -s -C apps/busybox install
make -s -C apps/redis install
make -s -C apps/dwarf/md5 install
make -s -C apps/dwarf/sort install
make -s -C apps/dwarf/wordcount install
make[2]: 进入目录“/home/zhantong/XiangShan/riscv-rootfs/apps/hello”
make[2]: 进入目录“/home/zhantong/XiangShan/riscv-rootfs/apps/stream”
make[2]: 进入目录“/home/zhantong/XiangShan/riscv-rootfs/apps/dwarf/md5”
make[2]: 进入目录“/home/zhantong/XiangShan/riscv-rootfs/apps/busybox”
make[2]: 进入目录“/home/zhantong/XiangShan/riscv-rootfs/apps/dwarf/sort”
make[2]: 进入目录“/home/zhantong/XiangShan/riscv-rootfs/apps/redis”
make[2]: 进入目录“/home/zhantong/XiangShan/riscv-rootfs/apps/dwarf/wordcount”
make[2]: 离开目录“/home/zhantong/XiangShan/riscv-rootfs/apps/redis”
make[2]: 离开目录“/home/zhantong/XiangShan/riscv-rootfs/apps/busybox”
make[2]: 离开目录“/home/zhantong/XiangShan/riscv-rootfs/apps/stream”
make[2]: 离开目录“/home/zhantong/XiangShan/riscv-rootfs/apps/dwarf/md5”
make[2]: 离开目录“/home/zhantong/XiangShan/riscv-rootfs/apps/dwarf/sort”
make[2]: 离开目录“/home/zhantong/XiangShan/riscv-rootfs/apps/dwarf/wordcount”
make[2]: 离开目录“/home/zhantong/XiangShan/riscv-rootfs/apps/hello”
make[1]: 离开目录“/home/zhantong/XiangShan/riscv-rootfs”
RISCV_ROOTFS_HOME=/home/zhantong/XiangShan/riscv-rootfs make -C /home/zhantong/XiangShan/riscv-linux CROSS_COMPILE=riscv64-unknown-linux-gnu- ARCH=riscv vmlinux
make[1]: 进入目录“/home/zhantong/XiangShan/riscv-linux”
checking build system type... x86_64-pc-linux-gnu
checking host system type... riscv64-unknown-elf
checking for riscv64-unknown-elf-gcc... riscv64-unknown-elf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether riscv64-unknown-elf-gcc accepts -g... yes
checking for riscv64-unknown-elf-gcc option to accept ISO C89... none needed
checking for riscv64-unknown-elf-g++... riscv64-unknown-elf-g++
checking whether we are using the GNU C++ compiler... yes
checking whether riscv64-unknown-elf-g++ accepts -g... yes
checking for riscv64-unknown-elf-ar... riscv64-unknown-elf-ar
checking for riscv64-unknown-elf-ranlib... riscv64-unknown-elf-ranlib
checking for riscv64-unknown-elf-readelf... riscv64-unknown-elf-readelf
checking for riscv64-unknown-elf-objcopy... riscv64-unknown-elf-objcopy
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... riscv64-unknown-elf-gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
configure: configuring default subproject : pk
configure: configuring default subproject : bbl
configure: configuring default subproject : softfloat
configure: configuring default subproject : dummy_payload
configure: configuring default subproject : machine
configure: configuring default subproject : util
configure: creating ./config.status
config.status: creating pk.mk
scripts/kconfig/conf --syncconfig Kconfig
config.status: creating bbl.mk
config.status: creating softfloat.mk
config.status: creating dummy_payload.mk
config.status: creating machine.mk
config.status: creating util.mk
config.status: creating Makefile
config.status: creating config.h

configuration written to .config

WRAP arch/riscv/include/generated/uapi/asm/setup.h
WRAP arch/riscv/include/generated/uapi/asm/unistd.h
WRAP arch/riscv/include/generated/uapi/asm/bpf_perf_event.h
WRAP arch/riscv/include/generated/uapi/asm/errno.h
WRAP arch/riscv/include/generated/uapi/asm/fcntl.h
WRAP arch/riscv/include/generated/uapi/asm/ioctl.h
WRAP arch/riscv/include/generated/uapi/asm/ioctls.h
WRAP arch/riscv/include/generated/uapi/asm/ipcbuf.h
WRAP arch/riscv/include/generated/uapi/asm/mman.h
WRAP arch/riscv/include/generated/uapi/asm/msgbuf.h
WRAP arch/riscv/include/generated/uapi/asm/param.h
WRAP arch/riscv/include/generated/uapi/asm/poll.h
WRAP arch/riscv/include/generated/uapi/asm/posix_types.h
WRAP arch/riscv/include/generated/uapi/asm/resource.h
WRAP arch/riscv/include/generated/uapi/asm/sembuf.h
UPD include/generated/uapi/linux/version.h
WRAP arch/riscv/include/generated/uapi/asm/shmbuf.h
WRAP arch/riscv/include/generated/uapi/asm/signal.h
WRAP arch/riscv/include/generated/uapi/asm/socket.h
WRAP arch/riscv/include/generated/uapi/asm/sockios.h
WRAP arch/riscv/include/generated/uapi/asm/stat.h
WRAP arch/riscv/include/generated/uapi/asm/statfs.h
WRAP arch/riscv/include/generated/uapi/asm/swab.h
WRAP arch/riscv/include/generated/uapi/asm/termbits.h
WRAP arch/riscv/include/generated/uapi/asm/termios.h
WRAP arch/riscv/include/generated/uapi/asm/types.h
WRAP arch/riscv/include/generated/asm/bugs.h
WRAP arch/riscv/include/generated/asm/cacheflush.h
WRAP arch/riscv/include/generated/asm/checksum.h
WRAP arch/riscv/include/generated/asm/compat.h
WRAP arch/riscv/include/generated/asm/cputime.h
WRAP arch/riscv/include/generated/asm/device.h
WRAP arch/riscv/include/generated/asm/div64.h
WRAP arch/riscv/include/generated/asm/dma.h
WRAP arch/riscv/include/generated/asm/dma-contiguous.h
WRAP arch/riscv/include/generated/asm/dma-mapping.h
WRAP arch/riscv/include/generated/asm/emergency-restart.h
WRAP arch/riscv/include/generated/asm/errno.h
WRAP arch/riscv/include/generated/asm/exec.h
WRAP arch/riscv/include/generated/asm/fb.h
WRAP arch/riscv/include/generated/asm/fcntl.h
WRAP arch/riscv/include/generated/asm/futex.h
WRAP arch/riscv/include/generated/asm/hardirq.h
WRAP arch/riscv/include/generated/asm/hash.h
WRAP arch/riscv/include/generated/asm/hw_irq.h
WRAP arch/riscv/include/generated/asm/ioctl.h
WRAP arch/riscv/include/generated/asm/ioctls.h
WRAP arch/riscv/include/generated/asm/ipcbuf.h
WRAP arch/riscv/include/generated/asm/irq_regs.h
WRAP arch/riscv/include/generated/asm/irq_work.h
WRAP arch/riscv/include/generated/asm/kdebug.h
WRAP arch/riscv/include/generated/asm/kmap_types.h
WRAP arch/riscv/include/generated/asm/kvm_para.h
WRAP arch/riscv/include/generated/asm/local.h
WRAP arch/riscv/include/generated/asm/local64.h
WRAP arch/riscv/include/generated/asm/mm-arch-hooks.h
WRAP arch/riscv/include/generated/asm/mman.h
WRAP arch/riscv/include/generated/asm/module.h
WRAP arch/riscv/include/generated/asm/msgbuf.h
WRAP arch/riscv/include/generated/asm/mutex.h
WRAP arch/riscv/include/generated/asm/param.h
WRAP arch/riscv/include/generated/asm/percpu.h
WRAP arch/riscv/include/generated/asm/poll.h
WRAP arch/riscv/include/generated/asm/posix_types.h
WRAP arch/riscv/include/generated/asm/preempt.h
WRAP arch/riscv/include/generated/asm/resource.h
WRAP arch/riscv/include/generated/asm/scatterlist.h
WRAP arch/riscv/include/generated/asm/sections.h
WRAP arch/riscv/include/generated/asm/sembuf.h
WRAP arch/riscv/include/generated/asm/serial.h
WRAP arch/riscv/include/generated/asm/setup.h
WRAP arch/riscv/include/generated/asm/shmbuf.h
WRAP arch/riscv/include/generated/asm/shmparam.h
WRAP arch/riscv/include/generated/asm/signal.h
WRAP arch/riscv/include/generated/asm/socket.h
WRAP arch/riscv/include/generated/asm/sockios.h
WRAP arch/riscv/include/generated/asm/stat.h
WRAP arch/riscv/include/generated/asm/statfs.h
WRAP arch/riscv/include/generated/asm/swab.h
WRAP arch/riscv/include/generated/asm/termbits.h
WRAP arch/riscv/include/generated/asm/termios.h
WRAP arch/riscv/include/generated/asm/topology.h
WRAP arch/riscv/include/generated/asm/trace_clock.h
WRAP arch/riscv/include/generated/asm/types.h
WRAP arch/riscv/include/generated/asm/unaligned.h
WRAP arch/riscv/include/generated/asm/user.h
WRAP arch/riscv/include/generated/asm/vga.h
WRAP arch/riscv/include/generated/asm/vmlinux.lds.h
WRAP arch/riscv/include/generated/asm/xor.h
HOSTCC scripts/dtc/dtc.o
CC scripts/mod/empty.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/mod/mk_elfconfig
HOSTCC scripts/dtc/fstree.o
CC scripts/mod/devicetable-offsets.s
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/util.o
LEX scripts/dtc/dtc-lexer.lex.c
Assembler messages:
致命错误: invalid -march= option: `rv64imac'
make[3]: *** [scripts/Makefile.build:318:scripts/mod/empty.o] 错误 1
make[3]: *** 正在等待未完成的任务....
YACC scripts/dtc/dtc-parser.tab.h
YACC scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTCC scripts/dtc/dtc-lexer.lex.o
make[2]: *** [scripts/Makefile.build:558:scripts/mod] 错误 2
make[2]: *** 正在等待未完成的任务....
HOSTLD scripts/dtc/dtc
make[1]: *** [Makefile:1045:scripts] 错误 2
make[1]: *** 正在等待未完成的任务....
UPD include/config/kernel.release
make[1]: 离开目录“/home/zhantong/XiangShan/riscv-linux”
make: *** [Makefile:90:/home/zhantong/XiangShan/riscv-linux/vmlinux] 错误 2

目前配置的riscv64交叉编译器配置如下:
zhantong@ubuntu:$ export PATH=$PATH:/opt/riscv/bin
zhantong@ubuntu:
$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/opt/riscv/libexec/gcc/riscv64-unknown-linux-gnu/10.2.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /home/zhantong/XiangShan/riscv-gnu-toolchain/riscv-gcc/configure --target=riscv64-unknown-linux-gnu --prefix=/opt/riscv --with-sysroot=/opt/riscv/sysroot --with-newlib --without-headers --disable-shared --disable-threads --with-system-zlib --enable-tls --enable-languages=c --disable-libatomic --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-bootstrap --src=.././riscv-gcc --disable-multilib --with-abi=lp64d --with-arch=rv64imafdc --with-tune=rocket 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC)
zhantong@ubuntu:$ export PATH=$PATH:/home/zhantong/my_riscv/bin
zhantong@ubuntu:
$ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/home/zhantong/my_riscv/libexec/gcc/riscv64-unknown-elf/12.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /home/zhantong/riscv-gnu-toolchain/build/../gcc/configure --target=riscv64-unknown-elf --prefix=/home/zhantong/my_riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-pkgversion=g2ee5e430018 --with-system-zlib --enable-tls --with-newlib --with-sysroot=/home/zhantong/my_riscv/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=../../gcc --disable-multilib --with-abi=lp64d --with-arch=rv64gc --with-tune=rocket --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-Os -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.2.0 (g2ee5e430018)
zhantong@ubuntu:~$

应当足以涵盖指令集,为什么交叉编译器无法识别rv64imac的选项?
恳求解答!

内存16GB生成simpoint的时候bootload挂住

在利用NEMU生成specCPU2017 simpoint时需要16GB的内存,因此修改noop.dtsi把内存增加到16GB

/dts-v1/;

/ {
	L18: soc {
		L2: clint@2000000 {
			compatible = "riscv,clint0";
			interrupts-extended = <&L4 3 &L4 7>;
			reg = <0x0 0x38000000 0x0 0x10000>;
			reg-names = "control";
			clock-frequency-mhz = <500>;
		};
		L14: serial@60000000 {
			compatible = "xilinx,uartlite";
			//interrupt-parent = <&L1>;
			interrupts = <3>;
			reg = <0x0 0x40600000 0x0 0x1000>;
			reg-names = "control";
		};
    sdhci: mmc {
      compatible = "nemu-sdhost";
			reg = <0x0 0x40002000 0x0 0x1000>;
    };
	};
  chosen {
    bootargs = "root=/dev/mmcblk0 rootfstype=ext4 ro rootwait earlycon";
  };
	L11: memory@100000000 {
		device_type = "memory";
		reg = <0x0 0x80000000 0x4 0x00000000>;
	};
};

利用NEMU 如下指令跑的时候

/xiangshang/NEMU-master/NEMU/build/riscv64-nemu-interpreter /xiangshang/linux/riscv-pk/spec2017bin/build_xz_cpu/bbl.bin -D /xiangshang/NEMU-master/spec2017CheckPoint/CPU2017Simpoint -w xz_cpu -C cpu2016-simpoint-profiling -b --simpoint-profile --cpt-interval 20000000 -r /xiangshang/NEMU-master/NEMU/resource/gcpt_restore/build/gcpt.bin

bootload挂在了Initmem setup node 0,log如下:

bbl loader

freq-mhz = 500
CLINT: set frequency to 500 MHz
              vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

                  vvvvvvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrr       vvvvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrrrrr      vvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrrrrr      vvvvvvvvvvvvvvvvvvvvvv  

rrrrrrrrrrrrr       vvvvvvvvvvvvvvvvvvvvvv    

rr                vvvvvvvvvvvvvvvvvvvvvv      

rr            vvvvvvvvvvvvvvvvvvvvvvvv      rr

rrrr      vvvvvvvvvvvvvvvvvvvvvvvvvv      rrrr

rrrrrr      vvvvvvvvvvvvvvvvvvvvvv      rrrrrr

rrrrrrrr      vvvvvvvvvvvvvvvvvv      rrrrrrrr

rrrrrrrrrr      vvvvvvvvvvvvvv      rrrrrrrrrr

rrrrrrrrrrrr      vvvvvvvvvv      rrrrrrrrrrrr

rrrrrrrrrrrrrr      vvvvvv      rrrrrrrrrrrrrr

rrrrrrrrrrrrrrrr      vv      rrrrrrrrrrrrrrrr

rrrrrrrrrrrrrrrrrr          rrrrrrrrrrrrrrrrrr

rrrrrrrrrrrrrrrrrrrr      rrrrrrrrrrrrrrrrrrrr

rrrrrrrrrrrrrrrrrrrrrr  rrrrrrrrrrrrrrrrrrrrrr



       INSTRUCTION SETS WANT TO BE FREE

[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000

[    0.000000] Linux version 4.18.0 (hukun@n168-020-004) (gcc version 12.2.0 (g2ee5e430018)) #70 Mon Mar 4 19:41:28 CST 2024

[    0.000000] bootconsole [early0] enabled

[    0.000000] Initial ramdisk at: 0x(____ptrval____) (10874858 bytes)

[    0.000000] Zone ranges:

[    0.000000]   DMA32    empty

[    0.000000]   Normal   [mem 0x0000000080200000-0x000000047fffffff]

[    0.000000] Movable zone start for each node

[    0.000000] Early memory node ranges

[    0.000000]   node   0: [mem 0x0000000080200000-0x000000047fffffff]

[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x000000047fffffff]

如果内存是8GB,就可以正常启动

对于 Cache别名问题 章节表述的一些疑问

由于在 NanHu 架构中,DCache 和 ICache 都是采用 128KB 的 8 路组相联结构,cache 索引和块偏移所占 bit 数已经超过了页偏移 (4K 页的页偏移为 12 bits),由此引入了 cache 别名问题:当两个虚页映射到同一个物理页时,两个虚页的别名位 (alias bits) 很有可能是不一样的,如果不做额外处理的话,通过VIPT索引 (Virtual Index Physical Tag) 后这两个虚页会位于 cache 不同的 set,导致同一个物理页在 cache 中缓存了两份,造成一些一致性错误。

对Cache别名问题的定义中,认为两个同一物理页在Cache中缓存了两份造成了一些一致性错误。
结合图片来看,我认为这部分应该是同一物理页的物理块在Cache中缓存了两份。
定义这部分表述应该做一些修改,不知道是不是我哪里理解有错?

确定文档项目组织结构,team,Lead

简介

为了香山处理器长远发展,需要规划文档项目的组织结构,优先需要确定带领文档项目的成员组织结构

意义

文档项目成员有Lead和成员组成,Lead作用相当于最终拍板执行的人,群龙无首也是干不了事业的。
还需要普通成员,负责文档日常的编写,校对,review 文档,编写大纲,制定Road Map路线图。

建议

选举3-N名团队成员, 专注文档项目,有问题,有PR,有 新issue, 有人跟进。
Lead由团队成员选举,任期可以3个月或者半年。负责最终拍板,然后形成announce决议。

无人负责的菊面就是谁也不上心,三下五除二等于没人为这个操心和负责。
所以还是得有人负责。

先有团队,才有后续的工作开展,不组建团队,其他的也就无从开展了

补充

这里只是提议成立团队。第三方开发者,可以成为contributor,他们的工作向 文档team, contributor 可以被吸纳成为 文档team成员。

但这肯定会由初代team 来制定一些基本的规则和约束。

什么人能进team,怎么一个退役机制,有进有出,保持团队活力。

这一切的一切,得到初代的文档team成立后,由他们来决定。这里不再展开论述。

做 Linux Kernel 的第 2 步时,报错:Kernel panic - not syncing: Out of memory and no killable processes

按照《Linux Kernel 的构建.md》,做第 2 步,编译过程顺利。也给 NEMU 设置了额外多的 memory size(CONFIG_MSIZE=0x1800000000)。

但是,执行下面命令时,报错信息如下:

$ ./NEMU/build/riscv64-nemu-interpreter -b ./riscv-pk/build/bbl.bin

[src/device/io/mmio.c,18,add_mmio_map] Add mmio map 'clint' at [0x0000000038000000, 0x000000003800ffff]
[src/isa/riscv64/init.c,62,init_isa] NEMU will start from pc 0x80000000
[src/monitor/monitor.c,101,load_img] The image is ./riscv-pk/build/bbl.bin
[src/device/io/port-io.c,15,add_pio_map] Add port-io map 'uartlite' at [0x00000000000003f8, 0x0000000000000404]
[src/device/io/mmio.c,18,add_mmio_map] Add mmio map 'uartlite' at [0x0000000040600000, 0x000000004060000c]
[src/device/io/port-io.c,15,add_pio_map] Add port-io map 'rtc' at [0x0000000000000048, 0x000000000000004f]
[src/device/io/mmio.c,18,add_mmio_map] Add mmio map 'rtc' at [0x00000000a1000048, 0x00000000a100004f]
[src/device/io/port-io.c,15,add_pio_map] Add port-io map 'screen' at [0x0000000000000100, 0x0000000000000107]
[src/device/io/mmio.c,18,add_mmio_map] Add mmio map 'screen' at [0x0000000040001000, 0x0000000040001007]
[src/device/io/mmio.c,18,add_mmio_map] Add mmio map 'vmem' at [0x0000000050000000, 0x00000000500752ff]
[src/device/io/port-io.c,15,add_pio_map] Add port-io map 'keyboard' at [0x0000000000000060, 0x0000000000000063]
[src/device/io/mmio.c,18,add_mmio_map] Add mmio map 'keyboard' at [0x00000000a1000060, 0x00000000a1000063]
[src/device/io/mmio.c,18,add_mmio_map] Add mmio map 'sdhci' at [0x0000000040002000, 0x000000004000207f]
[src/device/sdcard.c,120,init_sdcard] Can not find sdcard image:
[src/monitor/monitor.c,25,welcome] Debug: OFF
[src/monitor/monitor.c,30,welcome] Build time: 14:45:29, Apr 6 2022
Welcome to riscv64-NEMU!
For help, type "help"
bbl loader
freq-mhz = 500
CLINT: set frequency to 500 MHz
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv
rr vvvvvvvvvvvvvvvvvvvvvv
rr vvvvvvvvvvvvvvvvvvvvvvvv rr
rrrr vvvvvvvvvvvvvvvvvvvvvvvvvv rrrr
rrrrrr vvvvvvvvvvvvvvvvvvvvvv rrrrrr
rrrrrrrr vvvvvvvvvvvvvvvvvv rrrrrrrr
rrrrrrrrrr vvvvvvvvvvvvvv rrrrrrrrrr
rrrrrrrrrrrr vvvvvvvvvv rrrrrrrrrrrr
rrrrrrrrrrrrrr vvvvvv rrrrrrrrrrrrrr
rrrrrrrrrrrrrrrr vv rrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrr

   INSTRUCTION SETS WANT TO BE FREE

[ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[ 0.000000] Linux version 4.18.0-14485-g036ca364c6b2-dirty (yangqi@gdcni-2U-Rack-Server) (gcc version 10.2.0 (g83718316603)) #3 Wed Apr 6 11:22:17 CST 2022
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] Initial ramdisk at: 0x(ptrval) (6730127 bytes)
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 empty
[ 0.000000] Normal [mem 0x0000000080200000-0x0000000081ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080200000-0x0000000081ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x0000000081ffffff]
[ 0.000000] Cannot allocate SWIOTLB buffer
[ 0.000000] elf_hwcap is 0x112d
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 7575
[ 0.000000] Kernel command line: root=/dev/mmcblk0 rootfstype=ext4 ro rootwait earlycon
[ 0.000000] Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.000000] Sorting __ex_table...
[ 0.000000] Memory: 18340K/30720K available (3204K kernel code, 218K rwdata, 922K rodata, 6704K init, 773K bss, 12380K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[ 0.000000] Console: colour dummy device 80x25
[ 0.000000] console [hvc0] enabled
[ 0.000000] console [hvc0] enabled
[ 0.000000] bootconsole [early0] disabled
[ 0.000000] bootconsole [early0] disabled
[ 0.000000] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.00 BogoMIPS (lpj=10000)
[ 0.000000] pid_max: default: 32768 minimum: 301
[ 0.000000] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[ 0.000000] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes)
[ 0.020000] devtmpfs: initialized
[ 0.020000] random: get_random_u32 called from bucket_table_alloc+0x6e/0x1a6 with crng_init=0
[ 0.020000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.020000] futex hash table entries: 256 (order: 0, 6144 bytes)
[ 0.030000] NET: Registered protocol family 16
[ 0.040000] SCSI subsystem initialized
[ 0.050000] clocksource: Switched to clocksource riscv_clocksource
[ 0.280000] NET: Registered protocol family 2
[ 0.280000] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes)
[ 0.280000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[ 0.280000] TCP bind hash table entries: 512 (order: 0, 4096 bytes)
[ 0.280000] TCP: Hash tables configured (established 512 bind 512)
[ 0.280000] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.280000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.280000] NET: Registered protocol family 1
[ 0.480000] RPC: Registered named UNIX socket transport module.
[ 0.480000] RPC: Registered udp transport module.
[ 0.480000] RPC: Registered tcp transport module.
[ 0.480000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 10.640000] swapper invoked oom-killer: gfp_mask=0x6200c2(GFP_HIGHUSER), nodemask=(null), order=0, oom_score_adj=0
[ 10.640000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-14485-g036ca364c6b2-dirty #3
[ 10.640000] Call Trace:
[ 10.640000] [] walk_stackframe+0x0/0xa6
[ 10.640000] [] show_stack+0x2a/0x34
[ 10.640000] [] dump_stack+0x20/0x28
[ 10.640000] [] dump_header.constprop.0+0x4a/0x14a
[ 10.640000] [] out_of_memory+0x2de/0x2f4
[ 10.640000] [] __alloc_pages_nodemask+0x444/0x874
[ 10.640000] [] pagecache_get_page+0xe6/0x236
[ 10.640000] [] grab_cache_page_write_begin+0x1a/0x2e
[ 10.640000] [] simple_write_begin+0x24/0x106
[ 10.640000] [] generic_perform_write+0x7a/0x15a
[ 10.640000] [] __generic_file_write_iter+0xd4/0x11e
[ 10.640000] [] generic_file_write_iter+0xc4/0x160
[ 10.840000] [] __vfs_write+0xd2/0x100
[ 10.840000] [] vfs_write+0x74/0x108
[ 10.840000] [] ksys_write+0x3a/0x7a
[ 10.840000] [] xwrite+0x30/0x64
[ 10.840000] [] do_copy+0x88/0xd0
[ 10.840000] [] write_buffer+0x26/0x3a
[ 10.840000] [] flush_buffer+0x42/0x96
[ 10.840000] [] __gunzip+0x21c/0x296
[ 10.840000] [] gunzip+0x12/0x1a
[ 10.840000] [] unpack_to_rootfs+0x13e/0x236
[ 10.840000] [] populate_rootfs+0x20/0xaa
[ 10.840000] [] do_one_initcall+0x28/0x100
[ 10.840000] [] kernel_init_freeable+0x11e/0x1b8
[ 10.840000] [] kernel_init+0x12/0xe8
[ 10.840000] [] ret_from_exception+0x0/0xc
[ 10.840000] Mem-Info:
[ 10.840000] active_anon:0 inactive_anon:0 isolated_anon:0
[ 10.840000] active_file:0 inactive_file:0 isolated_file:0
[ 10.840000] unevictable:4110 dirty:0 writeback:0 unstable:0
[ 10.840000] slab_reclaimable:35 slab_unreclaimable:201
[ 10.840000] mapped:0 shmem:0 pagetables:0 bounce:0
[ 10.840000] free:135 free_pcp:0 free_cma:0
[ 10.840000] Node 0 active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:16440kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:0kB shmem:0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
[ 10.840000] Normal free:540kB min:540kB low:672kB high:804kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:16440kB writepending:0kB present:30720kB managed:18340kB mlocked:0kB kernel_stack:144kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
[ 10.840000] lowmem_reserve[]: 0 0 0
[ 10.840000] Normal: 14kB (U) 18kB (U) 116kB (U) 032kB 064kB 0128kB 0256kB 1512kB (U) 01024kB 02048kB 0*4096kB = 540kB
[ 10.840000] 4123 total pagecache pages
[ 10.840000] 0 pages in swap cache
[ 10.840000] Swap cache stats: add 0, delete 0, find 0/0
[ 10.840000] Free swap = 0kB
[ 10.840000] Total swap = 0kB
[ 10.840000] 7680 pages RAM
[ 10.840000] 0 pages HighMem/MovableOnly
[ 10.840000] 3095 pages reserved
[ 10.840000] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name
[ 10.840000] Kernel panic - not syncing: Out of memory and no killable processes...
[ 10.840000]
[ 10.840000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-14485-g036ca364c6b2-dirty #3
[ 10.840000] Call Trace:
[ 10.840000] [] walk_stackframe+0x0/0xa6
[ 10.840000] [] show_stack+0x2a/0x34
[ 10.840000] [] dump_stack+0x20/0x28
[ 10.840000] [] panic+0xc0/0x1d0
[ 10.840000] [] out_of_memory+0x2ea/0x2f4
[ 10.840000] [] __alloc_pages_nodemask+0x444/0x874
[ 10.840000] [] pagecache_get_page+0xe6/0x236
[ 10.840000] [] grab_cache_page_write_begin+0x1a/0x2e
[ 10.840000] [] simple_write_begin+0x24/0x106
[ 10.840000] [] generic_perform_write+0x7a/0x15a
[ 10.840000] [] __generic_file_write_iter+0xd4/0x11e
[ 10.840000] [] generic_file_write_iter+0xc4/0x160
[ 10.840000] [] __vfs_write+0xd2/0x100
[ 10.840000] [] vfs_write+0x74/0x108
[ 10.840000] [] ksys_write+0x3a/0x7a
[ 10.840000] [] xwrite+0x30/0x64
[ 10.840000] [] do_copy+0x88/0xd0
[ 10.840000] [] write_buffer+0x26/0x3a
[ 10.840000] [] flush_buffer+0x42/0x96
[ 10.840000] [] __gunzip+0x21c/0x296
[ 10.840000] [] gunzip+0x12/0x1a
[ 10.840000] [] unpack_to_rootfs+0x13e/0x236
[ 10.840000] [] populate_rootfs+0x20/0xaa
[ 10.840000] [] do_one_initcall+0x28/0x100
[ 10.840000] [] kernel_init_freeable+0x11e/0x1b8
[ 10.840000] [] kernel_init+0x12/0xe8
[ 10.840000] [] ret_from_exception+0x0/0xc
[ 10.840000] ---[ end Kernel panic - not syncing: Out of memory and no killable processes...
[ 10.840000] ]---
^C

生成的simpoint_bbv.gz文件是空

我测试了一下specCPU2006 里的gobmk_13x13,想生成checkpoint。看log,程序跑完了,但是生成的simpoint_bbv.gz文件是空的。指令如下:

/xiangshang/NEMU-master/NEMU/build/riscv64-nemu-interpreter /xiangshang/linux/riscv-pk/build/bbl.bin -D /xiangshang/NEMU-master/spec2006CheckPoint/CPU2006Simpoint -w 445.gobmk -C cpu2006-simpoint-profiling -b --simpoint-profile --cpt-interval 20000000 -r /xiangshang/NEMU-master/NEMU/resource/gcpt_restore/build/gcpt.bin

log 如下:

bbl loader

freq-mhz = 500
CLINT: set frequency to 500 MHz
              vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

                  vvvvvvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrr       vvvvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrrrrr      vvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrrrrrrr    vvvvvvvvvvvvvvvvvvvvvvvv

rrrrrrrrrrrrrrrr      vvvvvvvvvvvvvvvvvvvvvv  

rrrrrrrrrrrrr       vvvvvvvvvvvvvvvvvvvvvv    

rr                vvvvvvvvvvvvvvvvvvvvvv      

rr            vvvvvvvvvvvvvvvvvvvvvvvv      rr

rrrr      vvvvvvvvvvvvvvvvvvvvvvvvvv      rrrr

rrrrrr      vvvvvvvvvvvvvvvvvvvvvv      rrrrrr

rrrrrrrr      vvvvvvvvvvvvvvvvvv      rrrrrrrr

rrrrrrrrrr      vvvvvvvvvvvvvv      rrrrrrrrrr

rrrrrrrrrrrr      vvvvvvvvvv      rrrrrrrrrrrr

rrrrrrrrrrrrrr      vvvvvv      rrrrrrrrrrrrrr

rrrrrrrrrrrrrrrr      vv      rrrrrrrrrrrrrrrr

rrrrrrrrrrrrrrrrrr          rrrrrrrrrrrrrrrrrr

rrrrrrrrrrrrrrrrrrrr      rrrrrrrrrrrrrrrrrrrr

rrrrrrrrrrrrrrrrrrrrrr  rrrrrrrrrrrrrrrrrrrrrr



       INSTRUCTION SETS WANT TO BE FREE

[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000

[    0.000000] Linux version 4.18.0 (hukun@n168-020-004) (gcc version 12.2.0 (g2ee5e430018)) #6 Fri Mar 1 11:43:52 CST 2024

[    0.000000] bootconsole [early0] enabled

[    0.000000] Initial ramdisk at: 0x(____ptrval____) (13131776 bytes)

[    0.000000] Zone ranges:

[    0.000000]   DMA32    empty

[    0.000000]   Normal   [mem 0x0000000080200000-0x00000000ffffffff]

[    0.000000] Movable zone start for each node

[    0.000000] Early memory node ranges

[    0.000000]   node   0: [mem 0x0000000080200000-0x00000000ffffffff]

[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x00000000ffffffff]

[    0.000000] software IO TLB [mem 0xfa3ff000-0xfe3ff000] (64MB) mapped at [(____ptrval____)-(____ptrval____)]

[    0.000000] elf_hwcap is 0x112d

[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 516615

[    0.000000] Kernel command line: root=/dev/mmcblk0 rootfstype=ext4 ro rootwait earlycon

[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)

[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)

[    0.000000] Sorting __ex_table...

[    0.000000] Memory: 1983476K/2095104K available (712K kernel code, 78K rwdata, 102K rodata, 12892K init, 98K bss, 111628K reserved, 0K cma-reserved)

[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

[    0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0

[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns

[    0.000000] console [hvc0] enabled

[    0.000000] console [hvc0] enabled

[    0.000000] bootconsole [early0] disabled

[    0.000000] bootconsole [early0] disabled

[    0.000000] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.00 BogoMIPS (lpj=10000)

[    0.000000] pid_max: default: 4096 minimum: 301

[    0.000000] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)

[    0.000000] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)

[    0.010000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns

[    0.010000] futex hash table entries: 16 (order: -4, 384 bytes)

[    0.020000] clocksource: Switched to clocksource riscv_clocksource

[    1.620000] Unpacking initramfs...

[    3.190000] workingset: timestamp_bits=62 max_order=19 bucket_order=0

[    3.200000] random: get_random_bytes called from 0xffffffff80c9ac66 with crng_init=0

[    3.300000] Freeing unused kernel memory: 12892K

[    3.300000] This architecture does not have kernel memory protection.

===== Start running SPEC2006 =====

======== BEGIN gobmk_13x13 ========

+ md5sum /spec/gobmk_base.riscv64-gcc10

7f60c96700e8008bc6cc89bf2f8e6940  /spec/gobmk_base.riscv64-gcc10

+ date -R

Thu, 01 Jan 1970 00:00:07 +0000

+ cd /spec

+ ./gobmk_base.riscv64-gcc10 --quiet --mode gtp

= white



=1 J2



= white



=2 E10



= white



=3 E5



= white



=4 M4



= white



=5 N9



= white



=6 M8



= white



=7 M1



= white



=8 H8



= white



=9 B6



= white



=10 E3



= white



=11 G6



= white



=12 G7



= white



=13 G7



= white



=14 E8



= white



=15 C7



= white



=16 C6



= white



=17 L5



= white



=18 0



= white



=19 C10



= white



=20 M8



= white



=21 N8



= white



=22 C9



= white



=23 E12



= white



=24 H6



= white



=25 J5



= white



=26 J5



= white



=27 E3



= white



=28 E3



= white



=29 C8



= white



=30 B7



= white



=31 M4



= white



=33 E7



= white



=34 K13



= white



=35 B13



= white



=36 B2



= white



=37 E10



= white



=38 G10



= white



=39 H4



= white



=40 L11



= white



=41 H10



= white



=42 C7



= black



=43 D6



= black



=44 B6



= black



=45 B4



= black



=46 L3



= black



=47 K9



= black



=48 K7



= black



=49 K7



= black



=149 H12



= black



=50 H12



= black



=51 N9



= black



=52 H10



= black



=53 C6



= black



=54 H11



= black



=55 H6



= black



=56 H4



= black



=57 N7



= black



=58 0



= black



=59 K5



= black



=60 G3



= black



=61 K8



= black



=62 C12



= black



=63 K4



= black



=64 M3



= black



=65 L2



= black



=66 M5



= black



=67 B9



= black



=68 A8



= black



=69 D5



= black



=70 L10



= black



=71 J11



= black



=72 J10



= black



=73 H4



= black



=74 G7



= black



=75 E6



= black



=76 J3



= black



=77 C8



= black



=78 L4



= black



=79 M5



= black



=80 M2



= black



=81 M8



= black



=82 K4



= black



=83 L12



= black



=84 H13



= black



=85 D2



= black



=86 1 H5



= black



=87 F6



= black



=88 D6



= black



=89 0



= black



=90 A5



= black



=91 F5



+ date -R

Thu, 01 Jan 1970 03:38:13 +0000

+ set +x

======== END   gobmk_13x13 ========

===== Finish running SPEC2006 =====

但是运行指令的窗口还没有结束,一直停住在下面

/xiangshang/NEMU-master/NEMU/build/riscv64-nemu-interpreter /xiangshang/linux/riscv-pk/build/bbl.bin -D /xiangshang/NEMU-master/spec2006CheckPoint/CPU2006Simpoint -w 445.gobmk -C cpu2006-simpoint-profiling -b --simpoint-profile --cpt-interval 20000000 -r /xiangshang/NEMU-master/NEMU/resource/gcpt_restore/build/gcpt.bin

NEMU 用的是master分支。请问simpoint_bbv.gz文件是空的是什么原因

riscv-rootfs使用新的app后运行报错Failed to execute /init (error -8)

自己编译的app属性如下,使用的riscv64-unknown-elf-gcc
zcc@zcc-virtual-machine:~/toolchain/spec2006/447.dealII/build$ file dealII
dealII: ELF 64-bit LSB executable, UCB RISC-V, version 1 (SYSV), statically linked, with debug_info, not stripped

将自己编译好的文件放在rootfsimg文件夹下后 编译出的bbl.bin在运行时报错
[ 0.010000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.030000] clocksource: Switched to clocksource riscv_clocksource
[ 0.030000] Unpacking initramfs...
[ 2.430000] workingset: timestamp_bits=62 max_order=19 bucket_order=0
[ 2.440000] random: get_random_bytes called from 0xffffffff811ffc5c with crng_init=0
[ 2.540000] Freeing unused kernel memory: 18416K
[ 2.540000] This architecture does not have kernel memory protection.
[ 2.540000] Failed to execute /init (error -8)
[ 2.540000] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[ 2.540000] ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. ]---

编译香山工具链时编译后工具套件不完整

按照文档要求替换了riscv-gcc和riscv-binutils到指定分支,编译后工具套件找那个缺少gcc g++ 等工具,但是又 ar as ld等,log如下,粘了一部分,因为这一部分就在check的时候就指出不生成gcc g++等,在这之前还报错了缺少isl,不知是否和这个有关
rm -rf stamps/build-binutils-linux build-binutils-linux
rm -rf stamps/build-gdb-linux build-gdb-linux
mkdir build-binutils-linux
mkdir build-gdb-linux
cd build-binutils-linux && CC_FOR_TARGET=riscv64-unknown-linux-gnu-gcc /home/zcc/toolchain/riscv-gnu-toolchain/build/../riscv-binutils/configure
--target=riscv64-unknown-linux-gnu

--prefix=/home/zcc/toolchain/riscv
--with-sysroot=/home/zcc/toolchain/riscv/sysroot
--disable-multilib

--disable-werror
--disable-nls
--with-expat=yes
--disable-gdb
--disable-sim
--disable-libdecnumber
--disable-readline
cd build-gdb-linux && CC_FOR_TARGET=riscv64-unknown-linux-gnu-gcc /home/zcc/toolchain/riscv-gnu-toolchain/build/../riscv-gdb/configure
--target=riscv64-unknown-linux-gnu

--prefix=/home/zcc/toolchain/riscv
--with-sysroot=/home/zcc/toolchain/riscv/sysroot
--disable-multilib

--disable-werror
--disable-nls
--with-expat=yes
--enable-gdb
--disable-gas
--disable-binutils
--disable-ld
--disable-gold
--disable-gprof
checking build system type... checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... riscv64-unknown-linux-gnu
riscv64-unknown-linux-gnu
checking for a BSD-compatible install... checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... /usr/bin/gawk
/usr/bin/sed
checking for gawk... /usr/bin/gawk
configure: WARNING: neither ld nor gold are enabled
checking for gdbserver support... no
checking for gdbserver support... checking for gcc... gcc
no
checking for gcc... gcc
checking whether the C compiler works... checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...

checking whether we are cross compiling... checking whether we are cross compiling... no
no
checking for suffix of object files... checking for suffix of object files... o
checking whether we are using the GNU C compiler... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -g... yes
yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... checking whether g++ accepts -static-libstdc++ -static-libgcc... yes
checking for gnatbind... yes
no
checking for gnatmake... no
checking whether compiler driver understands Ada... checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
.libs
checking for isl 0.15 or later... checking for isl 0.15 or later... no
required isl version is 0.15 or later
no
required isl version is 0.15 or later
*** This configuration is not supported in the following subdirectories:
gdbserver binutils gas gprof
(Any other directories should still work fine.)
*** This configuration is not supported in the following subdirectories:
gdbserver readline libdecnumber sim gdb
(Any other directories should still work fine.)
checking for default BUILD_CONFIG...
checking for --enable-vtable-verify... no
checking for default BUILD_CONFIG...
checking for --enable-vtable-verify... no
checking for bison... bison -y
checking for bison... bison
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for bison... bison -y
checking for bison... bison
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for expect... checking for expect... no
no
checking for runtest... checking for runtest... no
no
checking for ar... checking for ar... ar
ar
checking for as... checking for as... as
as
checking for dlltool... checking for dlltool... no
no
checking for ld... checking for ld... ld
ld
checking for lipo... checking for lipo... no
no
checking for nm... nm
checking for ranlib... checking for nm... ranlib
nm
checking for strip... checking for ranlib... strip
ranlib
checking for windres... checking for strip... no
strip
checking for windmc... checking for windres... no
no
checking for objcopy... checking for windmc... objcopy
no
checking for objdump... checking for objcopy... objcopy
objdump
checking for objdump... checking for readelf... objdump
readelf
checking for readelf... checking for cc... (cached) riscv64-unknown-linux-gnu-gcc
checking for gcc... (cached) readelf
riscv64-unknown-linux-gnu-gcc
checking for cc... (cached) riscv64-unknown-linux-gnu-gcc
checking for gcc... (cached) riscv64-unknown-linux-gnu-gcc
checking for riscv64-unknown-linux-gnu-c++... no
checking for riscv64-unknown-linux-gnu-g++... checking for riscv64-unknown-linux-gnu-c++... no
checking for riscv64-unknown-linux-gnu-cxx... no
checking for riscv64-unknown-linux-gnu-g++... no
no
checking for riscv64-unknown-linux-gnu-gxx... checking for riscv64-unknown-linux-gnu-cxx... no
no
checking for riscv64-unknown-linux-gnu-gxx... no
checking for riscv64-unknown-linux-gnu-gcc... checking for riscv64-unknown-linux-gnu-gcc... no
no
checking for riscv64-unknown-linux-gnu-gfortran... checking for riscv64-unknown-linux-gnu-gfortran... no
no
checking for riscv64-unknown-linux-gnu-gccgo... checking for riscv64-unknown-linux-gnu-gccgo... no
no
checking for riscv64-unknown-linux-gnu-ar... riscv64-unknown-linux-gnu-ar
checking for riscv64-unknown-linux-gnu-as... riscv64-unknown-linux-gnu-as
checking for riscv64-unknown-linux-gnu-ar... riscv64-unknown-linux-gnu-ar
checking for riscv64-unknown-linux-gnu-dlltool... checking for riscv64-unknown-linux-gnu-as... no
riscv64-unknown-linux-gnu-as
checking for riscv64-unknown-linux-gnu-ld... riscv64-unknown-linux-gnu-ld
checking for riscv64-unknown-linux-gnu-dlltool... no
checking for riscv64-unknown-linux-gnu-lipo... no
checking for riscv64-unknown-linux-gnu-ld... riscv64-unknown-linux-gnu-ld
checking for riscv64-unknown-linux-gnu-lipo... checking for riscv64-unknown-linux-gnu-nm... no
riscv64-unknown-linux-gnu-nm
checking for riscv64-unknown-linux-gnu-nm... checking for riscv64-unknown-linux-gnu-objcopy... riscv64-unknown-linux-gnu-objcopy
riscv64-unknown-linux-gnu-nm
checking for riscv64-unknown-linux-gnu-objdump... riscv64-unknown-linux-gnu-objdump
checking for riscv64-unknown-linux-gnu-ranlib... riscv64-unknown-linux-gnu-ranlib
checking for riscv64-unknown-linux-gnu-objcopy... checking for riscv64-unknown-linux-gnu-readelf... riscv64-unknown-linux-gnu-readelf
riscv64-unknown-linux-gnu-objcopy
checking for riscv64-unknown-linux-gnu-strip... riscv64-unknown-linux-gnu-strip
checking for riscv64-unknown-linux-gnu-objdump... riscv64-unknown-linux-gnu-objdump
checking for riscv64-unknown-linux-gnu-windres... no
checking for riscv64-unknown-linux-gnu-ranlib... riscv64-unknown-linux-gnu-ranlib
checking for riscv64-unknown-linux-gnu-windmc... no
checking where to find the target ar... checking for riscv64-unknown-linux-gnu-readelf... just compiled
checking where to find the target as... riscv64-unknown-linux-gnu-readelf
just compiled
checking where to find the target cc... checking for riscv64-unknown-linux-gnu-strip... riscv64-unknown-linux-gnu-strip
pre-installed
checking where to find the target c++... checking for riscv64-unknown-linux-gnu-windres... no
checking for riscv64-unknown-linux-gnu-windmc... no
checking where to find the target ar... pre-installed
checking where to find the target c++ for libstdc++... pre-installed
checking where to find the target as... pre-installed
checking where to find the target dlltool... just compiled
checking where to find the target gcc... pre-installed
checking where to find the target cc... pre-installed
checking where to find the target gfortran... pre-installed
checking where to find the target c++... pre-installed
checking where to find the target gccgo... pre-installed
checking where to find the target c++ for libstdc++... pre-installed
checking where to find the target ld... just compiled
checking where to find the target lipo... pre-installed
checking where to find the target dlltool... pre-installed
checking where to find the target nm... just compiled
checking where to find the target objcopy... just compiled
checking where to find the target objdump... just compiled
checking where to find the target ranlib... just compiled
checking where to find the target readelf... just compiled
checking where to find the target strip... just compiled
checking where to find the target windres... just compiled
checking where to find the target windmc... just compiled
checking whether to enable maintainer-specific portions of Makefiles... no
pre-installed
checking where to find the target gcc... pre-installed
checking where to find the target gfortran... pre-installed
checking where to find the target gccgo... pre-installed
checking where to find the target ld... pre-installed
checking where to find the target lipo... pre-installed
checking where to find the target nm... pre-installed
checking where to find the target objcopy... pre-installed
checking where to find the target objdump... pre-installed
checking where to find the target ranlib... pre-installed

checking where to find the target readelf... pre-installed
checking where to find the target strip... pre-installed
checking where to find the target windres... pre-installed
checking where to find the target windmc... pre-installed
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
configure: creating ./config.status
config.status: creating Makefile
config.status: creating Makefile
make -C build-binutils-linux

关于Minjie 论文的疑问

论文中的有这样的描述:
According to the RISC-V instruction set manuals, any store (PTE Write, Store Retire) before an explicit sfence.vma instruction may or may not take effect (Store Complete) in the virtual address translation process (TLB Page Walk).
我理解论文是在说sfence后的ptw 可能看到不store buffer中的请求。

在2019/2021的特权里看到:
SFENCE.VMA orders only the local hart’s implicit references to the memory-management data structures.
Executing an SFENCE.VMA instruction guarantees that any previous stores already visible to the current RISC-V hart are ordered before certain implicit references by subsequent instructions in that hart to the memory- management data structures. 这里我理解要求sfence后续的ptw 可以看到本hart的store buffer的内容或者store buffer 中的请求排空。

所以对这里的表述有些疑问。请问论文中的说法在spec的依据具体体现在哪里,谢谢。

checkpoint的生成

checkpoint的生成中,该“Checkpoint的生成.md文件”文档中采用riscv64-nemu-interpreter的--simpoint-profile来生成用于simpoint的BBV文件,
riscv64-nemu-interpreter workload.bin -D /home/user/spec_cpt -w workloadName -C run_spec -b --simpoint-profile --interval 100000000
1.该命令行中workload.bin是可执行文件吗,虽然后缀是bin,应该是类似elf的该执行文件吧
2.如果该可执行文件执行时需要后面跟输入参数,如一个文件,该怎么添加参数,如cpu2006中的某一个测试项,

这个bin文件使用OBJCOPY从可执行文件生成的吗

checkpointing运行后,文件夹为空,加了dont-skip-boot以后,checkpoint遇到crash

我的负载很简单,是hello world + 累加累减 + 一个卷积计算的简单计算。我使用的interval是10w,我的分支是tracing分支
profiling使用命令: ./build/riscv64-nemu-interpreter /root/riscv-pk/build/bbl.bin -D /home/zxk/spec_cpt -w workloadName2 -C profiling -b --simpoint-profile --cpt-interval 100000 -r ./resource
/gcpt_restore/build/gcpt.bin
生成了bbv.gz,但是文件大小只有20B

cluster使用命令:./resource/simpoint/simpoint_repo/bin/simpoint -loadFVFile /home/zxk/spec_cpt/profiling/workloadName2/simpoint_bbv.gz -saveSimpoints $CLUSTER/simpoints0 -saveSimpointWeigh
ts $CLUSTER/weights0 -inputVectorsGzipped -maxK 30 -numInitSeeds 2 -iters 1000 -seedkm 123456 -seedproj 654321
只聚了一个类

checkpointing使用命令:
./build/riscv64-nemu-interpreter $RISCV_PK_HOME/build/bbl.bin \ -D /home/zxk/spec_cpt -w workloadName2 -C take_cpt \ -b -S /home/zxk/spec_cpt/cluster--cpt-interval 100000 \ -r ./resource/gcpt_restore/build/gcpt.bin
未生成文件。

当我在profiling阶段加了--dont-skip-boot以后,bbv文件比较大,聚类聚了7个类,但是checkpointing阶段遇到了crash,信息如下:

[src/checkpoint/serializer.cpp:209,init] Simpoint 0: @ 18, weight: 0.048780
[src/checkpoint/serializer.cpp:209,init] Simpoint 1: @ 5, weight: 0.048780
[src/checkpoint/serializer.cpp:209,init] Simpoint 2: @ 3, weight: 0.048780
[src/checkpoint/serializer.cpp:209,init] Simpoint 3: @ 9, weight: 0.121951
[src/checkpoint/serializer.cpp:209,init] Simpoint 4: @ 0, weight: 0.048780
[src/checkpoint/serializer.cpp:209,init] Simpoint 5: @ 27, weight: 0.024390
[src/checkpoint/serializer.cpp:209,init] Simpoint 6: @ 17, weight: 0.024390
[src/checkpoint/serializer.cpp:209,init] Simpoint 7: @ 12, weight: 0.121951
[src/checkpoint/serializer.cpp:209,init] Simpoint 8: @ 38, weight: 0.195122
[src/checkpoint/serializer.cpp:209,init] Simpoint 9: @ 20, weight: 0.097561
[src/checkpoint/serializer.cpp:209,init] Simpoint 10: @ 26, weight: 0.024390
[src/checkpoint/serializer.cpp:209,init] Simpoint 11: @ 36, weight: 0.097561
[src/checkpoint/serializer.cpp:209,init] Simpoint 12: @ 21, weight: 0.097561
[src/memory/paddr.c:81,init_mem] mmap memory to anonymous file
[src/device/io/mmio.c:18,add_mmio_map] Add mmio map 'clint' at [0x0000000038000000, 0x000000003800ffff]
[src/isa/riscv64/init.c:70,init_isa] NEMU will start from pc 0x80000000
[src/monitor/image_loader.c:56,load_img] Loading Gcpt restorer form cmdline: /root/NEMU/resource/gcpt_restore/build/gcpt.bin

[src/monitor/image_loader.c:83,load_img] Warning: size is larger than img_size(upper limit), please check if code is missing. size:1100 img_size:f00
[src/monitor/image_loader.c:88,load_img] Fread from file because less than 512MB

[src/monitor/image_loader.c:120,load_img] Read 3840 bytes from file /root/NEMU/resource/gcpt_restore/build/gcpt.bin to 0x80000000
[src/monitor/image_loader.c:56,load_img] Loading image (bbl/bare metal app) from cmdline: ./resource/gcpt_restore/build/gcpt.bin

[src/monitor/image_loader.c:88,load_img] Fread from file because less than 512MB

[src/monitor/image_loader.c:120,load_img] Read 4352 bytes from file ./resource/gcpt_restore/build/gcpt.bin to 0x800a0000
[src/device/io/port-io.c:15,add_pio_map] Add port-io map 'uartlite' at [0x00000000000003f8, 0x0000000000000404]
[src/device/io/mmio.c:18,add_mmio_map] Add mmio map 'uartlite' at [0x0000000040600000, 0x000000004060000c]
[src/device/io/port-io.c:15,add_pio_map] Add port-io map 'rtc' at [0x0000000000000048, 0x000000000000004f]
[src/device/io/mmio.c:18,add_mmio_map] Add mmio map 'rtc' at [0x00000000a1000048, 0x00000000a100004f]
[src/device/io/port-io.c:15,add_pio_map] Add port-io map 'screen' at [0x0000000000000100, 0x0000000000000107]
[src/device/io/mmio.c:18,add_mmio_map] Add mmio map 'screen' at [0x0000000040001000, 0x0000000040001007]
[src/device/io/mmio.c:18,add_mmio_map] Add mmio map 'vmem' at [0x0000000050000000, 0x00000000500752ff]
[src/device/io/port-io.c:15,add_pio_map] Add port-io map 'keyboard' at [0x0000000000000060, 0x0000000000000063]
[src/device/io/mmio.c:18,add_mmio_map] Add mmio map 'keyboard' at [0x00000000a1000060, 0x00000000a1000063]
[src/device/io/mmio.c:18,add_mmio_map] Add mmio map 'sdhci' at [0x0000000040002000, 0x000000004000207f]
[src/device/sdcard.c:121,init_sdcard] Can not find sdcard image: 
[src/monitor/monitor.c:37,welcome] Debug: OFF
[src/monitor/monitor.c:42,welcome] Build time: 17:31:30, Jun 24 2023
Welcome to riscv64-NEMU!
For help, type "help"
(nemu) c
Invalid inst 0x0000: pc = 0x0000000080140000
  $0: 0x0000000000000000   ra: 0x0000000000000000   sp: 0x0000000000000000   gp: 0x0000000000000000 
  tp: 0x0000000000000000   t0: 0x0000000000000000   t1: 0x0000000000000000   t2: 0x000000000000beef 
  s0: 0x0000000080000f00   s1: 0x0000000000000000   a0: 0x0000000000000000   a1: 0x0000000000000000 
  a2: 0x0000000000000000   a3: 0x0000000000000000   a4: 0x0000000000000000   a5: 0x0000000000000000 
  a6: 0x0000000000000000   a7: 0x0000000000000000   s2: 0x0000000000000000   s3: 0x0000000000000000 
  s4: 0x0000000000000000   s5: 0x0000000000000000   s6: 0x0000000000000000   s7: 0x0000000000000000 
  s8: 0x0000000000000000   s9: 0x0000000000000000  s10: 0x0000000000000000  s11: 0x0000000000000000 
  t3: 0x0000000000000000   t4: 0x0000000000000000   t5: 0x0000000000000000   t6: 0x0000000000000000 
 ft0: 0x0000000000000000  ft1: 0x0000000000000000  ft2: 0x0000000000000000  ft3: 0x0000000000000000 
 ft4: 0x0000000000000000  ft5: 0x0000000000000000  ft6: 0x0000000000000000  ft7: 0x0000000000000000 
 fs0: 0x0000000000000000  fs1: 0x0000000000000000  fa0: 0x0000000000000000  fa1: 0x0000000000000000 
 fa2: 0x0000000000000000  fa3: 0x0000000000000000  fa4: 0x0000000000000000  fa5: 0x0000000000000000 
 fa6: 0x0000000000000000  fa7: 0x0000000000000000  fs2: 0x0000000000000000  fs3: 0x0000000000000000 
 fs4: 0x0000000000000000  fs5: 0x0000000000000000  fs6: 0x0000000000000000  fs7: 0x0000000000000000 
 fs8: 0x0000000000000000  fs9: 0x0000000000000000 fs10: 0x0000000000000000 fs11: 0x0000000000000000 
 ft8: 0x0000000000000000  ft9: 0x0000000000000000 ft10: 0x0000000000000000 ft11: 0x0000000000000000 
pc: 0x0000000080000000 mstatus: 0x0000000a00000000 mcause: 0x0000000000000000 mepc: 0x0000000000000000
                       sstatus: 0x0000000200000000 scause: 0x0000000000000000 sepc: 0x0000000000000000
satp: 0x0000000000000000
mip: 0x0000000000000000 mie: 0x0000000000000000 mscratch: 0x0000000000000000 sscratch: 0x0000000000000000
mideleg: 0x0000000000000000 medeleg: 0x0000000000000000
mtval: 0x0000000000000000 stval: 0x0000000000000000 mtvec: 0x0000000000000000 stvec: 0x0000000000000000
privilege mode:3  pmp: below
 0: cfg:0x00 addr:0x0000000000000000| 1: cfg:0x00 addr:0x0000000000000000
 2: cfg:0x00 addr:0x0000000000000000| 3: cfg:0x00 addr:0x0000000000000000
 4: cfg:0x00 addr:0x0000000000000000| 5: cfg:0x00 addr:0x0000000000000000
 6: cfg:0x00 addr:0x0000000000000000| 7: cfg:0x00 addr:0x0000000000000000
 8: cfg:0x00 addr:0x0000000000000000| 9: cfg:0x00 addr:0x0000000000000000
10: cfg:0x00 addr:0x0000000000000000|11: cfg:0x00 addr:0x0000000000000000
12: cfg:0x00 addr:0x0000000000000000|13: cfg:0x00 addr:0x0000000000000000
14: cfg:0x00 addr:0x0000000000000000|15: cfg:0x00 addr:0x0000000000000000
pmp csr rw: enable, pmp check: disable
[src/cpu/cpu-exec.c:76,monitor_statistic] host time spent = 0 us
[src/cpu/cpu-exec.c:78,monitor_statistic] total guest instructions = 18
[src/cpu/cpu-exec.c:80,monitor_statistic] Finish running in less than 1 us and can not calculate the simulation frequency
riscv64-nemu-interpreter: src/isa/riscv64/instr/rvc/decode.h:132: decode_C_ADDI4SPN: Assertion `0' failed.
Aborted (core dumped)

仿真环境下,香山核运行Linux镜像遇到无法引导的错误

根据文档:

https://xiangshan-doc.readthedocs.io/zh_CN/latest/tools/linux-kernel-for-xs/#4-debian

一步一步按照文档进行,制作了一个debian镜像,这个镜像是可以通过NEMU成功单独运行的,但当换成基于香山核来运行就出错了。

基本是这样处理的:

  • 对于NEMU,重新使用make riscv64-rvv-ref_defconfig编译,生成riscv64-nemu-interpreter-so以配合香山核
  • 对于XiangShan,修改difftest/config/config.h中SDCARD_IMAGE宏,指向制作的镜,重新构建make emu CONFIG=MinimalConfig
  • 对于riscv-pk,其dts/noop.dsi文件引导部分语句是:

bootargs = "root=/dev/mmcblk0p1 rootfstype=ext4 ro rootwait earlycon";

执行的时候报错找不到linux系统引导区:

....
[    0.000000] Kernel command line: root=/dev/mmcblk0p1 rootfstype=ext4 ro rootwait earlycon
....
[    0.440000] Key type dns_resolver registered
now = 51298s
[    0.450000] Waiting for root device /dev/mmcblk0p1...
[    0.470000] sdhost-nemu 40002000.mmc: no support for card's volts
[    0.470000] mmc0: error -22 whilst initialising SDIO card
[    0.500000] mmcblk0: mmc0:0001  4.00 GiB
[    0.540000] mmc0: Card stuck in wrong state! mmcblk0 card_busy_detect status: 0x0
[    0.630000] VFS: Cannot open root device "mmcblk0p1" or unknown-block(179,1): error -6
[    0.630000] Please append a correct "root=" boot option; here are the available partitions:
[    0.630000] b300         4194304 mmcblk0
[    0.630000]  driver: mmcblk
[    0.630000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1)
[    0.630000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-14486-g655055af981b #11

查了一些资料后依旧没有解决,镜像文件的分区信息如下:

label: gpt
label-id: 63C4D56A-31D3-9447-AD8E-64BBD721E3F0
device: debian.img
unit: sectors
first-lba: 2048
last-lba: 33554398
sector-size: 512

debian.img1 : start=        2048, size=    25165824, type=4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709, uuid=B97A0997-E707-744D-BCD3-11933AC4D278
debian.img2 : start=    25167872, size=     8386527, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=E2C381D4-F885-FB47-8A8B-C1FB4D2CBBF1

完整日志文件: debian13-v3.log

同一个debian镜像,使用NEMU单独运行顺利,换成基于香山核后就无法顺利运行,是什么原因呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.