Open LiuTaowen-Tony opened 2 years ago
Hi,
I am new to this sail-riscv project. I encountered some problems with compiling and running the elf tests.
Initially I used
opam install sail
to download sail. However, when runningsh test/run_tests.sh
, I failed all the tests except from theBuilding {32 | 64} bit RISCV {OCaml | C} emulator
.
That is supported. You should look at why the tests are failing, not just randomly try things with no real reason. Look at the .out and .cout files to see what the errors are, or run one of the tests by hand. Just saying it didn't work isn't really something we can help with.
I thought probably I used an incompatible version of sail, so I tried to build sail manually. However, this time, I tried to run "sail tests" (the test for sail, not for riscv model), but I got several tests failed (e.g.
type_pow_zero
,castreq
,exint
,rewrites
). I don't know how to fix them, so I proceeded this version of sail.
Not a concern for sail-riscv; if you are following the correct build instructions and see failing tests then that's something to take up with the Sail compiler itself, not here.
When running
make
atsail-riscv
directory, I got an error thatgenerated_definitions/Isabelle/RV64/Riscv.thy
extra character at the end of g command. Despite I failed to generate definition for Isabelle, I still got Ocaml and C emulators. But when I runsh test/run_tests.sh
I got the same result (no test passed).
"g command"? If you get errors, please give the actual error, not some vague description thereof.
The sail interactive worked fine. And the result of
opam list
is attached below.I am not quite sure if this is a sail version problem. Any advices would be very helpful for me.
0.14 is supported, and the latest released version.
Thank you so much for helping me!
I didn't know that there are .out
and .cout
files. And because I cloned an unchanged version of sail, and I still got the problem, so that I thought it was a sail compiler version problem.
With the help of error messages shown in .out
and .cout
files, I found the problems are caused by different paths in different systems.
Thank you again!
As for
I got an error that generated_definitions/Isabelle/RV64/Riscv.thy extra character at the end of g command.
The exact error message is attached below.
sed -i 's/datatype ast/datatype (plugins only: size) ast/' generated_definitions/isabelle/RV64/Riscv_types.thy
sed: 1: "generated_definitions/i ...": extra characters at the end of g command
make: *** [generated_definitions/isabelle/RV64/Riscv.thy] Error 1
make: *** Deleting file `generated_definitions/isabelle/RV64/Riscv.thy'
I am not familiar with Isabelle, so that I don't know what is the exact problem. It seems that I have a syntax error on the first line of generated_definitions/isabelle/RV64/Riscv_types.thy
. I think showing the first few lines of this file might be helpful, so I attached them at the end.
I am sorry for the vague descriptions, and thank you for your help.
chapter \<open>Generated by Lem from \<open>generated_definitions/lem/RV64/riscv_types.lem\<close>.\<close>
theory "Riscv_types"
imports
Main
"LEM.Lem_pervasives_extra"
"Sail.Sail2_instr_kinds"
"Sail.Sail2_values"
"Sail.Sail2_operators_mwords"
"Sail.Sail2_prompt_monad"
"Sail.Sail2_prompt"
"Sail.Sail2_string"
begin
\<comment> \<open>\<open>Generated by Sail from riscv.\<close>\<close>
\<comment> \<open>\<open>open import Pervasives_extra\<close>\<close>
\<comment> \<open>\<open>open import Sail2_instr_kinds\<close>\<close>
\<comment> \<open>\<open>open import Sail2_values\<close>\<close>
\<comment> \<open>\<open>open import Sail2_string\<close>\<close>
\<comment> \<open>\<open>open import Sail2_operators_mwords\<close>\<close>
\<comment> \<open>\<open>open import Sail2_prompt_monad\<close>\<close>
\<comment> \<open>\<open>open import Sail2_prompt\<close>\<close>
The file contents or the fact it's Isabelle is irrelevant. All it's saying is that there's a problem with the sed command being run by the Makefile. I assume you're running on macOS; those sed commands are written for GNU sed, not BSD sed, and the two differ in terms of the syntax for the -i
flag. If you edit the Makefile and change sed -i
to sed -i ''
it should work.
Thank you for your help. It is indeed a sed version problem. However, I got something like this, could you please help me to look at it?
[WARNING] var was deprecated in version 2.1 of the opam CLI. Use opam var instead or set OPAMCLI environment variable to 2.0.
File "handwritten_support/riscv_extras.lem", line 11, character 26 to line 11, character 52
Type error: type mismatch: application expression
unit -> Sail2_instr_kinds.barrier_kind
and
Sail2_instr_kinds.barrier_kind
Hi,
I am new to this sail-riscv project. I encountered some problems with compiling and running the elf tests.
Initially I used
opam install sail
to download sail. However, when runningsh test/run_tests.sh
, I failed all the tests except from theBuilding {32 | 64} bit RISCV {OCaml | C} emulator
.I thought probably I used an incompatible version of sail, so I tried to build sail manually. However, this time, I tried to run "sail tests" (the test for sail, not for riscv model), but I got several tests failed (e.g.
type_pow_zero
,castreq
,exint
,rewrites
). I don't know how to fix them, so I proceeded this version of sail.When running
make
atsail-riscv
directory, I got an error thatgenerated_definitions/Isabelle/RV64/Riscv.thy
extra character at the end of g command. Despite I failed to generate definition for Isabelle, I still got Ocaml and C emulators. But when I runsh test/run_tests.sh
I got the same result (no test passed).The sail interactive worked fine. And the result of
opam list
is attached below.I am not quite sure if this is a sail version problem. Any advices would be very helpful for me.
Sincerely, Tony