-
Notifications
You must be signed in to change notification settings - Fork 141
Convert torture tests to unit tests #530
Comments
Fixes #589 Additionally: New utility method in class BaseMIPSInstr: MapType::iterator find_entry(MapType isaMap, std::string_view name); New unit tests: TEST_CASE( "sllv") (#530) TEST_CASE( "MIPS32_instr: Divmult") ( using new ctor) Fix types of supporting function. Add get_v_imm and set_v_imm for unit tests. Add sllv, mul, addi, teqi tests. Fix nop bug for ctor, add nop test for new ctor.
Just to clarify: torture tests are located here: https://github.com/MIPT-ILab/mips-traces/blob/master/tt.core.universal.s |
@pooh64 What's the progress with that? |
@pavelkryukov Now I'm learning mips assembler, I haven't written new tests yet. |
Fixes in jmp cases. Fixed movn/movz case. Test for 64bit instr in 32bit ctor. References for bug-issue (MIPT-ILab#709).
Implemented, but not tested instructions:
|
@pavelkryukov Can I write to the HI and LO registers that are used as destination registers in instruction madd (for example)? As I can see I can change only one destination register by using instr.set_v_dst() function. |
Also I see that every |
There is some discrepancy between the behavior in 32 bit and 64 bit mode. |
I'm not sure if this is significant difference but in |
Ok, I agree that difference may be ignored in unit tests. The issue was that MIPS code has to use different immediates. |
Leaving 2 points as 2 points were committed to the score table. |
@pavelkryukov |
We do not have a data cache model so far, therefore it should behave like a simple load of the similar size. |
mipt-mips/simulator/mips/mips_instr.cpp Lines 76 to 77 in 8a2335b
Do I need to fix this or this is ok? |
If you are able to write manual on these instructions (#413), then you can implement them. But at the moment, we should just skip them, since they are not implemented. |
How can I read memory created by this function? mipt-mips/simulator/mips/t/unit_test.cpp Lines 1065 to 1070 in 8bcc2a3
|
auto m = get_plain_memory_with_data();
auto value = m->read<uint32, Endian::little>( address); |
Can I write templates in |
Yes, but could you please share your intention? I don't feel there is a good idea... |
@pavelkryukov Why do I get |
Looks like a bug — |
Does likely branches do the same thing in simulator as basic branches? |
Likely branches are not supported at the moment, so you may write tests but probably they won't pass. The general idea is that likely branches do not execute delay slot instruction. |
Blocked by #589
To test functionality of instruction, we use SPIM torture tests (TT). That is not very convinient, as we have to build Binutils and traces in addition to unit tests. The idea is to convert the TT test cases into unit test cases.
Example:
becomes
There are about 120 instructions supported by MIPT-MIPS so far.
Let's assume that adding tests for 17 instructions is a 1 point, so adding tests to 119 instructions is 7 points. You are not obliged to get all the 7 points at once, you may make 1 point and stop, then continue later or pass the task to another project participant.
The text was updated successfully, but these errors were encountered: