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

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

?? translatetoutopia.vhd

?? VHDL寫一個轉換到utopia接口的轉換源程序.可以進行utopia接口的仿真試驗
?? VHD
字號:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity TranslateToUTOPIA is  -- slave mode 
  generic(
    fifo_width: integer := 32;
    Pclass    : integer := 4;
    clock_syn : boolean := true     
  );
  Port (  
    reset     : in  std_logic;
    txclk     : in  std_logic;  
    sysclk    : in  std_logic;
    txaddr    : in  std_logic_vector(4 downto 0);
    txenb     : in  std_logic;
    txclav    : out std_logic;
    txclaven  : out std_logic;
    txdata    : out std_logic_vector(7 downto 0);   
    txdataen  : out std_logic;
    txsoc     : out std_logic;
    txsocen   : out std_logic;  
    rbe       : in  std_logic_vector(Pclass - 1 downto 0);  
    rdd       : in  std_logic_vector(fifo_width - 1 downto 0);
    rdeop     : out std_logic;  
    rden      : out std_logic;   
    rdport    : out std_logic_vector(Pclass - 1 downto 0);   
    timerset  : in  std_logic_vector((Pclass * 16) - 1 downto 0);                     
    phyaddr   : in  std_logic_vector(4 downto 0)
  );
end TranslateToUTOPIA;

architecture Behavioral of TranslateToUTOPIA is

  function Get_CRC(
    data        :   std_logic_vector; 
    CRC         :   std_logic_vector;
    CRC_ACCUM   :   std_logic_vector
  )return std_logic_vector is  
    variable NewCRC     : std_logic_vector(CRC'length - 1 downto 0);  
    variable OldCRC     : std_logic_vector(CRC'length - 1 downto 0);
    variable CRC_POLY   : std_logic_vector(CRC'length - 1 downto 0); 
  begin
    OldCRC      := CRC;
    CRC_POLY    := CRC_ACCUM;
    for i in data'length - 1 downto 0 loop
      for j in 0 to CRC_POLY'length - 1 loop
        if j = 0 then
          if CRC_POLY(j) = '1' then
            NewCRC(j) := OldCRC(CRC_POLY'length - 1) xor data(i);
          else
            NewCRC(j) := data(i);    
          end if;
        else
          if CRC_POLY(j) = '1' then
            NewCRC(j) := OldCRC(CRC_POLY'length - 1) xor data(i) xor OldCRC(j - 1);
          else
            NewCRC(j) := OldCRC(j - 1);    
          end if;          
        end if;
      end loop; 
      OldCRC    := NewCRC;   
    end loop;
    return NewCRC;
  end Get_CRC;

  type translatestate is (idle,waiting,translating,stop,pause,pause1,pause2);
  signal state        : translatestate;
  signal dataout      :   std_logic_vector(7 downto 0);
  signal offset       :   integer  range 0 to 63 :=0;
  signal crc8         :   std_logic_vector(7 downto 0);
  signal rden_tmp     :   std_logic;
  signal rdeop_tmp    :   std_logic;
  signal txclk_d      :   std_logic;
  signal txclken      :   std_logic;  
  signal clk,clk_en   :   std_logic;
  signal txenb_syn    :   std_logic;
  signal txaddr_tmp   :   std_logic_vector(4 downto 0);
  signal txclav_tmp   :   std_logic;
  signal txdata_tmp   :   std_logic_vector(7 downto 0);
  signal txdataen_tmp :   std_logic;
  signal txsoc_tmp    :   std_logic;
  signal txsocen_tmp  :   std_logic;
  signal temp         :   std_logic_vector(31 downto 0);

  signal txrbe        :   std_logic;
  type timertype is array(Pclass -1 downto 0) of std_logic_vector(15 downto 0);
  signal timer        :   timertype;
  signal txenable     :   std_logic_vector(Pclass -1 downto 0):=(others=>'0');
  signal rdport_tmp   :   std_logic_vector(Pclass - 1 downto 0);

begin
  
  txrbeProc : Process(rbe)
    variable  temp : std_logic;
  begin
    temp := '1';
    for i in 0 to Pclass - 1 loop
      temp  := temp and rbe(i);
    end loop;
    txrbe  <= temp;
  end Process;
  
  in_syn_proc : process(txclk)
  begin
    if txclk'event and txclk = '1' then
      txenb_syn <= txenb;
      if txenb = '1' then
        txaddr_tmp <= txaddr;
      end if;
    end if;
  end process;
  
  txclav_tmp_Proc : process(txclk)
  begin
    if txclk'event and txclk = '1' then
      if txaddr = phyaddr then
        txclaven    <= '1';
      else
        txclaven    <= '0';
      end if;
    end if;
  end process;     

  label1 : if clock_syn /= true generate 
  begin
    clk           <= txclk;
    clk_en        <= '1';
    txdata        <= txdata_tmp;
    txdataen      <= txdataen_tmp;
    txclav        <= txclav_tmp;
    txsoc         <= txsoc_tmp;
    txsocen       <= txsocen_tmp;  
    txdata_tmp    <= crc8 when offset = 4 else dataout;
    txdataen_tmp  <= not txenb_syn when (txaddr_tmp = phyaddr) and (state /= idle) else '0';  
    rden          <= rden_tmp;
    rdeop         <= rdeop_tmp;
    rdport        <= rdport_tmp;          
  end generate;
  
  label2 : if clock_syn = true generate
  begin
    clk           <= sysclk;
    clk_en        <= txclken;    
    txdata_tmp    <= crc8 when offset = 4 else dataout;
    txdataen_tmp  <= not txenb_syn when (txaddr_tmp = phyaddr) and (state /= idle) else '0';          
    data_syn_proc : process(txclk)
    begin
      if txclk'event and txclk = '1' then
        txdata    <= txdata_tmp;
        txdataen  <= txdataen_tmp;
        txclav    <= txclav_tmp;
        txsoc     <= txsoc_tmp;
        txsocen   <= txsocen_tmp;                   
      end if;
    end process;      
    txclk_syn_proc : process(txclk,txclken)
    begin
      if (txclken or reset) = '1' then
        txclk_d   <= '0';
      elsif txclk'event and txclk = '1' then
        txclk_d   <= '1';
      end if;
    end process;
    rxclkce_proc : process(sysclk)
    begin
      if sysclk'event and sysclk = '1' then
        txclken   <= txclk_d;
      end if;
    end process;        
    rd_proc : process(sysclk)
    begin
      if sysclk'event and sysclk = '1' then
        rden      <= rden_tmp and txclken;
        rdeop     <= rdeop_tmp and txclken;
        rdport    <= rdport_tmp;                
      end if;
    end process;
  end generate;
     
  stateProc : process(clk)
  begin  
    if clk'event and clk = '1' then
      if reset = '1' then
        state         <= idle;
        rdeop_tmp     <= '0';
        txclav_tmp    <= '0';
        txsoc_tmp     <= '0';
        txsocen_tmp   <= '0';  
        rden_tmp      <= '0'; 
        offset        <= 0;    
        temp          <= (others=>'0');    
        crc8          <= (others=>'0');         
        for i in 0 to Pclass - 1 loop
          timer(i)       <= (others=>'0');
          txenable(i)    <= '1';
          rdport_tmp(i)  <= '0';
        end loop;
      elsif clk_en = '1' then       
        for i in 0 to Pclass - 1 loop
          if (txenable(i)and not rbe(i)) = '1' then
            timer(i)      <= timerset((16 * i) + 15 downto 16 * i);  
          else
            if timer(i) /= x"0000" then
              timer(i)    <= timer(i) - 1;
            end if;        
          end if; 
          if timer(i) = x"0000" then
            txenable(i)   <= '1';
          else
            txenable(i)   <= '0';
          end if;        
        end loop;  
        case state is
          when idle      =>
            rdeop_tmp   <= '0';   
            rden_tmp    <= '0';                  
            offset      <= 0;                    
            for i in 0 to Pclass - 1 loop
              if (txenable(i) and not rbe(i)) = '1' then
                state         <= waiting;                                        
                rdport_tmp(i) <= '1';                                            
                exit;              
              else
                rdport_tmp(i) <= '0';               
              end if;
            end loop;
          when waiting     =>              
            if (txaddr_tmp = phyaddr) and (txenb_syn = '0') then         
              txsoc_tmp    <= '1';       
              txsocen_tmp  <= '1';
              temp         <= rdd;
              rden_tmp     <= '1';
              state        <= translating;
            else
              txsoc_tmp    <= '0';
              txsocen_tmp  <= '0';           
            end if;    
            offset         <= 0; 
            txclav_tmp     <= '1';
            crc8           <= (others=>'0');                
          when translating =>       
            txclav_tmp     <= '0';
            txsoc_tmp      <= '0';
            txsocen_tmp    <= '0'; 
            if clock_syn = true then
              if (((offset mod 4) = 3) and (offset > 4)) or ( offset = 4) then
                rden_tmp   <= '1';
                temp       <= rdd;                   
              else
                rden_tmp   <= '0';
              end if;            
            else
              if ((offset mod 4) = 3) or (offset = 4) then
                temp       <= rdd;                   
              end if;                                   
              if ((offset mod 4) = 2) then
                rden_tmp   <= '1';
              else
                rden_tmp   <= '0';
              end if;            
            end if;
            if offset = 4 then
              offset     <= 8;
            else               
              offset     <= offset + 1;  
            end if;
            if offset < 4 then
              CRC8       <= Get_CRC(dataout,CRC8,x"35");              
            end if;                               
            if txenb_syn = '1' then                       
              state      <= stop;                    
            end if;  
          when stop      =>
            rden_tmp     <= '1';         
            rdeop_tmp    <= '1';                
            state        <= pause;
          when pause     =>
            rdeop_tmp    <= '0';    
            rden_tmp     <= '0';  
            state        <= pause1;   
          when pause1    =>
            state        <= pause2;   
            for i in 0 to Pclass - 1 loop
              rdport_tmp(i)<= '0'; 
            end loop;
          when pause2    =>
            state        <= idle;     
          when others    => 
            state        <= idle;                                
        end case;
      end if; 
    end if;
  end process;
  
  dataout_Proc : process(offset,temp)
  begin  
    case offset mod 4 is
      when 0      =>
        dataout   <= temp(31 downto 24);
      when 1      =>
        dataout   <= temp(23 downto 16);
      when 2      =>
        dataout   <= temp(15 downto 8);    
      when others =>
        dataout   <= temp(7 downto 0);
    end case;
  end process;
  
end Behavioral;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久电影| 免费成人av在线| 老司机一区二区| av男人天堂一区| 日韩欧美一级特黄在线播放| 日韩美女视频一区| 国产在线一区观看| 91精品国产综合久久精品性色| 中文字幕乱码日本亚洲一区二区| 久久精品国产亚洲一区二区三区| 91在线看国产| 中文字幕乱码久久午夜不卡| 免费成人av资源网| 欧美日韩一级黄| 日韩一区在线看| 国产成人免费视| 欧美变态凌虐bdsm| 日本不卡视频在线| 欧美蜜桃一区二区三区| 夜夜精品视频一区二区| www.亚洲激情.com| 亚洲国产高清不卡| 国产黄色精品视频| 国产亚洲视频系列| 国产精品自拍三区| 2024国产精品| 国产麻豆精品theporn| 日韩一级二级三级| 麻豆精品视频在线| 日韩免费一区二区| 精品亚洲国内自在自线福利| 欧美一级专区免费大片| 日韩精品国产精品| 日韩你懂的在线播放| 成人av手机在线观看| 国产肉丝袜一区二区| 国产精品自在欧美一区| 亚洲国产精品成人综合色在线婷婷 | 国产精品一区二区三区99| 欧美电影免费观看高清完整版在| 日本成人中文字幕| 日韩美女主播在线视频一区二区三区| 日本不卡中文字幕| 精品欧美久久久| 国产中文一区二区三区| 中文字幕免费不卡在线| 色综合色狠狠综合色| 亚洲电影激情视频网站| 欧美一区二区三区爱爱| 国产精品原创巨作av| 欧美国产1区2区| 色国产综合视频| 香蕉av福利精品导航| 日韩免费成人网| 大尺度一区二区| 一区二区三区不卡视频| 欧美精品一二三区| 国产成人免费xxxxxxxx| 亚洲美女少妇撒尿| 日韩一级二级三级精品视频| 国产精品99精品久久免费| 亚洲色图视频网| 在线电影院国产精品| 国产福利精品一区二区| 亚洲品质自拍视频| 日韩欧美不卡在线观看视频| 成人黄页毛片网站| 天天影视网天天综合色在线播放| 精品久久久久久久久久久久久久久| 国产传媒欧美日韩成人| 亚洲一区二区成人在线观看| 精品日韩欧美一区二区| www.av精品| 久久精品72免费观看| 亚洲色图一区二区三区| 日韩三级视频在线看| 91同城在线观看| 色婷婷久久久综合中文字幕| 日本成人中文字幕| 亚洲人成网站影音先锋播放| 精品国偷自产国产一区| 色94色欧美sute亚洲线路一ni | 在线亚洲欧美专区二区| 麻豆成人久久精品二区三区小说| 国产精品久99| 欧美videofree性高清杂交| 91免费精品国自产拍在线不卡| 激情欧美日韩一区二区| 亚洲影院久久精品| 国产精品电影院| 久久综合九色综合97婷婷| 欧美日韩久久一区二区| 91玉足脚交白嫩脚丫在线播放| 极品美女销魂一区二区三区| 亚洲在线视频网站| 中文字幕一区二区三区蜜月| 26uuuu精品一区二区| 欧美一级日韩一级| 欧美绝品在线观看成人午夜影视| 色综合天天综合| 成人动漫一区二区| 丁香婷婷综合色啪| 国产麻豆视频一区二区| 免费一级欧美片在线观看| 亚洲成人福利片| 亚洲精品自拍动漫在线| 亚洲日本一区二区| 国产精品福利一区二区三区| 日本一区二区三区在线观看| 337p日本欧洲亚洲大胆精品 | 国产精品欧美精品| 久久久另类综合| 久久影院午夜论| 久久这里只精品最新地址| 日韩三级在线观看| 亚洲精品一区二区三区蜜桃下载| 中文字幕一区视频| 国产精品毛片无遮挡高清| 欧美激情在线看| 中文字幕在线观看不卡视频| 欧美经典一区二区三区| 中文字幕av一区二区三区免费看| 久久精品一区二区三区四区| 国产日产精品1区| 国产精品网站在线观看| 国产精品欧美综合在线| 亚洲欧美怡红院| 亚洲精品成a人| 偷拍日韩校园综合在线| 免费在线观看不卡| 国产另类ts人妖一区二区| 岛国一区二区在线观看| 91美女在线观看| 欧美日韩国产高清一区二区 | 欧美高清在线一区| 国产精品美女久久久久高潮| 国产精品电影一区二区三区| 亚洲影院久久精品| 日韩国产精品91| 国产老妇另类xxxxx| 99riav一区二区三区| 欧美午夜电影网| 精品精品欲导航| 亚洲欧洲三级电影| 视频在线观看一区| 国产一区二区三区香蕉| 99精品视频在线观看| 91麻豆精品国产91久久久| 久久久91精品国产一区二区精品 | 久久五月婷婷丁香社区| 亚洲色图欧洲色图| 另类专区欧美蜜桃臀第一页| 成人一区二区在线观看| 在线国产电影不卡| 久久久久久亚洲综合| 亚洲自拍偷拍欧美| 国产在线麻豆精品观看| 在线观看成人免费视频| 久久综合狠狠综合久久综合88 | 欧美极品aⅴ影院| 亚洲午夜久久久久久久久久久| 精品一区二区免费看| 色噜噜夜夜夜综合网| 欧美精品一区二区三区视频| 亚洲在线视频一区| 国产成a人无v码亚洲福利| 欧美日韩一区二区三区四区| 国产精品视频一二三区| 蜜臀99久久精品久久久久久软件| 99久久婷婷国产| 欧美精品一区二区蜜臀亚洲| 亚洲综合色丁香婷婷六月图片| 国产成人av网站| 欧美一级日韩不卡播放免费| 日韩欧美在线不卡| 国产毛片一区二区| 国产精品理伦片| 欧美日韩在线综合| 国产午夜亚洲精品不卡| 亚洲一区二区欧美| 99精品视频在线免费观看| 久久精品网站免费观看| 成人国产精品免费观看动漫| 日韩欧美成人一区二区| 午夜激情一区二区| 欧美影视一区在线| 亚洲欧美国产高清| 99这里只有精品| 中文一区在线播放| 国产成人精品免费网站| wwwwww.欧美系列| 狠狠狠色丁香婷婷综合激情| 6080yy午夜一二三区久久| 香蕉久久一区二区不卡无毒影院| 色欧美片视频在线观看在线视频| 综合在线观看色| 99精品视频在线观看| 亚洲卡通欧美制服中文| 91成人看片片| 亚洲综合色自拍一区|