OpenCores
URL https://opencores.org/ocsvn/uart_block/uart_block/trunk

Subversion Repositories uart_block

[/] [uart_block/] [trunk/] [hdl/] [iseProject/] [testUart_communication_block.vhd] - Blame information for rev 11

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 leonardoar
--! Test baud_generator module
2
LIBRARY ieee;
3
USE ieee.std_logic_1164.ALL;
4
 
5
--! Use Global Definitions package
6
use work.pkgDefinitions.all;
7
 
8
ENTITY testUart_communication_block IS
9
END testUart_communication_block;
10
 
11
ARCHITECTURE behavior OF testUart_communication_block IS
12
 
13
    -- Component Declaration for the Unit Under Test (UUT)
14
 
15
    COMPONENT uart_communication_blocks
16
    Port ( rst : in  STD_LOGIC;
17
           clk : in  STD_LOGIC;
18
                          cycle_wait_baud : in std_logic_vector((nBitsLarge-1) downto 0);
19
           byte_tx : in  STD_LOGIC_VECTOR ((nBits-1) downto 0);
20
           byte_rx : out  STD_LOGIC_VECTOR ((nBits-1) downto 0);
21
           data_sent_tx : out  STD_LOGIC;
22
           data_received_rx : out  STD_LOGIC;
23
                          serial_out : out std_logic;
24
                          serial_in : in std_logic;
25
           start_tx : in  STD_LOGIC);
26
    END COMPONENT;
27
 
28
 
29
   --Inputs
30
   signal rst : std_logic := '0';
31
   signal clk : std_logic := '0';
32
   signal cycle_wait_baud : std_logic_vector((nBitsLarge-1) downto 0) := (others => '0');
33
   signal byte_tx : std_logic_vector((nBits-1) downto 0) := (others => '0');
34
   signal serial_in : std_logic := '0';
35
   signal start_tx : std_logic := '0';
36
 
37
        --Outputs
38
   signal byte_rx : std_logic_vector((nBits-1) downto 0);
39
   signal data_sent_tx : std_logic;
40
   signal data_received_rx : std_logic;
41
   signal serial_out : std_logic;
42
 
43
   -- Clock period definitions   
44
        constant clk_period : time := 0.543 us; -- 0.543us (1.8432Mhz) 2ns (50Mhz)
45
 
46
BEGIN
47
 
48
        -- Instantiate the Unit Under Test (UUT)
49
   uut: uart_communication_blocks PORT MAP (
50
          rst => rst,
51
          clk => clk,
52
          cycle_wait_baud => cycle_wait_baud,
53
          byte_tx => byte_tx,
54
          byte_rx => byte_rx,
55
          data_sent_tx => data_sent_tx,
56
          data_received_rx => data_received_rx,
57
          serial_out => serial_out,
58
          serial_in => serial_in,
59
          start_tx => start_tx
60
        );
61
 
62
   -- Clock process definitions
63
   clk_process :process
64
   begin
65
                clk <= '0';
66
                wait for clk_period/2;
67
                clk <= '1';
68
                wait for clk_period/2;
69
   end process;
70
 
71
 
72
   -- Stimulus process
73
   stim_proc: process
74
   begin
75
      -- Setup communication blocks
76
                rst <= '1';
77
                cycle_wait_baud <= conv_std_logic_vector(16, (nBitsLarge));
78
      wait for 2 ns;
79
                rst <= '0';
80
 
81
      wait for clk_period*10;
82
 
83
      -- insert stimulus here 
84
 
85
      wait;
86
   end process;
87
 
88
END;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.