|
Message
From: bknpk@h...<bknpk@h...>
Date: Mon Feb 21 09:38:35 CET 2005
Subject: [usb] processRxBit.v fix to previous fix
I still with my fix so a problem. Here is a new fix. Please send comments. A good test is tring to send from host to slave a DATA0 packet of 0x1e, 0x1f, 0xff, 0xff.
I would like to suggest now :
`DATA_RX_CHK_SE0: begin next_bitStuffError <= 1'b0; if (RxBits == `SE0) begin NextState_prRxBit <= `DATA_RX_WAIT_PRB_RDY; end //RxBits == `SE0 else begin NextState_prRxBit <= `DATA_RX_DATA_DESTUFF; if (RxBits == oldRXBits) //NRZI no change 1 /change 0 //if the current 'RxBits' are the same as the old 'RxBits', then begin next_RXSameBitCount <= RXSameBitCount + 1'b1; //inc 'RXSameBitCount' if (RXSameBitCount == `MAX_CONSEC_SAME_BITS) //if 'RXSameBitCount' == 7 there has been a bit stuff error next_bitStuffError <= 1'b1; //flag 'bitStuffError' else //else no bit stuffing error begin next_RXBitCount <= RXBitCount + 1'b1; if (RXBitCount != 4'h7) begin next_processRxBitRdy <= 1'b1; //early indication of ready end next_RXByte <= { 1'b1, RXByte[7:1]}; //RZ bit <= 1 (ie no change in 'RxBits') end end else //else current 'RxBits' are different from old 'RxBits' begin if (RXSameBitCount != `MAX_CONSEC_SAME_BITS) //if this is not the RZ 0 bit after 6 consecutive RZ 1s, then begin next_RXBitCount <= RXBitCount + 1'b1; if (RXBitCount != 4'h7) begin next_processRxBitRdy <= 1'b1; //early indication of ready end next_RXByte <= {1'b0, RXByte[7:1]}; //RZ bit <= 0 (ie current'RxBits' is different than old 'RxBits') end //by PK //old //next_RXSameBitCount <= 4'h1; //old //new if (RXSameBitCount == `MAX_CONSEC_SAME_BITS) next_RXSameBitCount <= 4'h1; else next_RXSameBitCount <= 4'h0; //reset 'RXSameBitCount' //new //by PK end next_oldRXBits <= RxBits; end end
|
 |