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

Implement Zicond #628

Closed
tilk opened this issue Mar 25, 2024 · 2 comments · Fixed by #747
Closed

Implement Zicond #628

tilk opened this issue Mar 25, 2024 · 2 comments · Fixed by #747
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tilk
Copy link
Member

tilk commented Mar 25, 2024

The Zicond extension extends the architecture with conditional instructions, which allow to create code with less branches. It's probably the best to implement this in ALU.

@tilk tilk added enhancement New feature or request good first issue Good for newcomers labels Mar 25, 2024
@Hazardu
Copy link
Contributor

Hazardu commented Nov 2, 2024

When trying to implement Zicond, I came across enums of different shapes named Funct3 and Funct7 in isa_consts.py but I can't find any descriptions what they are supposted to describe exactly and what their values mean.

I see that they are used when defining the encodings of operation types in instr_description.py

Encoding(Opcode.OP, Funct3.ADD, Funct7.ADD),

as well as used differently in alu.py to describe instructions

(self.Fn.ADD, OpType.ARITHMETIC, Funct3.ADD, Funct7.ADD),

but I dont understand what their values represent (like previousely mentioned Funct3.ADD and Funct7.ADD equal 0)
Could you please explain?

@piotro888
Copy link
Member

image
@Hazardu Opcode/Funct* are fields from raw RISC-V instruction encoding.

Optype is our internal representation of instruction groups (as replacement of Opcode), used also as an only factor for routing instructions to Functional Units. Optype is resolved in Decode stage.

Functional units have their own small internal decoders that convert Optype (from instruction_description.py) and Funct3, Funct7 (from raw instruction; Funct7 is not always present or needed [if Optype+Funct3 are unique]) to specific unique FU operation (to self.Fn)

Zicond should have separate Optype as it is separate extension.

@piotro888 piotro888 linked a pull request Nov 19, 2024 that will close this issue
@tilk tilk closed this as completed in #747 Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants