Skip to content

Vector arith idl #605

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

Draft
wants to merge 10 commits into
base: vector
Choose a base branch
from

Conversation

latifbhatti
Copy link
Contributor

@latifbhatti latifbhatti commented Apr 10, 2025

Objective: This pull request resolves all syntax errors detected using the ./do test:smoke command.

Instruction Implementation: Implemented RISC-V vector Arithmatic instructions

Next Action: Proceeding to validate the correctness of the implementation through simulation using the command ./do build:cpp_hart.

Current Issue: Encountering an error during the execution of ./do build:cpp_hart, indicating that the C++ ISS (Instruction Set Simulator) is not properly work.

Environment Status: Spike, QEMU, and the RISC-V GCC toolchain are already installed and available in the local environment.
Simulation Goal: The goal is to simulate the program and identify any remaining logical errors to ensure correctness.
Assistance Request: Requesting help with (i) setting up the C++ ISS, and (ii) guidance on how to define RISC-V vector registers in UDB using IDL (ISA Definition Language).

latifbhatti and others added 10 commits March 6, 2025 10:21
…the spec. This is required for several use cases like Go risc-v support which relies only on 64-bit spec, thus being able to filter rv32 CSRs is mandatory. (riscv-software-src#532)

Signed-off-by: Afonso Oliveira <[email protected]>
Co-authored-by: Derek Hower <[email protected]>
Co-authored-by: Your Name <[email protected]>
Co-authored-by: Derek Hower <[email protected]>
* Separate Zcf and Zcd extensions from Zce

Signed-off-by: Albert Yosher <[email protected]>

* Restore per-instruction dependencies of Zcf/Zcd

Signed-off-by: Albert Yosher <[email protected]>

---------

Signed-off-by: Albert Yosher <[email protected]>
…rc#551)

* Xqci/Xqcibm extension: fix some representation issues, fix qc.extdur rs1 != 31

Signed-off-by: Albert Yosher <[email protected]>

* Xqci: fix asciidoc formatting in description

* gen:adoc fix asciidoc generation of IDL csr read

* gen:ext_pdf fix implication list; improve version display

* Add missing word 'CSRs' in CSR summary generation

Signed-off-by: Albert Yosher <[email protected]>

---------

Signed-off-by: Albert Yosher <[email protected]>
Co-authored-by: Albert Yosher <[email protected]>
* Add initial Golang generation support.

Signed-off-by: Afonso Oliveira <[email protected]>

* Enhance go generator to allow filtering by extensions

* Enhance Go CSR generation by filtering out unused extensions and define set of extensions that GO currently supports.

Signed-off-by: Afonso Oliveira <[email protected]>

* update checked out version of inst.go changed by latest commits.

Signed-off-by: Afonso Oliveira <[email protected]>

* Refactor to ensure reusable code, given the extensibility of outputs generator.py may be used to generate.

Signed-off-by: Afonso Oliveira <[email protected]>

* Fix Go awkward struct spacing.

Signed-off-by: Afonso Oliveira <[email protected]>

* Add rake task to generate Golang input - inst.go

Signed-off-by: Afonso Oliveira <[email protected]>

* Add CSR ordering to match riscv-opcodes.

Signed-off-by: Afonso Oliveira <[email protected]>

* Remove checked out inst.go

Signed-off-by: Afonso Oliveira <[email protected]>

* Update all spacing to exactly match riscv-opcodes.

Signed-off-by: Afonso Oliveira <[email protected]>

* Change check_requirement due to being out of scope for go_generator call.

Signed-off-by: Afonso Oliveira <[email protected]>

* Add gen:go to CI regression.

Signed-off-by: Afonso Oliveira <[email protected]>

* Add gen:go to local regression test.

Signed-off-by: Afonso Oliveira <[email protected]>

---------

Signed-off-by: Afonso Oliveira <[email protected]>
Co-authored-by: Your Name <[email protected]>
@dhower-qc
Copy link
Collaborator

have you run do test:idl? It looks like you have some syntax issues that should point out.

@latifbhatti
Copy link
Contributor Author

Yes, I ran the do test:idl command. I also fixed all the syntax errors identified by the ./do test:smoke command. Now, when I run the do test:idl command, there are no syntax errors.

@latifbhatti
Copy link
Contributor Author

I attempted to run the following commands to generate the cpp_hart files with different configuration options:

./do gen:cpp_hart CONFIG=rv32  
./do gen:cpp_hart CONFIG=all  
./do gen:cpp_hart CONFIG=rv64  
./do gen:cpp_hart CONFIG=example_rv64_with_overlay  
./do gen:cpp_hart CONFIG=MC100-32  

Before re-running some of these commands, I also executed the ./do clean command to ensure a clean state. However, I still encountered errors for all the configuration options.

I have attached a screenshot showing the error message I received while running the ./do gen:cpp_hart CONFIG=rv32 command. The errors for the other configurations were similar.
configError

Could you please guide me on what might be going wrong or how to proceed?

Thank you for your support.

@jmawet jmawet changed the base branch from main to vector April 21, 2025 22:21
@jmawet
Copy link
Collaborator

jmawet commented Apr 21, 2025

Moved base branch to vector branch. As discussed, we will do all development for vector extension in the vector branch before we merge to main.

Additionally, I wanted to ask on v.idl. Here you created v.idl, while in mine (#467) I called it vec.idl. It really doesn't matter, but we should probably stay consistent. @dhower-qc your call, what do we want to call the file?

@ThinkOpenly
Copy link
Collaborator

I have attached a screenshot showing the error message I received while running the ./do gen:cpp_hart CONFIG=rv32 command.

Does the failure occur without your changes? Does the failure occur for you on the main branch? The cpp_hart and Ruby processing is not familiar to me. In the absence of more knowledgeable guidance, it might help to bisect the branch. Are you familiar with git bisect?

@latifbhatti
Copy link
Contributor Author

I tried running it without my changes, and the failure still occurs.
I also checked the latest main branch, and the same issue is present there.

I used git bisect as you suggested, but I could not find any fully good commit — the error is present throughout.
However, after checking the commit aa87f8e3 (C++ model generator #403), I noticed that the type of error changed compared to the earlier one, but a failure is still there.

@ThinkOpenly
Copy link
Collaborator

I tried running it without my changes, and the failure still occurs.

I see the same error with current "main". @dhower-qc ?

@ThinkOpenly
Copy link
Collaborator

I see the same error with current "main". @dhower-qc ?

This is reported separately as #678

@dhower-qc
Copy link
Collaborator

Fixed in main.

@latifbhatti
Copy link
Contributor Author

Hi @dhower-qc , @ThinkOpenly,
I have encountered an issue while running the following command in the project environment:

./do build:cpp_hart CONFIG=32

Although you previously addressed and resolved an error related to this command, I regret to inform you that I am still unable to execute it successfully, as a new error has arisen.

I would appreciate the opportunity to schedule a brief meeting with you to discuss this persistent issue and to seek guidance on properly setting up the C++ Instruction Set Simulator (ISS).

@ThinkOpenly
Copy link
Collaborator

./do build:cpp_hart CONFIG=32

Do you mean "CONFIG=rv32"?

Although you previously addressed and resolved an error related to this command, I regret to inform you that I am still unable to execute it successfully, as a new error has arisen.

I was able to successfully run this just now on the branch "main" (HEAD commit cf88b2b):

./do gen:cpp_hart CONFIG=rv32

The ISS is not really my area of expertise. Can you provide more details about the error you see?

@latifbhatti
Copy link
Contributor Author

Thank you for your response!

I think both commands are different:

./do build:cpp_hart CONFIG=rv32 — I think this command is used to set up and build the C++ hart on the machine.

./do gen:cpp_hart CONFIG=rv32 — I think this command is used to generate the files for the C++ hart according to the given configuration.

This generation command (gen:cpp_hart) runs successfully on my laptop, so I think the setup is working fine on my side. But I get an error when using build:cpp_hart CONFIG=rv32.

error in main branch

show gen and build command with cpp iss

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.

7 participants