From b0cab97d3aaf7613260345e480e67ec81bc7a83d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Vejn=C3=A1r?= Date: Mon, 24 Jun 2013 21:28:09 +0200 Subject: [PATCH] Fixed bit-stuff at EoP in tx. --- usb_tx.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usb_tx.v b/usb_tx.v index 78f2568..850d703 100644 --- a/usb_tx.v +++ b/usb_tx.v @@ -45,7 +45,7 @@ reg crc_enabled; wire dump_crc = state == st_crc1 || state == st_crc2; wire crc_out; wire d = dump_crc? !crc_out: tx_data[0]; -wire se0 = state == st_eop1 || state == st_eop2; +wire se0 = !bit_stuff && (state == st_eop1 || state == st_eop2); wire tx_data_empty = (tx_data[8:2] == 1'b0); assign data_strobe = transmit && tx_data_empty && bit_strobe; @@ -120,7 +120,7 @@ always @(posedge clk_48 or negedge rst_n) begin end reg last_j; -wire j = state == st_idle || state == st_eop3? 1'b1: (bit_stuff || !d? !last_j: last_j); +wire j = state == st_idle || state == st_eop3? 1'b1: ((bit_stuff || !d)? !last_j: last_j); always @(posedge clk_48) begin if (bit_strobe) last_j <= usb_tx_en? j: 1'b1;