From c1e2d4f4e135ebbbef3e05c90f4e0d002e042888 Mon Sep 17 00:00:00 2001 From: Max Braungardt Date: Thu, 26 Apr 2018 20:10:36 +0200 Subject: [PATCH] Add more overflow ADD and SUB tests --- firmware/alu/tests/toy_16.vhd | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/firmware/alu/tests/toy_16.vhd b/firmware/alu/tests/toy_16.vhd index 84f0ccf..8f6cbbf 100644 --- a/firmware/alu/tests/toy_16.vhd +++ b/firmware/alu/tests/toy_16.vhd @@ -126,6 +126,13 @@ begin wait for period; assert result = "0111110110011101" report "ADD failed"; + info("ADD-O"); + accu <= "1111111111111111"; + ram <= "0000000000000001"; carry_in <= '0'; + func <= "0011"; + wait for period; + assert result = "0000000000000000" report "ADD-O failed"; + info("SUB"); accu <= "0100010000110011"; ram <= "0011100000101010"; carry_in <= '0'; @@ -133,6 +140,13 @@ begin wait for period; assert result = "0000110000001001" report "SUB failed"; + info("SUB-O"); + accu <= "0000000000000000"; + ram <= "0000000000000001"; carry_in <= '0'; + func <= "0100"; + wait for period; + assert result = "1111111111111111" report "SUB-O failed"; + info("SUB-B"); accu <= "0100010010110011"; ram <= "0011100011101010"; carry_in <= '0';