Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

立即数位显示不正确 #13

Open
x402 opened this issue Jul 25, 2022 · 2 comments
Open

立即数位显示不正确 #13

x402 opened this issue Jul 25, 2022 · 2 comments

Comments

@x402
Copy link
Contributor

x402 commented Jul 25, 2022

目前已知B型、U型的位显示不正确:
b-type(x)

手册中是这样的:
b-type
B型指令给出的立即数有效位为[12:1],最低位补0,高位符号扩展。实际上RV中每种立即数类型都是指令只给出某一段(有效位),低位补0,高位符号扩展。

@zhangyx1998
Copy link
Member

zhangyx1998 commented Jul 26, 2022

由于目前还需要照顾到decoder和parser的生成,需要对 lib/decoder.jslib/parser.js 做出相应的改变后才能将你提出的PR涉及的改动部署到Web。

目前主要不兼容的部分是低位自动补零的操作,你可以在项目根目录运行 node test 查看对于一段示例代码的测试结果。如果你有兴趣修改这两个模块的话,也欢迎提出对上述两个模块的PR。

例如 BEQ 的指令类型解码虽然正确(所以显示 pass ),但是立即数实际上没有正确解析:

02060c63 beq      BEQ      pass
rs2 = 0, rs1 = 0, imm = 0 a2,zero,0x160

@zhangyx1998 zhangyx1998 reopened this Jul 26, 2022
@x402
Copy link
Contributor Author

x402 commented Jul 26, 2022

明白了,过后我会再完善一下标准文档,然后学一下js再协助完善上述模块XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants