|
@@ -9,26 +9,26 @@
|
|
// License: LGPL
|
|
// License: LGPL
|
|
//-----------------------------------------------------------------
|
|
//-----------------------------------------------------------------
|
|
//
|
|
//
|
|
-// 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 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
|
|
|
|
|
|
+// 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.
|
|
// 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
|
|
|
|
|
|
+// 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.
|
|
// details.
|
|
//
|
|
//
|
|
-// You should have received a copy of the GNU Lesser General
|
|
|
|
-// Public License along with this source; if not, write to the
|
|
|
|
-// Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
|
|
|
|
+// You should have received a copy of the GNU Lesser General
|
|
|
|
+// Public License along with this source; if not, write to the
|
|
|
|
+// Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
// Boston, MA 02111-1307 USA
|
|
// Boston, MA 02111-1307 USA
|
|
//-----------------------------------------------------------------
|
|
//-----------------------------------------------------------------
|
|
|
|
|
|
@@ -47,27 +47,34 @@ module usb_cdc_top
|
|
// Ports
|
|
// Ports
|
|
//-----------------------------------------------------------------
|
|
//-----------------------------------------------------------------
|
|
(
|
|
(
|
|
- input clk_i,
|
|
|
|
- input rst_i,
|
|
|
|
-
|
|
|
|
- output [7:0] utmi_data_out_o,
|
|
|
|
- output utmi_txvalid_o,
|
|
|
|
- output [1:0] utmi_op_mode_o,
|
|
|
|
- output [1:0] utmi_xcvrselect_o,
|
|
|
|
- output utmi_termselect_o,
|
|
|
|
- output utmi_dppulldown_o,
|
|
|
|
- output utmi_dmpulldown_o,
|
|
|
|
-
|
|
|
|
- input [7:0] utmi_data_in_i,
|
|
|
|
- input utmi_txready_i,
|
|
|
|
- input utmi_rxvalid_i,
|
|
|
|
- input utmi_rxactive_i,
|
|
|
|
- input utmi_rxerror_i,
|
|
|
|
- input [1:0] utmi_linestate_i,
|
|
|
|
-
|
|
|
|
- input tx_i,
|
|
|
|
- output rx_o,
|
|
|
|
- output rx_break_o
|
|
|
|
|
|
+ input clk_i,
|
|
|
|
+ input rst_i,
|
|
|
|
+
|
|
|
|
+ output [7:0] utmi_data_out_o,
|
|
|
|
+ output utmi_txvalid_o,
|
|
|
|
+ output [1:0] utmi_op_mode_o,
|
|
|
|
+ output [1:0] utmi_xcvrselect_o,
|
|
|
|
+ output utmi_termselect_o,
|
|
|
|
+ output utmi_dppulldown_o,
|
|
|
|
+ output utmi_dmpulldown_o,
|
|
|
|
+
|
|
|
|
+ input [7:0] utmi_data_in_i,
|
|
|
|
+ input utmi_txready_i,
|
|
|
|
+ input utmi_rxvalid_i,
|
|
|
|
+ input utmi_rxactive_i,
|
|
|
|
+ input utmi_rxerror_i,
|
|
|
|
+ input [1:0] utmi_linestate_i,
|
|
|
|
+
|
|
|
|
+ input sys_clk,
|
|
|
|
+ input cpu_valid,
|
|
|
|
+ input [15:0] cpu_addr,
|
|
|
|
+ output [31:0] cpu_rdata,
|
|
|
|
+ input [31:0] cpu_wdata,
|
|
|
|
+ input [3:0] cpu_wstrb,
|
|
|
|
+
|
|
|
|
+ input tx_i,
|
|
|
|
+ output rx_o,
|
|
|
|
+ output rx_break_o
|
|
);
|
|
);
|
|
|
|
|
|
wire [ 7:0] usb_rx_data_w;
|
|
wire [ 7:0] usb_rx_data_w;
|
|
@@ -107,7 +114,15 @@ u_usb
|
|
,.inport_accept_o(usb_tx_accept_w)
|
|
,.inport_accept_o(usb_tx_accept_w)
|
|
,.outport_valid_o(usb_rx_valid_w)
|
|
,.outport_valid_o(usb_rx_valid_w)
|
|
,.outport_data_o(usb_rx_data_w)
|
|
,.outport_data_o(usb_rx_data_w)
|
|
- ,.outport_break_o(usb_rx_break_w)
|
|
|
|
|
|
+ ,.outport_break_o(usb_rx_break_w),
|
|
|
|
+
|
|
|
|
+ // CPU bus
|
|
|
|
+ .sys_clk ( sys_clk ),
|
|
|
|
+ .cpu_valid ( cpu_valid ),
|
|
|
|
+ .cpu_addr ( cpu_addr ),
|
|
|
|
+ .cpu_rdata ( cpu_rdata ),
|
|
|
|
+ .cpu_wdata ( cpu_wdata ),
|
|
|
|
+ .cpu_wstrb ( cpu_wstrb )
|
|
);
|
|
);
|
|
|
|
|
|
//-----------------------------------------------------------------
|
|
//-----------------------------------------------------------------
|
|
@@ -181,9 +196,6 @@ localparam START_BIT = 4'd0;
|
|
localparam STOP_BIT0 = 4'd9;
|
|
localparam STOP_BIT0 = 4'd9;
|
|
localparam STOP_BIT1 = 4'd10;
|
|
localparam STOP_BIT1 = 4'd10;
|
|
|
|
|
|
-// Xilinx placement pragmas:
|
|
|
|
-//synthesis attribute IOB of txd_q is "TRUE"
|
|
|
|
-
|
|
|
|
// TX Signals
|
|
// TX Signals
|
|
reg tx_busy_q;
|
|
reg tx_busy_q;
|
|
reg [3:0] tx_bits_q;
|
|
reg [3:0] tx_bits_q;
|
|
@@ -271,7 +283,7 @@ begin
|
|
rx_busy_q <= 1'b0;
|
|
rx_busy_q <= 1'b0;
|
|
end
|
|
end
|
|
// Rx shift register
|
|
// Rx shift register
|
|
- else
|
|
|
|
|
|
+ else
|
|
rx_shift_reg_q <= {rxd_q, rx_shift_reg_q[7:1]};
|
|
rx_shift_reg_q <= {rxd_q, rx_shift_reg_q[7:1]};
|
|
end
|
|
end
|
|
// Start bit?
|
|
// Start bit?
|