Przeglądaj źródła

Observe the production state bank in STEP count integration check

codex 2 miesięcy temu
rodzic
commit
97c1b862f0

+ 1 - 2
src/motor/motor_axis_core.v

@@ -46,6 +46,7 @@ module motor_axis_core #(
  reg [AXIS_COUNT-1:0] seen;
  reg [1:0] state[0:AXIS_COUNT-1];
  reg [2:0] r_mode[0:AXIS_COUNT-1];
+ // Diagnostic aliases only; production datapaths use the selected state word.
  wire [31:0] r_half_us[0:AXIS_COUNT-1],r_remaining[0:AXIS_COUNT-1],r_executed[0:AXIS_COUNT-1];
  wire [31:0] r_position[0:AXIS_COUNT-1],r_total[0:AXIS_COUNT-1],r_last[0:AXIS_COUNT-1];
  wire [31:0] r_lhits[0:AXIS_COUNT-1],r_uhits[0:AXIS_COUNT-1];
@@ -301,7 +302,6 @@ module motor_axis_core #(
     seen<=0;
    end
    // All wide arithmetic and state transitions use this single selected axis.
-   
    if(rise_pending[scan_axis]) begin
     if(total_sum[32])r_wrap[scan_axis][0]<=1;
     if(exec_sum[32])r_wrap[scan_axis][1]<=1;
@@ -330,7 +330,6 @@ module motor_axis_core #(
    end else if((load_pending[scan_axis] || seg_load[scan_axis]) && state[scan_axis]==IDLE) begin
     seg_consumed[scan_axis]<=1;
     load_pending[scan_axis]<=0;r_mode[scan_axis]<=selected_load[10:8];r_dir_upper[scan_axis]<=selected_upper;
-    
     r_unlimited[scan_axis]<=selected_load[63:32]==0 && (selected_load[10:8]==1 || selected_load[10:8]==2 || selected_load[10:8]==3);
     state[scan_axis]<=selected_load[18] ? ARMED : RUN;scheduled_step[scan_axis]<=0;
     if(selected_moving)dir_out[scan_axis]<=selected_dir;

+ 4 - 1
tests/sim/prod2u_mrdimm_i2c_e2e_tb.v

@@ -12,13 +12,16 @@ module prod2u_mrdimm_i2c_e2e_tb;
     wire x_step;
     integer x_rises=0;
     reg x_previous=0;
+    // Observe the production counter bank; parallel diagnostic views are off.
+    wire [31:0] x_emitted_total=dut.u_motor.u_axes.u_state_bank.valid[0] ?
+        dut.u_motor.u_axes.u_state_bank.u_words.words[0][159:128] : 32'd0;
     always @(posedge clk)begin
         #1;
         if(!dut.rst_n)begin x_rises=0;x_previous=0;end
         else begin
             if(x_step && !x_previous)x_rises=x_rises+1;
             x_previous=x_step;
-            if(dut.motor_telemetry_ready && dut.u_motor.ax_total[0]!==x_rises)
+            if(dut.motor_telemetry_ready && x_emitted_total!==x_rises)
                 $fatal(1,"snapshot/Host activity lost actual motor STEP counts");
         end
     end