Line 1... |
Line 1... |
//--------------------------------------------------------------------------------------------------
|
|
//
|
//////////////////////////////////////////////////////////////////////
|
// Title : No Title
|
//// ////
|
// Design : usbhostslave
|
//// usbTxWireArbiter
|
// Author :
|
//// ////
|
// Company :
|
//// This file is part of the usbhostslave opencores effort.
|
//
|
//// http://www.opencores.org/cores/usbhostslave/ ////
|
//-------------------------------------------------------------------------------------------------
|
//// ////
|
|
//// 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 ////
|
|
//// ////
|
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// File : c:\projects\USBHostSlave\Aldec\usbhostslave\usbhostslave\compile\usbTxWireArbiter.v
|
// $Id: usbTxWireArbiter.v,v 1.2 2004-12-18 14:36:16 sfielding Exp $
|
// Generated : 06/05/04 05:53:14
|
|
// From : c:\projects\USBHostSlave\RTL\serialInterfaceEngine\usbTxWireArbiter.asf
|
|
// By : FSM2VHDL ver. 4.0.3.8
|
|
//
|
//
|
//-------------------------------------------------------------------------------------------------
|
// CVS Revision History
|
//
|
//
|
// Description :
|
// $Log: not supported by cvs2svn $
|
//
|
//
|
//-------------------------------------------------------------------------------------------------
|
|
|
|
`timescale 1ns / 1ps
|
`timescale 1ns / 1ps
|
`include "usbConstants_h.v"
|
`include "usbConstants_h.v"
|
|
`include "usbSerialInterfaceEngine_h.v"
|
|
|
module USBWireTxArbiter (SIETxCtrl, SIETxData, SIETxGnt, SIETxReq, SIETxWEn, TxBits, TxCtl, USBWireRdyIn, USBWireRdyOut, USBWireWEn, clk, prcTxByteCtrl, prcTxByteData, prcTxByteGnt, prcTxByteReq, prcTxByteWEn, rst);
|
|
input SIETxCtrl;
|
|
input [1:0] SIETxData;
|
module USBWireTxArbiter (clk, prcTxByteCtrl, prcTxByteData, prcTxByteGnt, prcTxByteReq, prcTxByteWEn, rst, SIETxCtrl, SIETxData, SIETxGnt, SIETxReq, SIETxWEn, TxBits, TxCtl, USBWireRdyIn, USBWireRdyOut, USBWireWEn);
|
input SIETxReq;
|
|
input SIETxWEn;
|
|
input USBWireRdyIn;
|
|
input clk;
|
input clk;
|
input prcTxByteCtrl;
|
input prcTxByteCtrl;
|
input [1:0] prcTxByteData;
|
input [1:0] prcTxByteData;
|
input prcTxByteReq;
|
input prcTxByteReq;
|
input prcTxByteWEn;
|
input prcTxByteWEn;
|
input rst;
|
input rst;
|
|
input SIETxCtrl;
|
|
input [1:0]SIETxData;
|
|
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 USBWireRdyOut;
|
output USBWireRdyOut;
|
output USBWireWEn;
|
output USBWireWEn;
|
output prcTxByteGnt;
|
|
|
|
|
wire clk;
|
|
wire prcTxByteCtrl;
|
|
wire [1:0]prcTxByteData;
|
|
reg prcTxByteGnt, next_prcTxByteGnt;
|
|
wire prcTxByteReq;
|
|
wire prcTxByteWEn;
|
|
wire rst;
|
wire SIETxCtrl;
|
wire SIETxCtrl;
|
wire [1:0] SIETxData;
|
wire [1:0] SIETxData;
|
reg SIETxGnt, next_SIETxGnt;
|
reg SIETxGnt, next_SIETxGnt;
|
wire SIETxReq;
|
wire SIETxReq;
|
wire SIETxWEn;
|
wire SIETxWEn;
|
reg [1:0] TxBits, next_TxBits;
|
reg [1:0] TxBits, next_TxBits;
|
reg TxCtl, next_TxCtl;
|
reg TxCtl, next_TxCtl;
|
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;
|
|
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 66... |
Line 99... |
`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;
|
reg [1:0]CurrState_txWireArb, NextState_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
|
Line 93... |
Line 125... |
TxCtl <= prcTxByteCtrl;
|
TxCtl <= prcTxByteCtrl;
|
end
|
end
|
end
|
end
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// Machine: txWireArb
|
// Machine: txWireArb
|
//--------------------------------------------------------------------
|
|
//----------------------------------
|
|
// NextState logic (combinatorial)
|
// NextState logic (combinatorial)
|
//----------------------------------
|
always @ (prcTxByteReq or SIETxReq or prcTxByteGnt or SIETxGnt or muxSIENotPTXB or CurrState_txWireArb)
|
always @ (prcTxByteReq or SIETxReq or prcTxByteGnt or muxSIENotPTXB or SIETxGnt or CurrState_txWireArb)
|
begin
|
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_muxSIENotPTXB <= muxSIENotPTXB;
|
|
next_SIETxGnt <= SIETxGnt;
|
next_SIETxGnt <= SIETxGnt;
|
|
next_muxSIENotPTXB <= muxSIENotPTXB;
|
case (CurrState_txWireArb) // synopsys parallel_case full_case
|
case (CurrState_txWireArb) // synopsys parallel_case full_case
|
`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 122... |
Line 154... |
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 : txWireArb_CurrentState
|
begin
|
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 : txWireArb_RegOutput
|
begin
|
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
|