Line 1... |
Line 1... |
//--------------------------------------------------------------------------------------------------
|
|
//
|
//////////////////////////////////////////////////////////////////////
|
// Title : No Title
|
//// ////
|
// Design : usbhostslave
|
//// sendpacketcheckpreamble
|
// 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\sendpacketcheckpreamble.v
|
// $Id: sendpacketcheckpreamble.v,v 1.2 2004-12-18 14:36:11 sfielding Exp $
|
// Generated : 09/10/04 20:20:24
|
|
// From : c:\projects\USBHostSlave\RTL\hostController\sendpacketcheckpreamble.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"
|
|
|
module sendPacketCheckPreamble (clk, fullSpeedBitRate, fullSpeedPolarity, grabLineControl, preAmbleEnable, rst, sendPacketCPPID, sendPacketCPReady, sendPacketCPWEn, sendPacketPID, sendPacketRdy, sendPacketWEn);
|
module sendPacketCheckPreamble (clk, fullSpeedBitRate, fullSpeedPolarity, grabLineControl, preAmbleEnable, rst, sendPacketCPPID, sendPacketCPReady, sendPacketCPWEn, sendPacketPID, sendPacketRdy, sendPacketWEn);
|
input clk;
|
input clk;
|
Line 61... |
Line 91... |
`define REG_PKT_SEND_PID 4'b1000
|
`define REG_PKT_SEND_PID 4'b1000
|
`define REG_PKT_WAIT_RDY1 4'b1001
|
`define REG_PKT_WAIT_RDY1 4'b1001
|
`define REG_PKT_WAIT_RDY 4'b1010
|
`define REG_PKT_WAIT_RDY 4'b1010
|
`define READY 4'b1011
|
`define READY 4'b1011
|
|
|
reg [3:0] CurrState_sendPktCP;
|
reg [3:0]CurrState_sendPktCP, NextState_sendPktCP;
|
reg [3:0] NextState_sendPktCP;
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
// Machine: sendPktCP
|
// Machine: sendPktCP
|
//--------------------------------------------------------------------
|
|
//----------------------------------
|
|
// NextState logic (combinatorial)
|
// NextState logic (combinatorial)
|
//----------------------------------
|
always @ (sendPacketCPWEn or preAmbleEnable or sendPacketRdy or sendPacketCPPID or sendPacketCPReady or sendPacketWEn or sendPacketPID or fullSpeedBitRate or fullSpeedPolarity or grabLineControl or CurrState_sendPktCP)
|
always @ (sendPacketCPPID or sendPacketCPWEn or preAmbleEnable or sendPacketRdy or sendPacketCPReady or sendPacketWEn or sendPacketPID or fullSpeedBitRate or fullSpeedPolarity or grabLineControl or CurrState_sendPktCP)
|
begin
|
begin : sendPktCP_NextState
|
|
NextState_sendPktCP <= CurrState_sendPktCP;
|
NextState_sendPktCP <= CurrState_sendPktCP;
|
// Set default values for outputs and signals
|
// Set default values for outputs and signals
|
next_sendPacketCPReady <= sendPacketCPReady;
|
next_sendPacketCPReady <= sendPacketCPReady;
|
next_sendPacketWEn <= sendPacketWEn;
|
next_sendPacketWEn <= sendPacketWEn;
|
next_sendPacketPID <= sendPacketPID;
|
next_sendPacketPID <= sendPacketPID;
|
next_fullSpeedBitRate <= fullSpeedBitRate;
|
next_fullSpeedBitRate <= fullSpeedBitRate;
|
next_fullSpeedPolarity <= fullSpeedPolarity;
|
next_fullSpeedPolarity <= fullSpeedPolarity;
|
next_grabLineControl <= grabLineControl;
|
next_grabLineControl <= grabLineControl;
|
case (CurrState_sendPktCP) // synopsys parallel_case full_case
|
case (CurrState_sendPktCP) // synopsys parallel_case full_case
|
`SPC_WAIT_EN:
|
`SPC_WAIT_EN:
|
|
begin
|
if (sendPacketCPWEn == 1'b1)
|
if (sendPacketCPWEn == 1'b1)
|
begin
|
begin
|
NextState_sendPktCP <= `CHK_PREAM;
|
NextState_sendPktCP <= `CHK_PREAM;
|
next_sendPacketCPReady <= 1'b0;
|
next_sendPacketCPReady <= 1'b0;
|
end
|
end
|
|
end
|
`START_SPC:
|
`START_SPC:
|
|
begin
|
NextState_sendPktCP <= `SPC_WAIT_EN;
|
NextState_sendPktCP <= `SPC_WAIT_EN;
|
|
end
|
`CHK_PREAM:
|
`CHK_PREAM:
|
|
begin
|
if (preAmbleEnable == 1'b1)
|
if (preAmbleEnable == 1'b1)
|
|
begin
|
NextState_sendPktCP <= `PREAM_PKT_WAIT_RDY1;
|
NextState_sendPktCP <= `PREAM_PKT_WAIT_RDY1;
|
|
end
|
else
|
else
|
|
begin
|
NextState_sendPktCP <= `REG_PKT_WAIT_RDY1;
|
NextState_sendPktCP <= `REG_PKT_WAIT_RDY1;
|
|
end
|
|
end
|
`READY:
|
`READY:
|
begin
|
begin
|
next_sendPacketCPReady <= 1'b1;
|
next_sendPacketCPReady <= 1'b1;
|
NextState_sendPktCP <= `SPC_WAIT_EN;
|
NextState_sendPktCP <= `SPC_WAIT_EN;
|
end
|
end
|
Line 108... |
Line 144... |
next_sendPacketPID <= `PREAMBLE;
|
next_sendPacketPID <= `PREAMBLE;
|
NextState_sendPktCP <= `PREAM_PKT_WAIT_RDY2;
|
NextState_sendPktCP <= `PREAM_PKT_WAIT_RDY2;
|
next_sendPacketWEn <= 1'b0;
|
next_sendPacketWEn <= 1'b0;
|
end
|
end
|
`PREAM_PKT_WAIT_RDY1:
|
`PREAM_PKT_WAIT_RDY1:
|
|
begin
|
if (sendPacketRdy == 1'b1)
|
if (sendPacketRdy == 1'b1)
|
begin
|
begin
|
NextState_sendPktCP <= `PREAM_PKT_SND_PREAM;
|
NextState_sendPktCP <= `PREAM_PKT_SND_PREAM;
|
next_fullSpeedBitRate <= 1'b1;
|
next_fullSpeedBitRate <= 1'b1;
|
next_fullSpeedPolarity <= 1'b1;
|
next_fullSpeedPolarity <= 1'b1;
|
next_grabLineControl <= 1'b1;
|
next_grabLineControl <= 1'b1;
|
end
|
end
|
|
end
|
`PREAM_PKT_WAIT_RDY2:
|
`PREAM_PKT_WAIT_RDY2:
|
|
begin
|
if (sendPacketRdy == 1'b1)
|
if (sendPacketRdy == 1'b1)
|
begin
|
begin
|
NextState_sendPktCP <= `PREAM_PKT_SND_PID;
|
NextState_sendPktCP <= `PREAM_PKT_SND_PID;
|
next_fullSpeedBitRate <= 1'b1;
|
next_fullSpeedBitRate <= 1'b1;
|
end
|
end
|
|
end
|
`PREAM_PKT_SND_PID:
|
`PREAM_PKT_SND_PID:
|
begin
|
begin
|
next_sendPacketWEn <= 1'b1;
|
next_sendPacketWEn <= 1'b1;
|
next_sendPacketPID <= sendPacketCPPID;
|
next_sendPacketPID <= sendPacketCPPID;
|
NextState_sendPktCP <= `PREAM_PKT_WAIT_RDY3;
|
NextState_sendPktCP <= `PREAM_PKT_WAIT_RDY3;
|
next_sendPacketWEn <= 1'b0;
|
next_sendPacketWEn <= 1'b0;
|
end
|
end
|
`PREAM_PKT_WAIT_RDY3:
|
`PREAM_PKT_WAIT_RDY3:
|
|
begin
|
if (sendPacketRdy == 1'b1)
|
if (sendPacketRdy == 1'b1)
|
begin
|
begin
|
NextState_sendPktCP <= `READY;
|
NextState_sendPktCP <= `READY;
|
next_grabLineControl <= 1'b0;
|
next_grabLineControl <= 1'b0;
|
end
|
end
|
|
end
|
`REG_PKT_SEND_PID:
|
`REG_PKT_SEND_PID:
|
begin
|
begin
|
next_sendPacketWEn <= 1'b1;
|
next_sendPacketWEn <= 1'b1;
|
next_sendPacketPID <= sendPacketCPPID;
|
next_sendPacketPID <= sendPacketCPPID;
|
NextState_sendPktCP <= `REG_PKT_WAIT_RDY;
|
NextState_sendPktCP <= `REG_PKT_WAIT_RDY;
|
end
|
end
|
`REG_PKT_WAIT_RDY1:
|
`REG_PKT_WAIT_RDY1:
|
|
begin
|
if (sendPacketRdy == 1'b1)
|
if (sendPacketRdy == 1'b1)
|
|
begin
|
NextState_sendPktCP <= `REG_PKT_SEND_PID;
|
NextState_sendPktCP <= `REG_PKT_SEND_PID;
|
|
end
|
|
end
|
`REG_PKT_WAIT_RDY:
|
`REG_PKT_WAIT_RDY:
|
begin
|
begin
|
next_sendPacketWEn <= 1'b0;
|
next_sendPacketWEn <= 1'b0;
|
NextState_sendPktCP <= `READY;
|
NextState_sendPktCP <= `READY;
|
end
|
end
|
endcase
|
endcase
|
end
|
end
|
|
|
//----------------------------------
|
|
// Current State Logic (sequential)
|
// Current State Logic (sequential)
|
//----------------------------------
|
|
always @ (posedge clk)
|
always @ (posedge clk)
|
begin : sendPktCP_CurrentState
|
begin
|
if (rst)
|
if (rst)
|
CurrState_sendPktCP <= `START_SPC;
|
CurrState_sendPktCP <= `START_SPC;
|
else
|
else
|
CurrState_sendPktCP <= NextState_sendPktCP;
|
CurrState_sendPktCP <= NextState_sendPktCP;
|
end
|
end
|
|
|
//----------------------------------
|
|
// Registered outputs logic
|
// Registered outputs logic
|
//----------------------------------
|
|
always @ (posedge clk)
|
always @ (posedge clk)
|
begin : sendPktCP_RegOutput
|
begin
|
if (rst)
|
if (rst)
|
begin
|
begin
|
|
sendPacketCPReady <= 1'b1;
|
sendPacketWEn <= 1'b0;
|
sendPacketWEn <= 1'b0;
|
sendPacketPID <= 4'b0;
|
sendPacketPID <= 4'b0;
|
fullSpeedBitRate <= 1'b0;
|
fullSpeedBitRate <= 1'b0;
|
fullSpeedPolarity <= 1'b0;
|
fullSpeedPolarity <= 1'b0;
|
grabLineControl <= 1'b0;
|
grabLineControl <= 1'b0;
|
sendPacketCPReady <= 1'b1;
|
|
end
|
end
|
else
|
else
|
begin
|
begin
|
|
sendPacketCPReady <= next_sendPacketCPReady;
|
sendPacketWEn <= next_sendPacketWEn;
|
sendPacketWEn <= next_sendPacketWEn;
|
sendPacketPID <= next_sendPacketPID;
|
sendPacketPID <= next_sendPacketPID;
|
fullSpeedBitRate <= next_fullSpeedBitRate;
|
fullSpeedBitRate <= next_fullSpeedBitRate;
|
fullSpeedPolarity <= next_fullSpeedPolarity;
|
fullSpeedPolarity <= next_fullSpeedPolarity;
|
grabLineControl <= next_grabLineControl;
|
grabLineControl <= next_grabLineControl;
|
sendPacketCPReady <= next_sendPacketCPReady;
|
|
end
|
end
|
end
|
end
|
|
|
endmodule
|
endmodule
|
No newline at end of file
|
No newline at end of file
|