Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- check_response(ins: instruction_s) is only {
- // Check for overflow
- if (ins.din2 > ins.din1) {
- // Underflow occurs
- check that ins.resp == 2 else
- dut_error(appendf("[R==>Port %s invalid response.<==R]\n \
- Instruction %s %u %u,\n \
- expected resp: %d \n \
- recieved resp: %d \n ",
- ins.port, ins.cmd_in, ins.din1, ins.din2, 2, ins.resp));
- } else {
- // Check correct subtraction occurs
- check that ins.resp == 01;
- check that (ins.dout == (ins.din1 - ins.din2)) else
- dut_error(appendf("[R==>Port %s invalid output.<==R]\n \
- Instruction %s %u %u,\n \
- expected %032.32b \t %u,\n \
- received %032.32b \t %u.\n",
- ins.port, ins.cmd_in, ins.din1, ins.din2,
- (ins.din1 - ins.din2),
- (ins.din1 - ins.din2),
- ins.dout,ins.dout));
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement