From f8d09347a43ddab462d94f716e0a6f249e2e6635 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sun, 8 Jan 2017 15:09:38 -0600 Subject: Move ALU test cases to external testcase file This makes is a little easier to create new ALU testcases and to quickly read and understand the existing testcases. Additionally, the test bench itself can now report when a test fails, rather than requiring inspection on the waveform (though the waveform is still available). --- tests/alu | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/alu (limited to 'tests/alu') diff --git a/tests/alu b/tests/alu new file mode 100644 index 0000000..7496359 --- /dev/null +++ b/tests/alu @@ -0,0 +1,19 @@ +# X op Y = RESULT ZERO CARRY +# +# Operations: +# + : add +# - : subtract +# * : multiply +# / : divide +# & : and +# | : or +# ^ : xor + +0x0123 + 0x1234 = 0x1357 Z=0 C=0 +0x0123 - 0x1234 = 0xeeef Z=0 C=1 +0x0123 - 0x0123 = 0x0000 Z=1 C=0 +0x0123 * 0x1234 = 0xb11c Z=0 C=0 +0x3e58 / 0x0078 = 0x0085 Z=0 C=0 +0xaf74 & 0x7cc7 = 0x2c44 Z=0 C=0 +0xaf74 | 0x7cc7 = 0xfff7 Z=0 C=0 +0xaf74 ^ 0x7cc7 = 0xd3b3 Z=0 C=0 -- cgit v1.2.3