diff --git a/cpld/CNT.v b/cpld/CNT.v index c84d2ed..f654c0a 100644 --- a/cpld/CNT.v +++ b/cpld/CNT.v @@ -85,6 +85,18 @@ module CNT( else if (QS!=0 && TimerTick) QS <= QS-1; end + reg [1:0] QFS; + always @(posedge CLK) begin + if (!nRESin) QFS <= 0; + else if (BACT && IACK1CS) QFS <= 2; + else if (BACT && IACK0CS) QFS <= 0; + else if (BACT && VIACS) QFS <= 0; + else if (BACT && IWMCS) QFS <= 0; + else if (BACT && SCCCS) QFS <= 2; + else if (SndCSWRr) QFS <= 0; + else if (QFS!=0 && TimerTick) QFS <= QFS-1; + end + reg ClockGateEN; always @(posedge CLK) begin if (!nRESin) ClockGateEN <= 0; @@ -98,7 +110,7 @@ module CNT( end /* QoS enable control */ - always @(posedge CLK) if (!BACT) QoSEN <= QS!=0; + always @(posedge CLK) if (!BACT) QoSEN <= QS!=0 && QFS==0; /* MC68k clock gating during QoS */ always @(negedge CLK, negedge nAS) begin