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

Subversion Repositories uart16750

[/] [uart16750/] [trunk/] [bench/] [vhdl/] [uart_package.vhd] - Diff between revs 17 and 25

Show entire file | Details | Blame | View Log

Rev 17 Rev 25
Line 21... Line 21...
-- Boston, MA  02111-1307  USA
-- Boston, MA  02111-1307  USA
--
--
 
 
LIBRARY IEEE;
LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
USE IEEE.std_logic_1164.all;
 
USE IEEE.numeric_std.all;
use std.textio.all;
use std.textio.all;
 
 
use work.txt_util.all;
use work.txt_util.all;
 
 
 
 
Line 69... Line 70...
                         );
                         );
 
 
    -- Compare two std_logig_vectors (handles don't-care)
    -- Compare two std_logig_vectors (handles don't-care)
    function compare (d1 : std_logic_vector; d2 : std_logic_vector) return boolean;
    function compare (d1 : std_logic_vector; d2 : std_logic_vector) return boolean;
 
 
 
    -- Send serial data to UART
 
    procedure uart_send  (signal sout   : out std_logic;
 
                          baud          : in time;
 
                          wl            : in integer;
 
                          count         : in integer;
 
                          file log      : TEXT
 
                         );
end uart_package;
end uart_package;
 
 
package body uart_package is
package body uart_package is
    -- Write to UART
    -- Write to UART
    procedure uart_write (signal ui : inout uart_interface;
    procedure uart_write (signal ui : inout uart_interface;
Line 130... Line 138...
            end if;
            end if;
        end loop;
        end loop;
        return true;
        return true;
    end compare;
    end compare;
 
 
 
    -- Send serial data to UART
 
    procedure uart_send  (signal sout   : out std_logic;
 
                          baud          : in time;
 
                          wl            : in integer;
 
                          count         : in integer;
 
                          file log      : TEXT
 
                         ) is
 
        variable data : unsigned(7 downto 0);
 
    begin
 
        print (log, "UART send:  Sending " & integer'image(count) & " symbols with " & integer'image(wl) & " bits");
 
 
 
        data := (others => '0');
 
 
 
        for i in 0 to count loop
 
 
 
            -- Start bit
 
            sout <= '0';
 
            wait for baud;
 
 
 
            for i in 0 to wl loop
 
                sout <= data(i);
 
                wait for baud;
 
            end loop;
 
 
 
            -- Stop bit
 
            sout <= '1';
 
            wait for baud;
 
 
 
            data := data + 1;
 
        end loop;
 
 
 
    end uart_send;
end uart_package;
end uart_package;
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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