Przeglądaj źródła

Keep baseline history mask after native result increased one LUT

codex 3 miesięcy temu
rodzic
commit
a0beb81b2d
1 zmienionych plików z 2 dodań i 5 usunięć
  1. 2 5
      src/motor/motor_engine.v

+ 2 - 5
src/motor/motor_engine.v

@@ -319,7 +319,7 @@ module motor_engine #(
         .clk(clk),.rst_n(rst_n),.write_enable(|ax_limit_pulse),
         .write_data({ax_limit_time_high,ax_limit_data}),
         .read_axis(history_scan_axis),.read_data(limit_read_record));
-    wire [159:0] status_limit_record=limit_read_record;
+    wire [159:0] status_limit_record=limit_history_valid[limit_read_axis] ? limit_read_record : 160'd0;
     reg [31:0] history_pair;
     wire history_selected=telemetry_word_addr>=`MR_AXIS_LAST_LIMIT_POSITION_OFFSET/2 &&
         telemetry_word_addr<(`MR_AXIS_LAST_LIMIT_TIME_HIGH_OFFSET+4)/2;
@@ -334,10 +334,7 @@ module motor_engine #(
             default:history_pair=0;
         endcase
     end
-    wire [15:0] history_word_unmasked=telemetry_word_addr[0] ? history_pair[31:16] : history_pair[15:0];
-    // Qualify only the requested word. The axis-owned stop reason below is
-    // independent of whether a physical limit history record exists yet.
-    wire [15:0] history_word=limit_history_valid[limit_read_axis] ? history_word_unmasked : 16'd0;
+    wire [15:0] history_word=telemetry_word_addr[0] ? history_pair[31:16] : history_pair[15:0];
     // Stop reason remains axis-owned in the low byte of the event/reason word.
     wire [15:0] history_stop_word=telemetry_word_addr==`MR_AXIS_LAST_STOP_REASON_OFFSET/2 ? {12'd0,ax_last_reason[limit_read_axis]} : 16'd0;
     assign telemetry_word_data=history_selected ? (history_word | history_stop_word) :