浏览代码

fix(mse): queue A1 DDA services under short SERVICE_CLKS

Always latch service_pending on service_ce and restart X→Y→Z when a
request arrives during the walk so accelerated TBs do not drop pulses.

Co-authored-by: Cursor <cursoragent@cursor.com>
root 3 月之前
父节点
当前提交
f5cd525120
共有 2 个文件被更改,包括 23 次插入 和 9 次删除
  1. 12 5
      receipts/scheme-a-a2-attempt/door_shared_dda_scheduler_a1.v
  2. 11 4
      src/modules/door_shared_dda_scheduler.v

+ 12 - 5
receipts/scheme-a-a2-attempt/door_shared_dda_scheduler_a1.v

@@ -1,6 +1,6 @@
 `timescale 1ns/1ps
 
-// RECONSTRUCTED Scheme A1 sequential shared DDA (not exact byte-archive).
+// RECONSTRUCTED Scheme A1 sequential shared DDA (pending-queue + drain parity).
 // Provenance: recovered from agent transcript 7c830c69 (Round-2 A1 implementation)
 // matching yosys-a1-dda.stat signals (state/service_pending/f_fire/f_next).
 // Label: reconstructed — must pass same functional tests as A2 before fair TD.
@@ -90,11 +90,12 @@ module door_shared_dda_scheduler #(
         end else begin
             toggle_pulse <= 3'b000;
 
+            // Always latch the request. Short SERVICE_CLKS TBs (e.g. 4) would
+            // otherwise drop pulses while the 3-cycle X→Y→Z walk is busy.
             if (service_ce) begin
                 if (busy)
                     overrun_r <= 1'b1;
-                else
-                    service_pending <= 1'b1;
+                service_pending <= 1'b1;
             end
 
             case (state)
@@ -131,8 +132,14 @@ module door_shared_dda_scheduler #(
                         toggle_pulse[2] <= f_fire(phase2, rate2, thr, active[2], allow_toggle[2]);
                         phase2 <= f_next(phase2, rate2, thr, active[2]);
                     end
-                    busy <= 1'b0;
-                    state <= ST_IDLE;
+                    if (service_pending) begin
+                        service_pending <= 1'b0;
+                        busy <= 1'b1;
+                        state <= ST_X;
+                    end else begin
+                        busy <= 1'b0;
+                        state <= ST_IDLE;
+                    end
                 end
             endcase
         end

+ 11 - 4
src/modules/door_shared_dda_scheduler.v

@@ -90,11 +90,12 @@ module door_shared_dda_scheduler #(
         end else begin
             toggle_pulse <= 3'b000;
 
+            // Always latch the request. Short SERVICE_CLKS TBs (e.g. 4) would
+            // otherwise drop pulses while the 3-cycle X→Y→Z walk is busy.
             if (service_ce) begin
                 if (busy)
                     overrun_r <= 1'b1;
-                else
-                    service_pending <= 1'b1;
+                service_pending <= 1'b1;
             end
 
             case (state)
@@ -131,8 +132,14 @@ module door_shared_dda_scheduler #(
                         toggle_pulse[2] <= f_fire(phase2, rate2, thr, active[2], allow_toggle[2]);
                         phase2 <= f_next(phase2, rate2, thr, active[2]);
                     end
-                    busy <= 1'b0;
-                    state <= ST_IDLE;
+                    if (service_pending) begin
+                        service_pending <= 1'b0;
+                        busy <= 1'b1;
+                        state <= ST_X;
+                    end else begin
+                        busy <= 1'b0;
+                        state <= ST_IDLE;
+                    end
                 end
             endcase
         end