?? usbslavecontrolbi.v
字號:
//////////////////////////////////////////////////////////////////////
//// ////
//// USBSlaveControlBI.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 "usbSlaveControl_h.v"
module USBSlaveControlBI (address, dataIn, dataOut, writeEn,
strobe_i,
busClk,
rstSyncToBusClk,
usbClk,
rstSyncToUsbClk,
SOFRxedIntOut, resetEventIntOut, resumeIntOut, transDoneIntOut, NAKSentIntOut,
endP0TransTypeReg, endP0NAKTransTypeReg,
endP1TransTypeReg, endP1NAKTransTypeReg,
endP2TransTypeReg, endP2NAKTransTypeReg,
endP3TransTypeReg, endP3NAKTransTypeReg,
endP0ControlReg,
endP1ControlReg,
endP2ControlReg,
endP3ControlReg,
EP0StatusReg,
EP1StatusReg,
EP2StatusReg,
EP3StatusReg,
SCAddrReg, frameNum,
connectStateIn,
SOFRxedIn, resetEventIn, resumeIntIn, transDoneIn, NAKSentIn,
slaveControlSelect,
clrEP0Ready, clrEP1Ready, clrEP2Ready, clrEP3Ready,
TxLineState,
LineDirectControlEn,
fullSpeedPol,
fullSpeedRate,
SCGlobalEn
);
input [4:0] address;
input [7:0] dataIn;
input writeEn;
input strobe_i;
input busClk;
input rstSyncToBusClk;
input usbClk;
input rstSyncToUsbClk;
output [7:0] dataOut;
output SOFRxedIntOut;
output resetEventIntOut;
output resumeIntOut;
output transDoneIntOut;
output NAKSentIntOut;
input [1:0] endP0TransTypeReg;
input [1:0] endP0NAKTransTypeReg;
input [1:0] endP1TransTypeReg;
input [1:0] endP1NAKTransTypeReg;
input [1:0] endP2TransTypeReg;
input [1:0] endP2NAKTransTypeReg;
input [1:0] endP3TransTypeReg;
input [1:0] endP3NAKTransTypeReg;
output [4:0] endP0ControlReg;
output [4:0] endP1ControlReg;
output [4:0] endP2ControlReg;
output [4:0] endP3ControlReg;
input [7:0] EP0StatusReg;
input [7:0] EP1StatusReg;
input [7:0] EP2StatusReg;
input [7:0] EP3StatusReg;
output [6:0] SCAddrReg;
input [10:0] frameNum;
input [1:0] connectStateIn;
input SOFRxedIn;
input resetEventIn;
input resumeIntIn;
input transDoneIn;
input NAKSentIn;
input slaveControlSelect;
input clrEP0Ready;
input clrEP1Ready;
input clrEP2Ready;
input clrEP3Ready;
output [1:0] TxLineState;
output LineDirectControlEn;
output fullSpeedPol;
output fullSpeedRate;
output SCGlobalEn;
wire [4:0] address;
wire [7:0] dataIn;
wire writeEn;
wire strobe_i;
wire busClk;
wire rstSyncToBusClk;
wire usbClk;
wire rstSyncToUsbClk;
reg [7:0] dataOut;
reg SOFRxedIntOut;
reg resetEventIntOut;
reg resumeIntOut;
reg transDoneIntOut;
reg NAKSentIntOut;
wire [1:0] endP0TransTypeReg;
wire [1:0] endP0NAKTransTypeReg;
wire [1:0] endP1TransTypeReg;
wire [1:0] endP1NAKTransTypeReg;
wire [1:0] endP2TransTypeReg;
wire [1:0] endP2NAKTransTypeReg;
wire [1:0] endP3TransTypeReg;
wire [1:0] endP3NAKTransTypeReg;
reg [4:0] endP0ControlReg;
reg [4:0] endP1ControlReg;
reg [4:0] endP2ControlReg;
reg [4:0] endP3ControlReg;
wire [7:0] EP0StatusReg;
wire [7:0] EP1StatusReg;
wire [7:0] EP2StatusReg;
wire [7:0] EP3StatusReg;
reg [6:0] SCAddrReg;
reg [3:0] TxEndPReg;
wire [10:0] frameNum;
wire [1:0] connectStateIn;
wire SOFRxedIn;
wire resetEventIn;
wire resumeIntIn;
wire transDoneIn;
wire NAKSentIn;
wire slaveControlSelect;
wire clrEP0Ready;
wire clrEP1Ready;
wire clrEP2Ready;
wire clrEP3Ready;
reg [1:0] TxLineState;
reg LineDirectControlEn;
reg fullSpeedPol;
reg fullSpeedRate;
reg SCGlobalEn;
//internal wire and regs
reg [5:0] SCControlReg;
reg clrNAKReq;
reg clrSOFReq;
reg clrResetReq;
reg clrResInReq;
reg clrTransDoneReq;
reg SOFRxedInt;
reg resetEventInt;
reg resumeInt;
reg transDoneInt;
reg NAKSentInt;
reg [4:0] interruptMaskReg;
reg EP0SetReady;
reg EP1SetReady;
reg EP2SetReady;
reg EP3SetReady;
reg EP0SendStall;
reg EP1SendStall;
reg EP2SendStall;
reg EP3SendStall;
reg EP0IsoEn;
reg EP1IsoEn;
reg EP2IsoEn;
reg EP3IsoEn;
reg EP0DataSequence;
reg EP1DataSequence;
reg EP2DataSequence;
reg EP3DataSequence;
reg EP0Enable;
reg EP1Enable;
reg EP2Enable;
reg EP3Enable;
reg EP0Ready;
reg EP1Ready;
reg EP2Ready;
reg EP3Ready;
//clock domain crossing sync registers
//STB = Sync To Busclk
reg [4:0] endP0ControlRegSTB;
reg [4:0] endP1ControlRegSTB;
reg [4:0] endP2ControlRegSTB;
reg [4:0] endP3ControlRegSTB;
reg NAKSentInSTB;
reg SOFRxedInSTB;
reg resetEventInSTB;
reg resumeIntInSTB;
reg transDoneInSTB;
reg clrEP0ReadySTB;
reg clrEP1ReadySTB;
reg clrEP2ReadySTB;
reg clrEP3ReadySTB;
reg SCGlobalEnSTB;
reg [1:0] TxLineStateSTB;
reg LineDirectControlEnSTB;
reg fullSpeedPolSTB;
reg fullSpeedRateSTB;
reg [7:0] EP0StatusRegSTB;
reg [7:0] EP1StatusRegSTB;
reg [7:0] EP2StatusRegSTB;
reg [7:0] EP3StatusRegSTB;
reg [1:0] endP0TransTypeRegSTB;
reg [1:0] endP0NAKTransTypeRegSTB;
reg [1:0] endP1TransTypeRegSTB;
reg [1:0] endP1NAKTransTypeRegSTB;
reg [1:0] endP2TransTypeRegSTB;
reg [1:0] endP2NAKTransTypeRegSTB;
reg [1:0] endP3TransTypeRegSTB;
reg [1:0] endP3NAKTransTypeRegSTB;
reg [10:0] frameNumSTB;
//sync write demux
always @(posedge busClk)
begin
if (rstSyncToBusClk == 1'b1) begin
EP0IsoEn <= 1'b0;
EP0SendStall <= 1'b0;
EP0DataSequence <= 1'b0;
EP0Enable <= 1'b0;
EP1IsoEn <= 1'b0;
EP1SendStall <= 1'b0;
EP1DataSequence <= 1'b0;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -