Line 1... |
Line 1... |
|
|
|
// File : ../RTL/hostController/sendpacketcheckpreamble.v
|
|
// Generated : 10/06/06 19:35:27
|
|
// From : ../RTL/hostController/sendpacketcheckpreamble.asf
|
|
// By : FSM2VHDL ver. 5.0.0.9
|
|
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// sendpacketcheckpreamble
|
//// sendpacketcheckpreamble
|
//// ////
|
//// ////
|
//// 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"
|
|
|
module sendPacketCheckPreamble (clk, preAmbleEnable, rst, sendPacketCPPID, sendPacketCPReady, sendPacketCPWEn, sendPacketPID, sendPacketRdy, sendPacketWEn);
|
module sendPacketCheckPreamble (clk, preAmbleEnable, rst, sendPacketCPPID, sendPacketCPReady, sendPacketCPWEn, sendPacketPID, sendPacketRdy, sendPacketWEn);
|
input clk;
|
input clk;
|
input preAmbleEnable;
|
input preAmbleEnable;
|
Line 81... |
Line 86... |
`define REG_PKT_WAIT_RDY 4'b1010
|
`define REG_PKT_WAIT_RDY 4'b1010
|
`define READY 4'b1011
|
`define READY 4'b1011
|
`define PREAM_PKT_WAIT_RDY2 4'b1100
|
`define PREAM_PKT_WAIT_RDY2 4'b1100
|
`define PREAM_PKT_WAIT_RDY3 4'b1101
|
`define PREAM_PKT_WAIT_RDY3 4'b1101
|
|
|
reg [3:0]CurrState_sendPktCP, NextState_sendPktCP;
|
reg [3:0] CurrState_sendPktCP;
|
|
reg [3:0] NextState_sendPktCP;
|
|
|
|
|
|
//--------------------------------------------------------------------
|
// Machine: sendPktCP
|
// Machine: sendPktCP
|
|
//--------------------------------------------------------------------
|
// NextState logic (combinatorial)
|
//----------------------------------
|
always @ (sendPacketCPWEn or preAmbleEnable or sendPacketRdy or sendPacketCPPID or sendPacketCPReady or sendPacketWEn or sendPacketPID or CurrState_sendPktCP)
|
// Next State Logic (combinatorial)
|
begin
|
//----------------------------------
|
|
always @ (sendPacketCPPID or sendPacketCPWEn or preAmbleEnable or sendPacketRdy or sendPacketCPReady or sendPacketWEn or sendPacketPID or CurrState_sendPktCP)
|
|
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;
|
case (CurrState_sendPktCP) // synopsys parallel_case full_case
|
case (CurrState_sendPktCP)
|
`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 130... |
Line 129... |
next_sendPacketWEn <= 1'b1;
|
next_sendPacketWEn <= 1'b1;
|
next_sendPacketPID <= `PREAMBLE;
|
next_sendPacketPID <= `PREAMBLE;
|
NextState_sendPktCP <= `PREAM_PKT_PREAM_SENT;
|
NextState_sendPktCP <= `PREAM_PKT_PREAM_SENT;
|
end
|
end
|
`PREAM_PKT_WAIT_RDY1:
|
`PREAM_PKT_WAIT_RDY1:
|
begin
|
|
if (sendPacketRdy == 1'b1)
|
if (sendPacketRdy == 1'b1)
|
begin
|
|
NextState_sendPktCP <= `PREAM_PKT_SND_PREAM;
|
NextState_sendPktCP <= `PREAM_PKT_SND_PREAM;
|
end
|
|
end
|
|
`PREAM_PKT_PREAM_SENT:
|
`PREAM_PKT_PREAM_SENT:
|
begin
|
begin
|
next_sendPacketWEn <= 1'b0;
|
next_sendPacketWEn <= 1'b0;
|
NextState_sendPktCP <= `PREAM_PKT_WAIT_RDY2;
|
NextState_sendPktCP <= `PREAM_PKT_WAIT_RDY2;
|
end
|
end
|
Line 153... |
Line 148... |
begin
|
begin
|
next_sendPacketWEn <= 1'b0;
|
next_sendPacketWEn <= 1'b0;
|
NextState_sendPktCP <= `PREAM_PKT_WAIT_RDY3;
|
NextState_sendPktCP <= `PREAM_PKT_WAIT_RDY3;
|
end
|
end
|
`PREAM_PKT_WAIT_RDY2:
|
`PREAM_PKT_WAIT_RDY2:
|
begin
|
|
if (sendPacketRdy == 1'b1)
|
if (sendPacketRdy == 1'b1)
|
begin
|
|
NextState_sendPktCP <= `PREAM_PKT_SND_PID;
|
NextState_sendPktCP <= `PREAM_PKT_SND_PID;
|
end
|
|
end
|
|
`PREAM_PKT_WAIT_RDY3:
|
`PREAM_PKT_WAIT_RDY3:
|
begin
|
|
if (sendPacketRdy == 1'b1)
|
if (sendPacketRdy == 1'b1)
|
begin
|
|
NextState_sendPktCP <= `READY;
|
NextState_sendPktCP <= `READY;
|
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
|
begin : sendPktCP_CurrentState
|
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
|
begin : sendPktCP_RegOutput
|
if (rst)
|
if (rst)
|
begin
|
begin
|
sendPacketCPReady <= 1'b1;
|
|
sendPacketWEn <= 1'b0;
|
sendPacketWEn <= 1'b0;
|
sendPacketPID <= 4'b0;
|
sendPacketPID <= 4'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;
|
|
sendPacketCPReady <= next_sendPacketCPReady;
|
end
|
end
|
end
|
end
|
|
|
endmodule
|
endmodule
|
No newline at end of file
|
No newline at end of file
|