Browse Source

update

pull/12/head
WangXuan95 2 years ago
parent
commit
fe2937089f
  1. 10
      RTL/usb_class/usb_audio_top.sv
  2. 5
      RTL/usbfs_core/usbfs_transaction.sv

10
RTL/usb_class/usb_audio_top.sv

@ -36,7 +36,7 @@ initial audio_en = 1'b0;
initial {audio_ro, audio_lo} = '0; initial {audio_ro, audio_lo} = '0;
wire sot; wire sof;
wire [7:0] out_data; // data from USB device core (host-to-device) wire [7:0] out_data; // data from USB device core (host-to-device)
wire out_valid; wire out_valid;
@ -80,7 +80,7 @@ always @ (posedge clk or negedge usb_rstn)
o_pcm_en <= '0; o_pcm_en <= '0;
end else begin end else begin
o_pcm_en <= '0; o_pcm_en <= '0;
if(sot) begin // reset at the start of a new frame if(sof) begin // reset at the start of a new frame
o_pcm_cnt <= '0; o_pcm_cnt <= '0;
end else if(out_valid) begin end else if(out_valid) begin
o_pcm_cnt <= o_pcm_cnt + 2'd1; o_pcm_cnt <= o_pcm_cnt + 2'd1;
@ -169,7 +169,7 @@ always @ (posedge clk or negedge usb_rstn)
i_pkt_cnt <= '0; i_pkt_cnt <= '0;
in_valid <= '0; in_valid <= '0;
end else begin end else begin
if(sot) begin if(sof) begin
i_pcm_cnt <= '0; i_pcm_cnt <= '0;
i_pkt_cnt <= '0; i_pkt_cnt <= '0;
in_valid <= 1'b1; in_valid <= 1'b1;
@ -249,8 +249,8 @@ usbfs_core_top #(
.usb_dp ( usb_dp ), .usb_dp ( usb_dp ),
.usb_dn ( usb_dn ), .usb_dn ( usb_dn ),
.usb_rstn ( usb_rstn ), .usb_rstn ( usb_rstn ),
.sot ( sot ), .sot ( ),
.sof ( ), .sof ( sof ),
.ep00_setup_cmd ( ), .ep00_setup_cmd ( ),
.ep00_resp_idx ( ), .ep00_resp_idx ( ),
.ep00_resp ( '0 ), .ep00_resp ( '0 ),

5
RTL/usbfs_core/usbfs_transaction.sv

@ -296,11 +296,10 @@ always @ (posedge clk or negedge rstn)
sot <= 1'b0; sot <= 1'b0;
sof <= 1'b0; sof <= 1'b0;
if(rp_fin & rp_okay) begin if(rp_fin & rp_okay) begin
if(rp_endp == 4'd0) begin if(rp_endp == 4'd0)
sot <= (rp_pid == PID_SETUP); sot <= (rp_pid == PID_SETUP);
end else begin else
sot <= (rp_pid == PID_IN || rp_pid == PID_OUT); sot <= (rp_pid == PID_IN || rp_pid == PID_OUT);
end
sof <= (rp_pid == PID_SOF); sof <= (rp_pid == PID_SOF);
end end
end end

Loading…
Cancel
Save