//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// usbHostSlaveCyc2Wrap.v ////
|
//// usbHostSlaveCyc2Wrap.v ////
|
//// ////
|
//// ////
|
//// This file is part of the usbhostslave opencores effort.
|
//// This file is part of the usbhostslave opencores effort.
|
//// <http://www.opencores.org/cores//> ////
|
//// <http://www.opencores.org/cores//> ////
|
//// ////
|
//// ////
|
//// Module Description: ////
|
//// Module Description: ////
|
//// Top level module wrapper.
|
//// Top level module wrapper.
|
//// ////
|
//// ////
|
//// To Do: ////
|
//// To Do: ////
|
////
|
////
|
//// ////
|
//// ////
|
//// Author(s): ////
|
//// Author(s): ////
|
//// - Steve Fielding, sfielding@base2designs.com ////
|
//// - Steve Fielding, sfielding@base2designs.com ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// Copyright (C) 2008 Steve Fielding and OPENCORES.ORG ////
|
//// Copyright (C) 2008 Steve Fielding and OPENCORES.ORG ////
|
//// ////
|
//// ////
|
//// This source file may be used and distributed without ////
|
//// This source file may be used and distributed without ////
|
//// restriction provided that this copyright statement is not ////
|
//// restriction provided that this copyright statement is not ////
|
//// removed from the file and that any derivative work contains ////
|
//// removed from the file and that any derivative work contains ////
|
//// the original copyright notice and the associated disclaimer. ////
|
//// the original copyright notice and the associated disclaimer. ////
|
//// ////
|
//// ////
|
//// This source file is free software; you can redistribute it ////
|
//// This source file is free software; you can redistribute it ////
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
//// Public License as published by the Free Software Foundation; ////
|
//// Public License as published by the Free Software Foundation; ////
|
//// either version 2.1 of the License, or (at your option) any ////
|
//// either version 2.1 of the License, or (at your option) any ////
|
//// later version. ////
|
//// later version. ////
|
//// ////
|
//// ////
|
//// This source is distributed in the hope that it will be ////
|
//// This source is distributed in the hope that it will be ////
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
//// details. ////
|
//// details. ////
|
//// ////
|
//// ////
|
//// You should have received a copy of the GNU Lesser General ////
|
//// You should have received a copy of the GNU Lesser General ////
|
//// Public License along with this source; if not, download it ////
|
//// Public License along with this source; if not, download it ////
|
//// from <http://www.opencores.org/lgpl.shtml> ////
|
//// from <http://www.opencores.org/lgpl.shtml> ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
`include "timescale.v"
|
`include "timescale.v"
|
|
|
|
|
module usbHostSlaveCyc2Wrap(
|
module usbHostSlaveCyc2Wrap(
|
clk_i,
|
clk_i,
|
rst_i,
|
rst_i,
|
address_i,
|
address_i,
|
data_i,
|
data_i,
|
data_o,
|
data_o,
|
we_i,
|
we_i,
|
strobe_i,
|
strobe_i,
|
ack_o,
|
ack_o,
|
irq,
|
irq,
|
usbClk,
|
usbClk,
|
USBWireVP,
|
USBWireVP,
|
USBWireVM,
|
USBWireVM,
|
USBWireOE_n,
|
USBWireOE_n,
|
USBFullSpeed
|
USBFullSpeed
|
);
|
);
|
|
|
input clk_i;
|
input clk_i;
|
input rst_i;
|
input rst_i;
|
input [7:0] address_i;
|
input [7:0] address_i;
|
input [7:0] data_i;
|
input [7:0] data_i;
|
output [7:0] data_o;
|
output [7:0] data_o;
|
input we_i;
|
input we_i;
|
input strobe_i;
|
input strobe_i;
|
output ack_o;
|
output ack_o;
|
output irq;
|
output irq;
|
input usbClk;
|
input usbClk;
|
inout USBWireVP /* synthesis useioff=1 */;
|
inout USBWireVP /* synthesis useioff=1 */;
|
inout USBWireVM /* synthesis useioff=1 */;
|
inout USBWireVM /* synthesis useioff=1 */;
|
output USBWireOE_n /* synthesis useioff=1 */;
|
output USBWireOE_n /* synthesis useioff=1 */;
|
output USBFullSpeed /* synthesis useioff=1 */;
|
output USBFullSpeed /* synthesis useioff=1 */;
|
|
|
wire clk_i;
|
wire clk_i;
|
wire rst_i;
|
wire rst_i;
|
wire [7:0] address_i;
|
wire [7:0] address_i;
|
wire [7:0] data_i;
|
wire [7:0] data_i;
|
wire [7:0] data_o;
|
wire [7:0] data_o;
|
wire irq;
|
wire irq;
|
wire usbClk;
|
wire usbClk;
|
wire USBWireDataOutTick;
|
wire USBWireDataOutTick;
|
wire USBWireDataInTick;
|
wire USBWireDataInTick;
|
wire USBFullSpeed;
|
wire USBFullSpeed;
|
|
|
//internal wiring
|
//internal wiring
|
wire hostSOFSentIntOut;
|
wire hostSOFSentIntOut;
|
wire hostConnEventIntOut;
|
wire hostConnEventIntOut;
|
wire hostResumeIntOut;
|
wire hostResumeIntOut;
|
wire hostTransDoneIntOut;
|
wire hostTransDoneIntOut;
|
wire slaveSOFRxedIntOut;
|
wire slaveSOFRxedIntOut;
|
wire slaveResetEventIntOut;
|
wire slaveResetEventIntOut;
|
wire slaveResumeIntOut;
|
wire slaveResumeIntOut;
|
wire slaveTransDoneIntOut;
|
wire slaveTransDoneIntOut;
|
wire slaveNAKSentIntOut;
|
wire slaveNAKSentIntOut;
|
wire USBWireCtrlOut;
|
wire USBWireCtrlOut;
|
wire [1:0] USBWireDataIn;
|
wire [1:0] USBWireDataIn;
|
wire [1:0] USBWireDataOut;
|
wire [1:0] USBWireDataOut;
|
|
|
|
|
assign irq = hostSOFSentIntOut | hostConnEventIntOut |
|
assign irq = hostSOFSentIntOut | hostConnEventIntOut |
|
hostResumeIntOut | hostTransDoneIntOut |
|
hostResumeIntOut | hostTransDoneIntOut |
|
slaveSOFRxedIntOut | slaveResetEventIntOut |
|
slaveSOFRxedIntOut | slaveResetEventIntOut |
|
slaveResumeIntOut | slaveTransDoneIntOut |
|
slaveResumeIntOut | slaveTransDoneIntOut |
|
slaveNAKSentIntOut;
|
slaveNAKSentIntOut;
|
|
|
assign USBWireDataIn = {USBWireVP, USBWireVM};
|
assign USBWireDataIn = {USBWireVP, USBWireVM};
|
assign {USBWireVP, USBWireVM} = (USBWireCtrlOut == 1'b1) ? USBWireDataOut : 2'bzz;
|
assign {USBWireVP, USBWireVM} = (USBWireCtrlOut == 1'b1) ? USBWireDataOut : 2'bzz;
|
assign USBWireOE_n = ~USBWireCtrlOut;
|
assign USBWireOE_n = ~USBWireCtrlOut;
|
|
|
//Parameters declaration:
|
//Parameters declaration:
|
defparam usbHostSlaveInst.HOST_FIFO_DEPTH = 64;
|
defparam usbHostSlaveInst.HOST_FIFO_DEPTH = 64;
|
parameter HOST_FIFO_DEPTH = 64;
|
parameter HOST_FIFO_DEPTH = 64;
|
defparam usbHostSlaveInst.HOST_FIFO_ADDR_WIDTH = 6;
|
defparam usbHostSlaveInst.HOST_FIFO_ADDR_WIDTH = 6;
|
parameter HOST_FIFO_ADDR_WIDTH = 6;
|
parameter HOST_FIFO_ADDR_WIDTH = 6;
|
defparam usbHostSlaveInst.EP0_FIFO_DEPTH = 64;
|
defparam usbHostSlaveInst.EP0_FIFO_DEPTH = 64;
|
parameter EP0_FIFO_DEPTH = 64;
|
parameter EP0_FIFO_DEPTH = 64;
|
defparam usbHostSlaveInst.EP0_FIFO_ADDR_WIDTH = 6;
|
defparam usbHostSlaveInst.EP0_FIFO_ADDR_WIDTH = 6;
|
parameter EP0_FIFO_ADDR_WIDTH = 6;
|
parameter EP0_FIFO_ADDR_WIDTH = 6;
|
defparam usbHostSlaveInst.EP1_FIFO_DEPTH = 64;
|
defparam usbHostSlaveInst.EP1_FIFO_DEPTH = 64;
|
parameter EP1_FIFO_DEPTH = 64;
|
parameter EP1_FIFO_DEPTH = 64;
|
defparam usbHostSlaveInst.EP1_FIFO_ADDR_WIDTH = 6;
|
defparam usbHostSlaveInst.EP1_FIFO_ADDR_WIDTH = 6;
|
parameter EP1_FIFO_ADDR_WIDTH = 6;
|
parameter EP1_FIFO_ADDR_WIDTH = 6;
|
defparam usbHostSlaveInst.EP2_FIFO_DEPTH = 64;
|
defparam usbHostSlaveInst.EP2_FIFO_DEPTH = 64;
|
parameter EP2_FIFO_DEPTH = 64;
|
parameter EP2_FIFO_DEPTH = 64;
|
defparam usbHostSlaveInst.EP2_FIFO_ADDR_WIDTH = 6;
|
defparam usbHostSlaveInst.EP2_FIFO_ADDR_WIDTH = 6;
|
parameter EP2_FIFO_ADDR_WIDTH = 6;
|
parameter EP2_FIFO_ADDR_WIDTH = 6;
|
defparam usbHostSlaveInst.EP3_FIFO_DEPTH = 64;
|
defparam usbHostSlaveInst.EP3_FIFO_DEPTH = 64;
|
parameter EP3_FIFO_DEPTH = 64;
|
parameter EP3_FIFO_DEPTH = 64;
|
defparam usbHostSlaveInst.EP3_FIFO_ADDR_WIDTH = 6;
|
defparam usbHostSlaveInst.EP3_FIFO_ADDR_WIDTH = 6;
|
parameter EP3_FIFO_ADDR_WIDTH = 6;
|
parameter EP3_FIFO_ADDR_WIDTH = 6;
|
usbHostSlave usbHostSlaveInst (
|
usbHostSlave usbHostSlaveInst (
|
.clk_i(clk_i),
|
.clk_i(clk_i),
|
.rst_i(rst_i),
|
.rst_i(rst_i),
|
.address_i(address_i),
|
.address_i(address_i),
|
.data_i(data_i),
|
.data_i(data_i),
|
.data_o(data_o),
|
.data_o(data_o),
|
.we_i(we_i),
|
.we_i(we_i),
|
.strobe_i(strobe_i),
|
.strobe_i(strobe_i),
|
.ack_o(ack_o),
|
.ack_o(ack_o),
|
.usbClk(usbClk),
|
.usbClk(usbClk),
|
.hostSOFSentIntOut(hostSOFSentIntOut),
|
.hostSOFSentIntOut(hostSOFSentIntOut),
|
.hostConnEventIntOut(hostConnEventIntOut),
|
.hostConnEventIntOut(hostConnEventIntOut),
|
.hostResumeIntOut(hostResumeIntOut),
|
.hostResumeIntOut(hostResumeIntOut),
|
.hostTransDoneIntOut(hostTransDoneIntOut),
|
.hostTransDoneIntOut(hostTransDoneIntOut),
|
.slaveSOFRxedIntOut(slaveSOFRxedIntOut),
|
.slaveSOFRxedIntOut(slaveSOFRxedIntOut),
|
.slaveResetEventIntOut(slaveResetEventIntOut),
|
.slaveResetEventIntOut(slaveResetEventIntOut),
|
.slaveResumeIntOut(slaveResumeIntOut),
|
.slaveResumeIntOut(slaveResumeIntOut),
|
.slaveTransDoneIntOut(slaveTransDoneIntOut),
|
.slaveTransDoneIntOut(slaveTransDoneIntOut),
|
.slaveNAKSentIntOut(slaveNAKSentIntOut),
|
.slaveNAKSentIntOut(slaveNAKSentIntOut),
|
.USBWireDataIn(USBWireDataIn),
|
.USBWireDataIn(USBWireDataIn),
|
.USBWireDataInTick(USBWireDataInTick),
|
.USBWireDataInTick(USBWireDataInTick),
|
.USBWireDataOut(USBWireDataOut),
|
.USBWireDataOut(USBWireDataOut),
|
.USBWireDataOutTick(USBWireDataOutTick),
|
.USBWireDataOutTick(USBWireDataOutTick),
|
.USBWireCtrlOut(USBWireCtrlOut),
|
.USBWireCtrlOut(USBWireCtrlOut),
|
.USBFullSpeed(USBFullSpeed));
|
.USBFullSpeed(USBFullSpeed));
|
|
|
|
|
endmodule
|
endmodule
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|