lasthunter657

Tb_lab3

Apr 11th, 2022 (edited)
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.66 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3. USE ieee.numeric_std.ALL;
  4. USE ieee.std_logic_unsigned.ALL;
  5. USE ieee.std_logic_arith.ALL;
  6. USE work.ITCE364Project_lab3.ALL;
  7.  
  8. ENTITY tb_lab3 IS
  9. END ENTITY;
  10.  
  11. ARCHITECTURE rtl OF tb_lab3 IS
  12.  
  13.   COMPONENT lab3
  14.     PORT (
  15.       conin : IN std_logic;
  16.       inbus : IN std_logic_vector(length - 1 DOWNTO 0) := (OTHERS => '0');
  17.       ir : IN integer RANGE 0 TO length := 0;
  18.       condition : OUT std_logic);
  19.   END COMPONENT;
  20.  
  21.   ---------------- Signal -------------------
  22.  
  23.   SIGNAL conin, condition : std_logic := '0';
  24.   SIGNAL ir : integer RANGE 0 TO opcode := 0;
  25.   SIGNAL inbus : std_logic_vector(length - 1 DOWNTO 0) := (OTHERS => '0');
  26.   SIGNAL stop_the_clock : boolean;
  27.   SIGNAL Decoder_out : std_logic_vector(length - 1 DOWNTO 0) := ((OTHERS => '0'));
  28.   SIGNAL g : std_logic_vector(g_length - 1 DOWNTO 0) := ((OTHERS => '0'));
  29.   SIGNAL brn : std_logic := '0';
  30.  
  31.   --   SIGNAL A_ad, B_ad, WB_ad : integer RANGE 0 TO address := 0;
  32. BEGIN
  33.  
  34.   g(0) <= Decoder_out(1);
  35.  
  36.   ---------------- maping to test bench  -------------------
  37.  
  38.   uut : lab3 PORT MAP(conin, inbus, ir, condition);
  39.   clocking : PROCESS
  40.   BEGIN
  41.     WHILE NOT stop_the_clock LOOP
  42.       conin <= '0', '1' AFTER clk_period_half;
  43.       WAIT FOR clk_period;
  44.     END LOOP;
  45.     WAIT;
  46.   END PROCESS;
  47.  
  48.   Checkking_vairables : PROCESS
  49.   BEGIN
  50.     Change : FOR i IN 0 TO opcode LOOP
  51.       IR <= i;
  52.       WAIT FOR clk_period;
  53.       FOR j IN 0 TO length - 1 LOOP
  54.         inbus <= inbusrom(j);
  55.         WAIT FOR clk_period;
  56.       END LOOP;
  57.       WAIT FOR clk_period;
  58.     END LOOP;
  59.     stop_the_clock <= true;
  60.     WAIT;
  61.   END PROCESS;
  62. END ARCHITECTURE;
Add Comment
Please, Sign In to add comment