OpenCores
URL https://opencores.org/ocsvn/usbhostslave/usbhostslave/trunk

Subversion Repositories usbhostslave

[/] [usbhostslave/] [trunk/] [RTL/] [serialInterfaceEngine/] [usbTxWireArbiter.v] - Diff between revs 14 and 22

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 14 Rev 22
 
 
 
// 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.
//// http://www.opencores.org/cores/usbhostslave/                 ////
//// http://www.opencores.org/cores/usbhostslave/                 ////
////                                                              ////
////                                                              ////
//// Module Description:                                          ////
//// Module Description:                                          ////
//// 
//// 
////                                                              ////
////                                                              ////
//// To Do:                                                       ////
//// To Do:                                                       ////
//// 
//// 
////                                                              ////
////                                                              ////
//// Author(s):                                                   ////
//// Author(s):                                                   ////
//// - Steve Fielding, sfielding@base2designs.com                 ////
//// - Steve Fielding, sfielding@base2designs.com                 ////
////                                                              ////
////                                                              ////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////                                                              ////
////                                                              ////
//// Copyright (C) 2004 Steve Fielding and OPENCORES.ORG          ////
//// Copyright (C) 2004 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                     ////
////                                                              ////
////                                                              ////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
`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;
wire    SIETxWEn;
wire    SIETxWEn;
reg     [1:0]TxBits, next_TxBits;
reg     [1:0] TxBits, next_TxBits;
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
// State codes definitions:
// State codes definitions:
`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
always @(muxSIENotPTXB or SIETxWEn or SIETxData or
always @(muxSIENotPTXB or SIETxWEn or SIETxData or
SIETxCtrl or prcTxByteWEn or prcTxByteData or prcTxByteCtrl or
SIETxCtrl or prcTxByteWEn or prcTxByteData or prcTxByteCtrl or
SIETxFSRate or prcTxByteFSRate)
SIETxFSRate or prcTxByteFSRate)
begin
begin
if (muxSIENotPTXB  == 1'b1)
    if (muxSIENotPTXB  == 1'b1)
begin
    begin
USBWireWEn <= SIETxWEn;
        USBWireWEn <= SIETxWEn;
TxBits <= SIETxData;
        TxBits <= SIETxData;
TxCtl <= SIETxCtrl;
        TxCtl <= SIETxCtrl;
TxFSRate <= SIETxFSRate;
        TxFSRate <= SIETxFSRate;
end
    end
else
    else
begin
    begin
USBWireWEn <= prcTxByteWEn;
        USBWireWEn <= prcTxByteWEn;
TxBits <= prcTxByteData;
        TxBits <= prcTxByteData;
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;
      end
                        end
      else if (SIETxReq == 1'b1)
                        else if (SIETxReq == 1'b1)
      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
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.