From 7e0fff91b7e3fdd257ee1101d95d1be1f59913f0 Mon Sep 17 00:00:00 2001 From: Ruige Lee Date: Fri, 10 Oct 2025 15:24:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=BF=E7=9C=9F=E6=BF=80?= =?UTF-8?q?=E5=8A=B1cs=E6=8B=89=E9=AB=98=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tb/shinTest/ShinTopSpiTb.v | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tb/shinTest/ShinTopSpiTb.v b/tb/shinTest/ShinTopSpiTb.v index c1f3a96..1ce6724 100644 --- a/tb/shinTest/ShinTopSpiTb.v +++ b/tb/shinTest/ShinTopSpiTb.v @@ -456,13 +456,13 @@ always @(negedge reset) begin _reset_deactive <= 1'b1; end - `define SCKFRE #640 + `define SCKFRE 640 reg sck = 0; initial begin forever begin - `SCKFRE sck <= ~sck; + #`SCKFRE sck <= ~sck; end end @@ -558,6 +558,16 @@ always @(negedge sck) begin end end +//输入 +always @(negedge sck) begin + if( isBusy ) begin + if( transCnt == length & &bitCnt ) begin + isBusy <= #(`SCKFRE/2) 1'b0; + spi_csn[idx] <= #(`SCKFRE/2) 1'b1; + end + end +end + //输入 always @(posedge sck) begin if( isBusy ) begin @@ -600,9 +610,6 @@ always @(posedge sck) begin exChangeRegi <= isQspi ? {exChangeRegi[3:0], qspi_mux_miso} : {exChangeRegi[6:0], spi_mux_miso}; end end - end else begin - isBusy <= #5 1'b0; - spi_csn[idx] <= #5 1'b1; end end end