Line 59... |
Line 59... |
stRX_CB = 21'h000004,
|
stRX_CB = 21'h000004,
|
stRX_CC = 21'h000008,
|
stRX_CC = 21'h000008,
|
stRX_CD = 21'h000010,
|
stRX_CD = 21'h000010,
|
stRX_INVALID = 21'h000020,
|
stRX_INVALID = 21'h000020,
|
stIDLE_D = 21'h000040,
|
stIDLE_D = 21'h000040,
|
stCARRIER_DTEC = 21'h000080,
|
stFALSE_CARRIER = 21'h000080,
|
stFALSE_CARRIER = 21'h000100,
|
stSTART_OF_PKT = 21'h000100,
|
stSTART_OF_PKT = 21'h000200,
|
stEARLY_END = 21'h000200,
|
stRECEIVE = 21'h000400,
|
stTRI_RRI = 21'h000400,
|
stEARLY_END = 21'h000800,
|
stTRR_EXTEND = 21'h000800,
|
stTRI_RRI = 21'h001000,
|
stPKT_BURST_RRS = 21'h001000,
|
stTRR_EXTEND = 21'h002000,
|
stRX_DATA_ERR = 21'h002000,
|
stEPD2_CHK_END = 21'h004000,
|
stRX_DATA = 21'h004000,
|
stPKT_BURST_RRS = 21'h008000,
|
stEARLY_END_EXT = 21'h008000,
|
stRX_DATA_ERR = 21'h010000,
|
stEXT_ERROR = 21'h010000;
|
stRX_DATA = 21'h020000,
|
|
stEARLY_END_EXT = 21'h040000,
|
|
stEXT_ERROR = 21'h080000,
|
|
stLINK_FAILED = 21'h100000;
|
|
|
|
reg [20:00] r21_State;
|
|
reg [20:00] r21_NxtState;
|
|
|
|
|
reg [16:00] r17_State;
|
|
reg [16:00] r21_NxtState;
|
|
|
wire wSUDIK28_5;
|
wire wSUDIK28_5;
|
wire wSUDID21_5;
|
wire wSUDID21_5;
|
wire wSUDID2_2;
|
wire wSUDID2_2;
|
wire wCarrierDtect;//what is this
|
wire wCarrierDtect;//what is this
|
Line 96... |
Line 95... |
|
|
//synthesis translate_off
|
//synthesis translate_off
|
reg [8*30-1:0] rvStateName;
|
reg [8*30-1:0] rvStateName;
|
always@(*)
|
always@(*)
|
begin
|
begin
|
case(r21_State)
|
case(r17_State)
|
stWAIT_FOR_K : rvStateName <= "Wait For K";
|
stWAIT_FOR_K : rvStateName <= "Wait For K";
|
stRX_K : rvStateName <= "RX K";
|
stRX_K : rvStateName <= "RX K";
|
stRX_CB : rvStateName <= "RX CB";
|
stRX_CB : rvStateName <= "RX CB";
|
stRX_CC : rvStateName <= "RX CC";
|
stRX_CC : rvStateName <= "RX CC";
|
stRX_CD : rvStateName <= "RX CD";
|
stRX_CD : rvStateName <= "RX CD";
|
stRX_INVALID : rvStateName <= "RX Invalid";
|
stRX_INVALID : rvStateName <= "RX Invalid";
|
stIDLE_D : rvStateName <= "IDLE D";
|
stIDLE_D : rvStateName <= "IDLE D";
|
stCARRIER_DTEC : rvStateName <= "CARRIER DETECT";
|
//stCARRIER_DTEC : rvStateName <= "CARRIER DETECT";
|
stFALSE_CARRIER : rvStateName <= "FALSE CARRIER";
|
stFALSE_CARRIER : rvStateName <= "FALSE CARRIER";
|
stSTART_OF_PKT : rvStateName <= "Start of Packet";
|
stSTART_OF_PKT : rvStateName <= "Start of Packet";
|
stRECEIVE : rvStateName <= "Receiving";
|
//stRECEIVE : rvStateName <= "Receiving";
|
stEARLY_END : rvStateName <= "Early End";
|
stEARLY_END : rvStateName <= "Early End";
|
stTRI_RRI : rvStateName <= "TRI RRI";
|
stTRI_RRI : rvStateName <= "TRI RRI";
|
stTRR_EXTEND : rvStateName <= "TRR Extend";
|
stTRR_EXTEND : rvStateName <= "TRR Extend";
|
stEPD2_CHK_END : rvStateName <= "EPD2 Check End";
|
//stEPD2_CHK_END : rvStateName <= "EPD2 Check End";
|
stPKT_BURST_RRS : rvStateName <= "PKT BURST RRS";
|
stPKT_BURST_RRS : rvStateName <= "PKT BURST RRS";
|
stRX_DATA_ERR : rvStateName <= "RX DATA Error";
|
stRX_DATA_ERR : rvStateName <= "RX DATA Error";
|
stRX_DATA : rvStateName <= "RX DATA";
|
stRX_DATA : rvStateName <= "RX DATA";
|
stEARLY_END_EXT : rvStateName <= "Early End Ext";
|
stEARLY_END_EXT : rvStateName <= "Early End Ext";
|
stEXT_ERROR : rvStateName <= "Ext Error";
|
stEXT_ERROR : rvStateName <= "Ext Error";
|
stLINK_FAILED : rvStateName <= "Link Failed";
|
//stLINK_FAILED : rvStateName <= "Link Failed";
|
endcase
|
endcase
|
//$display("mReceive State: %s",rvStateName);
|
//$display("mReceive State: %s",rvStateName);
|
end
|
end
|
//synthesis translate_on
|
//synthesis translate_on
|
|
|
Line 130... |
Line 129... |
assign wSUDI = ~i_RxCodeInvalid;
|
assign wSUDI = ~i_RxCodeInvalid;
|
assign wCarrierDtect = i_IsRSet|i_IsSSet|i_IsTSet|i_IsVSet;
|
assign wCarrierDtect = i_IsRSet|i_IsSSet|i_IsTSet|i_IsVSet;
|
|
|
always@(posedge i_Clk or negedge i_ARst_L)
|
always@(posedge i_Clk or negedge i_ARst_L)
|
if(i_ARst_L==1'b0) begin
|
if(i_ARst_L==1'b0) begin
|
r21_State <= stWAIT_FOR_K;
|
r17_State <= stWAIT_FOR_K;
|
end else begin
|
end else begin
|
r21_State <= r21_NxtState;
|
r17_State <= r21_NxtState;
|
end
|
end
|
|
|
assign wSUDIK28_5 = (!i_RxCodeInvalid) && (i_RxCodeCtrl) && (i8_RxCodeGroupIn==`K28_5);
|
assign wSUDIK28_5 = (!i_RxCodeInvalid) && (i_RxCodeCtrl) && (i8_RxCodeGroupIn==`K28_5);
|
assign wSUDID21_5 = (!i_RxCodeInvalid) && (!i_RxCodeCtrl) && (i8_RxCodeGroupIn==`D21_5);
|
assign wSUDID21_5 = (!i_RxCodeInvalid) && (!i_RxCodeCtrl) && (i8_RxCodeGroupIn==`D21_5);
|
assign wSUDID2_2 = (!i_RxCodeInvalid) && (!i_RxCodeCtrl) && (i8_RxCodeGroupIn==`D2_2);
|
assign wSUDID2_2 = (!i_RxCodeInvalid) && (!i_RxCodeCtrl) && (i8_RxCodeGroupIn==`D2_2);
|
always@(*)
|
always@(*)
|
begin
|
begin
|
case(r21_State)
|
case(r17_State)
|
stWAIT_FOR_K: if(i_IsComma && i_RxEven) r21_NxtState <= stRX_K; else r21_NxtState<=stWAIT_FOR_K;
|
stWAIT_FOR_K: if(i_IsComma && i_RxEven) r21_NxtState <= stRX_K; else r21_NxtState<=stWAIT_FOR_K;
|
stRX_K : if(wSUDID21_5||wSUDID2_2)
|
stRX_K : if(wSUDID21_5||wSUDID2_2)
|
r21_NxtState <= stRX_CB; else
|
r21_NxtState <= stRX_CB; else
|
if((!i_RxCodeInvalid) && (i_RxCodeCtrl) && i3_Xmit!=`cXmitDATA)
|
if((!i_RxCodeInvalid) && (i_RxCodeCtrl) && i3_Xmit!=`cXmitDATA)
|
r21_NxtState <= stRX_INVALID; else
|
r21_NxtState <= stRX_INVALID; else
|
Line 238... |
Line 237... |
if(i_CheckEndRRS) r21_NxtState <= stPKT_BURST_RRS; else
|
if(i_CheckEndRRS) r21_NxtState <= stPKT_BURST_RRS; else
|
r21_NxtState <= stEXT_ERROR;
|
r21_NxtState <= stEXT_ERROR;
|
endcase
|
endcase
|
end
|
end
|
|
|
assign o_RUDIConfig = (r21_State==stRX_CD )?1'b1:1'b0;
|
assign o_RUDIConfig = (r17_State==stRX_CD )?1'b1:1'b0;
|
assign o_RUDIIdle = (r21_State==stIDLE_D )?1'b1:1'b0;
|
assign o_RUDIIdle = (r17_State==stIDLE_D )?1'b1:1'b0;
|
assign o_RUDIInvalid= (r21_State==stRX_INVALID && i3_Xmit==`cXmitCONFIG)?1'b1:1'b0;
|
assign o_RUDIInvalid= (r17_State==stRX_INVALID && i3_Xmit==`cXmitCONFIG)?1'b1:1'b0;
|
|
|
always@(posedge i_Clk or negedge i_ARst_L)
|
always@(posedge i_Clk or negedge i_ARst_L)
|
if(i_ARst_L==1'b0) begin
|
if(i_ARst_L==1'b0) begin
|
o_Receiving <= 1'b0;
|
o_Receiving <= 1'b0;
|
o_RxDV <= 1'b0;
|
o_RxDV <= 1'b0;
|
Line 306... |
Line 305... |
stEARLY_END_EXT : o_RxER <= 1'b1;
|
stEARLY_END_EXT : o_RxER <= 1'b1;
|
stEXT_ERROR : begin
|
stEXT_ERROR : begin
|
o_RxDV <= 1'b0;
|
o_RxDV <= 1'b0;
|
o8_RxD <= 8'b0001_1111;
|
o8_RxD <= 8'b0001_1111;
|
end
|
end
|
stLINK_FAILED : begin
|
// stLINK_FAILED : begin
|
if(o_Receiving==1'b1)
|
// if(o_Receiving==1'b1)
|
begin
|
// begin
|
o_Receiving <= 1'b0;
|
// o_Receiving <= 1'b0;
|
o_RxER <= 1'b1;
|
// o_RxER <= 1'b1;
|
end else
|
// end else
|
begin
|
// begin
|
o_RxDV <= 1'b0;
|
// o_RxDV <= 1'b0;
|
o_RxER <= 1'b0;
|
// o_RxER <= 1'b0;
|
end
|
// end
|
if(i3_Xmit!=`cXmitDATA) o_Invalid <= 1'b1;
|
// if(i3_Xmit!=`cXmitDATA) o_Invalid <= 1'b1;
|
end
|
// end
|
endcase
|
endcase
|
end
|
end
|
|
|
endmodule
|
endmodule
|
|
|
No newline at end of file
|
No newline at end of file
|