Skip to content

Verify correctness of read-after-write behavior #1266

Open
pavelkryukov opened this issue Mar 18, 2020 · 0 comments
Open

Verify correctness of read-after-write behavior #1266

pavelkryukov opened this issue Mar 18, 2020 · 0 comments
Labels
1 Usually one-liner tasks, but may require some deep into infrastructure. good first issue Good task to start with MIPT-MIPS development S1 — ISA To solve the issue, you need knowledge about MIPS or RISC-V ISA testing Improves testing coverage

Comments

@pavelkryukov
Copy link
Member

Some RISC-V instructions perform writes to 2 destinations, either 2 register or register or program counter. In cases if the source of one sub-operation matches a destination of another one, the order of result output is important. The examples are jalr and instruction operating with CSRs:

riscv-software-src/riscv-tests#258
riscv-software-src/riscv-tests#263

Your objective is to convert these test cases to unit tests, similarly to tests we have already:

TEST_CASE("RISCV add")
{
CHECK( RISCVInstr<uint32>(0x00b505b3).get_disasm() == "add $a1, $a0, $a1");
RISCVInstr<uint32> instr( "add", 0);
instr.set_v_src( 0x10, 0);
instr.set_v_src( 0xf, 1);
instr.execute();
CHECK( instr.get_v_dst() == 0x1f);
}

After test implementation, you might have to fix our implementation of instructions in alu.h.
After that, you may build and run test binaries from trackers mentioned above.

@pavelkryukov pavelkryukov added testing Improves testing coverage 1 Usually one-liner tasks, but may require some deep into infrastructure. S1 — ISA To solve the issue, you need knowledge about MIPS or RISC-V ISA good first issue Good task to start with MIPT-MIPS development labels Mar 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 Usually one-liner tasks, but may require some deep into infrastructure. good first issue Good task to start with MIPT-MIPS development S1 — ISA To solve the issue, you need knowledge about MIPS or RISC-V ISA testing Improves testing coverage
Projects
None yet
Development

No branches or pull requests

1 participant