亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rxcver.vhd

?? 利用VHDL語言開發一個UART的源代碼
?? VHD
?? 第 1 頁 / 共 2 頁
字號:
-- --------------------------------------------------------------------
-- >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<
-- --------------------------------------------------------------------
-- Copyright (c) 2001 by Lattice Semiconductor Corporation
-- --------------------------------------------------------------------
--
-- Permission:
--
--   Lattice Semiconductor grants permission to use this code for use
--   in synthesis for any Lattice programmable logic product.  Other
--   use of this code, including the selling or duplication of any
--   portion is strictly prohibited.
--
-- Disclaimer:
--
--   This VHDL or Verilog source code is intended as a design reference
--   which illustrates how these types of functions can be implemented.
--   It is the user's responsibility to verify their design for
--   consistency and functionality through the use of formal
--   verification methods.  Lattice Semiconductor provides no warranty
--   regarding the use or functionality of this code.
--
-- --------------------------------------------------------------------
--           
--                     Lattice Semiconductor Corporation
--                     5555 NE Moore Court
--                     Hillsboro, OR 97214
--                     U.S.A
--
--                     TEL: 1-800-Lattice (USA and Canada)
--                          408-826-6000 (other locations)
--
--                     web: http://www.latticesemi.com/
--                     email: techsupport@latticesemi.com
--
-- --------------------------------------------------------------------
--
--  Project:           Universal Asynchronous Receiver Transmitter
--  File:              rxcver.vhd
--  Title:             rxcver
--  Design Library:    IEEE
--  Dependencies:      IEEE.std_logic_1164.all
--                     IEEE.std_logic_unsigned.all
--  Description:       VHDL file for the UART Receiver Module
--
--    <Global reset and clock>
--      Reset       : Master reset
--      Clk16X      : UART internal clock
--
--    <Register>
--      RBR         : Receiver Buffer Register
--
--    <Rising edge of RBR, LSR read strobes>
--      RbrRDn_re   : one Clk16X width pulse indicating rising edge of RbrRDn_r
--      LsrRDn_re   : one Clk16X width pulse indicating rising edge of LsrRDn_r
--
--    <Receiver input>
--      SIN         : Receiver serial input
--
--    <Receiver control>
--      Databits    : "00"=5-bit, "01"=6-bit, "10"=7-bit, "11"=8-bit
--      ParityEnable: '0'=Parity Bit Enable, '1'=Parity Bit Disable
--      ParityEven  : '0'=Even Parity Selected, '1'=Odd Parity Selected
--      ParityStick : '0'=Stick Parity Disable, '1'=Stick Parity Enable
--
--    <Receiver/Transmitter status>
--      RxRDY       : RBR data is ready to be read
--      OverrunErr  : Overrun error
--      ParityErr   : Parity error
--      FrameErr    : Frame error
--      BreakInt    : BREAK interrupt
--
-- --------------------------------------------------------------------
--
-- Revision History :
-- --------------------------------------------------------------------
--   Ver  :| Author            :| Mod. Date :| Changes Made:
--   V1.1 :| J.H.              :| 06/19/01  :| Support ispMACH 5000VG
--   V1.0 :| D.W. & J.H.       :| 06/01/01  :| First Release
-- --------------------------------------------------------------------

library IEEE;
use IEEE.Std_Logic_1164.all;
use IEEE.Std_Logic_Unsigned.all;

entity Rxcver is
  port (
    -- Global reset and clock
    Reset       : in  std_logic; -- Master reset
    Clk16X      : in  std_logic; -- UART internal clock
    -- Register
    RBR         : out std_logic_vector(7 downto 0); -- Receiver Buffer Reg
    -- Rising edge of RBR, LSR read strobes
    RbrRDn_re   : in  std_logic; -- pulse indicating rising of RbrRDn_r
    LsrRDn_re   : in  std_logic; -- pulse indicating rising of LsrRDn_r
    -- Receiver input
    SIN         : in  std_logic;
    -- Receiver control
    Databits    : in  std_logic_vector(1 downto 0); -- Data bits length
    ParityEnable: in  std_logic; -- 0= Parity Disabled; 1= Parity Enabled
    ParityEven  : in  std_logic; -- 0= Odd Parity; 1= Even Parity
    ParityStick : in  std_logic; -- 0= Stick Disabled; 1= Stick Enabled
    -- Receiver status
    RxRDY       : out std_logic; -- Receiver data ready to read
    OverrunErr  : out std_logic; -- Receiver overrun error flag
    ParityErr   : out std_logic; -- Receiver parity error flag
    FrameErr    : out std_logic; -- Receiver framing error flag
    BreakInt    : out std_logic  -- Receiver BREAK interrupt flag
  );
end Rxcver;

architecture Rxcver_a of Rxcver is

  signal NumDataBitReceived_r : std_logic_vector(3 downto 0);

  signal RSR         : std_logic_vector(7 downto 0);
  signal RxPrtyErr   : std_logic;
  signal RxFrmErr    : std_logic;
  signal RxIdle_r    : std_logic;
  signal RbrDataRDY  : std_logic;
  signal CNT_r       : std_logic_vector(3 downto 0);

  signal Hunt_r      : boolean;
  signal HuntOne_r   : std_logic;

  signal SIN1_r      : std_logic;
  signal RxFrmErr1_r : std_logic;
  signal RxIdle1_r   : std_logic;

  signal OverrunErr_r: std_logic;
  signal ParityErr_r : std_logic;
  signal FrameErr_r  : std_logic;
  signal BreakInt_r  : std_logic;

  signal SampledOnce : std_logic;

  -- Receiver Clock Enable Signal
  signal RxClkEn     : std_logic;

  signal RBR_r       : std_logic_vector(7 downto 0);

  -- State Machine Definition
  type state_typ is (idle, shift, parity, stop);
  signal Rx_State : state_typ;

  -- Attributes for ispMACH5000VG to get higher performance
  --   These can be removed when the UART design is targeted to other devices.
  ATTRIBUTE SYN_KEEP : integer;
  ATTRIBUTE SYN_KEEP OF RxPrtyErr, NumDataBitReceived_r, RSR : SIGNAL IS 1;
  ATTRIBUTE SYN_KEEP OF Hunt_r, HuntOne_r, ParityErr_r, FrameErr_r : SIGNAL IS 1;
  ATTRIBUTE SYN_KEEP OF BreakInt_r, RBR_r, OverrunErr_r, RbrDataRDY : SIGNAL IS 1;
  ATTRIBUTE SYN_KEEP OF RxFrmErr, RxIdle_r : SIGNAL IS 1;
  ATTRIBUTE OPT : string;
  ATTRIBUTE OPT OF RxPrtyErr, NumDataBitReceived_r, RSR : SIGNAL IS "KEEP";
  ATTRIBUTE OPT OF Hunt_r, HuntOne_r, ParityErr_r, FrameErr_r : SIGNAL IS "KEEP";
  ATTRIBUTE OPT OF BreakInt_r, RBR_r, OverrunErr_r, RbrDataRDY : SIGNAL IS "KEEP";
  ATTRIBUTE OPT OF RxFrmErr, RxIdle_r : SIGNAL IS "KEEP";

begin

--------------------------------------------------------------------------------
-- Generate RxClkEn signal
--------------------------------------------------------------------------------

  -- RxClkEn : serial port data receiving clock enable
  RxCLK_Proc: process (Reset, Clk16X)
  begin
    if (Reset='1') then
      RxClkEn <= '0';
    elsif rising_edge(Clk16X) then
      if (CNT_r="0110") then
        RxClkEn <= '1';
      else
        RxClkEn <= '0';
      end if;
    end if;
  end process RxCLK_Proc;

  -- CNT_r : 4-bit counter for RxClkEn waveform generation
  CNT_Proc: process (Reset, Clk16X)
  begin
    if (Reset='1') then
      CNT_r <= (others => '0');
    elsif rising_edge(Clk16X) then
      if (Rx_State /= idle) or (Hunt_r) then
        -- Increment count when not idle or when Hunt_r is TRUE
        CNT_r <= CNT_r + 1;
      elsif (SampledOnce='1') then
        -- Adjust 2 clks forward for RxClkEn during the resync after framing error
        CNT_r <= "0010";
      else
        CNT_r <= (others => '0');
      end if;
    end if;
  end process CNT_Proc;

--------------------------------------------------------------------------------
-- Generate Hunt_r
--------------------------------------------------------------------------------

  -- Hunt_r : will be TRUE when start bit is found
  Hunt_r_Proc: process (Reset, Clk16X)
  begin
    if (Reset='1') then
      Hunt_r <= FALSE;
    elsif rising_edge(Clk16X) then
      if (Rx_State=idle) and (SIN='0') and (SIN1_r='1') then
        -- Set Hunt_r when SIN falling edge is found at the idle state
        Hunt_r <= TRUE;
      elsif (SampledOnce='1') and (SIN='0') then
        -- Start bit is successfully sampled twice after framing error
        -- set Hunt_r "true" for resynchronizing of next frame
        Hunt_r <= TRUE;
      elsif (RxIdle_r='0') or (SIN='1') then
        -- Clear Hunt_r when data shifting starts or when SIN returns to '1'
        Hunt_r <= FALSE;
      end if;
    end if;
  end process Hunt_r_Proc;

  -- HuntOne_r :
  --   HuntOne_r, used for BI flag generation, indicates that there is at
  --   least a '1' in the (data + parity + stop) bits of the frame.
  --   Break Interrupt flag(BI) is set to '1' whenever the received input
  --   is held at the '0' state for all bits in the frame (Start bit +
  --   Data bits + Parity bit + Stop bit).  So, as long as HuntOne_r is still
  --   low after all bits are received, BI will be set to '1'.
  HuntOne_r_Proc: process(Clk16X, Reset)
  begin
    if (Reset='1') then
      HuntOne_r <= '0';
    elsif rising_edge(Clk16X) then
      if (Hunt_r) then
        HuntOne_r <= '0';
      elsif (RxIdle_r='0') and (CNT_r(3)='1') and (SIN='1') then
        HuntOne_r <= '1';
      end if;
    end if;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲123区在线观看| 日韩高清不卡一区| 亚洲精品一区二区三区四区高清| 欧美日韩激情一区| 欧美日韩一级二级| 欧美福利视频导航| 欧美一级专区免费大片| 日韩欧美成人午夜| 久久人人爽爽爽人久久久| 久久久天堂av| 亚洲丝袜美腿综合| 亚洲精品免费在线观看| 亚洲小少妇裸体bbw| 亚洲国产另类av| 蜜臂av日日欢夜夜爽一区| 蜜臀av在线播放一区二区三区| 免费欧美在线视频| 国产精品123| 色系网站成人免费| 欧美偷拍一区二区| 欧美成人官网二区| 国产精品福利一区二区| 亚洲免费在线视频| 日韩精品一二三四| 国产成人精品免费一区二区| av男人天堂一区| 欧美美女一区二区| 久久亚洲综合av| 一区二区三区免费观看| 日韩不卡一区二区| 91小视频在线| 日韩三级在线观看| 亚洲欧洲一区二区三区| 日本成人在线网站| 成人av手机在线观看| 91精品国产免费| 国产精品久久久久久久久免费相片 | 1区2区3区国产精品| 性欧美大战久久久久久久久| 国产资源精品在线观看| 99在线热播精品免费| 欧美一卡在线观看| 亚洲丝袜制服诱惑| 国产自产v一区二区三区c| 欧美亚洲一区二区三区四区| 久久久激情视频| 全国精品久久少妇| 91在线视频免费91| 国产三级三级三级精品8ⅰ区| 一区二区不卡在线播放| 成人av在线资源网站| 91精品国产综合久久精品麻豆| 国产精品久久99| 国产麻豆精品一区二区| 欧美在线|欧美| 最新国产成人在线观看| 国产成人亚洲精品青草天美| 欧美伦理电影网| 亚洲午夜免费视频| 91亚洲国产成人精品一区二三| 国产午夜亚洲精品午夜鲁丝片| 免费观看在线综合| 在线不卡一区二区| 天天做天天摸天天爽国产一区| 色综合色狠狠天天综合色| 国产精品女上位| 国产精品99久久久久| 26uuu亚洲综合色| 久久丁香综合五月国产三级网站| 欧美日韩在线不卡| 一区二区免费看| 在线视频欧美精品| 一区二区理论电影在线观看| 在线免费精品视频| 亚洲小说欧美激情另类| 欧美影院精品一区| 亚洲福中文字幕伊人影院| 色婷婷精品大在线视频 | 一区二区不卡在线视频 午夜欧美不卡在 | 依依成人精品视频| 色狠狠一区二区三区香蕉| 一区二区三区欧美| 欧美精品久久一区| 免费不卡在线视频| 久久久精品黄色| av网站免费线看精品| 一区二区三区四区中文字幕| 在线观看区一区二| 奇米在线7777在线精品| wwwwww.欧美系列| 处破女av一区二区| 一区二区三区在线免费观看 | 婷婷中文字幕一区三区| 538在线一区二区精品国产| 蜜臀av一级做a爰片久久| 精品国产乱子伦一区| 国产麻豆一精品一av一免费| 国产精品素人视频| 欧美性一二三区| 国产一区二区在线免费观看| 亚洲国产成人私人影院tom| 色香蕉久久蜜桃| 日本aⅴ精品一区二区三区 | 免费观看在线综合色| 国产视频一区二区在线观看| 91免费版在线| 日本不卡免费在线视频| 国产精品久久久久久久裸模| 欧美精品在线一区二区三区| 国产成人av电影| 日韩精品每日更新| 国产亚洲欧美激情| 欧美日韩成人高清| 国产69精品久久久久毛片| 亚洲无线码一区二区三区| 精品成人a区在线观看| 在线观看免费视频综合| 国产美女精品在线| 亚洲v精品v日韩v欧美v专区| 中文字幕免费观看一区| 制服丝袜亚洲精品中文字幕| va亚洲va日韩不卡在线观看| 免费在线看成人av| 亚洲女人****多毛耸耸8| 精品成人免费观看| 欧美日韩视频在线一区二区| www.视频一区| 国产成人在线视频网址| 日韩av中文在线观看| 亚洲激情自拍偷拍| 国产精品天天看| 久久影视一区二区| 日韩欧美亚洲国产另类| 欧美日韩1234| 一本到高清视频免费精品| 国产成人在线网站| 激情综合网天天干| 理论电影国产精品| 美国三级日本三级久久99| 亚洲国产综合视频在线观看| 亚洲欧美中日韩| 国产精品乱码一区二区三区软件| 日韩欧美123| 日韩一级片网站| 制服丝袜一区二区三区| 欧美美女直播网站| 欧美三级午夜理伦三级中视频| 成人动漫视频在线| 丁香婷婷综合网| 不卡免费追剧大全电视剧网站| 国产乱码精品1区2区3区| 久久精品久久久精品美女| 日韩高清不卡在线| 韩国三级在线一区| 国产成人精品一区二区三区四区| 国产麻豆一精品一av一免费 | 91在线视频播放地址| 成人激情开心网| av在线这里只有精品| 99这里只有精品| 在线观看亚洲一区| 欧美精品免费视频| 精品美女被调教视频大全网站| 91精品国产欧美一区二区成人| 日韩三级视频中文字幕| 久久久精品综合| 亚洲欧美成aⅴ人在线观看| 一区二区成人在线| 另类小说欧美激情| 国产成人精品一区二区三区四区 | 国产免费久久精品| 中文字幕第一区综合| 亚洲人精品一区| 午夜欧美在线一二页| 久久www免费人成看片高清| 国产精品88av| 在线视频你懂得一区| 日韩精品一区二区三区视频 | 91亚洲大成网污www| 欧美日韩中文字幕一区| 精品国产成人在线影院| 国产精品蜜臀在线观看| 亚洲成人自拍网| 国产精品一二三四五| 欧洲av一区二区嗯嗯嗯啊| 日韩欧美一级片| 亚洲欧美日本在线| 免费成人av在线播放| 一本色道久久综合精品竹菊| 91精品国产aⅴ一区二区| 国产欧美日韩另类一区| 香蕉久久夜色精品国产使用方法| 九九九精品视频| 欧美最猛性xxxxx直播| 欧美激情一区二区三区蜜桃视频| 亚洲成人黄色影院| 本田岬高潮一区二区三区| 欧美一区二区三区在线看| 亚洲欧洲精品一区二区三区| 美女任你摸久久|