From fdedf7b6570a8f99c2b6098f42857da3ece4de80 Mon Sep 17 00:00:00 2001 From: Max Braungardt Date: Thu, 26 Apr 2018 20:08:16 +0200 Subject: [PATCH] Add tests for INC and DEC --- firmware/alu/tests/toy_16.vhd | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/firmware/alu/tests/toy_16.vhd b/firmware/alu/tests/toy_16.vhd index 3590073..ee0fc1d 100644 --- a/firmware/alu/tests/toy_16.vhd +++ b/firmware/alu/tests/toy_16.vhd @@ -133,6 +133,30 @@ begin wait for period; assert result = "0000101111001001" report "SUB failed"; + info("INC"); + accu <= "0000000000000000"; + func <= "1001"; + wait for period; + assert result = "0000000000000001" report "INC failed"; + + info("INC-O"); + accu <= "1111111111111111"; + func <= "1001"; + wait for period; + assert result = "0000000000000000" report "INC-O failed"; + + info("DEC"); + accu <= "0000000000000001"; + func <= "1010"; + wait for period; + assert result = "0000000000000000" report "DEC failed"; + + info("DEC-O"); + accu <= "0000000000000000"; + func <= "1010"; + wait for period; + assert result = "1111111111111111" report "DEC-O failed"; + -- terminate test wait;