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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? can_btl.vhd

?? 一個(gè)基于can_bus的虛擬程序
?? VHD
字號(hào):
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all; 
use ieee.numeric_std.all;
--use ieee.std_logic_arith.all;

entity can_btl is
port (

       clk: in std_logic;
       rst: in std_logic;
       rx : in std_logic;

--   Mode register 
       reset_mode: in std_logic;

-- Bus Timing 0 register 
       baud_r_presc    : in std_logic_vector(5 downto 0);
       sync_jump_width : in std_logic_vector(1 downto 0);

-- Bus Timing 1 register 
       time_segment1   : in std_logic_vector(3 downto 0);
       time_segment2   : in std_logic_vector(2 downto 0);
       triple_sampling : in std_logic;

-- Output from can_bsp module 
       rx_idle           : in std_logic;
       transmitting      : in std_logic;
       last_bit_of_inter : in std_logic;

-- Output signals from this module 
       clk_en        :  out std_logic ;
       sample_point  :  out std_logic ;
       sampled_bit   :  out std_logic ;
       sampled_bit_q :  out std_logic ;
       tx_point      :  out std_logic ;
       hard_sync     :  out std_logic ;
       resync        :  out std_logic);  
end can_btl;

architecture RTL of can_btl is

constant Tp              : time := 1 ns;

signal  clk_cnt          : std_logic_vector(8 downto 0);       
signal  clk_en_reg       : std_logic;        
signal  sync_blocked     : std_logic;  
signal  resync_blocked   : std_logic;
signal  sampled_bit_reg  : std_logic;   
signal  resync_reg       : std_logic;
signal  hard_sync_reg    : std_logic;
signal  quant_cnt        : std_logic_vector(7 downto 0);     
signal  delay            : std_logic_vector(3 downto 0);         
signal  sync             : std_logic;          
signal  seg1             : std_logic;          
signal  seg2             : std_logic;          
signal  resync_latched   : std_logic;
signal  sample           : std_logic_vector(1 downto 0);        
                     
signal  go_sync           : std_logic;       
signal  go_seg1           : std_logic;       
signal  go_seg2           : std_logic;       
signal  preset_cnt        : std_logic_vector(8 downto 0);    
signal  sync_window       : std_logic;   
                      
signal  baud_r_presc_plus_1: std_logic_vector(5 downto 0);

signal  delay_temp          : unsigned(3 downto 0);


 

begin

clk_en       <= clk_en_reg;
resync       <= resync_reg;
hard_sync    <= hard_sync_reg;
sampled_bit  <= sampled_bit_reg;

baud_r_presc_plus_1 <= baud_r_presc + 1;

preset_cnt <= "00"&baud_r_presc_plus_1(5 downto 0)&'0';        -- (BRP+1)*2
hard_sync_reg  <= '1' when (rx_idle = '1' or last_bit_of_inter = '1')  and rx = '0' and sampled_bit_reg = '1' and sync_blocked = '1' and transmitting = '0' else '0';  -- Hard synchronization
resync_reg     <= '1' when rx_idle = '0'                      and rx = '0' and sampled_bit_reg = '1' and  sync_blocked = '0' and resync_blocked = '0' and transmitting = '0' else '0';  -- Re-synchronization


-- Generating general enable signal that defines baud rate. 
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    clk_cnt <= (others => '0');
  elsif ((clk_cnt = (preset_cnt-1)) or reset_mode = '1') then
    clk_cnt <= (others => '0') after Tp;
  else
    clk_cnt <= clk_cnt + 1 after Tp;
  end if;
end if;
end process;


process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    clk_en_reg  <= '0';
  elsif (clk_cnt = (preset_cnt-1)) then
    clk_en_reg  <= '1' after Tp;
  else
    clk_en_reg  <= '0' after Tp;
  end if;
end if;
end process;



-- Changing states 
go_sync <= '1' when clk_en_reg = '1' and (seg2 = '1' and hard_sync_reg = '0' and resync_reg = '0' and (quant_cnt = time_segment2)) else '0';
go_seg1 <= '1' when clk_en_reg = '1' and (sync = '1' or hard_sync_reg = '1' or (resync_reg = '1' and seg2 = '1' and sync_window = '1') or (resync_latched = '1' and sync_window = '1')) else '0';
go_seg2 <= '1' when clk_en_reg = '1' and (seg1 = '1' and hard_sync_reg = '0' and (quant_cnt = (time_segment1 + delay))) else '0';



-- When early edge is detected outside of the SJW field, synchronization request is latched and performed when
-- SJW is reached 
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    resync_latched <= '0';
  elsif (resync_reg = '1' and seg2 = '1' and sync_window = '0') then
    resync_latched <= '1' after Tp;
  elsif (go_seg1 = '1') then
    resync_latched <= '0';
  end if;
end if;
end process;



-- Synchronization stage/segment 
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    sync <= '0';
  elsif (go_sync = '1') then
    sync <= '1' after Tp;
  elsif (go_seg1 = '1') then
    sync <= '0' after Tp;
  end if;
end if;
end process;


tx_point <= go_sync;

-- Seg1 stage/segment (together with propagation segment which is 1 quant long) 
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    seg1 <= '1';
  elsif (go_seg1 = '1') then
    seg1 <= '1' after Tp;
  elsif (go_seg2 = '1') then
    seg1 <= '0' after Tp;
  end if;
end if;
end process;


-- Seg2 stage/segment 
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    seg2 <= '0';
  elsif (go_seg2 = '1') then
    seg2 <= '1' after Tp;
  elsif (go_sync = '1' or go_seg1 = '1') then
    seg2 <= '0' after Tp;
  end if;
end if;
end process;


-- Quant counter 
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    quant_cnt <= (others =>'0');
  elsif (go_sync = '1' or go_seg1 = '1' or go_seg2 = '1' or reset_mode = '1') then
    quant_cnt <= (others =>'0') after Tp;
  elsif (clk_en_reg = '1') then
    quant_cnt <= quant_cnt + 1 after Tp;
  end if;
end if;
end process;


-- When late edge is detected (in seg1 stage), stage seg1 is prolonged. 
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    delay_temp <= (others =>'0');
  elsif (clk_en_reg = '1' and resync_reg = '1' and seg1 = '1') then
    if (quant_cnt > sync_jump_width) then
     delay_temp <= to_unsigned(conv_integer(sync_jump_width),4) + 1 after
Tp;
    else
     delay_temp <= to_unsigned(conv_integer(quant_cnt),4) + 1 after Tp;
    end if;
  elsif (go_sync = '1' or go_seg1 = '1') then
    delay_temp <= (others =>'0');
  end if;
end if;
  delay <= std_logic_vector(delay_temp);
end process;




-- If early edge appears within this window (in seg2 stage), phase error is fully compensated
sync_window <= '1' when((time_segment2 - quant_cnt) < ( sync_jump_width + 1)) else '0';


-- Sampling data (memorizing two samples all the time).
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    sample <= "11";
  elsif (clk_en_reg = '1') then
    sample <= sample(0)&rx;
  end if;
end if;
end process;


-- When enabled, tripple sampling is done here.
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
      sampled_bit_reg   <= '1';
      sampled_bit_q <= '1';
      sample_point  <= '0';
  elsif (clk_en_reg = '1' and hard_sync_reg = '0' ) then
      if (seg1 = '1' and (quant_cnt = (time_segment1 + delay))) then
          sample_point <= '1' after Tp;
          sampled_bit_q <= sampled_bit_reg after Tp;
          if (triple_sampling = '1') then
            sampled_bit_reg <= (sample(0) and sample(1)) or ( sample(0) and rx) or (sample(1) and rx);
          else
            sampled_bit_reg <= rx after Tp;
          end if;
      else
          sample_point <= '0' after Tp;
      end if;
  end if;
end if;
end process;



-- Blocking synchronization (can occur only once in a bit time) 
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    sync_blocked <= '0' after Tp;
  elsif (clk_en_reg = '1') then
      if (hard_sync_reg = '1' or resync_reg = '1') then
        sync_blocked <= '1' after Tp;
      elsif (seg2 = '1' and (quant_cnt = time_segment2)) then
        sync_blocked <= '0' after Tp;
      end if;
  end if;
end if;
end process;


-- Blocking resynchronization until reception starts (needed because after reset mode exits we are waiting for
-- end-of-frame and interframe. No resynchronization is needed meanwhile). */
process(clk,rst)
begin
if (clk = '1' and clk'event) then
  if (rst = '1') then
    resync_blocked <= '1' after Tp;
  elsif (reset_mode = '1') then
    resync_blocked <= '1' after Tp;
  elsif (hard_sync_reg = '1') then
    resync_blocked <= '0' after Tp;
  end if;
end if;
end process;

end RTL;





       





?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频一二三区| 精品成人佐山爱一区二区| 老司机精品视频线观看86| 国产三级精品三级在线专区| 日本高清不卡视频| 麻豆精品在线视频| www.久久精品| 国产精品色哟哟网站| 亚洲一区二区欧美激情| 99国内精品久久| 国产亚洲成aⅴ人片在线观看| 亚洲免费观看高清完整版在线| 亚洲一区二区三区中文字幕在线 | 经典一区二区三区| 中文字幕国产一区二区| 精品视频999| 成人av影视在线观看| 蜜桃视频免费观看一区| 伊人开心综合网| 国产女人18水真多18精品一级做| 欧美日韩夫妻久久| 色播五月激情综合网| 福利一区二区在线观看| 日本女优在线视频一区二区| 一区二区三区不卡在线观看 | 久久久一区二区三区捆绑**| 欧美丰满少妇xxxbbb| 欧美性猛片xxxx免费看久爱| 97精品电影院| 99视频超级精品| 成人精品gif动图一区| 国产伦精品一区二区三区在线观看| 天天影视网天天综合色在线播放| 亚洲男女一区二区三区| 日韩久久一区二区| 中文字幕免费不卡在线| 国产欧美日韩激情| 国产日产精品1区| 国产日韩欧美不卡在线| 国产日韩欧美亚洲| 国产精品美女久久福利网站| 久久久久久久久久电影| 久久久噜噜噜久久中文字幕色伊伊| 亚洲精品一线二线三线无人区| 欧美一区二区三区小说| 91精品婷婷国产综合久久| 欧美一级艳片视频免费观看| 欧美一区二区三区男人的天堂| 欧美日韩国产首页在线观看| 欧美精品日韩一区| 7777精品久久久大香线蕉| 3751色影院一区二区三区| 丰满放荡岳乱妇91ww| 一区二区三区**美女毛片| 中文字幕一区二区三区不卡| 欧美另类高清zo欧美| 麻豆久久久久久久| 日韩中文欧美在线| 国产欧美日韩精品一区| 欧美日韩精品欧美日韩精品一综合| 青草av.久久免费一区| 欧美va亚洲va香蕉在线| 亚洲成av人**亚洲成av**| 国产日韩欧美制服另类| 国产精品久久久久久久久快鸭 | 亚洲综合激情网| 国产精品丝袜91| 亚洲影院免费观看| 椎名由奈av一区二区三区| 亚洲综合一二区| 亚洲国产另类av| 久久精品国产77777蜜臀| 久久精品99国产精品日本| 亚洲 欧美综合在线网络| 视频在线观看一区| 久久99国内精品| 成人不卡免费av| 91激情五月电影| 欧美一级生活片| 久久久久久久久久久黄色| 亚洲欧美aⅴ...| 亚洲成人综合在线| 午夜影视日本亚洲欧洲精品| 日本欧美在线观看| 免费一级欧美片在线观看| 久久99久久精品欧美| 国产精品资源网站| proumb性欧美在线观看| 成人av集中营| 欧美日韩国产综合草草| 久久久久久久综合日本| 亚洲免费成人av| 久久av老司机精品网站导航| 国产999精品久久久久久| 欧美性色欧美a在线播放| 精品人在线二区三区| 亚洲精品高清在线| 久久国产免费看| 91高清在线观看| 日韩欧美中文一区| 亚洲欧美另类在线| 天天色天天操综合| 99re8在线精品视频免费播放| 欧美日韩国产乱码电影| 国产精品麻豆一区二区| 亚洲成人av电影在线| 成人国产在线观看| 欧美日韩一本到| 亚洲色图.com| 精品一区二区在线免费观看| 久久亚洲精品小早川怜子| 国产精品污污网站在线观看| av电影一区二区| 欧美色爱综合网| 一区二区免费看| 免费人成在线不卡| 欧美一区二区三区四区高清| 欧美日韩亚洲高清一区二区| 一本到不卡精品视频在线观看| 国产一区二区三区| 色综合中文字幕国产 | 精品国产免费人成在线观看| 久久久国产一区二区三区四区小说| 午夜欧美大尺度福利影院在线看 | 欧美精品日韩精品| 欧美大肚乱孕交hd孕妇| 中文字幕在线不卡| 国产精品一区二区在线观看不卡| 日本福利一区二区| 亚洲人成亚洲人成在线观看图片| 国产亚洲精品福利| 精品一区二区影视| 99久久综合99久久综合网站| 精品一区二区日韩| 精品一区二区三区香蕉蜜桃| 不卡一区二区在线| 精品少妇一区二区三区免费观看| 亚洲激情av在线| 在线观看一区不卡| 日韩理论电影院| 在线观看免费一区| 亚洲色图一区二区| 在线观看av一区| 蜜桃av一区二区三区电影| 国产一区二区三区美女| 亚洲午夜久久久久久久久久久| 91精品国产美女浴室洗澡无遮挡| 欧美精品久久天天躁| 亚洲欧美成人一区二区三区| 91麻豆国产精品久久| 国产午夜一区二区三区| 丁香一区二区三区| 久久嫩草精品久久久精品| 国产自产视频一区二区三区| 欧美一级二级在线观看| 日本欧美加勒比视频| 91精品欧美一区二区三区综合在| 日韩专区一卡二卡| 欧美一区二区三区在线观看视频| 热久久免费视频| 日韩欧美一级二级三级久久久| 久久99精品国产91久久来源| 欧美精品一区二区三区在线播放 | 欧美日韩一区二区三区不卡| 亚洲美女屁股眼交| 色av一区二区| 一区二区在线看| 91在线观看污| 欧美激情一区二区三区全黄 | 九九国产精品视频| 久久九九影视网| 成人午夜激情视频| 一区二区三区精品在线| 欧美日韩一区成人| 国产毛片精品视频| 中文字幕在线免费不卡| 欧美性色欧美a在线播放| 亚洲妇女屁股眼交7| 精品免费一区二区三区| 国产精品一区二区不卡| 《视频一区视频二区| 色婷婷国产精品| 国内外成人在线| 亚洲天堂精品在线观看| 91精品国产免费| 福利一区二区在线观看| 亚洲午夜在线电影| 精品国产污污免费网站入口 | 欧美一区二区福利视频| 精品一区二区日韩| 国产精品国产三级国产普通话99 | 欧美羞羞免费网站| 久久se精品一区二区| 亚洲人被黑人高潮完整版| 色哟哟一区二区三区| 国精产品一区一区三区mba桃花| 欧美不卡激情三级在线观看| 不卡的电视剧免费网站有什么| 亚洲福利视频三区| 亚洲国产精品t66y|