[Sim, Tests] Improve sim. Add sim tests.#16
[Sim, Tests] Improve sim. Add sim tests.#16egorshamshura wants to merge 8 commits intoProteusLab:masterfrom
Conversation
778da7a to
b10499c
Compare
769dcfe to
5fdfd4f
Compare
| @@ -0,0 +1,167 @@ | |||
| --- | |||
There was a problem hiding this comment.
Changes to clang format should be discussed, this change is not related to this PR. Consider using either minimal default clang format (e.g. LLVM), or remove this file completely
There was a problem hiding this comment.
Started to use LLVM format
|
Pls separate formatting commits |
| name: Test | ||
| runs-on: ubuntu-22.04 | ||
| container: | ||
| image: ghcr.io/egorshamshura/protea-build:latest |
There was a problem hiding this comment.
What does the image contain? Add more info
| @@ -0,0 +1,3 @@ | |||
| if (NOT DEFINED QEMU_PATH) | |||
| set(QEMU_PATH "qemu") | |||
There was a problem hiding this comment.
Added status message
| emitter.emit_line("void do#{instruction[:name].to_s.upcase}(CPU &cpu, const Instruction &insn) {") | ||
| emitter.increase_indent | ||
|
|
||
There was a problem hiding this comment.
Please, remove redundant tabulations and spaces
…unctions. Add LLVM based clang-format.
29b2c66 to
f00a942
Compare
test/SimTests/Common/RunTests.py
Outdated
|
|
||
| has_error = False | ||
|
|
||
| for filename in os.listdir(directory): |
There was a problem hiding this comment.
Is possible to use ctest facilities to run all tests in parallel?
| @@ -0,0 +1,179 @@ | |||
| // See LICENSE for license details. | |||
There was a problem hiding this comment.
This file (LICENSE) should be put near benchmark sources
test/SimTests/Common/RunTests.py
Outdated
| program = sys.argv[1] | ||
| directory = sys.argv[2] |
There was a problem hiding this comment.
Removed this file
test/SimTests/Common/RunTests.py
Outdated
| has_error = True | ||
| continue | ||
|
|
||
| match = re.search(r"Exiting with code (\d+)", result.stdout) |
There was a problem hiding this comment.
Seems like it would be simpler to propagate exit() code as simulator exit code
There was a problem hiding this comment.
Removed this file
| next if attrs.include?(:zero) || attrs.include?(:pc) | ||
| size = reg[:size] || 32 | ||
| max = (1 << size) - 1 | ||
| values[reg[:name]] = rand(0..max) |
There was a problem hiding this comment.
How this works random works? Does it have seed value? If no, tests are unpredictable, if yes, consider passing it via cmdline
| if ARGV.size < 3 || ARGV.size > 4 | ||
| puts "Usage: #{$0} <ir_yaml_file> <snippets_directory> <output_directory> [num_tests]" | ||
| exit 1 | ||
| end |
There was a problem hiding this comment.
Pls use built in Ruby CLI facilities
There was a problem hiding this comment.
Added OptionParser
| num_tests.times do |i| | ||
| output_file = File.join(output_directory, "#{base}_#{i}.init.") | ||
| generator.generate(formatter, snippet_content, output_file) |
There was a problem hiding this comment.
Could it be run in parallel?
There was a problem hiding this comment.
Yes, now it is possible to specify number of threads via cmdline option
9986ac2 to
d6f4b6b
Compare
…s in CMakePresets.
e15114d to
8eed710
Compare
No description provided.