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

Partially support CSRRW where source and destination register is zero #123

Open
wants to merge 2 commits into
base: feature/mininny/integrate-instruction-matching-tool
Choose a base branch
from

Conversation

mininny
Copy link
Collaborator

@mininny mininny commented Jan 13, 2025

Description

Kona's binary contains CSRRW (C0001073) instruction. This instruction can be mapped as

Field Bits Value (Binary) Value (Hex) Description
opcode 0–6 1110011 0x73 Indicates a SYSTEM instruction
rd 7–11 00000 0x0 Destination register (none specified)
funct3 12–14 001 0x1 Defines the type of SYSTEM instruction
rs1 15–19 00000 0x0 Source register 1 (none specified)
rs2 20–24 00000 0x0 Source register 2 (not used for this format)
funct7 25–31 1100000 0x60 Additional instruction-specific function

The above table shows that rd and rs1 register are set to zero, which means the actual source and destination for this read-write instruction is missing - thus, this instruction is no-op. We can implement this into asterisc vm and only pass through instruction where the rs1Value and rdValue is zero, and revert if one of those value are non-zero.

@mininny mininny force-pushed the feature/mininny/partially-support-csrrw branch from b6ff98b to f0ba4bb Compare January 13, 2025 10:38
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

Successfully merging this pull request may close these issues.

1 participant