aboutsummaryrefslogtreecommitdiff
path: root/works/life/computer-organization-experiment/test_bench.vhdl
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-11-26 21:24:20 +0800
committercrupest <crupest@outlook.com>2021-11-26 21:24:20 +0800
commite3fb643403ae71a38cba404e8d548d7a49cfdb88 (patch)
treedb17171e551f53b697b78320f18acfbaab8140f6 /works/life/computer-organization-experiment/test_bench.vhdl
parent1ea48b1fcb7ac64935018b1ced2d0f11982872ea (diff)
downloadcrupest-e3fb643403ae71a38cba404e8d548d7a49cfdb88.tar.gz
crupest-e3fb643403ae71a38cba404e8d548d7a49cfdb88.tar.bz2
crupest-e3fb643403ae71a38cba404e8d548d7a49cfdb88.zip
import(life): Add computer organization 5.
Diffstat (limited to 'works/life/computer-organization-experiment/test_bench.vhdl')
-rw-r--r--works/life/computer-organization-experiment/test_bench.vhdl40
1 files changed, 40 insertions, 0 deletions
diff --git a/works/life/computer-organization-experiment/test_bench.vhdl b/works/life/computer-organization-experiment/test_bench.vhdl
index 64daf7f..6e5e9e8 100644
--- a/works/life/computer-organization-experiment/test_bench.vhdl
+++ b/works/life/computer-organization-experiment/test_bench.vhdl
@@ -84,3 +84,43 @@ begin
end loop;
end process stimulus;
end architecture test_adder_32;
+
+architecture test_shift_32 of test_bench is
+ signal D: std_logic_vector(31 downto 0) := B"00000000000000000000000000000011";
+ signal SA: std_logic_vector(4 downto 0) := B"00000";
+ signal Right: std_logic;
+ signal Arith: std_logic;
+ signal SH: std_logic_vector(31 downto 0);
+begin
+ shift: entity work.shift_32(behavioral)
+ port map (D, SA, Right, Arith, SH);
+ stimulus: process is
+ begin
+ loop
+ D <= B"00000000000000000000000000000011" and D;
+ Right <= '0';
+ Arith <= '0';
+ wait for 5 ns;
+ Arith <= '1';
+ wait for 5 ns;
+ Right <= '1';
+ Arith <= '0';
+ wait for 5 ns;
+ Arith <= '1';
+ wait for 5 ns;
+ D <= B"10000000000000000000000000000000" or D;
+ Right <= '0';
+ Arith <= '0';
+ wait for 5 ns;
+ Arith <= '1';
+ wait for 5 ns;
+ Right <= '1';
+ Arith <= '0';
+ wait for 5 ns;
+ Arith <= '1';
+ wait for 5 ns;
+
+ SA <= SA + 1;
+ end loop;
+ end process stimulus;
+end architecture test_shift_32;