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

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [VHDL/] [async_ser_tx.vhd] - Diff between revs 207 and 208

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 207 Rev 208
Line 29... Line 29...
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_misc.all;
use ieee.std_logic_misc.all;
 
 
library work;
 
  use work.open8_pkg.all;
 
 
 
entity async_ser_tx is
entity async_ser_tx is
generic(
generic(
    Reset_Level              : std_logic;
    Reset_Level              : std_logic;
    Enable_Parity            : boolean;
    Enable_Parity            : boolean;
    Parity_Odd_Even_n        : std_logic;
    Parity_Odd_Even_n        : std_logic;
Line 53... Line 50...
);
);
end entity;
end entity;
 
 
architecture behave of async_ser_tx is
architecture behave of async_ser_tx is
 
 
 
  -- The ceil_log2 function returns the minimum register width required to
 
  --  hold the supplied integer.
 
  function ceil_log2 (x : in natural) return natural is
 
    variable retval          : natural;
 
  begin
 
    retval                   := 1;
 
    while ((2**retval) - 1) < x loop
 
      retval                 := retval + 1;
 
    end loop;
 
    return retval;
 
  end ceil_log2;
 
 
  constant Tick_Base         : integer := Clock_Divider - 1;
  constant Tick_Base         : integer := Clock_Divider - 1;
  constant Tick_Bits         : integer := ceil_log2(Tick_Base);
  constant Tick_Bits         : integer := ceil_log2(Tick_Base);
  constant TICK_DIV          : std_logic_vector(Tick_Bits - 1 downto 0) :=
  constant TICK_DIV          : std_logic_vector(Tick_Bits - 1 downto 0) :=
                                 conv_std_logic_vector(Tick_Base, Tick_Bits);
                                 conv_std_logic_vector(Tick_Base, Tick_Bits);
 
 
  signal Tick_Cntr           : std_logic_vector(Tick_Bits - 1 downto 0);
  signal Tick_Cntr           : std_logic_vector(Tick_Bits - 1 downto 0) :=
  signal Tick_Trig           : std_logic;
                                 (others => '0');
 
 
  signal Tx_Enable           : std_logic;
 
  signal Tx_Buffer           : std_logic_vector(7 downto 0);
 
  signal Tx_Parity           : std_logic;
 
 
 
  signal Tx_State            : std_logic_vector(3 downto 0);
  signal Tick_Trig           : std_logic := '0';
 
  signal Tx_Enable           : std_logic := '0';
 
  signal Tx_Buffer           : std_logic_vector(7 downto 0) := x"00";
 
  signal Tx_Parity           : std_logic := '0';
 
  signal Tx_State            : std_logic_vector(3 downto 0) := x"0";
  alias  Tx_Bit_Sel          is Tx_State(2 downto 0);
  alias  Tx_Bit_Sel          is Tx_State(2 downto 0);
 
 
  -- State machine definitions
  -- State machine definitions
  constant IO_RSV0           : std_logic_vector(3 downto 0) := "1011"; -- B
  constant IO_RSV0           : std_logic_vector(3 downto 0) := "1011"; -- B
  constant IO_RSV1           : std_logic_vector(3 downto 0) := "1100"; -- C
  constant IO_RSV1           : std_logic_vector(3 downto 0) := "1100"; -- C

powered by: WebSVN 2.1.0

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