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

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

?? usbhostcontrolbi.v

?? 包括USB
?? V
字號:
//////////////////////////////////////////////////////////////////////
////                                                              ////
//// USBHostControlBI.v                                           ////
////                                                              ////
//// This file is part of the usbhostslave opencores effort.
//// <http://www.opencores.org/cores//>                           ////
////                                                              ////
//// Module Description:                                          ////
//// 
////                                                              ////
//// To Do:                                                       ////
//// 
////                                                              ////
//// Author(s):                                                   ////
//// - Steve Fielding, sfielding@base2designs.com                 ////
////                                                              ////
//////////////////////////////////////////////////////////////////////
////                                                              ////
//// Copyright (C) 2004 Steve Fielding and OPENCORES.ORG          ////
////                                                              ////
//// This source file may be used and distributed without         ////
//// restriction provided that this copyright statement is not    ////
//// removed from the file and that any derivative work contains  ////
//// the original copyright notice and the associated disclaimer. ////
////                                                              ////
//// This source file is free software; you can redistribute it   ////
//// and/or modify it under the terms of the GNU Lesser General   ////
//// Public License as published by the Free Software Foundation; ////
//// either version 2.1 of the License, or (at your option) any   ////
//// later version.                                               ////
////                                                              ////
//// This source is distributed in the hope that it will be       ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
//// PURPOSE. See the GNU Lesser General Public License for more  ////
//// details.                                                     ////
////                                                              ////
//// You should have received a copy of the GNU Lesser General    ////
//// Public License along with this source; if not, download it   ////
//// from <http://www.opencores.org/lgpl.shtml>                   ////
////                                                              ////
//////////////////////////////////////////////////////////////////////
//
`include "timescale.v"
`include "usbHostControl_h.v"
 
module USBHostControlBI (address, dataIn, dataOut, writeEn,
  strobe_i,
  busClk, 
  rstSyncToBusClk,
  usbClk, 
  rstSyncToUsbClk,
  SOFSentIntOut, connEventIntOut, resumeIntOut, transDoneIntOut,
  TxTransTypeReg, TxSOFEnableReg,
  TxAddrReg, TxEndPReg, frameNumIn, 
  RxPktStatusIn, RxPIDIn,
  connectStateIn,
  SOFSentIn, connEventIn, resumeIntIn, transDoneIn,
  hostControlSelect,
  clrTransReq,
  preambleEn,
  SOFSync,
  TxLineState,
  LineDirectControlEn,
  fullSpeedPol, 
  fullSpeedRate,
  transReq,
  isoEn,
  SOFTimer
  );
input [3:0] address;
input [7:0] dataIn;
input writeEn; 
input strobe_i;
input busClk; 
input rstSyncToBusClk;
input usbClk; 
input rstSyncToUsbClk;
output [7:0] dataOut;
output SOFSentIntOut;
output connEventIntOut;
output resumeIntOut;
output transDoneIntOut;

output [1:0] TxTransTypeReg;
output TxSOFEnableReg;
output [6:0] TxAddrReg;
output [3:0] TxEndPReg;
input [10:0] frameNumIn;
input [7:0] RxPktStatusIn;
input [3:0] RxPIDIn;
input [1:0] connectStateIn;
input SOFSentIn;
input connEventIn;
input resumeIntIn;
input transDoneIn;
input hostControlSelect;
input clrTransReq;
output preambleEn;
output SOFSync;
output [1:0] TxLineState;
output LineDirectControlEn;
output fullSpeedPol; 
output fullSpeedRate;
output transReq;
output isoEn;     //enable isochronous mode
input [15:0] SOFTimer;

wire [3:0] address;
wire [7:0] dataIn;
wire writeEn;
wire strobe_i;
wire busClk; 
wire rstSyncToBusClk;
wire usbClk; 
wire rstSyncToUsbClk;
reg [7:0] dataOut;

reg SOFSentIntOut;
reg connEventIntOut;
reg resumeIntOut;
reg transDoneIntOut;

reg [1:0] TxTransTypeReg;
reg TxSOFEnableReg;
reg [6:0] TxAddrReg;
reg [3:0] TxEndPReg;
wire [10:0] frameNumIn;
wire [7:0] RxPktStatusIn;
wire [3:0] RxPIDIn;
wire [1:0] connectStateIn;

wire SOFSentIn;
wire connEventIn;
wire resumeIntIn;
wire transDoneIn;
wire hostControlSelect;
wire clrTransReq;
reg preambleEn;
reg SOFSync;
reg [1:0] TxLineState;
reg LineDirectControlEn;
reg fullSpeedPol; 
reg fullSpeedRate;
reg transReq;
reg isoEn;
wire [15:0] SOFTimer;

//internal wire and regs
reg [1:0] TxControlReg;
reg [4:0] TxLineControlReg;
reg clrSOFReq;
reg clrConnEvtReq;
reg clrResInReq;
reg clrTransDoneReq;
reg SOFSentInt;
reg connEventInt;
reg resumeInt;
reg transDoneInt;
reg [3:0] interruptMaskReg;
reg setTransReq;

//clock domain crossing sync registers
//STB = Sync To Busclk
reg [1:0] TxTransTypeRegSTB;
reg TxSOFEnableRegSTB;
reg [6:0] TxAddrRegSTB;
reg [3:0] TxEndPRegSTB;
reg preambleEnSTB;
reg SOFSyncSTB;
reg [1:0] TxLineStateSTB;
reg LineDirectControlEnSTB;
reg fullSpeedPolSTB; 
reg fullSpeedRateSTB;
reg transReqSTB;
reg isoEnSTB;   
reg [10:0] frameNumInSTB;
reg [7:0] RxPktStatusInSTB;
reg [3:0] RxPIDInSTB;
reg [1:0] connectStateInSTB;
reg SOFSentInSTB;
reg connEventInSTB;
reg resumeIntInSTB;
reg transDoneInSTB;
reg clrTransReqSTB;
reg [15:0] SOFTimerSTB;

  
//sync write demux
always @(posedge busClk)
begin
  if (rstSyncToBusClk == 1'b1) begin
    isoEnSTB <= 1'b0;
    preambleEnSTB <= 1'b0;
    SOFSyncSTB <= 1'b0;
    TxTransTypeRegSTB <= 2'b00;
    TxLineControlReg <= 5'h00;
    TxSOFEnableRegSTB <= 1'b0;
    TxAddrRegSTB <= 7'h00;
    TxEndPRegSTB <= 4'h0;
    interruptMaskReg <= 4'h0;
  end
  else begin
    clrSOFReq <= 1'b0;
    clrConnEvtReq <= 1'b0;
    clrResInReq <= 1'b0;
    clrTransDoneReq <= 1'b0;
    setTransReq <= 1'b0;
    if (writeEn == 1'b1 && strobe_i == 1'b1 && hostControlSelect == 1'b1)
    begin
      case (address)
        `TX_CONTROL_REG : begin
          isoEnSTB <= dataIn[`ISO_ENABLE_BIT];
          preambleEnSTB <= dataIn[`PREAMBLE_ENABLE_BIT];
          SOFSyncSTB <= dataIn[`SOF_SYNC_BIT];
          setTransReq <= dataIn[`TRANS_REQ_BIT];
        end
        `TX_TRANS_TYPE_REG : TxTransTypeRegSTB <= dataIn[1:0];
        `TX_LINE_CONTROL_REG : TxLineControlReg <= dataIn[4:0];
        `TX_SOF_ENABLE_REG : TxSOFEnableRegSTB <= dataIn[`SOF_EN_BIT];
        `TX_ADDR_REG : TxAddrRegSTB <= dataIn[6:0];
        `TX_ENDP_REG : TxEndPRegSTB <= dataIn[3:0];
        `INTERRUPT_STATUS_REG :  begin
          clrSOFReq <= dataIn[`SOF_SENT_BIT];
          clrConnEvtReq <= dataIn[`CONNECTION_EVENT_BIT];
          clrResInReq <= dataIn[`RESUME_INT_BIT];
          clrTransDoneReq <= dataIn[`TRANS_DONE_BIT];
        end
        `INTERRUPT_MASK_REG  : interruptMaskReg <= dataIn[3:0];
      endcase
    end 
  end
end

//interrupt control
always @(posedge busClk)
begin
  if (rstSyncToBusClk == 1'b1) begin
    SOFSentInt <= 1'b0;
    connEventInt <= 1'b0;
    resumeInt <= 1'b0;
    transDoneInt <= 1'b0;
  end
  else begin
    if (SOFSentInSTB == 1'b1)
      SOFSentInt <= 1'b1;
    else if (clrSOFReq == 1'b1)
      SOFSentInt <= 1'b0;
    
    if (connEventInSTB == 1'b1)
      connEventInt <= 1'b1;
    else if (clrConnEvtReq == 1'b1)
      connEventInt <= 1'b0;
    
    if (resumeIntInSTB == 1'b1)
      resumeInt <= 1'b1;
    else if (clrResInReq == 1'b1)
      resumeInt <= 1'b0;  

    if (transDoneInSTB == 1'b1)
      transDoneInt <= 1'b1;
    else if (clrTransDoneReq == 1'b1)
      transDoneInt <= 1'b0;
  end
end

//mask interrupts
always @(interruptMaskReg or transDoneInt or resumeInt or connEventInt or SOFSentInt) begin
  transDoneIntOut <= transDoneInt & interruptMaskReg[`TRANS_DONE_BIT];
  resumeIntOut <= resumeInt & interruptMaskReg[`RESUME_INT_BIT];
  connEventIntOut <= connEventInt & interruptMaskReg[`CONNECTION_EVENT_BIT];
  SOFSentIntOut <= SOFSentInt & interruptMaskReg[`SOF_SENT_BIT];
end  
  
//transaction request set/clear
//Since 'busClk' can be a higher freq than 'usbClk',
//'setTransReq' must be delayed with respect to other control signals, thus
//ensuring that control signals have been clocked through to 'usbClk' clock
//domain before the transaction request is asserted.
//Not sure this is required because there is at least two 'usbClk' ticks between
//detection of 'transReq' and sampling of related control signals.always @(posedge busClk)
always @(posedge busClk)
begin
  if (rstSyncToBusClk == 1'b1) begin
    transReqSTB <= 1'b0;
  end
  else begin
    if (setTransReq == 1'b1)
      transReqSTB <= 1'b1;
    else if (clrTransReqSTB == 1'b1)
      transReqSTB <= 1'b0;
  end
end  
  
//break out control signals
always @(TxControlReg or TxLineControlReg) begin
  TxLineStateSTB <= TxLineControlReg[`TX_LINE_STATE_MSBIT:`TX_LINE_STATE_LSBIT];
  LineDirectControlEnSTB <= TxLineControlReg[`DIRECT_CONTROL_BIT];
  fullSpeedPolSTB <= TxLineControlReg[`FULL_SPEED_LINE_POLARITY_BIT]; 
  fullSpeedRateSTB <= TxLineControlReg[`FULL_SPEED_LINE_RATE_BIT];
end
  
// async read mux
always @(address or
  TxControlReg or TxTransTypeRegSTB or TxLineControlReg or TxSOFEnableRegSTB or
  TxAddrRegSTB or TxEndPRegSTB or frameNumInSTB or 
  SOFSentInt or connEventInt or resumeInt or transDoneInt or
  interruptMaskReg or RxPktStatusInSTB or RxPIDInSTB or connectStateInSTB or
  preambleEnSTB or SOFSyncSTB or transReqSTB or isoEnSTB or SOFTimerSTB)
begin
  case (address)
      `TX_CONTROL_REG : dataOut <= {4'b0000, isoEnSTB, preambleEnSTB, SOFSyncSTB, transReqSTB} ;
      `TX_TRANS_TYPE_REG : dataOut <= {6'b000000, TxTransTypeRegSTB};
      `TX_LINE_CONTROL_REG : dataOut <= {3'b000, TxLineControlReg};
      `TX_SOF_ENABLE_REG : dataOut <= {7'b0000000, TxSOFEnableRegSTB};
      `TX_ADDR_REG : dataOut <= {1'b0, TxAddrRegSTB};
      `TX_ENDP_REG : dataOut <= {4'h0, TxEndPRegSTB};
      `FRAME_NUM_MSB_REG : dataOut <= {5'b00000, frameNumInSTB[10:8]};
      `FRAME_NUM_LSB_REG : dataOut <= frameNumInSTB[7:0];
      `INTERRUPT_STATUS_REG :  dataOut <= {4'h0, SOFSentInt, connEventInt, resumeInt, transDoneInt};
      `INTERRUPT_MASK_REG  : dataOut <= {4'h0, interruptMaskReg};
      `RX_STATUS_REG  : dataOut <= RxPktStatusInSTB;
      `RX_PID_REG  : dataOut <= {4'b0000, RxPIDInSTB};
      `RX_CONNECT_STATE_REG : dataOut <= {6'b000000, connectStateInSTB};
      `HOST_SOF_TIMER_MSB_REG : dataOut <= SOFTimerSTB[15:8];
      default: dataOut <= 8'h00;
  endcase
end

//re-sync from busClk to usbClk. 
always @(posedge usbClk) begin
  if (rstSyncToUsbClk == 1'b1) begin
    isoEn <= 1'b0;
    preambleEn <= 1'b0;
    SOFSync <= 1'b0;
    TxTransTypeReg <= 2'b00;
    TxSOFEnableReg <= 1'b0;
    TxAddrReg <= 7'h00;
    TxEndPReg <= 4'h0;
    TxLineState <= 2'b00;
    LineDirectControlEn <= 1'b0;
    fullSpeedPol <= 1'b0; 
    fullSpeedRate <= 1'b0;
    transReq <= 1'b0;
  end
  else begin
    isoEn <= isoEnSTB;     
    preambleEn <= preambleEnSTB;
    SOFSync <= SOFSyncSTB;
    TxTransTypeReg <= TxTransTypeRegSTB;
    TxSOFEnableReg <= TxSOFEnableRegSTB;
    TxAddrReg <= TxAddrRegSTB;
    TxEndPReg <= TxEndPRegSTB;
    TxLineState <= TxLineStateSTB;
    LineDirectControlEn <= LineDirectControlEnSTB;
    fullSpeedPol <= fullSpeedPolSTB; 
    fullSpeedRate <= fullSpeedRateSTB;
    transReq <= transReqSTB;
  end
end

//re-sync from usbClk to busClk. Since 'clrTransReq', 'transDoneIn' etc are only asserted 
//for one 'usbClk' tick, busClk freq must be greater than or equal to usbClk freq
always @(posedge busClk) begin
  frameNumInSTB <= frameNumIn;
  RxPktStatusInSTB <= RxPktStatusIn;
  RxPIDInSTB <= RxPIDIn;
  connectStateInSTB <= connectStateIn;
  SOFSentInSTB <= SOFSentIn;
  connEventInSTB <= connEventIn;
  resumeIntInSTB <= resumeIntIn;
  transDoneInSTB <= transDoneIn;
  clrTransReqSTB <= clrTransReq;
  //FIXME. It is not safe to pass 'SOFTimer' multi-bit signal between clock domains this way
  //All the other multi-bit signals will be static at the time that they are
  //read, but 'SOFTimer' will not be static.
  SOFTimerSTB <= SOFTimer; 
end


endmodule

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线看一区| 久久成人免费电影| 久久精品国产一区二区三 | 国产欧美一区二区三区沐欲 | 成人国产精品免费观看动漫| 欧美无人高清视频在线观看| 国产日产欧美精品一区二区三区| 香蕉久久夜色精品国产使用方法| 丁香另类激情小说| 日韩丝袜美女视频| 亚洲一区中文在线| 99热精品一区二区| 国产午夜精品理论片a级大结局| 午夜在线成人av| 色哟哟国产精品| 国产亚洲精品资源在线26u| 免费xxxx性欧美18vr| 欧美亚洲免费在线一区| 中文字幕中文字幕一区| 国产一区二区精品久久91| 欧美一区二区三区小说| 亚洲国产三级在线| 色婷婷综合久久久久中文| 国产精品嫩草99a| 丁香五精品蜜臀久久久久99网站| 精品国产一区二区在线观看| 日产国产高清一区二区三区| 欧美日韩一区二区三区四区五区 | 午夜精品久久久久久久99水蜜桃| 99re视频精品| 亚洲美女精品一区| 色诱视频网站一区| 亚洲一二三四在线观看| 91福利视频久久久久| 一区二区三区.www| 欧美性猛交xxxxxx富婆| 亚洲一级二级三级在线免费观看| 色www精品视频在线观看| 亚洲少妇30p| 91成人在线精品| 午夜欧美2019年伦理| 欧美精品粉嫩高潮一区二区| 日韩成人一级片| 欧美mv日韩mv国产| 国产成人综合网站| 国产精品美女www爽爽爽| 99久久精品免费看| 亚洲影院在线观看| 日韩精品一区二区三区三区免费| 久久精品国产99国产精品| 久久男人中文字幕资源站| 国产一区二区在线看| 中文字幕 久热精品 视频在线| 成人毛片视频在线观看| 一区二区三区不卡视频| 日韩一级大片在线| 国产麻豆成人传媒免费观看| 国产精品久久久久久久久免费樱桃 | 337p日本欧洲亚洲大胆色噜噜| 国产福利一区二区三区在线视频| 亚洲天堂免费看| 欧美精品色综合| 国产成人免费9x9x人网站视频| 亚洲欧洲日产国码二区| 欧美日韩一区中文字幕| 国产成人aaa| 亚洲卡通动漫在线| 亚洲精品一区在线观看| 91免费看片在线观看| 美女尤物国产一区| ...xxx性欧美| 日韩片之四级片| 99re热视频这里只精品| 日韩激情视频在线观看| 国产精品萝li| 制服丝袜亚洲色图| 99麻豆久久久国产精品免费优播| 日韩精品一级中文字幕精品视频免费观看 | 91在线视频播放| 日韩1区2区3区| 亚洲啪啪综合av一区二区三区| 欧美一区二区不卡视频| 91免费观看国产| 韩国v欧美v亚洲v日本v| 亚洲欧洲成人av每日更新| 日韩美女视频一区二区在线观看| 一本色道久久综合亚洲aⅴ蜜桃| 麻豆精品视频在线| 亚洲综合激情网| 国产精品麻豆99久久久久久| 欧美白人最猛性xxxxx69交| 欧美在线小视频| proumb性欧美在线观看| 免费成人在线网站| 亚洲成av人在线观看| 日韩毛片精品高清免费| 久久综合色一综合色88| 5858s免费视频成人| 91麻豆视频网站| 成人h动漫精品一区二区| 麻豆久久久久久久| 日韩经典中文字幕一区| 亚洲精品免费一二三区| 中文字幕一区av| 中文字幕精品一区| 国产网站一区二区| 日韩一区二区电影在线| 91福利精品第一导航| 北岛玲一区二区三区四区| 国产福利一区二区三区视频 | 91论坛在线播放| 国产主播一区二区三区| 蜜臀av在线播放一区二区三区| 亚洲va欧美va国产va天堂影院| 一区二区三区四区蜜桃| 亚洲精品免费在线播放| 亚洲自拍都市欧美小说| 亚洲国产欧美在线| 亚洲一区二区精品3399| 五月综合激情网| 日本不卡一二三| 首页欧美精品中文字幕| 免费不卡在线观看| 精品一区二区免费| 国产白丝精品91爽爽久久| 国产99久久久久| 99精品久久只有精品| 一本大道久久a久久综合婷婷| 欧美综合视频在线观看| 欧美日韩一区二区三区四区| 91麻豆精品国产91久久久| 欧美大尺度电影在线| 日韩欧美第一区| 亚洲国产成人一区二区三区| 国产精品国产三级国产专播品爱网| 日本一区二区综合亚洲| 一区二区在线免费| 午夜激情综合网| 免费在线观看视频一区| 另类小说一区二区三区| 懂色av一区二区三区蜜臀| 色吧成人激情小说| 51精品国自产在线| 国产亚洲视频系列| 亚洲免费在线播放| 免费成人性网站| 97精品久久久久中文字幕 | 91天堂素人约啪| 91精品国产高清一区二区三区| 欧美大片在线观看一区| 中文字幕一区二区三区四区不卡 | 国产精品一区久久久久| 色噜噜狠狠色综合中国| 日韩一区二区三区精品视频| 国产亚洲精品久| 日日夜夜免费精品| 从欧美一区二区三区| 欧美日韩国产小视频| 国产蜜臀av在线一区二区三区| 午夜精品福利一区二区蜜股av| 国产综合久久久久久鬼色| 在线观看亚洲成人| 久久精品视频在线免费观看| 亚洲高清久久久| 成人午夜私人影院| 日韩欧美久久久| 亚洲一级片在线观看| 成人不卡免费av| 久久新电视剧免费观看| 亚洲一级不卡视频| 99精品久久免费看蜜臀剧情介绍| 精品国产一区二区三区久久久蜜月| 亚洲欧美乱综合| 风间由美性色一区二区三区| 欧美一区二区三区色| 中文字幕一区日韩精品欧美| 国内精品第一页| 91麻豆精品国产91久久久久久久久| 亚洲欧洲日韩女同| 豆国产96在线|亚洲| 精品国产乱码91久久久久久网站| 亚洲成在人线免费| 欧美伊人精品成人久久综合97| 国产欧美视频在线观看| 久久国产精品99久久久久久老狼| 欧美区视频在线观看| 亚洲综合999| 欧美性高清videossexo| 一区二区三区美女视频| 99久久综合色| 最近中文字幕一区二区三区| 国产成a人无v码亚洲福利| 亚洲精品一区二区三区精华液| 免费在线成人网| 91精品国产一区二区三区| 天天射综合影视| 欧美日韩亚洲国产综合| 亚洲成人精品一区二区| 欧美三级乱人伦电影| 亚洲观看高清完整版在线观看|