Closed abdullahyildiz closed 4 years ago
Hi @abdullah most of the GCC for RV64 we have seen always have been GC i.e. they do compressed so even if your .S is not compressed the compiler makes it into one - and if you look at your .csv you see the binary column shows only 4 hex chars - ie compressed - first line the binary column is 8501 - which is compressed - if you look at the objdump it should show this - and so riscvOVPsim is only listing what is in the log file... regards, Simon
You should remove hint instruction test if you want to disable compressed instructions. HINT instructions use compressed instruction encoding.
@simond-imperas @taoliug OK. Thanks for your explanation.
@taoliug,
Could you please take a look at the following link:
https://github.com/riscv/riscv-gnu-toolchain/issues/552#issuecomment-560312242
Thanks.
Yes, that's exactly how HINT/illegal instruction is injected, as compiler will throw errors if you pass HINT instruction assembly directly. Like I mentioned above, if your processor doesn't support compressed instruction, please remove the hint instruction test from the testlist.
@taoliug, Is this due to how you define HINT instruction tests in riscv-dv project? Because I couldn't see any description on how HINT instructions should be encoded in RISC-V instruction set manual.
Please refer to user mode spec 16.7 HINT instruction
Yes, I understand your point. -Put it another way- Should all HINT instructions be encoded as compressed instructions?
Each HINT has clean encoding definition in the spec. All HINT instruction use RVC encoding.
A portion of the RVC encoding space is reserved for microarchitectural HINTs
Shouldn't this definition be valid only for C extension? Then how a RV64G processor could run HINT instructions?
RV32I reserves a large encoding space for HINT instructions, which are usually used to commu-nicate performance hints to the microarchitecture. HINTs are encoded as integer computationalinstructions withrd=x0.
I just checked the spec. Actually there are also HINT instructions in RV32I encoding. These instruction are tested when rd is randomized to 0. The hint instruction test in the regression is for HINT instruction using RVC encoding.
Yes, that was my question.
Do you have a plan to support RV32I HINT instructions in the future?
They are supported already, rd could be randomized to x0 for computation instructions. It's pretty much tested in every test.
They are supported already, rd could be randomized to x0 for computation instructions. It's pretty much tested in every test.
OK. Thanks.
I work on commit id bce290e.
I want to implement HINT instruction tests for RV64G.
I used the custom_target option while running the run.py script. Before that, I made the following changes in the repository:
Then I ran this command:
python3 run.py --custom_target=target/rv64g --isa=rv64g --mabi=lp64 --test=riscv_hint_instr_test --iss=ovpsim,spike -v
This command fails while comparing outputs of spike and riscv-ovpsim (see run.log and another issue https://github.com/google/riscv-dv/issues/283#issue-517770838 in this repository). In addition to this, although there are no compressed instructions in generated assembly programs, csv files that are generated from riscv-ovpsim log files include compressed instructions:
run.log riscv_core_setting.txt