Manual multiplication tests

This commit is contained in:
xenia 2024-01-21 22:40:47 +01:00
parent ba09e75c57
commit 9c2d15e171

View File

@ -281,6 +281,50 @@ int main(int argc, char **argv) {
});
}
{
Tester mul_t(&alu_t, "mul", true);
test_op(&mul_t, {
.state = &state,
.name = "0x55*0x1",
.A = 0x55, .B = 0x1, .op = 0b010,
.O = 0x55,
.max_cycles = 33,
});
test_op(&mul_t, {
.state = &state,
.name = "0x1*0x55",
.A = 0x1, .B = 0x55, .op = 0b010,
.O = 0x55,
.max_cycles = 33,
});
test_op(&mul_t, {
.state = &state,
.name = "0x5*0x5",
.A = 0x5, .B = 0x5, .op = 0b010,
.O = 0x19,
.max_cycles = 33,
});
test_op(&mul_t, {
.state = &state,
.name = "0x21*0x37",
.A = 0x21, .B = 0x37, .op = 0b010,
.O = 0x717,
.max_cycles = 33,
});
test_op(&mul_t, {
.state = &state,
.name = "0x12345678*0x87654321",
.A = 0x12345678, .B = 0x87654321, .op = 0b010,
.O = 0x9a0cd0570b88d78,
.max_cycles = 33,
});
}
if (DO_AUTO) {
Tester auto_t(&alu_t, "auto", true);
@ -374,6 +418,8 @@ int main(int argc, char **argv) {
}
}
}
#ifdef TRACE
state.trace->close();
#endif