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

Instruction encoding in the comments field for metal_cache functions are incorrect #209

Open
TacoGrandeTX opened this issue Dec 17, 2019 · 1 comment

Comments

@TacoGrandeTX
Copy link

It appears that the instruction encoding in the function header blocks in cache.c are incorrect. For instance:

 * @brief CFlush.D.L1 instruction is a custom instruction implemented as a
 * state machine in L1 Data Cache (D$) with funct3=0, (for core with data caches)
 * It is an I type: .insn i opcode, func3, rd, rs1, simm12(signed immediate 12bs)
 * 31     28 27    24 23    20 19     16 15   12 11     8 7      4 3      0
 * |--------|--------|--------|--------|--------|--------|--------|--------|
 * +-------------+------------+----------+------+--------+-----------------+
 * |sign immediate12b (simm12)|   rs1    | func3|    rd  |      opcode     |
 * |-1-1-1-1 -1-1-0-0 -0-0-0-0|-x-x-x-x-x|0-0-0-|-0-0-0-0|-0-1-1-1 -0-0-1-1|
 * +--------------------------+----------+------+--------+-----------------+
 * 31     -0x40              20          15  0  12   x0  7      0x73       0

Is not matching the RISC-V Spec which shows opcode as 7 bits and rd as 5 bits:

image

This impacts metal_dcache_l1_flush(), metal_dcache_l1_discard() and metal_icache_l1_flush().

@bsousi5
Copy link
Collaborator

bsousi5 commented Dec 18, 2019 via email

bsousi5 added a commit that referenced this issue Apr 8, 2020
Make rtl target to use ram from dtim, flash from testram
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