Line 1... |
Line 1... |
|
|
|
// File : ../RTL/serialInterfaceEngine/usbTxWireArbiter.v
|
|
// Generated : 10/06/06 19:35:31
|
|
// From : ../RTL/serialInterfaceEngine/usbTxWireArbiter.asf
|
|
// By : FSM2VHDL ver. 5.0.0.9
|
|
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// usbTxWireArbiter
|
//// usbTxWireArbiter
|
//// ////
|
//// ////
|
//// This file is part of the usbhostslave opencores effort.
|
//// This file is part of the usbhostslave opencores effort.
|
Line 40... |
Line 45... |
//// 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 ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
`timescale 1ns / 1ps
|
`include "timescale.v"
|
`include "usbConstants_h.v"
|
`include "usbConstants_h.v"
|
`include "usbSerialInterfaceEngine_h.v"
|
`include "usbSerialInterfaceEngine_h.v"
|
|
|
|
|
|
|
module USBTxWireArbiter (clk, prcTxByteCtrl, prcTxByteData, prcTxByteFSRate, prcTxByteGnt, prcTxByteReq, prcTxByteWEn, rst, SIETxCtrl, SIETxData, SIETxFSRate, SIETxGnt, SIETxReq, SIETxWEn, TxBits, TxCtl, TxFSRate, USBWireRdyIn, USBWireRdyOut, USBWireWEn);
|
module USBTxWireArbiter (SIETxCtrl, SIETxData, SIETxFSRate, SIETxGnt, SIETxReq, SIETxWEn, TxBits, TxCtl, TxFSRate, USBWireRdyIn, USBWireRdyOut, USBWireWEn, clk, prcTxByteCtrl, prcTxByteData, prcTxByteFSRate, prcTxByteGnt, prcTxByteReq, prcTxByteWEn, rst);
|
|
input SIETxCtrl;
|
|
input [1:0] SIETxData;
|
|
input SIETxFSRate;
|
|
input SIETxReq;
|
|
input SIETxWEn;
|
|
input USBWireRdyIn;
|
input clk;
|
input clk;
|
input prcTxByteCtrl;
|
input prcTxByteCtrl;
|
input [1:0]prcTxByteData;
|
input [1:0]prcTxByteData;
|
input prcTxByteFSRate;
|
input prcTxByteFSRate;
|
input prcTxByteReq;
|
input prcTxByteReq;
|
input prcTxByteWEn;
|
input prcTxByteWEn;
|
input rst;
|
input rst;
|
input SIETxCtrl;
|
|
input [1:0]SIETxData;
|
|
input SIETxFSRate;
|
|
input SIETxReq;
|
|
input SIETxWEn;
|
|
input USBWireRdyIn;
|
|
output prcTxByteGnt;
|
|
output SIETxGnt;
|
output SIETxGnt;
|
output [1:0]TxBits;
|
output [1:0]TxBits;
|
output TxCtl;
|
output TxCtl;
|
output TxFSRate;
|
output TxFSRate;
|
output USBWireRdyOut;
|
output USBWireRdyOut;
|
output USBWireWEn;
|
output USBWireWEn;
|
|
output prcTxByteGnt;
|
|
|
wire clk;
|
|
wire prcTxByteCtrl;
|
|
wire [1:0]prcTxByteData;
|
|
wire prcTxByteFSRate;
|
|
reg prcTxByteGnt, next_prcTxByteGnt;
|
|
wire prcTxByteReq;
|
|
wire prcTxByteWEn;
|
|
wire rst;
|
|
wire SIETxCtrl;
|
wire SIETxCtrl;
|
wire [1:0]SIETxData;
|
wire [1:0]SIETxData;
|
wire SIETxFSRate;
|
wire SIETxFSRate;
|
reg SIETxGnt, next_SIETxGnt;
|
reg SIETxGnt, next_SIETxGnt;
|
wire SIETxReq;
|
wire SIETxReq;
|
Line 88... |
Line 85... |
reg TxCtl, next_TxCtl;
|
reg TxCtl, next_TxCtl;
|
reg TxFSRate, next_TxFSRate;
|
reg TxFSRate, next_TxFSRate;
|
wire USBWireRdyIn;
|
wire USBWireRdyIn;
|
reg USBWireRdyOut, next_USBWireRdyOut;
|
reg USBWireRdyOut, next_USBWireRdyOut;
|
reg USBWireWEn, next_USBWireWEn;
|
reg USBWireWEn, next_USBWireWEn;
|
|
wire clk;
|
|
wire prcTxByteCtrl;
|
|
wire [1:0] prcTxByteData;
|
|
wire prcTxByteFSRate;
|
|
reg prcTxByteGnt, next_prcTxByteGnt;
|
|
wire prcTxByteReq;
|
|
wire prcTxByteWEn;
|
|
wire rst;
|
|
|
// diagram signals declarations
|
// diagram signals declarations
|
reg muxSIENotPTXB, next_muxSIENotPTXB;
|
reg muxSIENotPTXB, next_muxSIENotPTXB;
|
|
|
// BINARY ENCODED state machine: txWireArb
|
// BINARY ENCODED state machine: txWireArb
|
Line 99... |
Line 104... |
`define START_TARB 2'b00
|
`define START_TARB 2'b00
|
`define TARB_WAIT_REQ 2'b01
|
`define TARB_WAIT_REQ 2'b01
|
`define PTXB_ACT 2'b10
|
`define PTXB_ACT 2'b10
|
`define SIE_TX_ACT 2'b11
|
`define SIE_TX_ACT 2'b11
|
|
|
reg [1:0]CurrState_txWireArb, NextState_txWireArb;
|
reg [1:0] CurrState_txWireArb;
|
|
reg [1:0] NextState_txWireArb;
|
|
|
// Diagram actions (continuous assignments allowed only: assign ...)
|
// Diagram actions (continuous assignments allowed only: assign ...)
|
|
|
// processTxByte/SIETransmitter mux
|
// processTxByte/SIETransmitter mux
|
always @(USBWireRdyIn)
|
always @(USBWireRdyIn)
|
begin
|
begin
|
USBWireRdyOut <= USBWireRdyIn;
|
USBWireRdyOut <= USBWireRdyIn;
|
end
|
end
|
Line 127... |
Line 134... |
TxCtl <= prcTxByteCtrl;
|
TxCtl <= prcTxByteCtrl;
|
TxFSRate <= prcTxByteFSRate;
|
TxFSRate <= prcTxByteFSRate;
|
end
|
end
|
end
|
end
|
|
|
|
//--------------------------------------------------------------------
|
// Machine: txWireArb
|
// Machine: txWireArb
|
|
//--------------------------------------------------------------------
|
// NextState logic (combinatorial)
|
//----------------------------------
|
always @ (prcTxByteReq or SIETxReq or prcTxByteGnt or SIETxGnt or muxSIENotPTXB or CurrState_txWireArb)
|
// Next State Logic (combinatorial)
|
begin
|
//----------------------------------
|
|
always @ (prcTxByteReq or SIETxReq or prcTxByteGnt or muxSIENotPTXB or SIETxGnt or CurrState_txWireArb)
|
|
begin : txWireArb_NextState
|
NextState_txWireArb <= CurrState_txWireArb;
|
NextState_txWireArb <= CurrState_txWireArb;
|
// Set default values for outputs and signals
|
// Set default values for outputs and signals
|
next_prcTxByteGnt <= prcTxByteGnt;
|
next_prcTxByteGnt <= prcTxByteGnt;
|
next_SIETxGnt <= SIETxGnt;
|
|
next_muxSIENotPTXB <= muxSIENotPTXB;
|
next_muxSIENotPTXB <= muxSIENotPTXB;
|
case (CurrState_txWireArb) // synopsys parallel_case full_case
|
next_SIETxGnt <= SIETxGnt;
|
|
case (CurrState_txWireArb)
|
`START_TARB:
|
`START_TARB:
|
begin
|
|
NextState_txWireArb <= `TARB_WAIT_REQ;
|
NextState_txWireArb <= `TARB_WAIT_REQ;
|
end
|
|
`TARB_WAIT_REQ:
|
`TARB_WAIT_REQ:
|
begin
|
|
if (prcTxByteReq == 1'b1)
|
if (prcTxByteReq == 1'b1)
|
begin
|
begin
|
NextState_txWireArb <= `PTXB_ACT;
|
NextState_txWireArb <= `PTXB_ACT;
|
next_prcTxByteGnt <= 1'b1;
|
next_prcTxByteGnt <= 1'b1;
|
next_muxSIENotPTXB <= 1'b0;
|
next_muxSIENotPTXB <= 1'b0;
|
Line 157... |
Line 163... |
begin
|
begin
|
NextState_txWireArb <= `SIE_TX_ACT;
|
NextState_txWireArb <= `SIE_TX_ACT;
|
next_SIETxGnt <= 1'b1;
|
next_SIETxGnt <= 1'b1;
|
next_muxSIENotPTXB <= 1'b1;
|
next_muxSIENotPTXB <= 1'b1;
|
end
|
end
|
end
|
|
`PTXB_ACT:
|
`PTXB_ACT:
|
begin
|
|
if (prcTxByteReq == 1'b0)
|
if (prcTxByteReq == 1'b0)
|
begin
|
begin
|
NextState_txWireArb <= `TARB_WAIT_REQ;
|
NextState_txWireArb <= `TARB_WAIT_REQ;
|
next_prcTxByteGnt <= 1'b0;
|
next_prcTxByteGnt <= 1'b0;
|
end
|
end
|
end
|
|
`SIE_TX_ACT:
|
`SIE_TX_ACT:
|
begin
|
|
if (SIETxReq == 1'b0)
|
if (SIETxReq == 1'b0)
|
begin
|
begin
|
NextState_txWireArb <= `TARB_WAIT_REQ;
|
NextState_txWireArb <= `TARB_WAIT_REQ;
|
next_SIETxGnt <= 1'b0;
|
next_SIETxGnt <= 1'b0;
|
end
|
end
|
end
|
|
endcase
|
endcase
|
end
|
end
|
|
|
|
//----------------------------------
|
// Current State Logic (sequential)
|
// Current State Logic (sequential)
|
|
//----------------------------------
|
always @ (posedge clk)
|
always @ (posedge clk)
|
begin
|
begin : txWireArb_CurrentState
|
if (rst)
|
if (rst)
|
CurrState_txWireArb <= `START_TARB;
|
CurrState_txWireArb <= `START_TARB;
|
else
|
else
|
CurrState_txWireArb <= NextState_txWireArb;
|
CurrState_txWireArb <= NextState_txWireArb;
|
end
|
end
|
|
|
|
//----------------------------------
|
// Registered outputs logic
|
// Registered outputs logic
|
|
//----------------------------------
|
always @ (posedge clk)
|
always @ (posedge clk)
|
begin
|
begin : txWireArb_RegOutput
|
if (rst)
|
if (rst)
|
begin
|
begin
|
|
muxSIENotPTXB <= 1'b0;
|
prcTxByteGnt <= 1'b0;
|
prcTxByteGnt <= 1'b0;
|
SIETxGnt <= 1'b0;
|
SIETxGnt <= 1'b0;
|
muxSIENotPTXB <= 1'b0;
|
|
end
|
end
|
else
|
else
|
begin
|
begin
|
|
muxSIENotPTXB <= next_muxSIENotPTXB;
|
prcTxByteGnt <= next_prcTxByteGnt;
|
prcTxByteGnt <= next_prcTxByteGnt;
|
SIETxGnt <= next_SIETxGnt;
|
SIETxGnt <= next_SIETxGnt;
|
muxSIENotPTXB <= next_muxSIENotPTXB;
|
|
end
|
end
|
end
|
end
|
|
|
endmodule
|
endmodule
|
No newline at end of file
|
No newline at end of file
|