Przeglądaj źródła

refactor(6400-v1.1): split single-product branch (No-MCU line)

Trim the standalone 6400-v1.1 tree down to the 6400 V1.1 No-MCU closure:
- keep src/ = 6400-front-rear closure (22) + thermal_host_command + double_bank_target_store
- keep V1.1-only assets: tools/v11_adaptive_pid|bmc_net|nomcu_gui.py,
  tests/sim/prod2u_6400_v11_nomcu_tb.v, tests/unit/test_6400_v11_nomcu_pid.py
- drop mrdimm/6400-v2 RTL, other products/generated/constraints/td/projects
- registry.json reduced to the 6400 target; DEFAULT_PROFILE=6400-front-rear
- fw_cli.py: diagnose choices resolved dynamically from registry
- tests: remove fixtures bound to deleted modules; config single-target
WorkBuddy 1 dzień temu
rodzic
commit
7be6b31e91
100 zmienionych plików z 0 dodań i 10227 usunięć
  1. 0 36
      config/current-product-tests.json
  2. 0 1
      constraints/prod2u_6400_architecture_ab.adc
  3. 0 1
      constraints/prod2u_6400_architecture_ab.sdc
  4. 0 105
      constraints/prod2u_6400_v2.adc
  5. 0 1
      constraints/prod2u_6400_v2.sdc
  6. 0 117
      constraints/prod2u_mrdimm.adc
  7. 0 2
      constraints/prod2u_mrdimm.sdc
  8. 0 107
      constraints/prod2u_mrdimm_chamber.adc
  9. 0 2
      constraints/prod2u_mrdimm_chamber.sdc
  10. 0 32
      constraints/prod2u_p4_normal_v3.adc
  11. 0 5
      constraints/prod2u_p4_normal_v3.sdc
  12. 0 1
      generated/6400-v2/channel-map.json
  13. 0 1
      generated/6400-v2/contract-sha256.txt
  14. 0 1
      generated/6400-v2/fan-control-parameters.json
  15. 0 1
      generated/6400-v2/golden-vectors.json
  16. 0 1
      generated/6400-v2/host-contract.json
  17. 0 1
      generated/6400-v2/manual-uart-contract.json
  18. 0 39
      generated/6400-v2/prod2u_6400_v2_params.vh
  19. 0 1
      generated/6400-v2/snapshot-layout.json
  20. 0 1
      generated/mrdimm/contract-sha256.txt
  21. 0 1
      generated/mrdimm/golden-vectors.json
  22. 0 40
      generated/mrdimm/prod2u_mrdimm_params.vh
  23. 0 1
      generated/mrdimm/snapshot-layout.json
  24. 0 25
      generated/mrdimm/status-layout.md
  25. 0 6
      products/6400-control/AGENTS.md
  26. 0 23
      products/6400-control/project.json
  27. 0 34
      products/6400-control/source-closure.json
  28. 0 6
      products/6400-identification/AGENTS.md
  29. 0 13
      products/6400-identification/project.json
  30. 0 10
      products/6400-identification/source-closure.json
  31. 0 5
      products/6400-sim-debug/AGENTS.md
  32. 0 11
      products/6400-sim-debug/project.json
  33. 0 11
      products/6400-sim-debug/source-closure.json
  34. 0 202
      products/6400-v2/project.json
  35. 0 45
      products/6400-v2/source-closure.json
  36. 0 5
      products/legacy-door-percent/AGENTS.md
  37. 0 10
      products/legacy-door-percent/project.json
  38. 0 49
      products/mrdimm-chamber/source-closure.json
  39. 0 580
      projects/mrdimm-chamber/project.json
  40. 0 44
      projects/mrdimm-chamber/requirements.zh-CN.md
  41. 0 26
      projects/prod2u-6400-front-back/HISTORICAL_ONLY.json
  42. 0 42
      projects/prod2u-6400-front-back/channel-map.zh-CN.md
  43. 0 675
      projects/prod2u-6400-front-back/project.json
  44. 0 16
      projects/prod2u-6400-front-back/requirements.zh-CN.md
  45. 0 29
      projects/prod2u-6400-front-back/source-closure.json
  46. 0 259
      projects/prod2u-door-temp/project.json
  47. 0 69
      projects/prod2u-door-temp/requirements.zh-CN.md
  48. 0 96
      projects/registry.json
  49. 0 294
      src/acquisition/bmc_ascii_poll.v
  50. 0 303
      src/acquisition/bmc_ascii_snapshot.v
  51. 0 85
      src/acquisition/bmc_poll_engine.v
  52. 0 170
      src/acquisition/ct7428_snapshot.v
  53. 0 43
      src/actuator/buzzer_pwm_4khz.v
  54. 0 25
      src/actuator/fan_boot_safety_controller.v
  55. 0 428
      src/actuator/mrdimm_actuator_core.v
  56. 0 75
      src/actuator/ssr_time_proportion.v
  57. 0 59
      src/common/ef2_bram_128k.v
  58. 0 87
      src/common/ef2_bram_256k.v
  59. 0 79
      src/common/ef2_bram_32k.v
  60. 0 115
      src/common/ef2_history_brams.v
  61. 0 57
      src/common/payload_ram.v
  62. 0 140
      src/common/prod2u_active_debug_engine.v
  63. 0 84
      src/common/uart_rx_byte_fractional.v
  64. 0 57
      src/common/uart_tx_byte_fractional.v
  65. 0 40
      src/control/manual_set_all_bank.v
  66. 0 134
      src/control/mrdimm_output_core.v
  67. 0 520
      src/control/mrdimm_transaction_core.v
  68. 0 89
      src/control/stimulus_atomic_bank.v
  69. 0 282
      src/control/thermal_control_core.v
  70. 0 81
      src/control/thermal_output_banks.v
  71. 0 67
      src/diag/prod2u_mrdimm_uart_diag_115200_top.v
  72. 0 47
      src/diag/prod2u_mrdimm_uart_diag_230400_top.v
  73. 0 67
      src/diag/prod2u_mrdimm_uart_diag_921600_top.v
  74. 0 277
      src/diag/prod2u_mrdimm_uart_diag_top.v
  75. 0 84
      src/generated/6400/prod2u_6400_front_back_params.vh
  76. 0 101
      src/generated/prod2u_door_temp_params.vh
  77. 0 921
      src/legacy/modules/door_axis_controller.v
  78. 0 91
      src/legacy/modules/door_calibration_sequencer.v
  79. 0 447
      src/legacy/modules/door_motion_controller.v
  80. 0 28
      src/legacy/modules/door_motion_service_tick.v
  81. 0 84
      src/legacy/modules/door_percent_planner.v
  82. 0 81
      src/legacy/modules/door_profile_quantum_builder.v
  83. 0 53
      src/legacy/modules/door_rate_quantum_builder.v
  84. 0 111
      src/legacy/modules/door_rate_quantum_dispatcher.v
  85. 0 150
      src/legacy/modules/door_shared_dda_scheduler.v
  86. 0 50
      src/legacy/modules/host_watchdog.v
  87. 0 51
      src/legacy/modules/output_target_ram.v
  88. 0 68
      src/legacy/modules/pwm_phase_scan_scheduler.v
  89. 0 55
      src/legacy/modules/pwm_scheduler.v
  90. 0 18
      src/legacy/modules/temperature_ram.v
  91. 0 118
      src/legacy/modules/temperature_reader.v
  92. 0 253
      src/legacy/project/command_controller.v
  93. 0 51
      src/legacy/project/prod2u_6400_adapter.v
  94. 0 121
      src/legacy/project/prod2u_6400_command_controller.v
  95. 0 88
      src/legacy/project/project_adapter.v
  96. 0 215
      src/legacy/top/prod2u_6400_front_back_top.v
  97. 0 24
      src/legacy/top/prod2u_6400_identification_top.v
  98. 0 428
      src/legacy/top/prod2u_p4_normal_v3_top.v
  99. 0 42
      src/modules/prod2u_runtime_step_limit_gate.v
  100. 0 0
      src/modules/shared_500us_tick.v

+ 0 - 36
config/current-product-tests.json

@@ -22,16 +22,12 @@
     }
   },
   "shared_unit_tests": [
-    "tests/unit/test_current_targets.py",
-    "tests/unit/test_6400_td_parser.py",
     "tests/unit/test_fw_multiproject.py",
-    "tests/unit/test_multiproject_targets.py",
     "tests/unit/test_fw_6400_v1_entrypoint.py",
     "tests/unit/test_td_reaudit.py",
     "tests/unit/test_source_package_closure.py",
     "tests/unit/test_rtl_result_reuse.py",
     "tests/unit/test_package_archive_v2.py",
-    "tests/unit/test_6400_canonical_packages.py",
     "tests/unit/test_gui_build_identity.py",
     "tests/unit/test_product_delivery.py",
     "tests/unit/test_dev_container.py",
@@ -45,9 +41,6 @@
     "tests/test_gui_serial_receiver.py",
     "tests/test_review_serial.py",
     "tests/test_gui_integration_probe.py",
-    "tests/unit/test_directed_mutations.py",
-    "tests/sim/full_chain_pty_e2e.py",
-    "tests/sim/full_chain_6400_v2_pty_e2e.py",
     "tests/unit/test_gui_current_release.py",
     "tests/unit/test_gui_stress_current.py",
     "tests/unit/test_host_monitor_and_programmer.py",
@@ -69,35 +62,6 @@
         "pwm_bitmap_engine_tb"
       ],
       "unit_tests": []
-    },
-    "mrdimm-chamber": {
-      "testbenches": [
-        "frame_rx_tb",
-        "frame_rx_boundaries_tb",
-        "frame_tx_tb",
-        "prod2u_mrdimm_uart_e2e_tb",
-        "prod2u_mrdimm_final_e2e_tb",
-        "prod2u_mrdimm_ttl_e2e_tb",
-        "mrdimm_actuator_timing_tb"
-      ],
-      "unit_tests": [
-        "tests/unit/test_mrdimm_full_status_schema.py"
-      ]
-    },
-    "6400-v2": {
-      "testbenches": [
-        "frame_rx_tb",
-        "frame_rx_boundaries_tb",
-        "frame_tx_tb",
-        "prod2u_6400_v2_tb",
-        "pwm_bitmap_engine_tb",
-        "temp_ram_v2_tb",
-        "pwm_commit_handshake_tb",
-        "ssr_time_proportion_tb"
-      ],
-      "unit_tests": [
-        "tests/unit/test_6400_v2_electrical_contract.py"
-      ]
     }
   }
 }

+ 0 - 1
constraints/prod2u_6400_architecture_ab.adc

@@ -1 +0,0 @@
-set_pin_assignment { clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }

+ 0 - 1
constraints/prod2u_6400_architecture_ab.sdc

@@ -1 +0,0 @@
-create_clock -name ab_clk -period 40.000 [get_ports {clk}]

+ 0 - 105
constraints/prod2u_6400_v2.adc

@@ -1,105 +0,0 @@
-# 6400 V2.0 Confirmed Pin Constraints (FCB_FPGA+MCU_V2.0_20260914.brd)
-# System Clock (25 MHz)
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-
-# CON12 External STM32H7 TTL UART (921600 8N1)
-set_pin_assignment { host_ttl_rx } { LOCATION = J4; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { host_ttl_tx } { LOCATION = K2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-
-# CON134 Secondary Host RS-232 UART (921600 8N1)
-set_pin_assignment { host_rs232_rx } { LOCATION = R13; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { host_rs232_tx } { LOCATION = T14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-
-# CON77 BMC RS-232 UART (115200 8N1)
-set_pin_assignment { bmc_rs232_rx } { LOCATION = M9; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { bmc_rs232_tx } { LOCATION = L10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-
-# CT7428 (U6 populated R1888/R1889 route is B14/A15; M8/N9 jumpers are NC) I2C Interface (Single chip U6: 0x49)
-set_pin_assignment { temp_scl } { LOCATION = B14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { temp_sda } { LOCATION = A15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-# CT7428 (U6 populated R1888/R1889 route is B14/A15; M8/N9 jumpers are NC) Alternate Bus Pins (Reserved Hi-Z to prevent bus conflict)
-set_pin_assignment { temp_scl_alt } { LOCATION = M8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { temp_sda_alt } { LOCATION = N9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-
-# Controlled SSR: 20 Hz; 6400高温罩电气图V3.0 Page 4 CON165.14/.13/.11 (CON165.12 NC)
-set_pin_assignment { ssr1_out } { LOCATION = E14; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ssr2_out } { LOCATION = E8; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ssr4_out } { LOCATION = D9; IOSTANDARD = LVCMOS33; }
-
-# Fans (NMOS low-side sinks Q10691..Q10698)
-# Chamber 1 (CON154.5 / CON154.6; field fan-pair correction20261026)
-set_pin_assignment { front_fan_pwm_out[0] } { LOCATION = C4; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { rear_fan_pwm_out[0] } { LOCATION = B5; IOSTANDARD = LVCMOS33; }
-
-# Chamber 2 (CON154.11 / CON154.12)
-set_pin_assignment { front_fan_pwm_out[1] } { LOCATION = B1; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { rear_fan_pwm_out[1] } { LOCATION = A14; IOSTANDARD = LVCMOS33; }
-
-# Chamber 3 (CON155.5 / CON155.6)
-set_pin_assignment { front_fan_pwm_out[2] } { LOCATION = P12; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { rear_fan_pwm_out[2] } { LOCATION = A10; IOSTANDARD = LVCMOS33; }
-
-# Chamber 4 (CON155.11 / CON155.12)
-set_pin_assignment { front_fan_pwm_out[3] } { LOCATION = D8; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { rear_fan_pwm_out[3] } { LOCATION = C7; IOSTANDARD = LVCMOS33; }
-
-# PTC Outputs (24 Channels)
-# Chamber 1 (CON147.1/3/5/7/9/11 -> PTC1..6)
-set_pin_assignment { ptc_pwm_out[0] } { LOCATION = F16; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[1] } { LOCATION = G16; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[2] } { LOCATION = T4; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[3] } { LOCATION = R5; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[4] } { LOCATION = T6; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[5] } { LOCATION = R7; IOSTANDARD = LVCMOS33; }
-
-# Chamber 2 (CON148.1/3/5/7/9/11 -> PTC11..16)
-set_pin_assignment { ptc_pwm_out[6] } { LOCATION = T2; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[7] } { LOCATION = R3; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[8] } { LOCATION = P16; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[9] } { LOCATION = R16; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[10] } { LOCATION = M16; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[11] } { LOCATION = N16; IOSTANDARD = LVCMOS33; }
-
-# Chamber 3 (CON149.1/3/5/7/9/11 -> PTC21..26)
-set_pin_assignment { ptc_pwm_out[12] } { LOCATION = P10; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[13] } { LOCATION = R10; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[14] } { LOCATION = T13; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[15] } { LOCATION = T12; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[16] } { LOCATION = L3; IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[17] } { LOCATION = N2; IOSTANDARD = LVCMOS33; }
-
-# Chamber 4 (新电气图 Page 4 & 8: PTC4-1=CON149.19->K5, PTC4-2=CON150.1->L4, PTC4-3=CON150.5->H4, PTC4-4=CON150.9->J6, PTC4-5=CON150.13->H5, PTC4-6=CON150.17->C15)
-set_pin_assignment { ptc_pwm_out[18] } { LOCATION = K5;  IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[19] } { LOCATION = L4;  IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[20] } { LOCATION = H4;  IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[21] } { LOCATION = J6;  IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[22] } { LOCATION = H5;  IOSTANDARD = LVCMOS33; }
-set_pin_assignment { ptc_pwm_out[23] } { LOCATION = C15; IOSTANDARD = LVCMOS33; }
-
-# Clamped Unused Spare PTC Pins to eliminate weak pullup / floating high
-set_pin_assignment { ptc_spare_zero[0] }  { LOCATION = M1; IOSTANDARD = LVCMOS33; }  # CON147.13
-set_pin_assignment { ptc_spare_zero[1] }  { LOCATION = N1; IOSTANDARD = LVCMOS33; }  # CON147.15
-set_pin_assignment { ptc_spare_zero[2] }  { LOCATION = P1; IOSTANDARD = LVCMOS33; }  # CON147.17
-set_pin_assignment { ptc_spare_zero[3] }  { LOCATION = R1; IOSTANDARD = LVCMOS33; }  # CON147.19
-set_pin_assignment { ptc_spare_zero[4] }  { LOCATION = P8; IOSTANDARD = LVCMOS33; }  # CON148.13
-set_pin_assignment { ptc_spare_zero[5] }  { LOCATION = P7; IOSTANDARD = LVCMOS33; }  # CON148.15
-set_pin_assignment { ptc_spare_zero[6] }  { LOCATION = T9; IOSTANDARD = LVCMOS33; }  # CON148.17
-set_pin_assignment { ptc_spare_zero[7] }  { LOCATION = P9; IOSTANDARD = LVCMOS33; }  # CON148.19
-set_pin_assignment { ptc_spare_zero[8] }  { LOCATION = P2; IOSTANDARD = LVCMOS33; }  # CON149.13
-set_pin_assignment { ptc_spare_zero[9] }  { LOCATION = M3; IOSTANDARD = LVCMOS33; }  # CON149.15
-set_pin_assignment { ptc_spare_zero[10] } { LOCATION = L5; IOSTANDARD = LVCMOS33; }  # CON149.17
-
-
-
-# Retired SSR pads: field CON165.14/.13/.11, now held low (F3 also shares ENA).
-set_pin_assignment { ssr_unused_zero[0] } { LOCATION = F3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ssr_unused_zero[1] } { LOCATION = F1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ssr_unused_zero[2] } { LOCATION = G4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-
-# V3.2.0 Button Inputs (6400高温罩电气图V3.0 Page 4/7; R1724/R1717/R1723 NC -> internal PULLDOWN; CON165.12 NC, F7 unbound)
-set_pin_assignment { estop_btn_in }      { LOCATION = F8;  IOSTANDARD = LVCMOS33; PULLTYPE = PULLDOWN; }  # EPB1 CON165.10 -> R1696/R1856 -> ADC0_CH0
-set_pin_assignment { hood_open_btn_in }  { LOCATION = C11; IOSTANDARD = LVCMOS33; PULLTYPE = PULLDOWN; }  # SB1  CON165.9  -> R1693/R1855 -> BANK0_GPIO2
-set_pin_assignment { hood_close_btn_in } { LOCATION = A11; IOSTANDARD = LVCMOS33; PULLTYPE = PULLDOWN; }  # SB2  CON165.8  -> R1692/R1854 -> BANK0_GPIO1
-
-# V3.2.0 Buzzer Output (CON146.1 KEYLED_V3 +24V high-side via R1301/R1297/Q10621/Q10620; 4000 Hz 80% duty when enabled)
-set_pin_assignment { buzzer_out }        { LOCATION = H6;  IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }

+ 0 - 1
constraints/prod2u_6400_v2.sdc

@@ -1 +0,0 @@
-create_clock -name sys_clk -period 40.000 [get_ports {sys_clk}]

+ 0 - 117
constraints/prod2u_mrdimm.adc

@@ -1,117 +0,0 @@
-# mrdimm-chamber FCB V1.2 authority constraints (r3 full wiring correction)
-# Generated from 8000 Electrical Schematic V1.2 & FCB V1.2 Cadence BRD netlist.
-# 12 Stepper Motors (M1..M12 via CON104..CON115) + 24 Limit Switches (LS1..12, HS1..12 via CON12/126/127/128/129/138).
-
-# System Clock
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-
-# Host RS232 (CON78) & Host 3.3V TTL (CON140); CON146 is a 12V LED/buzzer circuit
-set_pin_assignment { host_rs232_tx } { LOCATION = M10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CON78.1
-set_pin_assignment { host_rs232_rx } { LOCATION = N11; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # CON78.2
-set_pin_assignment { host_ttl_tx }   { LOCATION = T11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CON140.1 via R1261 (0 ohm)
-set_pin_assignment { host_ttl_rx }   { LOCATION = P13; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # CON140.2 via R1262 (0 ohm)
-
-# BMC RS232 via U22 TRSF3232E, CON77.3/4 = GND
-set_pin_assignment { bmc_rs232_tx } { LOCATION = L10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CON77.1
-set_pin_assignment { bmc_rs232_rx } { LOCATION = M9; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # CON77.2
-
-# CT7428 actual populated bus: B14/A15 via R1123/R1124; MCU I2C0 must be Hi-Z
-set_pin_assignment { temp_scl } { LOCATION = B14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CT7428 bus
-set_pin_assignment { temp_sda } { LOCATION = A15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CT7428 bus
-
-# Chamber 1..4 Physical PTC Heaters (24 channels, active high)
-set_pin_assignment { ptc_pwm_out[0]  } { LOCATION = F16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT1
-set_pin_assignment { ptc_pwm_out[1]  } { LOCATION = G16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT2
-set_pin_assignment { ptc_pwm_out[2]  } { LOCATION = T4  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT3
-set_pin_assignment { ptc_pwm_out[3]  } { LOCATION = R5  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT4
-set_pin_assignment { ptc_pwm_out[4]  } { LOCATION = T6  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT5
-set_pin_assignment { ptc_pwm_out[5]  } { LOCATION = R7  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT6
-set_pin_assignment { ptc_pwm_out[6]  } { LOCATION = M1  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT7
-set_pin_assignment { ptc_pwm_out[7]  } { LOCATION = N1  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT8
-set_pin_assignment { ptc_pwm_out[8]  } { LOCATION = P1  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT9
-set_pin_assignment { ptc_pwm_out[9]  } { LOCATION = R1  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT10
-set_pin_assignment { ptc_pwm_out[10] } { LOCATION = T2  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT11
-set_pin_assignment { ptc_pwm_out[11] } { LOCATION = R3  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT12
-set_pin_assignment { ptc_pwm_out[12] } { LOCATION = P16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT13
-set_pin_assignment { ptc_pwm_out[13] } { LOCATION = R16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT14
-set_pin_assignment { ptc_pwm_out[14] } { LOCATION = M16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT15
-set_pin_assignment { ptc_pwm_out[15] } { LOCATION = N16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT16
-set_pin_assignment { ptc_pwm_out[16] } { LOCATION = P8  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT17
-set_pin_assignment { ptc_pwm_out[17] } { LOCATION = P7  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT18
-set_pin_assignment { ptc_pwm_out[18] } { LOCATION = T9  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT19
-set_pin_assignment { ptc_pwm_out[19] } { LOCATION = P9  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT20
-set_pin_assignment { ptc_pwm_out[20] } { LOCATION = P10 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT21
-set_pin_assignment { ptc_pwm_out[21] } { LOCATION = R10 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT22
-set_pin_assignment { ptc_pwm_out[22] } { LOCATION = T13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT23
-set_pin_assignment { ptc_pwm_out[23] } { LOCATION = T12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT24
-
-# Chamber 1..4 FAN Outputs (FAN_BOARD_INVERT_MASK = 4'hF, board inverted)
-set_pin_assignment { fan_pwm_out[0] } { LOCATION = B1  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # chamber1 fan
-set_pin_assignment { fan_pwm_out[1] } { LOCATION = C4  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # chamber2 fan
-set_pin_assignment { fan_pwm_out[2] } { LOCATION = B5  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # chamber3 fan
-set_pin_assignment { fan_pwm_out[3] } { LOCATION = A14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # chamber4 fan
-
-# Motor Global Enable (CON120.2 via Q145 buffer)
-set_pin_assignment { motor_en_n } { LOCATION = C11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-
-# 12 Stepper Motor STEP Pulse Gates (motor_step_gate[0..11], 2N7002 open-drain buffer)
-set_pin_assignment { motor_step_gate[0]  } { LOCATION = C12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M1   (CON104.2)
-set_pin_assignment { motor_step_gate[1]  } { LOCATION = L12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M2   (CON105.2)
-set_pin_assignment { motor_step_gate[2]  } { LOCATION = L14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M3   (CON106.2)
-set_pin_assignment { motor_step_gate[3]  } { LOCATION = G14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M4   (CON113.2)
-set_pin_assignment { motor_step_gate[4]  } { LOCATION = L13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M5   (CON107.2)
-set_pin_assignment { motor_step_gate[5]  } { LOCATION = K12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M6   (CON108.2)
-set_pin_assignment { motor_step_gate[6]  } { LOCATION = J14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M7   (CON109.2)
-set_pin_assignment { motor_step_gate[7]  } { LOCATION = G13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M8   (CON114.2)
-set_pin_assignment { motor_step_gate[8]  } { LOCATION = H13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M9   (CON110.2)
-set_pin_assignment { motor_step_gate[9]  } { LOCATION = H11 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M10  (CON111.2)
-set_pin_assignment { motor_step_gate[10] } { LOCATION = G11 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M11  (CON112.2)
-set_pin_assignment { motor_step_gate[11] } { LOCATION = F12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M12  (CON115.2)
-
-# 12 Stepper Motor DIR Direction Gates (motor_dir_gate[0..11], 2N7002 open-drain buffer)
-set_pin_assignment { motor_dir_gate[0]  } { LOCATION = B12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M1   (CON104.3)
-set_pin_assignment { motor_dir_gate[1]  } { LOCATION = J11 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M2   (CON105.3)
-set_pin_assignment { motor_dir_gate[2]  } { LOCATION = K14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M3   (CON106.3)
-set_pin_assignment { motor_dir_gate[3]  } { LOCATION = G15 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M4   (CON113.3)
-set_pin_assignment { motor_dir_gate[4]  } { LOCATION = K11 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M5   (CON107.3)
-set_pin_assignment { motor_dir_gate[5]  } { LOCATION = K13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M6   (CON108.3)
-set_pin_assignment { motor_dir_gate[6]  } { LOCATION = J12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M7   (CON109.3)
-set_pin_assignment { motor_dir_gate[7]  } { LOCATION = F14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M8   (CON114.3)
-set_pin_assignment { motor_dir_gate[8]  } { LOCATION = J13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M9   (CON110.3)
-set_pin_assignment { motor_dir_gate[9]  } { LOCATION = H12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M10  (CON111.3)
-set_pin_assignment { motor_dir_gate[10] } { LOCATION = H14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M11  (CON112.3)
-set_pin_assignment { motor_dir_gate[11] } { LOCATION = D15 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M12  (CON115.3)
-
-# 12 Lower Limit Switch Inputs (limit_lower_raw[0..11], 2-stage sync)
-set_pin_assignment { limit_lower_raw[0]  } { LOCATION = A5  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS1  (CON12.1)
-set_pin_assignment { limit_lower_raw[1]  } { LOCATION = C8  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS2  (CON12.3)
-set_pin_assignment { limit_lower_raw[2]  } { LOCATION = D7  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS3  (CON126.1)
-set_pin_assignment { limit_lower_raw[3]  } { LOCATION = A4  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS4  (CON126.3)
-set_pin_assignment { limit_lower_raw[4]  } { LOCATION = A3  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS5  (CON127.1)
-set_pin_assignment { limit_lower_raw[5]  } { LOCATION = A12 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS6  (CON127.3)
-set_pin_assignment { limit_lower_raw[6]  } { LOCATION = L16 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS7  (CON128.1)
-set_pin_assignment { limit_lower_raw[7]  } { LOCATION = K15 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS8  (CON128.3)
-set_pin_assignment { limit_lower_raw[8]  } { LOCATION = K16 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS9  (CON129.1)
-set_pin_assignment { limit_lower_raw[9]  } { LOCATION = H15 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS10 (CON129.3)
-set_pin_assignment { limit_lower_raw[10] } { LOCATION = T3  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS11 (CON138.1)
-set_pin_assignment { limit_lower_raw[11] } { LOCATION = P4  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS12 (CON138.3)
-
-# 12 Upper Limit Switch Inputs (limit_upper_raw[0..11], 2-stage sync)
-set_pin_assignment { limit_upper_raw[0]  } { LOCATION = B6  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS1  (CON12.2)
-set_pin_assignment { limit_upper_raw[1]  } { LOCATION = A8  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS2  (CON12.4)
-set_pin_assignment { limit_upper_raw[2]  } { LOCATION = E7  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS3  (CON126.2)
-set_pin_assignment { limit_upper_raw[3]  } { LOCATION = C5  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS4  (CON126.4)
-set_pin_assignment { limit_upper_raw[4]  } { LOCATION = B4  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS5  (CON127.2)
-set_pin_assignment { limit_upper_raw[5]  } { LOCATION = B11 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS6  (CON127.4)
-set_pin_assignment { limit_upper_raw[6]  } { LOCATION = L15 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS7  (CON128.2)
-set_pin_assignment { limit_upper_raw[7]  } { LOCATION = J16 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS8  (CON128.4)
-set_pin_assignment { limit_upper_raw[8]  } { LOCATION = J15 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS9  (CON129.2)
-set_pin_assignment { limit_upper_raw[9]  } { LOCATION = H16 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS10 (CON129.4)
-set_pin_assignment { limit_upper_raw[10] } { LOCATION = R4  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS11 (CON138.2)
-set_pin_assignment { limit_upper_raw[11] } { LOCATION = T5  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS12 (CON138.4)
-
-# V3.1.0 Minimal Hood Switch Input (active-HIGH when pressed, default LOW/0 via PULLDOWN; CON140.3 R1335=NC)
-set_pin_assignment { hood_switch_in } { LOCATION = L3; IOSTANDARD = LVCMOS33; PULLTYPE = PULLDOWN; }  # CON140.3 EX_GPIO31
-
-# V3.1.0 MCU-Triggered Buzzer Output (active-HIGH 12V high-side switch Q10621/Q10620 -> CON146.1)
-set_pin_assignment { buzzer_out } { LOCATION = H6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CON146.1 SW_KEYLED3

+ 0 - 2
constraints/prod2u_mrdimm.sdc

@@ -1,2 +0,0 @@
-# mrdimm-chamber single-clock-domain constraints (25 MHz, no PLL).
-create_clock -name sys_clk -period 40.000 [get_ports {sys_clk}]

+ 0 - 107
constraints/prod2u_mrdimm_chamber.adc

@@ -1,107 +0,0 @@
-# mrdimm-chamber FCB V1.2 authority constraints (r3 full wiring correction)
-# Generated from 8000 Electrical Schematic V1.2 & FCB V1.2 Cadence BRD netlist.
-# 12 Stepper Motors (M1..M12 via CON104..CON115) + 24 Limit Switches (LS1..12, HS1..12 via CON12/126/127/128/129/138).
-
-# System Clock
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-
-# Host RS232 (CON78) & Host TTL (CON146)
-set_pin_assignment { host_rs232_tx } { LOCATION = M10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CON78.1
-set_pin_assignment { host_rs232_rx } { LOCATION = N11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CON78.2
-set_pin_assignment { host_ttl_tx }   { LOCATION = H6;  IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CON146.1 (KEYLED_V3 / SW_KEYLED3)
-set_pin_assignment { host_ttl_rx }   { LOCATION = N7;  IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # CON146.3 (KEY3_CON / KEY_3)
-
-# CT7428 I2C Bus (3 chips: U6, U24, U25)
-set_pin_assignment { temp_scl } { LOCATION = M8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CT7428 bus
-set_pin_assignment { temp_sda } { LOCATION = N9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # CT7428 bus
-
-# Chamber 1..4 Physical PTC Heaters (24 channels, active high)
-set_pin_assignment { ptc_pwm_out[0]  } { LOCATION = F16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT1
-set_pin_assignment { ptc_pwm_out[1]  } { LOCATION = G16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT2
-set_pin_assignment { ptc_pwm_out[2]  } { LOCATION = T4  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT3
-set_pin_assignment { ptc_pwm_out[3]  } { LOCATION = R5  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT4
-set_pin_assignment { ptc_pwm_out[4]  } { LOCATION = T6  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT5
-set_pin_assignment { ptc_pwm_out[5]  } { LOCATION = R7  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT6
-set_pin_assignment { ptc_pwm_out[6]  } { LOCATION = M1  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT7
-set_pin_assignment { ptc_pwm_out[7]  } { LOCATION = N1  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT8
-set_pin_assignment { ptc_pwm_out[8]  } { LOCATION = P1  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT9
-set_pin_assignment { ptc_pwm_out[9]  } { LOCATION = R1  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT10
-set_pin_assignment { ptc_pwm_out[10] } { LOCATION = T2  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT11
-set_pin_assignment { ptc_pwm_out[11] } { LOCATION = R3  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT12
-set_pin_assignment { ptc_pwm_out[12] } { LOCATION = P16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT13
-set_pin_assignment { ptc_pwm_out[13] } { LOCATION = R16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT14
-set_pin_assignment { ptc_pwm_out[14] } { LOCATION = M16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT15
-set_pin_assignment { ptc_pwm_out[15] } { LOCATION = N16 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT16
-set_pin_assignment { ptc_pwm_out[16] } { LOCATION = P8  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT17
-set_pin_assignment { ptc_pwm_out[17] } { LOCATION = P7  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT18
-set_pin_assignment { ptc_pwm_out[18] } { LOCATION = T9  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT19
-set_pin_assignment { ptc_pwm_out[19] } { LOCATION = P9  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT20
-set_pin_assignment { ptc_pwm_out[20] } { LOCATION = P10 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT21
-set_pin_assignment { ptc_pwm_out[21] } { LOCATION = R10 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT22
-set_pin_assignment { ptc_pwm_out[22] } { LOCATION = T13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT23
-set_pin_assignment { ptc_pwm_out[23] } { LOCATION = T12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # HEAT24
-
-# Chamber 1..4 FAN Outputs (FAN_BOARD_INVERT_MASK = 4'hF, board inverted)
-set_pin_assignment { fan_pwm_out[0] } { LOCATION = B1  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # chamber1 fan
-set_pin_assignment { fan_pwm_out[1] } { LOCATION = C4  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # chamber2 fan
-set_pin_assignment { fan_pwm_out[2] } { LOCATION = B5  ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # chamber3 fan
-set_pin_assignment { fan_pwm_out[3] } { LOCATION = A14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # chamber4 fan
-
-# Motor Global Enable (CON120.2 via Q145 buffer)
-set_pin_assignment { motor_en_n } { LOCATION = C11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-
-# 12 Stepper Motor STEP Pulse Gates (motor_step_gate[0..11], 2N7002 open-drain buffer)
-set_pin_assignment { motor_step_gate[0]  } { LOCATION = C12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M1   (CON104.2)
-set_pin_assignment { motor_step_gate[1]  } { LOCATION = L12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M2   (CON105.2)
-set_pin_assignment { motor_step_gate[2]  } { LOCATION = L14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M3   (CON106.2)
-set_pin_assignment { motor_step_gate[3]  } { LOCATION = G14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M4   (CON113.2)
-set_pin_assignment { motor_step_gate[4]  } { LOCATION = L13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M5   (CON107.2)
-set_pin_assignment { motor_step_gate[5]  } { LOCATION = K12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M6   (CON108.2)
-set_pin_assignment { motor_step_gate[6]  } { LOCATION = J14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M7   (CON109.2)
-set_pin_assignment { motor_step_gate[7]  } { LOCATION = G13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M8   (CON114.2)
-set_pin_assignment { motor_step_gate[8]  } { LOCATION = H13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M9   (CON110.2)
-set_pin_assignment { motor_step_gate[9]  } { LOCATION = H11 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M10  (CON111.2)
-set_pin_assignment { motor_step_gate[10] } { LOCATION = G11 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M11  (CON112.2)
-set_pin_assignment { motor_step_gate[11] } { LOCATION = F12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M12  (CON115.2)
-
-# 12 Stepper Motor DIR Direction Gates (motor_dir_gate[0..11], 2N7002 open-drain buffer)
-set_pin_assignment { motor_dir_gate[0]  } { LOCATION = B12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M1   (CON104.3)
-set_pin_assignment { motor_dir_gate[1]  } { LOCATION = J11 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M2   (CON105.3)
-set_pin_assignment { motor_dir_gate[2]  } { LOCATION = K14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M3   (CON106.3)
-set_pin_assignment { motor_dir_gate[3]  } { LOCATION = G15 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M4   (CON113.3)
-set_pin_assignment { motor_dir_gate[4]  } { LOCATION = K11 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M5   (CON107.3)
-set_pin_assignment { motor_dir_gate[5]  } { LOCATION = K13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M6   (CON108.3)
-set_pin_assignment { motor_dir_gate[6]  } { LOCATION = J12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M7   (CON109.3)
-set_pin_assignment { motor_dir_gate[7]  } { LOCATION = F14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M8   (CON114.3)
-set_pin_assignment { motor_dir_gate[8]  } { LOCATION = J13 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M9   (CON110.3)
-set_pin_assignment { motor_dir_gate[9]  } { LOCATION = H12 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M10  (CON111.3)
-set_pin_assignment { motor_dir_gate[10] } { LOCATION = H14 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M11  (CON112.3)
-set_pin_assignment { motor_dir_gate[11] } { LOCATION = D15 ; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }  # M12  (CON115.3)
-
-# 12 Lower Limit Switch Inputs (limit_lower_raw[0..11], 2-stage sync)
-set_pin_assignment { limit_lower_raw[0]  } { LOCATION = A5  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS1  (CON12.1)
-set_pin_assignment { limit_lower_raw[1]  } { LOCATION = C8  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS2  (CON12.3)
-set_pin_assignment { limit_lower_raw[2]  } { LOCATION = D7  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS3  (CON126.1)
-set_pin_assignment { limit_lower_raw[3]  } { LOCATION = A4  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS4  (CON126.3)
-set_pin_assignment { limit_lower_raw[4]  } { LOCATION = A3  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS5  (CON127.1)
-set_pin_assignment { limit_lower_raw[5]  } { LOCATION = A12 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS6  (CON127.3)
-set_pin_assignment { limit_lower_raw[6]  } { LOCATION = L16 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS7  (CON128.1)
-set_pin_assignment { limit_lower_raw[7]  } { LOCATION = K15 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS8  (CON128.3)
-set_pin_assignment { limit_lower_raw[8]  } { LOCATION = K16 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS9  (CON129.1)
-set_pin_assignment { limit_lower_raw[9]  } { LOCATION = H15 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS10 (CON129.3)
-set_pin_assignment { limit_lower_raw[10] } { LOCATION = T3  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS11 (CON138.1)
-set_pin_assignment { limit_lower_raw[11] } { LOCATION = P4  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # LS12 (CON138.3)
-
-# 12 Upper Limit Switch Inputs (limit_upper_raw[0..11], 2-stage sync)
-set_pin_assignment { limit_upper_raw[0]  } { LOCATION = B6  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS1  (CON12.2)
-set_pin_assignment { limit_upper_raw[1]  } { LOCATION = A8  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS2  (CON12.4)
-set_pin_assignment { limit_upper_raw[2]  } { LOCATION = E7  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS3  (CON126.2)
-set_pin_assignment { limit_upper_raw[3]  } { LOCATION = C5  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS4  (CON126.4)
-set_pin_assignment { limit_upper_raw[4]  } { LOCATION = B4  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS5  (CON127.2)
-set_pin_assignment { limit_upper_raw[5]  } { LOCATION = B11 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS6  (CON127.4)
-set_pin_assignment { limit_upper_raw[6]  } { LOCATION = L15 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS7  (CON128.2)
-set_pin_assignment { limit_upper_raw[7]  } { LOCATION = J16 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS8  (CON128.4)
-set_pin_assignment { limit_upper_raw[8]  } { LOCATION = J15 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS9  (CON129.2)
-set_pin_assignment { limit_upper_raw[9]  } { LOCATION = H16 ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS10 (CON129.4)
-set_pin_assignment { limit_upper_raw[10] } { LOCATION = R4  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS11 (CON138.2)
-set_pin_assignment { limit_upper_raw[11] } { LOCATION = T5  ; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }  # HS12 (CON138.4)

+ 0 - 2
constraints/prod2u_mrdimm_chamber.sdc

@@ -1,2 +0,0 @@
-# mrdimm-chamber single-clock-domain constraints (25 MHz, no PLL).
-create_clock -name sys_clk -period 40.000 [get_ports {sys_clk}]

+ 0 - 32
constraints/prod2u_p4_normal_v3.adc

@@ -1,32 +0,0 @@
-# Generated from project.json. Do not edit.
-# Active interface only; reserved board loads are intentionally absent.
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_rx } { LOCATION = N11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_tx } { LOCATION = M10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { temp_scl } { LOCATION = M8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { temp_sda } { LOCATION = N9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[0] } { LOCATION = G16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[1] } { LOCATION = F16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[2] } { LOCATION = N1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[3] } { LOCATION = M1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[4] } { LOCATION = R16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[5] } { LOCATION = P16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[6] } { LOCATION = P9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[7] } { LOCATION = T9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[0] } { LOCATION = B1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[1] } { LOCATION = C4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[2] } { LOCATION = B5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[3] } { LOCATION = A14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { motor_en_n } { LOCATION = C11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { x_step } { LOCATION = C12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { x_dir } { LOCATION = B12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { y_step } { LOCATION = L12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { y_dir } { LOCATION = J11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { z_step } { LOCATION = L14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { z_dir } { LOCATION = K14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { x_limit_ls } { LOCATION = A5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { x_limit_hs } { LOCATION = B6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { y_limit_ls } { LOCATION = C8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { y_limit_hs } { LOCATION = A8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { z_limit_ls } { LOCATION = K16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { z_limit_hs } { LOCATION = J15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }

+ 0 - 5
constraints/prod2u_p4_normal_v3.sdc

@@ -1,5 +0,0 @@
-create_clock -name sys_clk -period 40 -waveform {0 20} [get_ports {sys_clk}]
-# The single 25 MHz on-die clock has no additional board hold uncertainty.
-# This removes the vendor's conservative default from the same-clock hold
-# check; setup uncertainty remains vendor default and is not relaxed.
-set_clock_uncertainty -hold 0.000 [get_clocks sys_clk]

Plik diff jest za duży
+ 0 - 1
generated/6400-v2/channel-map.json


+ 0 - 1
generated/6400-v2/contract-sha256.txt

@@ -1 +0,0 @@
-141c54dd6903253897d6333032887359724778edc920f9a16047bf00d4120e5a

Plik diff jest za duży
+ 0 - 1
generated/6400-v2/fan-control-parameters.json


Plik diff jest za duży
+ 0 - 1
generated/6400-v2/golden-vectors.json


Plik diff jest za duży
+ 0 - 1
generated/6400-v2/host-contract.json


Plik diff jest za duży
+ 0 - 1
generated/6400-v2/manual-uart-contract.json


+ 0 - 39
generated/6400-v2/prod2u_6400_v2_params.vh

@@ -1,39 +0,0 @@
-`ifndef PROD2U_6400_V2_PARAMS_VH
-`define PROD2U_6400_V2_PARAMS_VH
-// Generated from raw manual/wire/snapshot/fan/channel-map contracts; SHA256 141c54dd6903253897d6333032887359724778edc920f9a16047bf00d4120e5a
-`define FB_CLOCK_HZ 25000000
-`define FB_PTC_COUNT 24
-`define FB_FRONT_FAN_COUNT 4
-`define FB_REAR_FAN_COUNT 4
-`define FB_OUTPUT_COUNT 36
-`define FB_BMC_COUNT 24
-`define FB_CT_COUNT 27
-`define FB_HOST_BAUD 921600
-`define FB_BMC_BAUD 115200
-`define FB_HOST_CLKS_PER_BIT 27
-`define FB_BMC_CLKS_PER_BIT 217
-`define FB_PWM_PHASES 100
-`define FB_PTC_PWM_HZ 20
-`define FB_FAN_PWM_HZ 20
-`define FB_PWM_PHASE_CLKS 12500
-`define FB_PWM_PERIOD_CLKS 1250000
-`define FAN_BOARD_INVERT_MASK 8'hFF
-`define CONTROL_WATCHDOG_SECONDS 30
-`define FB_FRAME_LENGTH_WIDTH 8
-`define FB_CMD_SET_ALL 8'h01
-`define FB_CMD_GET_ALL 8'h02
-`define FB_RSP_SET_ACK 8'h81
-`define FB_RSP_GET_ACK 8'h82
-`define FB_RSP_GET_DATA 8'h42
-`define FB_RSP_NACK 8'hC0
-`define FB_NACK_UNSUPPORTED 8'd1
-`define FB_NACK_BAD_LENGTH 8'd2
-`define FB_NACK_BAD_VALUE 8'd3
-`define FB_NACK_QUEUE_FULL 8'd4
-`define FB_NACK_BUSY 8'd5
-`define FB_SET_ALL_BYTES 36
-`define FB_GET_DATA_BYTES 90
-`define FB_HOST_INTER_BYTE_TIMEOUT_CLKS 250000
-`define FB_HOST_BAUD_DIV 15625
-`define FB_HOST_BAUD_MUL 576
-`endif

Plik diff jest za duży
+ 0 - 1
generated/6400-v2/snapshot-layout.json


+ 0 - 1
generated/mrdimm/contract-sha256.txt

@@ -1 +0,0 @@
-ce1f5e525c179f1163694c10d0fce4e3a40d8f85f2f87e02dde9f3e65656b6a0

Plik diff jest za duży
+ 0 - 1
generated/mrdimm/golden-vectors.json


+ 0 - 40
generated/mrdimm/prod2u_mrdimm_params.vh

@@ -1,40 +0,0 @@
-`ifndef PROD2U_MRDIMM_PARAMS_VH
-`define PROD2U_MRDIMM_PARAMS_VH
-// Generated from raw wire/status/project contracts; SHA256 ce1f5e525c179f1163694c10d0fce4e3a40d8f85f2f87e02dde9f3e65656b6a0
-`define MR_CLOCK_HZ 25000000
-`define MR_HOST_BAUD 921600
-`define MR_HOST_CLKS_PER_BIT 27
-`define MR_BMC_BAUD 115200
-`define MR_BMC_CLKS_PER_BIT 217
-`define MR_FRAME_LENGTH_WIDTH 8
-`define MR_CMD_SET_ALL 8'h01
-`define MR_CMD_GET_ALL 8'h02
-`define MR_RSP_SET_ACK 8'h81
-`define MR_RSP_GET_ACK 8'h82
-`define MR_RSP_GET_DATA 8'h42
-`define MR_RSP_MOTOR_DONE 8'h50
-`define MR_RSP_NACK 8'hC0
-`define MR_NACK_UNSUPPORTED 8'd1
-`define MR_NACK_BAD_LENGTH 8'd2
-`define MR_NACK_BAD_VALUE 8'd3
-`define MR_NACK_QUEUE_FULL 8'd4
-`define MR_NACK_BUSY 8'd5
-`define MR_SET_ALL_BYTES 69
-`define MR_GET_DATA_BYTES 65
-`define MR_MOTOR_DONE_BYTES 4
-`define MR_AXIS_COUNT 12
-`define MR_SLOTS_PER_AXIS 1
-`define MR_SLOT_BYTES 5
-`define MR_AXIS_SLOT_BASE 8
-`define MR_FAN_COUNT 4
-`define MR_PTC_COUNT 4
-`define MR_PTC_PHYSICAL 24
-`define MR_PWM_HZ 20
-`define MR_PWM_PHASES 100
-`define MR_PWM_PHASE_CLKS 12500
-`define MR_PWM_PERIOD_CLKS 1250000
-`define MR_LIMIT_ACTIVE_HIGH 1
-`define MR_BOOT_FAN_PERCENT 20
-`define MR_BOOT_PTC_PERCENT 0
-`define MR_HOST_INTER_BYTE_TIMEOUT_CLKS 250000
-`endif

Plik diff jest za duży
+ 0 - 1
generated/mrdimm/snapshot-layout.json


+ 0 - 25
generated/mrdimm/status-layout.md

@@ -1,25 +0,0 @@
-# MRDIMM GET_DATA (type 0x42)
-
-Length: 65 bytes. Little endian. Low 12 bits of a limit mask are Axis0..Axis11; the high 4 bits are zero.
-
-| Field | Offset | Bytes |
-|---|---:|---:|
-| fan_percent | 0 | 4 |
-| ptc_percent | 4 | 4 |
-| bmc_temp_c | 8 | 24 |
-| ct_temp_c | 32 | 27 |
-| lower_limit_mask | 59 | 2 |
-| upper_limit_mask | 61 | 2 |
-| hood_switch | 63 | 1 |
-| buzzer_state | 64 | 1 |
-
-## SET_ALL axis slot (offset 8 + 5*i)
-
-| Field | Offset | Bytes |
-|---|---:|---:|
-| action | 0 | 1 |
-| steps | 1 | 2 |
-| half_period_us | 3 | 2 |
-
-Actions: 00=NOTHING, 01=PUSH_DOWN, 02=PUSH_UP, FF=STOP_CLEAR
-

+ 0 - 6
products/6400-control/AGENTS.md

@@ -1,6 +0,0 @@
-# 6400 production profile
-
-- Follow `docs/architecture/6400-v1-design-lock.md` exactly.
-- Production includes autonomous target/ACK/snapshot behavior and excludes stimulus or manual raw duty control at compile time.
-- No Host watchdog, motor, limit, door, PLL, version, sequence, NACK, or runtime capability path.
-- All 24 BMC channels and 27 CT values participate in acquisition, safety, and telemetry according to generated maps.

+ 0 - 23
products/6400-control/project.json

@@ -1,23 +0,0 @@
-{
-  "schema": "prod2u-6400-profile-v1",
-  "project_id": "6400-control",
-  "product": "6400-front-rear-v1",
-  "top": "prod2u_6400_rs232_only_top",
-  "device": "EF2L45BG256B",
-  "clock_hz": 25000000,
-  "source_closure": "products/6400-control/source-closure.json",
-  "board_id": "fcb_fpga_mcu_v1_1_20260625",
-  "board_evidence": "external:FCB_FPGA+MCU_V1.1_20260625.brd",
-  "board_evidence_sha256": "db02938f7943b2ae532aa18208f61588364d32a70a0cc72f74b4a94aaab7e258",
-  "constraints": "constraints/prod2u_6400_front_back.adc",
-  "timing_constraints": "constraints/prod2u_6400_front_back.sdc",
-  "stimulus": false,
-  "host_interfaces": ["host_rs232"],
-  "host_rs232_connector": "CON78",
-  "ttl_pin_status": "disabled_in_rs232_only_hardware_profile_unbound",
-  "ct_physical_map_status": "unknown",
-  "host_watchdog_seconds": 10,
-  "default_pid_target_c": 70,
-  "fan_safe_connector_duty": 20,
-  "pll": false
-}

+ 0 - 34
products/6400-control/source-closure.json

@@ -1,34 +0,0 @@
-{
-  "schema": "prod2u-source-closure-v1",
-  "project_id": "6400-control",
-  "top_module": "prod2u_6400_rs232_only_top",
-  "sources": [
-    "generated/6400/prod2u_6400_v1_params.vh",
-    "src/common/uart_rx_byte.v",
-    "src/common/uart_tx_byte.v",
-    "src/common/crc16_serial.v",
-    "src/common/ef2_bram_dp.v",
-    "src/common/frame_rx.v",
-    "src/common/frame_tx.v",
-    "src/common/payload_ram.v",
-    "src/modules/shared_500us_tick.v",
-    "src/modules/i2c_word_reader.v",
-    "src/rtl/prod2u_por.v",
-    "src/rtl/prod2u_p4_i2c_stop_start_read.v",
-    "src/transport/host_port_selector.v",
-    "src/transport/thermal_host_command.v",
-    "src/acquisition/bmc_poll_engine.v",
-    "src/acquisition/bmc_ascii_snapshot.v",
-    "src/acquisition/ct7428_snapshot.v",
-    "src/control/thermal_output_banks.v",
-    "src/control/manual_set_all_bank.v",
-    "src/control/stimulus_atomic_bank.v",
-    "src/control/thermal_control_core.v",
-    "src/actuator/pwm_bitmap_engine.v",
-    "src/actuator/fan_board_output_adapter.v",
-    "src/telemetry/thermal_snapshot_mux.v",
-    "src/top/prod2u_6400_v1_top.v",
-    "src/top/prod2u_6400_rs232_only_top.v"
-  ],
-  "forbidden_substrings": ["door_", "motor", "limit_gate", "EF2_PHY_PLL", "SET_TARGET", "8'h81", "8'h42"]
-}

+ 0 - 6
products/6400-identification/AGENTS.md

@@ -1,6 +0,0 @@
-# 6400 identification profile
-
-- Inherit the production 6400 design and safety contract.
-- Add only finite-duration SET_STIMULUS and identification observability generated by the profile.
-- Stimulus expires without Host intervention and cannot bypass invalid, stale, 74/76/77 C, reset, or duty clamps.
-- Do not leak identification sources or commands into the production closure.

+ 0 - 13
products/6400-identification/project.json

@@ -1,13 +0,0 @@
-{
-  "schema": "prod2u-6400-profile-v1",
-  "project_id": "6400-identification",
-  "product": "6400-front-rear-v1",
-  "top": "prod2u_6400_identification_top",
-  "inherits": "products/6400-control/project.json",
-  "source_closure": "products/6400-identification/source-closure.json",
-  "host_interfaces": ["host_rs232"],
-  "host_rs232_connector": "CON78",
-  "ttl_pin_status": "disabled_in_rs232_only_hardware_profile_unbound",
-  "stimulus": true,
-  "production": false
-}

+ 0 - 10
products/6400-identification/source-closure.json

@@ -1,10 +0,0 @@
-{
-  "schema": "prod2u-source-closure-v1",
-  "project_id": "6400-identification",
-  "top_module": "prod2u_6400_identification_top",
-  "inherits": "products/6400-control/source-closure.json",
-  "additional_sources": ["src/top/prod2u_6400_identification_top.v"],
-  "stimulus": true,
-  "production": false,
-  "forbidden_substrings": ["door_", "motor", "limit_gate", "EF2_PHY_PLL", "SET_TARGET", "8'h81", "8'h42"]
-}

+ 0 - 5
products/6400-sim-debug/AGENTS.md

@@ -1,5 +0,0 @@
-# 6400 simulation/debug profile
-
-- This profile may shorten counters and expose deterministic simulation hooks.
-- It is never a production TD or firmware-package source closure.
-- Debug hooks cannot change the generated Host contract or weaken safety assertions.

+ 0 - 11
products/6400-sim-debug/project.json

@@ -1,11 +0,0 @@
-{
-  "schema": "prod2u-6400-profile-v1",
-  "project_id": "6400-sim-debug",
-  "product": "6400-front-rear-v1",
-  "top": "prod2u_6400_v1_top",
-  "inherits": "products/6400-control/project.json",
-  "source_closure": "products/6400-sim-debug/source-closure.json",
-  "stimulus": true,
-  "simulation_only": true,
-  "production": false
-}

+ 0 - 11
products/6400-sim-debug/source-closure.json

@@ -1,11 +0,0 @@
-{
-  "schema": "prod2u-source-closure-v1",
-  "project_id": "6400-sim-debug",
-  "top_module": "prod2u_6400_v1_top",
-  "inherits": "products/6400-control/source-closure.json",
-  "parameter_overrides": {"ENABLE_STIMULUS": 1},
-  "stimulus": true,
-  "simulation_only": true,
-  "production": false,
-  "forbidden_substrings": ["door_", "motor", "limit_gate", "EF2_PHY_PLL", "SET_TARGET", "8'h81", "8'h42"]
-}

+ 0 - 202
products/6400-v2/project.json

@@ -1,202 +0,0 @@
-{
-  "schema": "prod2u-6400-profile-v1",
-  "project_id": "6400-v2",
-  "product": "6400-v2",
-  "top": "prod2u_6400_v2_top",
-  "device": "EF2L45BG256B",
-  "clock_hz": 25000000,
-  "source_closure": "products/6400-v2/source-closure.json",
-  "board_id": "fcb_fpga_mcu_v2_0_20260914",
-  "board_evidence": "docs/evidence/6400-v2-electrical-alignment.md",
-  "board_evidence_sha256": "0115660ec4de2bd7f11fce0d3364531260322486d50d1962b94c37d85a110176",
-  "hardware_files": [
-    {
-      "role": "brd",
-      "path": "reference/original/board/FCB_FPGA_MCU_V2.0_20260914/FCB_FPGA+MCU_V2.0_20260914.brd",
-      "sha256": "c4a75fdc17746910989b76f2e10c357e57d67ec73bad79ad4310948c0e71fcfe",
-      "source": "native_cadence_allegro"
-    },
-    {
-      "role": "schematic_pdf_v2_0",
-      "path": "reference/original/schematics/6400高温罩电气图V2.0.pdf",
-      "sha256": "a8309e680714a389c38ffdeefb2e6d11b8535d50feecdf4efd1f610e0c7fc42c",
-      "source": "native_schematic"
-    },
-    {
-      "role": "schematic_pdf",
-      "path": "reference/original/schematics/6400高温罩电气图V3.0.pdf",
-      "sha256": "ec9b2e67710639451b8cac3979aa888f6347ef021135497054d134645743a4c1",
-      "source": "native_schematic_v3_0_authoritative"
-    }
-  ],
-  "constraints": "constraints/prod2u_6400_v2.adc",
-  "timing_constraints": "constraints/prod2u_6400_v2.sdc",
-  "stimulus": false,
-  "host_interfaces": [
-    "host_ttl",
-    "host_rs232"
-  ],
-  "host_ttl_connector": "CON12",
-  "host_ttl_tx": {
-    "connector_pin": 3,
-    "fpga_ball": "K2",
-    "status": "locked"
-  },
-  "host_ttl_rx": {
-    "connector_pin": 4,
-    "fpga_ball": "J4",
-    "status": "locked"
-  },
-  "host_rs232_connector": "CON134",
-  "host_rs232_tx": {
-    "connector_pin": 1,
-    "fpga_ball": "T14",
-    "status": "locked"
-  },
-  "host_rs232_rx": {
-    "connector_pin": 2,
-    "fpga_ball": "R13",
-    "status": "locked"
-  },
-  "bmc_rs232_connector": "CON77",
-  "bmc_rs232_tx": {
-    "connector_pin": 1,
-    "fpga_ball": "L10",
-    "status": "locked"
-  },
-  "bmc_rs232_rx": {
-    "connector_pin": 2,
-    "fpga_ball": "M9",
-    "status": "locked"
-  },
-  "ct_physical_map_status": "u6_single_chip_9ch",
-  "control_watchdog_seconds": 30,
-  "fan_safe_connector_duty": 20,
-  "fan_board_invert_mask": "0xFF",
-  "pll": false,
-  "host_baud": 921600,
-  "ct_i2c": {
-    "scl_ball": "B14",
-    "sda_ball": "A15",
-    "unused_hiz_balls": [
-      "M8",
-      "N9"
-    ],
-    "ct_instances": [
-      "U6"
-    ],
-    "source": "native BRD populated R1888/R1889; R744/R745/R800/R801 are NC",
-    "hardware_measurement": "NOT_RUN"
-  },
-  "ssr_control": {
-    "count": 3,
-    "pwm_hz": 20,
-    "default_percent": 0,
-    "set_offset": 32,
-    "get_offset": 83,
-    "channels": [
-      {
-        "index": 0,
-        "name": "SSR1",
-        "chambers": [
-          1
-        ],
-        "connector": "CON165.14",
-        "ball": "E14",
-        "cad_connector": "CON165.14",
-        "pin_number_basis": "6400高温罩电气图V3.0 Page 4 CON165 pinout matches FCB_FPGA+MCU_V2.0_20260914.brd directly"
-      },
-      {
-        "index": 1,
-        "name": "SSR2",
-        "chambers": [
-          2,
-          3
-        ],
-        "connector": "CON165.13",
-        "ball": "E8",
-        "cad_connector": "CON165.13",
-        "pin_number_basis": "6400高温罩电气图V3.0 Page 4 CON165 pinout matches FCB_FPGA+MCU_V2.0_20260914.brd directly"
-      },
-      {
-        "index": 2,
-        "name": "SSR4",
-        "chambers": [
-          4
-        ],
-        "connector": "CON165.11",
-        "ball": "D9",
-        "cad_connector": "CON165.11",
-        "pin_number_basis": "6400高温罩电气图V3.0 Page 4 CON165 pinout matches FCB_FPGA+MCU_V2.0_20260914.brd directly"
-      }
-    ],
-    "retired_zero_balls": [
-      "F3",
-      "F1",
-      "G4"
-    ]
-  },
-  "fan_pair_order": [
-    3,
-    4,
-    1,
-    2
-  ],
-  "set_payload_bytes": 36,
-  "get_payload_bytes": 90,
-  "buttons": {
-    "estop_btn": {
-      "designator": "EPB1",
-      "connector": "CON165.10",
-      "net_chain": "IO10 / CON_PE10 -> R1696/R1856 -> ADC0_CH0",
-      "ball": "F8",
-      "external_pullup_nc": "R1724",
-      "active_level": "high",
-      "default_unpressed": "low",
-      "pulltype": "PULLDOWN",
-      "sampled_only_on_get_all": true,
-      "cpld_interlock": false,
-      "get_offset": 86
-    },
-    "hood_open_btn": {
-      "designator": "SB1",
-      "connector": "CON165.9",
-      "net_chain": "IO9 / CON_PE9 -> R1693/R1855 -> BANK0_GPIO2",
-      "ball": "C11",
-      "external_pullup_nc": "R1717",
-      "active_level": "high",
-      "default_unpressed": "low",
-      "pulltype": "PULLDOWN",
-      "sampled_only_on_get_all": true,
-      "get_offset": 87
-    },
-    "hood_close_btn": {
-      "designator": "SB2",
-      "connector": "CON165.8",
-      "net_chain": "IO8 / CON_PE8 -> R1692/R1854 -> BANK0_GPIO1",
-      "ball": "A11",
-      "external_pullup_nc": "R1723",
-      "active_level": "high",
-      "default_unpressed": "low",
-      "pulltype": "PULLDOWN",
-      "sampled_only_on_get_all": true,
-      "get_offset": 88
-    },
-    "con165_pin12_status": "NC (empty in V3.0; old temporary F7 binding removed)"
-  },
-  "buzzer": {
-    "connector": "CON146.1",
-    "gnd_connector": "CON146.2",
-    "net_chain": "U3.H6 -> R1301/R1297/Q10621/Q10620 -> KEYLED_V3 (+24V high-side)",
-    "ball": "H6",
-    "active_level": "high",
-    "pwm_hz": 4000,
-    "duty_percent": 80,
-    "period_clks_25mhz": 6250,
-    "high_clks_25mhz": 5000,
-    "low_clks_25mhz": 1250,
-    "default": 0,
-    "set_offset": 35,
-    "get_offset": 89
-  }
-}

+ 0 - 45
products/6400-v2/source-closure.json

@@ -1,45 +0,0 @@
-{
-  "schema": "prod2u-source-closure-v1",
-  "project_id": "6400-v2",
-  "top_module": "prod2u_6400_v2_top",
-  "sources": [
-    "src/common/prod2u_build_config.vh",
-    "src/common/uart_rx_byte.v",
-    "src/common/uart_tx_byte.v",
-    "src/common/uart_rx_byte_fractional.v",
-    "src/common/uart_tx_byte_fractional.v",
-    "src/common/crc16_serial.v",
-    "src/common/ef2_bram_dp.v",
-    "src/common/frame_rx.v",
-    "src/common/frame_tx.v",
-    "src/rtl/prod2u_por.v",
-    "src/rtl/prod2u_p4_i2c_stop_start_read.v",
-    "src/modules/i2c_word_reader.v",
-    "src/transport/host_uart_endpoint.v",
-    "src/transport/reply_arbiter.v",
-    "src/transport/reply_ram.v",
-    "src/acquisition/temp_ram.v",
-    "src/acquisition/bmc_ascii_poll.v",
-    "src/acquisition/ct7428_scan.v",
-    "src/control/duty_register_bank.v",
-    "src/control/watchdog_30s.v",
-    "src/control/m6400_transaction_core.v",
-    "src/actuator/ssr_time_proportion.v",
-    "src/actuator/buzzer_pwm_4khz.v",
-    "src/actuator/pwm_bitmap_engine.v",
-    "src/actuator/fan_board_output_adapter.v",
-    "src/telemetry/get_data_6400.v",
-    "src/top/prod2u_6400_v2_top.v"
-  ],
-  "forbidden_substrings": [
-    "door_",
-    "motor",
-    "limit_gate",
-    "EF2_PHY_PLL",
-    "SET_TARGET",
-    "stimulus_atomic_bank",
-    "PID",
-    "pid_",
-    "pi_"
-  ]
-}

+ 0 - 5
products/legacy-door-percent/AGENTS.md

@@ -1,5 +0,0 @@
-# Legacy door-percent profile
-
-- The legacy product retains its frozen door-percent, motor, limit, startup calibration, Host watchdog, and historical protocol contract.
-- Legacy behavior is local to this directory and its generated/source closure. It must not influence any 6400 profile.
-- Keep Legacy generate, simulation, formal, TD, and packaging entrypoints buildable while migrating sources.

+ 0 - 10
products/legacy-door-percent/project.json

@@ -1,10 +0,0 @@
-{
-  "schema": "prod2u-legacy-profile-pointer-v1",
-  "project_id": "legacy-door-percent",
-  "legacy_project": "projects/prod2u-door-temp/project.json",
-  "legacy_requirements": "projects/prod2u-door-temp/requirements.zh-CN.md",
-  "legacy_protocol": "docs/prod2u-door-temp-protocol.zh-CN.md",
-  "legacy_top": "prod2u_p4_normal_v3_top",
-  "buildable": true,
-  "isolated_from_6400": true
-}

+ 0 - 49
products/mrdimm-chamber/source-closure.json

@@ -1,49 +0,0 @@
-{
-  "schema": "prod2u-source-closure-v1",
-  "product": "mrdimm-chamber",
-  "board": "FCB V1.2",
-  "note": "Actual compile closure. Source presence and successful elaboration do not establish complete functionality or TD acceptance.",
-  "excluded_legacy": {
-    "reason": "Retired door-percent engine: percent positioning, S-curve profiles, startup seek-close/measure-open calibration and 500-step backoff are replaced by contract section 10 external planning.",
-    "files": [
-      "src/modules/door_percent_planner.v",
-      "src/modules/door_motion_controller.v",
-      "src/modules/door_calibration_sequencer.v",
-      "src/modules/door_profile_quantum_builder.v",
-      "src/modules/door_rate_quantum_builder.v",
-      "src/modules/door_rate_quantum_dispatcher.v",
-      "src/modules/door_shared_dda_scheduler.v",
-      "src/modules/door_axis_controller.v",
-      "src/modules/door_motion_service_tick.v"
-    ]
-  },
-  "project_id": "mrdimm-chamber",
-  "top_module": "prod2u_mrdimm_rs232_only_top",
-  "sources": [
-    "src/common/prod2u_build_config.vh",
-    "src/rtl/prod2u_por.v",
-    "src/common/uart_rx_byte.v",
-    "src/common/uart_tx_byte.v",
-    "src/common/crc16_serial.v",
-    "src/common/frame_rx.v",
-    "src/common/frame_tx.v",
-    "src/common/ef2_bram_dp.v",
-    "src/transport/reply_ram.v",
-    "src/transport/host_uart_endpoint.v",
-    "src/transport/unified_tx_arbiter.v",
-    "src/control/watchdog_30s.v",
-    "src/control/duty_register_bank.v",
-    "src/actuator/pwm_bitmap_engine.v",
-    "src/actuator/buzzer_pwm_4khz.v",
-    "src/acquisition/temp_ram.v",
-    "src/acquisition/bmc_ascii_poll.v",
-    "src/acquisition/ct7428_scan.v",
-    "src/modules/i2c_word_reader.v",
-    "src/rtl/prod2u_p4_i2c_stop_start_read.v",
-    "src/telemetry/get_data_mrdimm.v",
-    "src/actuator/mrdimm_actuator_core.v",
-    "src/control/mrdimm_transaction_core.v",
-    "src/top/prod2u_mrdimm_final_top.v",
-    "src/top/prod2u_mrdimm_rs232_only_top.v"
-  ]
-}

+ 0 - 580
projects/mrdimm-chamber/project.json

@@ -1,580 +0,0 @@
-{
-  "project_id": "mrdimm-chamber",
-  "profile": "mrdimm-chamber-v2",
-  "display_name": "MRDIMM FCB V1.2 chamber controller (fan/ptc + 12 logical motor axes)",
-  "board": {
-    "id": "FCB V1.2",
-    "device": "EF2L45BG256B",
-    "clock_hz": 25000000,
-    "clock_ball": "J1",
-    "single_clock_domain": true,
-    "pll": false
-  },
-  "host": {
-    "rs232": {
-      "connector": "CON78",
-      "baud": 921600,
-      "format": "8N1",
-      "tx_ball": "M10",
-      "rx_ball": "N11",
-      "status": "confirmed",
-      "supported_build_bauds": [
-        921600,
-        460800,
-        230400,
-        115200
-      ]
-    },
-    "ttl_uart": {
-      "connector": "CON140",
-      "baud": 921600,
-      "format": "8N1",
-      "tx_ball": "T11",
-      "rx_ball": "P13",
-      "status": "native_brd_trace_verified_hardware_not_run",
-      "note": "CON140.1 TX via populated R1261 0 ohm to T11; CON140.2 RX via populated R1262 0 ohm to P13. Both 3.3V GPIO. CON140.3/4 are GPIO, NOT GND. CON146 is a 12V LED/key circuit and is not a UART. Host default 921600 8N1; fixed fallback builds 460800/230400/115200.",
-      "supported_build_bauds": [
-        921600,
-        460800,
-        230400,
-        115200
-      ],
-      "tx_pin": 1,
-      "rx_pin": 2,
-      "ground": "CON77.3 or CON77.4 / verified board GND"
-    },
-    "i2c_slave": "REMOVED_NOT_PRESENT"
-  },
-  "acquisition": {
-    "bmc_uart": {
-      "connector": "CON77",
-      "baud": 115200,
-      "format": "8N1",
-      "channels": 24,
-      "optional": true,
-      "status": "board_uart1_rs232_confirmed_role_bmc_console_assigned",
-      "tx_ball": "L10",
-      "rx_ball": "M9",
-      "note": "CON77 is a confirmed V1.2 UART1 RS-232 port on L10/M9. Its role as the BMC console is the product assignment carried over from the shared FCB contract; the board annotation itself only names it UART1 RS-232. Recorded separately from a hardware measurement, which is NOT RUN.",
-      "production_physical_export": true
-    },
-    "ct7428_i2c_master": {
-      "channels": 27,
-      "independent_bus": false,
-      "scl_ball": "B14",
-      "sda_ball": "A15",
-      "physical_path": "B14/R1123 and A15/R1124 to MUC_IIC0; populated CT links R800/R801, R843/R846, R873/R876",
-      "mcu_requirement": "MCU I2C0 pins must remain high-impedance; FPGA is the only I2C master",
-      "ct_addresses": [
-        "0x49",
-        "0x48",
-        "0x4B"
-      ],
-      "address_evidence": "existing MCU contract plus native AD0 straps; real ACK verification NOT_RUN"
-    }
-  },
-  "outputs": {
-    "fan_count": 4,
-    "chamber_ptc_count": 4,
-    "physical_ptc_count": 24,
-    "ptc_map": "4 logical chambers mapped onto 24 physical PTC outputs (6 heaters per chamber: Chamber 1 on CON18, Chamber 2 on CON27, Chamber 3 on CON28, Chamber 4 on CON29)",
-    "ptc_pwm_hz": 20,
-    "fan_pwm_hz": 20,
-    "pwm_period_clks": 1250000,
-    "boot": {
-      "ptc_percent": 0,
-      "fan_percent": 20
-    },
-    "watchdog": {
-      "seconds": 30,
-      "expiry": {
-        "fan_percent": 20,
-        "ptc_percent": 0
-      },
-      "stops_motor": true,
-      "clears_queue": true,
-      "invalidate_unsent_dones": true,
-      "reset_uart_or_parser": false
-    },
-    "fan_board_invert_mask": "0xF",
-    "fan_board_invert_mask_is_the_only_inversion_point": true,
-    "fan_polarity_source": "V1.2 board facts; never reuse the V1.1 invert mask",
-    "fan_output_order": [
-      {
-        "index": 0,
-        "connector": "CON25.7",
-        "ball": "B1",
-        "net": "FAN_PWM3",
-        "chamber": 1
-      },
-      {
-        "index": 1,
-        "connector": "CON8.7",
-        "ball": "C4",
-        "net": "FAN_PWM1",
-        "chamber": 2
-      },
-      {
-        "index": 2,
-        "connector": "CON24.7",
-        "ball": "B5",
-        "net": "FAN_PWM2",
-        "chamber": 3
-      },
-      {
-        "index": 3,
-        "connector": "CON26.7",
-        "ball": "A14",
-        "net": "FAN_PWM4",
-        "chamber": 4
-      }
-    ],
-    "ptc_output_order": [
-      {
-        "index": 0,
-        "connector": "CON18.1",
-        "ball": "F16",
-        "net": "HEAT1",
-        "chamber": 1
-      },
-      {
-        "index": 1,
-        "connector": "CON18.3",
-        "ball": "G16",
-        "net": "HEAT2",
-        "chamber": 1
-      },
-      {
-        "index": 2,
-        "connector": "CON18.5",
-        "ball": "T4",
-        "net": "HEAT3",
-        "chamber": 1
-      },
-      {
-        "index": 3,
-        "connector": "CON18.7",
-        "ball": "R5",
-        "net": "HEAT4",
-        "chamber": 1
-      },
-      {
-        "index": 4,
-        "connector": "CON18.9",
-        "ball": "T6",
-        "net": "HEAT5",
-        "chamber": 1
-      },
-      {
-        "index": 5,
-        "connector": "CON18.11",
-        "ball": "R7",
-        "net": "HEAT6",
-        "chamber": 1
-      },
-      {
-        "index": 6,
-        "connector": "CON27.1",
-        "ball": "M1",
-        "net": "HEAT7",
-        "chamber": 2
-      },
-      {
-        "index": 7,
-        "connector": "CON27.3",
-        "ball": "N1",
-        "net": "HEAT8",
-        "chamber": 2
-      },
-      {
-        "index": 8,
-        "connector": "CON27.5",
-        "ball": "P1",
-        "net": "HEAT9",
-        "chamber": 2
-      },
-      {
-        "index": 9,
-        "connector": "CON27.7",
-        "ball": "R1",
-        "net": "HEAT10",
-        "chamber": 2
-      },
-      {
-        "index": 10,
-        "connector": "CON27.9",
-        "ball": "T2",
-        "net": "HEAT11",
-        "chamber": 2
-      },
-      {
-        "index": 11,
-        "connector": "CON27.11",
-        "ball": "R3",
-        "net": "HEAT12",
-        "chamber": 2
-      },
-      {
-        "index": 12,
-        "connector": "CON28.1",
-        "ball": "P16",
-        "net": "HEAT13",
-        "chamber": 3
-      },
-      {
-        "index": 13,
-        "connector": "CON28.3",
-        "ball": "R16",
-        "net": "HEAT14",
-        "chamber": 3
-      },
-      {
-        "index": 14,
-        "connector": "CON28.5",
-        "ball": "M16",
-        "net": "HEAT15",
-        "chamber": 3
-      },
-      {
-        "index": 15,
-        "connector": "CON28.7",
-        "ball": "N16",
-        "net": "HEAT16",
-        "chamber": 3
-      },
-      {
-        "index": 16,
-        "connector": "CON28.9",
-        "ball": "P8",
-        "net": "HEAT17",
-        "chamber": 3
-      },
-      {
-        "index": 17,
-        "connector": "CON28.11",
-        "ball": "P7",
-        "net": "HEAT18",
-        "chamber": 3
-      },
-      {
-        "index": 18,
-        "connector": "CON29.1",
-        "ball": "T9",
-        "net": "HEAT19",
-        "chamber": 4
-      },
-      {
-        "index": 19,
-        "connector": "CON29.3",
-        "ball": "P9",
-        "net": "HEAT20",
-        "chamber": 4
-      },
-      {
-        "index": 20,
-        "connector": "CON29.5",
-        "ball": "P10",
-        "net": "HEAT21",
-        "chamber": 4
-      },
-      {
-        "index": 21,
-        "connector": "CON29.7",
-        "ball": "R10",
-        "net": "HEAT22",
-        "chamber": 4
-      },
-      {
-        "index": 22,
-        "connector": "CON29.9",
-        "ball": "T13",
-        "net": "HEAT23",
-        "chamber": 4
-      },
-      {
-        "index": 23,
-        "connector": "CON29.11",
-        "ball": "T12",
-        "net": "HEAT24",
-        "chamber": 4
-      }
-    ]
-  },
-  "motors": {
-    "count": 12,
-    "axis_index_order": "Axis0..Axis11 = M1..M12 in the verified ADC generator order; no X/Y/Z remapping",
-    "logical_axes": 12,
-    "simulated_axes": 12,
-    "native_resource_axes": 12,
-    "physically_brought_out_axes": 12,
-    "physically_brought_out_note": "All 12 STEP/DIR pairs and 24 limit input pads are confirmed in the native V1.2 BRD. Limit sensor active-high behavior must match the external wiring; real motion test NOT_RUN.",
-    "axis_map": [
-      {
-        "index": 0,
-        "name": "M1",
-        "step_ball": "C12",
-        "dir_ball": "B12",
-        "step_connector": "CON104.2",
-        "dir_connector": "CON104.3",
-        "lower_limit_ball": "A5",
-        "lower_limit_connector": "CON12.1",
-        "upper_limit_ball": "B6",
-        "upper_limit_connector": "CON12.2",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 1,
-        "name": "M2",
-        "step_ball": "L12",
-        "dir_ball": "J11",
-        "step_connector": "CON105.2",
-        "dir_connector": "CON105.3",
-        "lower_limit_ball": "C8",
-        "lower_limit_connector": "CON12.3",
-        "upper_limit_ball": "A8",
-        "upper_limit_connector": "CON12.4",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 2,
-        "name": "M3",
-        "step_ball": "L14",
-        "dir_ball": "K14",
-        "step_connector": "CON106.2",
-        "dir_connector": "CON106.3",
-        "lower_limit_ball": "D7",
-        "lower_limit_connector": "CON126.1",
-        "upper_limit_ball": "E7",
-        "upper_limit_connector": "CON126.2",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 3,
-        "name": "M4",
-        "step_ball": "G14",
-        "dir_ball": "G15",
-        "step_connector": "CON113.2",
-        "dir_connector": "CON113.3",
-        "lower_limit_ball": "A4",
-        "lower_limit_connector": "CON126.3",
-        "upper_limit_ball": "C5",
-        "upper_limit_connector": "CON126.4",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 4,
-        "name": "M5",
-        "step_ball": "L13",
-        "dir_ball": "K11",
-        "step_connector": "CON107.2",
-        "dir_connector": "CON107.3",
-        "lower_limit_ball": "A3",
-        "lower_limit_connector": "CON127.1",
-        "upper_limit_ball": "B4",
-        "upper_limit_connector": "CON127.2",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 5,
-        "name": "M6",
-        "step_ball": "K12",
-        "dir_ball": "K13",
-        "step_connector": "CON108.2",
-        "dir_connector": "CON108.3",
-        "lower_limit_ball": "A12",
-        "lower_limit_connector": "CON127.3",
-        "upper_limit_ball": "B11",
-        "upper_limit_connector": "CON127.4",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 6,
-        "name": "M7",
-        "step_ball": "J14",
-        "dir_ball": "J12",
-        "step_connector": "CON109.2",
-        "dir_connector": "CON109.3",
-        "lower_limit_ball": "L16",
-        "lower_limit_connector": "CON128.1",
-        "upper_limit_ball": "L15",
-        "upper_limit_connector": "CON128.2",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 7,
-        "name": "M8",
-        "step_ball": "G13",
-        "dir_ball": "F14",
-        "step_connector": "CON114.2",
-        "dir_connector": "CON114.3",
-        "lower_limit_ball": "K15",
-        "lower_limit_connector": "CON128.3",
-        "upper_limit_ball": "J16",
-        "upper_limit_connector": "CON128.4",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 8,
-        "name": "M9",
-        "step_ball": "H13",
-        "dir_ball": "J13",
-        "step_connector": "CON110.2",
-        "dir_connector": "CON110.3",
-        "lower_limit_ball": "K16",
-        "lower_limit_connector": "CON129.1",
-        "upper_limit_ball": "J15",
-        "upper_limit_connector": "CON129.2",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 9,
-        "name": "M10",
-        "step_ball": "H11",
-        "dir_ball": "H12",
-        "step_connector": "CON111.2",
-        "dir_connector": "CON111.3",
-        "lower_limit_ball": "H15",
-        "lower_limit_connector": "CON129.3",
-        "upper_limit_ball": "H16",
-        "upper_limit_connector": "CON129.4",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 10,
-        "name": "M11",
-        "step_ball": "G11",
-        "dir_ball": "H14",
-        "step_connector": "CON112.2",
-        "dir_connector": "CON112.3",
-        "lower_limit_ball": "T3",
-        "lower_limit_connector": "CON138.1",
-        "upper_limit_ball": "R4",
-        "upper_limit_connector": "CON138.2",
-        "evidence": "native_brd_path"
-      },
-      {
-        "index": 11,
-        "name": "M12",
-        "step_ball": "F12",
-        "dir_ball": "D15",
-        "step_connector": "CON115.2",
-        "dir_connector": "CON115.3",
-        "lower_limit_ball": "P4",
-        "lower_limit_connector": "CON138.3",
-        "upper_limit_ball": "T5",
-        "upper_limit_connector": "CON138.4",
-        "evidence": "native_brd_path"
-      }
-    ],
-    "motor_enable_n": {
-      "ball": "C11",
-      "connector": "CON120.2",
-      "active_level": "low",
-      "drive": "constant_high_permanent_assert"
-    },
-    "engine": "mrdimm_actuator_core.v (BRAM-backed serial 12-axis finite-segment actuator)",
-    "startup": {
-      "behavior": "no_automatic_seek",
-      "step_output_at_boot": "low",
-      "queues_at_boot": "empty",
-      "note": "The retired power-on SEEK_LOWER of every axis is deleted. Reset/Boot/standby leaves STEP low and the queues empty."
-    },
-    "limits": {
-      "active_level": "high",
-      "sync_ff": 2,
-      "semantics": "while moving down only the lower limit blocks new STEP rising edges; while moving up only the upper; both active reports reason 03; a reversed direction may leave a single triggered limit",
-      "mapping": "24 native BRD-bound pads, generator order LS1..LS12 and HS1..HS12",
-      "external_requirement": "Inactive must read low; active must read high. Open/unconnected pulled-up input is active."
-    },
-    "queue": {
-      "slots_per_axis": 1,
-      "slots_include_running_segment": true,
-      "replacement": "latest_wins_per_axis",
-      "descriptor_fields": "direction:1 + steps:u16 + half_period_us:u16",
-      "storage": "per-axis registers; no queued segments",
-      "done_on_replacement": false,
-      "host_usage": "Wait for MOTOR_DONE before replacing an axis when every finite segment must complete; other axes may run concurrently."
-    },
-    "done": {
-      "slots_per_axis": 1,
-      "frame": "MOTOR_DONE {axis:u8, reason:u8, steps_done:u16le}",
-      "reasons": {
-        "0": "steps_complete",
-        "1": "lower_limit",
-        "2": "upper_limit",
-        "3": "both_limits"
-      },
-      "steps_done_counts": "final output STEP rising edges"
-    },
-    "timing": {
-      "implementation": "12 independent counters clock-enabled by the shared 1 us tick",
-      "tick_us_clks": 25,
-      "protocol_min_half_period_us": 1,
-      "protocol_max_half_period_us": 65535,
-      "implemented_min_half_period_us": 1,
-      "dir_setup_us": 10,
-      "verification": "tests/sim/mrdimm_actuator_timing_tb.v checks all 12 axes, 1..65535 ticks, maximum step count and full final high pulse",
-      "concurrent_start": "Axis commands apply sequentially; simultaneous triggering is not promised or required."
-    }
-  },
-  "protocol": {
-    "schema": "prod2u-unified-wire-v2",
-    "frame": "A5 5A | TYPE | LENGTH:u8 | PAYLOAD | CRC16/CCITT-FALSE",
-    "length_width_bits": 8,
-    "supported": [
-      "SET_ALL",
-      "GET_ALL",
-      "HEARTBEAT"
-    ],
-    "responses": [
-      "SET_ACK",
-      "GET_ACK",
-      "HEARTBEAT_ACK",
-      "GET_DATA",
-      "NACK",
-      "MOTOR_DONE",
-      "BEACON",
-      "DIAGNOSTIC"
-    ],
-    "retired": [
-      "16-bit length frames",
-      "ACK_NACK 0x80 with a 4-byte detail payload",
-      "ALL_STATUS_DATA 0x81",
-      "MOTOR_QUEUE_WRITE 0x03",
-      "MOTOR_CONTROL 0x04",
-      "OUTPUT_KEEPALIVE 0x05",
-      "EVENT_READ 0x08",
-      "EVENT_CLEAR 0x09",
-      "EVENT_DATA 0x83",
-      "host i2c mailbox",
-      "position / tags / event ring / host step cap / hold / continuous / armed start",
-      "startup calibration seek-close/measure-open and 500-step backoff"
-    ]
-  },
-  "temperature_protection": {
-    "mode": "acquisition_only",
-    "auto_override_outputs": false,
-    "auto_stop_motor": false,
-    "note": "Temperature never decides FAN, PTC or motor behaviour."
-  },
-  "closed_loop": false,
-  "pid": false,
-  "production": true,
-  "hood_switch": {
-    "connector": "CON140.3",
-    "ball": "L3",
-    "active_level": "high",
-    "default_unpressed": "low",
-    "pulltype": "PULLDOWN",
-    "sampled_only_on_get_all": true
-  },
-  "buzzer": {
-    "connector": "CON146.1",
-    "ball": "H6",
-    "active_level": "high",
-    "default": 0
-  },
-  "source_closure": "products/mrdimm-chamber/source-closure.json",
-  "requirements": "projects/mrdimm-chamber/requirements.zh-CN.md",
-  "release_version": "3.1.0"
-}

+ 0 - 44
projects/mrdimm-chamber/requirements.zh-CN.md

@@ -1,44 +0,0 @@
-# MRDIMM FCB V1.2 当前产品
-
-产品 ID 为 `mrdimm-chamber`,命令行简称 `mrdimm`。原始行为合同是本目录
-`project.json`、`contracts/mrdimm-wire.yaml` 和 `contracts/mrdimm-status.yaml`。
-`projects/registry.json` 只负责入口映射,不是另一份行为合同。
-
-- EF2L45BG256B,25 MHz 单时钟域;主机 UART 支持 CON78 RS232(M10/N11)与 CON140 Host TTL(Pin 1 TX = T11、Pin 2 RX = P13,3.3V;另接 CON77.3/4 或已确认板级 GND;CON140.3/4 是 GPIO,不能接地)。
-- 主机默认 921600 8N1;固定编译备选为 460800、230400、115200。串口适配器与固件必须选择同一档,没有自动切换。BMC 保持 115200。
-- 固件在无上位机触发时每5秒自动输出 CRC 正确的 BEACON(0x51、零载荷),不喂看门狗。HEARTBEAT(0x03、0或4字节)用于快速链路检查。
-- 唯一帧格式 `A5 5A | TYPE:u8 | LENGTH:u8 | PAYLOAD | CRC_L | CRC_H`,
-  CRC-16/CCITT-FALSE 覆盖 TYPE+LENGTH+PAYLOAD;无版本、序号、Tag 或自动识别。
-- SET_ALL `01`(68字节):FAN4、逻辑 PTC4、十二个 5 字节轴槽(轴 i 在 8+5*i:
-  action、steps:u16le、half_period_us:u16le)。action 00 NOTHING、01 PUSH_DOWN、
-  02 PUSH_UP、FF STOP_CLEAR;PUSH 步数 1..65535、半周期非零,速度 = 500000/半周期。
-- GET_ALL `02`:GET_ACK `82` 后紧跟 GET_DATA `42`(63字节)。SET_ACK `81`、NACK `C0`、
-  MOTOR_DONE `50`(axis、reason、steps_done:u16le)。NACK reason 01..05。
-- FAN4、逻辑 PTC4(每腔复制到6路,共物理 PTC24),500 Hz;复位、SET 前和看门狗到期为 FAN20/PTC0。
-- 12 个逻辑轴、每轴仅一个执行段,新 PUSH 直接替换该轴旧任务;若要每段完整执行,MCU 等待该轴 MOTOR_DONE 后再下发。不同轴可同时使能,不要求同步起动。只支持有限段,
-  没有上电自动寻限位,没有共同 START、位置/计数设置、事件环或 Tag。
-  限位仅支持 PCB 实际绑定的输入;限位、STOP、看门狗与真实 STEP 边沿计数规则以原始合同为准。
-- GET_DATA 63字节:0..3 FAN、4..7 逻辑 PTC、8..31 BMC24、32..58 CT27、
-  59..60 lower-limit mask、61..62 upper-limit mask(低12位 = Axis0..11,高4位为0)。
-  CT固定使用原装配可达的B14/A15(通过R1123/R1124与MCU I2C0共网);MCU对应GPIO必须高阻,由FPGA作为唯一主机。
-  BMC/CT 只提供遥测,不覆盖本产品人工输出或电机任务;温度无效为 FF。
-
-生产物理封装为 `src/top/prod2u_mrdimm_rs232_only_top.v`,内部核心为 `src/top/prod2u_mrdimm_final_top.v`,约束为
-`constraints/prod2u_mrdimm.adc` 和 `.sdc`。CON78 RS232(M10/N11)、CON140 Host TTL(T11/P13)、CT 总线、输出和 12 轴电机/限位按 V1.2 证据绑定;BMC CON77(L10/M9)也在物理顶层导出。Host I2C 接口在本产品不存在。CON146 为12V LED/按键电路,不能作为TTL串口。
-
-Linux 精确源码快照中的公开入口:
-
-```sh
-python3 tools/fw_cli.py list
-python3 tools/fw_cli.py generate mrdimm
-python3 tools/fw_cli.py generate mrdimm --check
-python3 tools/fw_cli.py test mrdimm --run-root /data/prod2u/runs/<new-test-id>
-python3 tools/fw_cli.py build mrdimm --run-root /data/prod2u/runs/<new-td-id>
-python3 tools/fw_cli.py package delivery --help
-```
-
-生成和测试必须使用当前合同;不再通过 `prod2u-door-temp` 别名调用旧校准产品。
-构建前要求生成物一致,Git 快照干净;导出源码使用 `WORKSPACE-SNAPSHOT.json`
-中的 commit/tree 身份,不伪造 Git clean。TD/正式 Formal 由现有重任务调度入口
-串行执行。`test` 运行当前 Python/RTL 回归,完整软件验收还包括 Formal、GUI、
-工具恢复和打包重放等项目;通过这个命令不表示 Full 或硬件验收完成。

+ 0 - 26
projects/prod2u-6400-front-back/HISTORICAL_ONLY.json

@@ -1,26 +0,0 @@
-{
-  "schema": "prod2u-historical-product-marker-v1",
-  "status": "historical_only",
-  "active_product": false,
-  "reason": "Obsolete interleaved 8-fan direct-duty/no-ACK profile",
-  "superseded_by": {
-    "production_project": "products/6400-control/project.json",
-    "production_source_closure": "products/6400-control/source-closure.json",
-    "identification_project": "products/6400-identification/project.json",
-    "generated_contract": "generated/6400/host-contract.json",
-    "active_adc": "constraints/prod2u_6400_front_back.adc",
-    "td_runner": "tools/run_6400_td.py"
-  },
-  "historical_generated_files": [
-    "src/generated/6400/prod2u_6400_front_back.adc",
-    "src/generated/6400/td-source-manifest.json"
-  ],
-  "forbidden_current_consumers": [
-    "td",
-    "package_target",
-    "6400-control",
-    "6400-identification",
-    "gui"
-  ],
-  "retention": "Preserve for audit; do not delete without an explicit historical-data review"
-}

+ 0 - 42
projects/prod2u-6400-front-back/channel-map.zh-CN.md

@@ -1,42 +0,0 @@
-# 6400 通道映射
-
-> **HISTORICAL ONLY**:本表属于旧 interleaved direct-duty/no-ACK 工程,不是当前 6400 Control/Identification 合同,并从当前 TD 与打包路径排除。当前权威映射见 `contracts/channel-map.yaml` 与 `generated/6400/channel-map.json`。
-
-观察方向:FPGA 板丝印正向,温度传感器接口在上,FPGA 在下,左→右。证据:`config/pin_inventory.fcb_fpga_mcu0611.json` 与本合同冻结表。Pin13 与该腔 L1 同网并联,不是额外通道。
-
-| payload | 逻辑名 | 网 | 连接器 | Ball | 极性 | pin_status |
-| ---: | --- | --- | --- | --- | --- | --- |
-| 0 | C1_PTC_L1 | HEAT6 | CON18.11 | R7 | high | confirmed |
-| 1 | C1_PTC_L2 | HEAT5 | CON18.9 | T6 | high | confirmed |
-| 2 | C1_PTC_L3 | HEAT4 | CON18.7 | R5 | high | confirmed |
-| 3 | C1_PTC_L4 | HEAT3 | CON18.5 | T4 | high | confirmed |
-| 4 | C1_PTC_L5 | HEAT2 | CON18.3 | G16 | high | confirmed |
-| 5 | C1_PTC_L6 | HEAT1 | CON18.1 | F16 | high | confirmed |
-| 6 | C2_PTC_L1 | HEAT12 | CON27.11 | R3 | high | confirmed |
-| 7 | C2_PTC_L2 | HEAT11 | CON27.9 | T2 | high | confirmed |
-| 8 | C2_PTC_L3 | HEAT10 | CON27.7 | R1 | high | confirmed |
-| 9 | C2_PTC_L4 | HEAT9 | CON27.5 | P1 | high | confirmed |
-| 10 | C2_PTC_L5 | HEAT8 | CON27.3 | N1 | high | confirmed |
-| 11 | C2_PTC_L6 | HEAT7 | CON27.1 | M1 | high | confirmed |
-| 12 | C3_PTC_L1 | HEAT18 | CON28.11 | P7 | high | confirmed |
-| 13 | C3_PTC_L2 | HEAT17 | CON28.9 | P8 | high | confirmed |
-| 14 | C3_PTC_L3 | HEAT16 | CON28.7 | N16 | high | confirmed |
-| 15 | C3_PTC_L4 | HEAT15 | CON28.5 | M16 | high | confirmed |
-| 16 | C3_PTC_L5 | HEAT14 | CON28.3 | R16 | high | confirmed |
-| 17 | C3_PTC_L6 | HEAT13 | CON28.1 | P16 | high | confirmed |
-| 18 | C4_PTC_L1 | HEAT24 | CON29.11 | T12 | high | confirmed |
-| 19 | C4_PTC_L2 | HEAT23 | CON29.9 | T13 | high | confirmed |
-| 20 | C4_PTC_L3 | HEAT22 | CON29.7 | R10 | high | confirmed |
-| 21 | C4_PTC_L4 | HEAT21 | CON29.5 | P10 | high | confirmed |
-| 22 | C4_PTC_L5 | HEAT20 | CON29.3 | P9 | high | confirmed |
-| 23 | C4_PTC_L6 | HEAT19 | CON29.1 | T9 | high | confirmed |
-| 24 | C1_FAN_IN | FAN_PWM3 | CON25.7 | B1 | V1.1 板级 Q 反相 | confirmed |
-| 25 | C1_FAN_OUT | FAN_GPIO44 | CON64.4 | P15 | V1.1 板级 0R 直连 | confirmed |
-| 26 | C2_FAN_IN | FAN_PWM1 | CON8.7 | C4 | V1.1 板级 Q 反相 | confirmed |
-| 27 | C2_FAN_OUT | FAN_GPIO46 | CON66.4 | N15 | V1.1 板级 0R 直连 | confirmed |
-| 28 | C3_FAN_IN | FAN_PWM2 | CON24.7 | B5 | V1.1 板级 Q 反相 | confirmed |
-| 29 | C3_FAN_OUT | FAN_GPIO42 | CON62.4 | M14 | V1.1 板级 0R 直连 | confirmed |
-| 30 | C4_FAN_IN | FAN_PWM4 | CON26.7 | A14 | V1.1 板级 Q 反相 | confirmed |
-| 31 | C4_FAN_OUT | FAN_GPIO40 | CON60.4 | P5 | V1.1 板级 0R 直连 | confirmed |
-
-出风 PIN3 是 FG,本合同不用、不进 ADC。左→右腔体顺序按 CON64 / CON66 / CON62 / CON60。

+ 0 - 675
projects/prod2u-6400-front-back/project.json

@@ -1,675 +0,0 @@
-{
-  "project_id": "prod2u-6400-front-back",
-  "profile": "thermal-24ptc-8fan-v1",
-  "display_name": "6400 front/back independent duct temperature controller",
-  "features": {
-    "motors": false,
-    "limits": false,
-    "startup_calibration": false,
-    "get_motor_status": false,
-    "fan_fg": false,
-    "fan_presence": false,
-    "closed_loop": false,
-    "runtime_project_select": false
-  },
-  "device": {
-    "family": "EF2",
-    "part": "EF2L45BG256B",
-    "clock_hz": 25000000,
-    "clock_ball": "J1"
-  },
-  "uart": {
-    "baud": 115200,
-    "data_bits": 8,
-    "parity": "N",
-    "stop_bits": 1,
-    "flow_control": "none",
-    "clks_per_bit": 217,
-    "inter_byte_timeout_ms": 10,
-    "rx_ball": "N11",
-    "tx_ball": "M10"
-  },
-  "outputs": {
-    "ptc_count": 24,
-    "fan_count": 8,
-    "output_count": 32,
-    "ptc_channels": [
-      {
-        "index": 0,
-        "name": "C1_PTC_L1",
-        "signal": "ptc_pwm_out[0]",
-        "board_signal": "HEAT6",
-        "ball": "R7",
-        "connector": "CON18",
-        "connector_pin": 11,
-        "connector_pin13_parallel": true,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 1,
-        "left_to_right": 1,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 1,
-        "name": "C1_PTC_L2",
-        "signal": "ptc_pwm_out[1]",
-        "board_signal": "HEAT5",
-        "ball": "T6",
-        "connector": "CON18",
-        "connector_pin": 9,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 1,
-        "left_to_right": 2,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 2,
-        "name": "C1_PTC_L3",
-        "signal": "ptc_pwm_out[2]",
-        "board_signal": "HEAT4",
-        "ball": "R5",
-        "connector": "CON18",
-        "connector_pin": 7,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 1,
-        "left_to_right": 3,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 3,
-        "name": "C1_PTC_L4",
-        "signal": "ptc_pwm_out[3]",
-        "board_signal": "HEAT3",
-        "ball": "T4",
-        "connector": "CON18",
-        "connector_pin": 5,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 1,
-        "left_to_right": 4,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 4,
-        "name": "C1_PTC_L5",
-        "signal": "ptc_pwm_out[4]",
-        "board_signal": "HEAT2",
-        "ball": "G16",
-        "connector": "CON18",
-        "connector_pin": 3,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 1,
-        "left_to_right": 5,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 5,
-        "name": "C1_PTC_L6",
-        "signal": "ptc_pwm_out[5]",
-        "board_signal": "HEAT1",
-        "ball": "F16",
-        "connector": "CON18",
-        "connector_pin": 1,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 1,
-        "left_to_right": 6,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 6,
-        "name": "C2_PTC_L1",
-        "signal": "ptc_pwm_out[6]",
-        "board_signal": "HEAT12",
-        "ball": "R3",
-        "connector": "CON27",
-        "connector_pin": 11,
-        "connector_pin13_parallel": true,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 2,
-        "left_to_right": 1,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 7,
-        "name": "C2_PTC_L2",
-        "signal": "ptc_pwm_out[7]",
-        "board_signal": "HEAT11",
-        "ball": "T2",
-        "connector": "CON27",
-        "connector_pin": 9,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 2,
-        "left_to_right": 2,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 8,
-        "name": "C2_PTC_L3",
-        "signal": "ptc_pwm_out[8]",
-        "board_signal": "HEAT10",
-        "ball": "R1",
-        "connector": "CON27",
-        "connector_pin": 7,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 2,
-        "left_to_right": 3,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 9,
-        "name": "C2_PTC_L4",
-        "signal": "ptc_pwm_out[9]",
-        "board_signal": "HEAT9",
-        "ball": "P1",
-        "connector": "CON27",
-        "connector_pin": 5,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 2,
-        "left_to_right": 4,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 10,
-        "name": "C2_PTC_L5",
-        "signal": "ptc_pwm_out[10]",
-        "board_signal": "HEAT8",
-        "ball": "N1",
-        "connector": "CON27",
-        "connector_pin": 3,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 2,
-        "left_to_right": 5,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 11,
-        "name": "C2_PTC_L6",
-        "signal": "ptc_pwm_out[11]",
-        "board_signal": "HEAT7",
-        "ball": "M1",
-        "connector": "CON27",
-        "connector_pin": 1,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 2,
-        "left_to_right": 6,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 12,
-        "name": "C3_PTC_L1",
-        "signal": "ptc_pwm_out[12]",
-        "board_signal": "HEAT18",
-        "ball": "P7",
-        "connector": "CON28",
-        "connector_pin": 11,
-        "connector_pin13_parallel": true,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 3,
-        "left_to_right": 1,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 13,
-        "name": "C3_PTC_L2",
-        "signal": "ptc_pwm_out[13]",
-        "board_signal": "HEAT17",
-        "ball": "P8",
-        "connector": "CON28",
-        "connector_pin": 9,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 3,
-        "left_to_right": 2,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 14,
-        "name": "C3_PTC_L3",
-        "signal": "ptc_pwm_out[14]",
-        "board_signal": "HEAT16",
-        "ball": "N16",
-        "connector": "CON28",
-        "connector_pin": 7,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 3,
-        "left_to_right": 3,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 15,
-        "name": "C3_PTC_L4",
-        "signal": "ptc_pwm_out[15]",
-        "board_signal": "HEAT15",
-        "ball": "M16",
-        "connector": "CON28",
-        "connector_pin": 5,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 3,
-        "left_to_right": 4,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 16,
-        "name": "C3_PTC_L5",
-        "signal": "ptc_pwm_out[16]",
-        "board_signal": "HEAT14",
-        "ball": "R16",
-        "connector": "CON28",
-        "connector_pin": 3,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 3,
-        "left_to_right": 5,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 17,
-        "name": "C3_PTC_L6",
-        "signal": "ptc_pwm_out[17]",
-        "board_signal": "HEAT13",
-        "ball": "P16",
-        "connector": "CON28",
-        "connector_pin": 1,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 3,
-        "left_to_right": 6,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 18,
-        "name": "C4_PTC_L1",
-        "signal": "ptc_pwm_out[18]",
-        "board_signal": "HEAT24",
-        "ball": "T12",
-        "connector": "CON29",
-        "connector_pin": 11,
-        "connector_pin13_parallel": true,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 4,
-        "left_to_right": 1,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 19,
-        "name": "C4_PTC_L2",
-        "signal": "ptc_pwm_out[19]",
-        "board_signal": "HEAT23",
-        "ball": "T13",
-        "connector": "CON29",
-        "connector_pin": 9,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 4,
-        "left_to_right": 2,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 20,
-        "name": "C4_PTC_L3",
-        "signal": "ptc_pwm_out[20]",
-        "board_signal": "HEAT22",
-        "ball": "R10",
-        "connector": "CON29",
-        "connector_pin": 7,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 4,
-        "left_to_right": 3,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 21,
-        "name": "C4_PTC_L4",
-        "signal": "ptc_pwm_out[21]",
-        "board_signal": "HEAT21",
-        "ball": "P10",
-        "connector": "CON29",
-        "connector_pin": 5,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 4,
-        "left_to_right": 4,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 22,
-        "name": "C4_PTC_L5",
-        "signal": "ptc_pwm_out[22]",
-        "board_signal": "HEAT20",
-        "ball": "P9",
-        "connector": "CON29",
-        "connector_pin": 3,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 4,
-        "left_to_right": 5,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      },
-      {
-        "index": 23,
-        "name": "C4_PTC_L6",
-        "signal": "ptc_pwm_out[23]",
-        "board_signal": "HEAT19",
-        "ball": "T9",
-        "connector": "CON29",
-        "connector_pin": 1,
-        "connector_pin13_parallel": false,
-        "polarity": "active_high",
-        "pin_status": "confirmed",
-        "chamber": 4,
-        "left_to_right": 6,
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json + contract left-to-right table"
-      }
-    ],
-    "fan_channels": [
-      {
-        "index": 0,
-        "name": "C1_FAN_IN",
-        "signal": "fan_pwm_out[0]",
-        "board_signal": "FAN_PWM3",
-        "ball": "B1",
-        "connector": "CON25",
-        "connector_pin": 7,
-        "polarity": "active_low",
-        "pin_status": "confirmed",
-        "chamber": 1,
-        "role": "intake",
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json"
-      },
-      {
-        "index": 1,
-        "name": "C1_FAN_OUT",
-        "signal": "fan_pwm_out[1]",
-        "board_signal": "FAN_GPIO44",
-        "ball": "P15",
-        "connector": "CON64",
-        "connector_pin": 4,
-        "fg_pin": 3,
-        "fg_used": false,
-        "polarity": "active_low",
-        "pin_status": "confirmed",
-        "chamber": 1,
-        "role": "exhaust",
-        "evidence": "user L->R CON64/66/62/60 pin4 PWM; pin3 FG unused; ball from 0611 dual-gpio-12v gpio_b"
-      },
-      {
-        "index": 2,
-        "name": "C2_FAN_IN",
-        "signal": "fan_pwm_out[2]",
-        "board_signal": "FAN_PWM1",
-        "ball": "C4",
-        "connector": "CON8",
-        "connector_pin": 7,
-        "polarity": "active_low",
-        "pin_status": "confirmed",
-        "chamber": 2,
-        "role": "intake",
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json"
-      },
-      {
-        "index": 3,
-        "name": "C2_FAN_OUT",
-        "signal": "fan_pwm_out[3]",
-        "board_signal": "FAN_GPIO46",
-        "ball": "N15",
-        "connector": "CON66",
-        "connector_pin": 4,
-        "fg_pin": 3,
-        "fg_used": false,
-        "polarity": "active_low",
-        "pin_status": "confirmed",
-        "chamber": 2,
-        "role": "exhaust",
-        "evidence": "user L->R CON64/66/62/60 pin4 PWM; pin3 FG unused; ball from 0611 dual-gpio-12v gpio_b"
-      },
-      {
-        "index": 4,
-        "name": "C3_FAN_IN",
-        "signal": "fan_pwm_out[4]",
-        "board_signal": "FAN_PWM2",
-        "ball": "B5",
-        "connector": "CON24",
-        "connector_pin": 7,
-        "polarity": "active_low",
-        "pin_status": "confirmed",
-        "chamber": 3,
-        "role": "intake",
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json"
-      },
-      {
-        "index": 5,
-        "name": "C3_FAN_OUT",
-        "signal": "fan_pwm_out[5]",
-        "board_signal": "FAN_GPIO42",
-        "ball": "M14",
-        "connector": "CON62",
-        "connector_pin": 4,
-        "fg_pin": 3,
-        "fg_used": false,
-        "polarity": "active_low",
-        "pin_status": "confirmed",
-        "chamber": 3,
-        "role": "exhaust",
-        "evidence": "user L->R CON64/66/62/60 pin4 PWM; pin3 FG unused; ball from 0611 dual-gpio-12v gpio_b"
-      },
-      {
-        "index": 6,
-        "name": "C4_FAN_IN",
-        "signal": "fan_pwm_out[6]",
-        "board_signal": "FAN_PWM4",
-        "ball": "A14",
-        "connector": "CON26",
-        "connector_pin": 7,
-        "polarity": "active_low",
-        "pin_status": "confirmed",
-        "chamber": 4,
-        "role": "intake",
-        "evidence": "config/pin_inventory.fcb_fpga_mcu0611.json"
-      },
-      {
-        "index": 7,
-        "name": "C4_FAN_OUT",
-        "signal": "fan_pwm_out[7]",
-        "board_signal": "FAN_GPIO40",
-        "ball": "P5",
-        "connector": "CON60",
-        "connector_pin": 4,
-        "fg_pin": 3,
-        "fg_used": false,
-        "polarity": "active_low",
-        "pin_status": "confirmed",
-        "chamber": 4,
-        "role": "exhaust",
-        "evidence": "user L->R CON64/66/62/60 pin4 PWM; pin3 FG unused; ball from 0611 dual-gpio-12v gpio_b"
-      }
-    ],
-    "pwm_bits": 8,
-    "pwm_internal_width": 7,
-    "pwm_max_duty": 100,
-    "pwm_phase_count": 100,
-    "pwm_phase_clks": 12500,
-    "pwm_period_clks": 1250000,
-    "pwm_frequency_hz": 20,
-    "pwm_actual_frequency_hz": 20.0,
-    "ptc_polarity": "active_high",
-    "fan_polarity": "active_low",
-    "ptc_default": 0,
-    "fan_default": 10,
-    "fan_connector_active_level": "high",
-    "fan_board_inverts": true,
-    "boot_targets": {
-      "ptc": 0,
-      "fan": 10
-    },
-    "compare_rule": "logical_on = duty > phase"
-  },
-  "temperature": {
-    "value_count": 27,
-    "device_addresses": [
-      73,
-      72,
-      75
-    ],
-    "registers": [
-      0,
-      1,
-      2,
-      3,
-      4,
-      5,
-      6,
-      7,
-      8
-    ],
-    "scl_ball": "M8",
-    "sda_ball": "N9",
-    "bus": "i2c",
-    "device": "CT7428",
-    "invalid_value": 255,
-    "maximum_celsius": 150,
-    "wire_order": "address_then_register_unchanged",
-    "conversion": {
-      "profile": "ct7428-msb-integer",
-      "raw_shift": 7,
-      "raw_width": 9,
-      "reject_sign_bit": true
-    }
-  },
-  "pins": {
-    "host_uart_rx": "N11",
-    "host_uart_tx": "M10",
-    "temp_scl": "M8",
-    "temp_sda": "N9",
-    "ptc_pwm": [
-      "R7",
-      "T6",
-      "R5",
-      "T4",
-      "G16",
-      "F16",
-      "R3",
-      "T2",
-      "R1",
-      "P1",
-      "N1",
-      "M1",
-      "P7",
-      "P8",
-      "N16",
-      "M16",
-      "R16",
-      "P16",
-      "T12",
-      "T13",
-      "R10",
-      "P10",
-      "P9",
-      "T9"
-    ],
-    "fan_pwm": [
-      "B1",
-      "P15",
-      "C4",
-      "N15",
-      "B5",
-      "M14",
-      "A14",
-      "P5"
-    ]
-  },
-  "resource_policy": {
-    "target_store": "double_bank_flip",
-    "shared_pwm_comparators": 1,
-    "shared_i2c_readers": 1,
-    "dsp": "forbidden",
-    "bram": "optional"
-  },
-  "protocol": {
-    "header_hex": "A55A",
-    "crc": {
-      "name": "CRC-16/CCITT-FALSE",
-      "polynomial": 4129,
-      "initial": 65535,
-      "reflect_input": false,
-      "reflect_output": false,
-      "xor_output": 0,
-      "coverage": "type_length_payload",
-      "wire_order": "little"
-    },
-    "commands": {
-      "set_all": 1,
-      "get_temperature": 2,
-      "temperature_data": 130
-    },
-    "set_all": {
-      "payload_length": 32,
-      "frame_length": 38,
-      "ptc_offset": 0,
-      "ptc_count": 24,
-      "fan_offset": 24,
-      "fan_count": 8,
-      "fan_order": "chamber_then_intake_then_exhaust",
-      "duty_min": 0,
-      "duty_max": 100,
-      "response": "none",
-      "atomic_commit": true,
-      "no_ack": true,
-      "no_command_queue": true,
-      "busy_drops_new_frames": true
-    },
-    "temperature_data": {
-      "payload_length": 27,
-      "frame_length": 33
-    }
-  },
-  "timeouts": {
-    "frame_inter_byte_ms": 10,
-    "host_get_response_ms": 5000
-  },
-  "watchdog": {
-    "timeout_seconds": 30,
-    "tick_us": 500,
-    "tick_clks": 12500,
-    "timeout_ticks": 60000,
-    "enable_after_startup_complete": false,
-    "enable_after_por": true,
-    "target": {
-      "ptc": 0,
-      "fan": 10
-    }
-  }
-}

+ 0 - 16
projects/prod2u-6400-front-back/requirements.zh-CN.md

@@ -1,16 +0,0 @@
-# 6400 前后独立风道温控项目要求
-
-- 别名:`6400`
-- project_id:`prod2u-6400-front-back`
-- 器件:`EF2L45BG256B`,时钟 25 MHz
-- UART:115200 8N1,帧头 `A5 5A`,CRC-16/CCITT-FALSE,低字节在前
-- 命令:`SET_ALL 0x01`(32 字节)、`GET_TEMPERATURE 0x02`、`TEMPERATURE_DATA 0x82`
-- 无马达、无风门、无限位、无上电校准、无 `GET_MOTOR_STATUS`
-- 24 路独立 PTC + 8 路独立 FAN(每腔先进风后出风)
-- PWM 500 Hz,周期精确 50,000 时钟,`logical_on = duty > phase`
-- PTC FPGA 高有效;FAN FPGA 脚反相
-- 上电与 watchdog:PTC 0%、FAN 10%;仅合法 SET commit 喂狗;30 s / 60,000 tick
-- 温度:3×CT7428,地址 0x49/0x48/0x4B,27 个整数摄氏度,线路顺序不重排
-- 出风 FAN PWM:左→右 CON64.4 / CON66.4 / CON62.4 / CON60.4;PIN3 FG 不用
-- 生产 TD syn/phy/bitgen 已接线;firmware 包必须包含 6400 专用 `.bit`、SHA256 与 TD 构建证据
-- Hardware validation:`NOT RUN`

+ 0 - 29
projects/prod2u-6400-front-back/source-closure.json

@@ -1,29 +0,0 @@
-{
- "schema": "prod2u-source-closure-v1",
- "project_id": "prod2u-6400-front-back",
- "target_alias": "6400",
- "top_module": "prod2u_6400_front_back_top",
- "description": "6400-only source closure. Motor, door, limit, and MRDIMM top modules are excluded.",
- "sources": [
-  "src/generated/6400/prod2u_6400_front_back_params.vh",
-  "src/common/uart_rx_byte.v",
-  "src/common/uart_tx_byte.v",
-  "src/common/crc16_serial.v",
-  "src/common/frame_rx.v",
-  "src/common/frame_tx.v",
-  "src/common/payload_ram.v",
-  "src/modules/double_bank_target_store.v",
-  "src/legacy/modules/pwm_phase_scan_scheduler.v",
-  "src/modules/shared_500us_tick.v",
-  "src/legacy/modules/host_watchdog.v",
-  "src/modules/i2c_word_reader.v",
-  "src/legacy/modules/temperature_reader.v",
-  "src/legacy/modules/temperature_ram.v",
-  "src/legacy/project/prod2u_6400_command_controller.v",
-  "src/legacy/project/prod2u_6400_adapter.v",
-  "src/rtl/prod2u_por.v",
-  "src/rtl/prod2u_p4_i2c_stop_start_read.v",
-  "src/legacy/top/prod2u_6400_front_back_top.v"
- ],
- "note": "RETIRED project lineage (superseded by prod2u-6400-front-rear v1_top manual stack). Sources point into src/legacy/."
-}

+ 0 - 259
projects/prod2u-door-temp/project.json

@@ -1,259 +0,0 @@
-{
-  "project_id": "prod2u-door-temp",
-  "profile": "prod2u-normal-multiproject-115200-v1",
-  "display_name": "Prod2U door and temperature controller",
-  "device": {
-    "family": "EF2",
-    "part": "EF2L45BG256B",
-    "clock_hz": 25000000,
-    "clock_ball": "J1"
-  },
-  "uart": {
-    "baud": 115200,
-    "data_bits": 8,
-    "parity": "N",
-    "stop_bits": 1,
-    "flow_control": "none",
-    "clks_per_bit": 217,
-    "inter_byte_timeout_ms": 10,
-    "rx_ball": "N11",
-    "tx_ball": "M10"
-  },
-  "outputs": {
-    "ptc_count": 8,
-    "fan_count": 4,
-    "chamber_ptc_count": 4,
-    "chamber_ptc_pairs": [
-      {"chamber": 1, "ptc_indices": [0, 1]},
-      {"chamber": 2, "ptc_indices": [2, 3]},
-      {"chamber": 3, "ptc_indices": [4, 5]},
-      {"chamber": 4, "ptc_indices": [6, 7]}
-    ],
-    "ptc_channels": [
-      {"index": 0, "name": "ptc1", "signal": "ptc_pwm_out[0]", "board_signal": "HEAT2", "ball": "G16", "connector": "CON18", "connector_pin": 3, "polarity": "active_high"},
-      {"index": 1, "name": "ptc2", "signal": "ptc_pwm_out[1]", "board_signal": "HEAT1", "ball": "F16", "connector": "CON18", "connector_pin": 1, "polarity": "active_high"},
-      {"index": 2, "name": "ptc3", "signal": "ptc_pwm_out[2]", "board_signal": "HEAT8", "ball": "N1", "connector": "CON27", "connector_pin": 3, "polarity": "active_high"},
-      {"index": 3, "name": "ptc4", "signal": "ptc_pwm_out[3]", "board_signal": "HEAT7", "ball": "M1", "connector": "CON27", "connector_pin": 1, "polarity": "active_high"},
-      {"index": 4, "name": "ptc5", "signal": "ptc_pwm_out[4]", "board_signal": "HEAT14", "ball": "R16", "connector": "CON28", "connector_pin": 3, "polarity": "active_high"},
-      {"index": 5, "name": "ptc6", "signal": "ptc_pwm_out[5]", "board_signal": "HEAT13", "ball": "P16", "connector": "CON28", "connector_pin": 1, "polarity": "active_high"},
-      {"index": 6, "name": "ptc7", "signal": "ptc_pwm_out[6]", "board_signal": "HEAT20", "ball": "P9", "connector": "CON29", "connector_pin": 3, "polarity": "active_high"},
-      {"index": 7, "name": "ptc8", "signal": "ptc_pwm_out[7]", "board_signal": "HEAT19", "ball": "T9", "connector": "CON29", "connector_pin": 1, "polarity": "active_high"}
-    ],
-    "fan_channels": [
-      {"index": 0, "name": "fan1", "signal": "fan_pwm_out[0]", "board_signal": "FAN_PWM3", "ball": "B1", "connector": "CON25", "connector_pin": 7, "polarity": "active_low"},
-      {"index": 1, "name": "fan2", "signal": "fan_pwm_out[1]", "board_signal": "FAN_PWM1", "ball": "C4", "connector": "CON8", "connector_pin": 7, "polarity": "active_low"},
-      {"index": 2, "name": "fan3", "signal": "fan_pwm_out[2]", "board_signal": "FAN_PWM2", "ball": "B5", "connector": "CON24", "connector_pin": 7, "polarity": "active_low"},
-      {"index": 3, "name": "fan4", "signal": "fan_pwm_out[3]", "board_signal": "FAN_PWM4", "ball": "A14", "connector": "CON26", "connector_pin": 7, "polarity": "active_low"}
-    ],
-    "pwm_bits": 8,
-    "pwm_internal_width": 7,
-    "pwm_max_duty": 100,
-    "pwm_phase_count": 100,
-    "pwm_slot_clks": 1042,
-    "pwm_frequency_hz": 20,
-    "pwm_actual_frequency_hz": 19.993602047,
-    "ptc_polarity": "active_high",
-    "fan_polarity": "active_low",
-    "ptc_default": 0,
-    "fan_default": 10,
-    "fan_connector_active_level": "high",
-    "fan_board_inverts": true,
-    "boot_targets": {"ptc": 0, "fan": 10}
-  },
-  "doors": {
-    "scope": "four_chamber_thermal_plus_chamber1_three_doors",
-    "chamber_controlled": 1,
-    "door_axes": ["x", "y", "z"]
-  },
-  "motors": {
-    "count": 3,
-    "order": ["x", "y", "z"],
-    "role": "door",
-    "execution": "overlap",
-    "step_rate_hz": 1000,
-    "step_half_cycles": 12500,
-    "motion_service_us": 25,
-    "motion_service_clks": 625,
-    "phase_factor": 5120,
-    "profile_full": 256,
-    "profile_scale_q8": [64, 66, 73, 84, 98, 114, 132, 150, 170, 188, 206, 222, 236, 247, 254, 256],
-    "cal_ramp_unit": 8,
-    "scheme": "A_full_feature_per_axis_kernels_shared_slow_arith",
-    "dir_setup_cycles": 25000,
-    "open_dir_value": 0,
-    "close_dir_value": 1,
-    "dir_close_level": [1, 1, 1],
-    "positioning": {
-      "mode": "percent_close",
-      "percent_min": 0,
-      "percent_max": 100,
-      "open_endpoint_percent": 0,
-      "close_endpoint_percent": 100,
-      "mid_percent_min": 1,
-      "mid_percent_max": 99,
-      "rounding": "half_up",
-      "mid_clamp": "1_to_travel_minus_1",
-      "latest_wins": true,
-      "idempotent_same_target": true,
-      "command_interrupt": "finish_current_high_pulse_then_replan",
-      "shared_percent_planner": true,
-      "planner_count": 1,
-      "endpoint_guard_extra_steps": 500
-    },
-    "mapping": {
-      "x": {"axis": "x", "role": "door", "step_ball": "C12", "dir_ball": "B12", "step_connector": "CON104", "step_connector_pin": 2, "dir_connector": "CON104", "dir_connector_pin": 3},
-      "y": {"axis": "y", "role": "door", "step_ball": "L12", "dir_ball": "J11", "step_connector": "CON105", "step_connector_pin": 2, "dir_connector": "CON105", "dir_connector_pin": 3},
-      "z": {"axis": "z", "role": "door", "step_ball": "L14", "dir_ball": "K14", "step_connector": "CON106", "step_connector_pin": 2, "dir_connector": "CON106", "dir_connector_pin": 3}
-    },
-    "enable_n": {
-      "ball": "C11",
-      "connector": "CON120",
-      "connector_pin": 2,
-      "active_level": "low",
-      "policy": "permanent_high",
-      "notes": "NPN open-collector invert at board; FPGA drives constant 1 so connector EN is permanently asserted."
-    }
-  },
-  "limits": {
-    "limit_count": 6,
-    "active_level": "high",
-    "limit_active_high": [true, true, true],
-    "close_limit_is_ls": [true, true, true],
-    "functional_use": true,
-    "runtime_use": true,
-    "startup": {
-      "enabled": true,
-      "mode": "seek_close_then_measure_open",
-      "max_steps": 5000,
-      "min_travel_steps": 2,
-      "step_rate_hz": 1000,
-      "axis_order": ["x", "y", "z"],
-      "calibration_schedule": "serial_xyz",
-      "runtime_overlap_allowed": true,
-      "final_position": "open",
-      "limit_stop_during_move": true,
-      "stop_semantics": "truncate_current_high_pulse_immediately_after_synchronized_limit",
-      "additional_rising_edges_after_synchronized_limit": 0,
-      "runtime_limit_use": true,
-      "partial_axis_failure_allowed": true,
-      "fault_lock_until_reset": true
-    },
-    "channels": [
-      {"name": "x_limit_ls", "ball": "A5", "connector": "CON12", "connector_pin": 1, "side": "low"},
-      {"name": "x_limit_hs", "ball": "B6", "connector": "CON12", "connector_pin": 2, "side": "high"},
-      {"name": "y_limit_ls", "ball": "C8", "connector": "CON12", "connector_pin": 3, "side": "low"},
-      {"name": "y_limit_hs", "ball": "A8", "connector": "CON12", "connector_pin": 4, "side": "high"},
-      {"name": "z_limit_ls", "ball": "K16", "connector": "CON129", "connector_pin": 1, "side": "low"},
-      {"name": "z_limit_hs", "ball": "J15", "connector": "CON129", "connector_pin": 2, "side": "high"}
-    ]
-  },
-  "temperature": {
-    "value_count": 27,
-    "device_addresses": [73, 72, 75],
-    "registers": [0, 1, 2, 3, 4, 5, 6, 7, 8],
-    "scl_ball": "M8",
-    "sda_ball": "N9",
-    "bus": "i2c",
-    "device": "CT7428",
-    "invalid_value": 255,
-    "maximum_celsius": 150,
-    "conversion": {
-      "profile": "ct7428-msb-integer",
-      "raw_shift": 7,
-      "raw_width": 9,
-      "reject_sign_bit": true
-    }
-  },
-  "pins": {
-    "host_uart_rx": "N11",
-    "host_uart_tx": "M10",
-    "temp_scl": "M8",
-    "temp_sda": "N9",
-    "ptc_pwm": ["G16", "F16", "N1", "M1", "R16", "P16", "P9", "T9"],
-    "fan_pwm": ["B1", "C4", "B5", "A14"],
-    "motor_en_n": "C11",
-    "x_step": "C12",
-    "x_dir": "B12",
-    "y_step": "L12",
-    "y_dir": "J11",
-    "z_step": "L14",
-    "z_dir": "K14",
-    "x_limit_ls": "A5",
-    "x_limit_hs": "B6",
-    "y_limit_ls": "C8",
-    "y_limit_hs": "A8",
-    "z_limit_ls": "K16",
-    "z_limit_hs": "J15"
-  },
-  "resource_policy": {
-    "target_ram": "optional",
-    "request_ram": "optional",
-    "temperature_ram": "optional",
-    "dsp": "optional",
-    "bram": "optional",
-    "shared_pwm_comparators": 1,
-    "shared_percent_planner": 1,
-    "shared_i2c_readers": 1
-  },
-  "protocol": {
-    "header_hex": "A55A",
-    "crc": {
-      "name": "CRC-16/CCITT-FALSE",
-      "polynomial": 4129,
-      "initial": 65535,
-      "reflect_input": false,
-      "reflect_output": false,
-      "xor_output": 0,
-      "coverage": "type_length_payload",
-      "wire_order": "little"
-    },
-    "commands": {
-      "set_all": 1,
-      "get_temperature": 2,
-      "get_motor_status": 3,
-      "temperature_data": 130,
-      "motor_status_data": 131
-    },
-    "set_all": {
-      "payload_length": 11,
-      "fan_offset": 0,
-      "chamber_ptc_offset": 4,
-      "chamber_ptc_count": 4,
-      "z_door_offset": 8,
-      "exhaust_x_offset": 9,
-      "exhaust_y_offset": 10,
-      "legacy_payload_length_rejected": 14,
-      "duty_min": 0,
-      "duty_max": 100,
-      "door_percent_min": 0,
-      "door_percent_max": 100,
-      "door_percent_rejected_example": 101,
-      "response": "none"
-    },
-    "get_motor_status": {
-      "payload_length": 0,
-      "response": "motor_status_data"
-    },
-    "temperature_data": {
-      "payload_length": 27,
-      "frame_length": 33
-    },
-    "motor_status_data": {
-      "payload_length": 31,
-      "frame_length": 37,
-      "layout": "host-contract"
-    }
-  },
-  "timeouts": {
-    "frame_inter_byte_ms": 10,
-    "host_get_response_ms": 5000
-  },
-  "watchdog": {
-    "timeout_seconds": 30,
-    "tick_us": 500,
-    "tick_clks": 12500,
-    "timeout_ticks": 60000,
-    "enable_after_startup_complete": true,
-    "target": {"ptc": 0, "fan": 10}
-  }
-}

+ 0 - 69
projects/prod2u-door-temp/requirements.zh-CN.md

@@ -1,69 +0,0 @@
-# Prod2U 门控与温度项目需求
-
-## 破坏性协议迁移警告
-
-**旧合同已废弃**:门字节 `00/01/02` jog(`00` 不启动/心跳、`01` 开 450、`02` 关 450);busy 忽略新门命令;watchdog 10 s → FAN 20;startup 关门寻限 + 500 步 backoff。
-
-**新合同**:门字节为闭合百分比 `0..100`(`0`=全开,`100`=全关);合法 SET_ALL latest-wins;标定 seek-close → measure-open;watchdog **30 s → FAN 10**;`GET_MOTOR_STATUS 0x03` / `MOTOR_STATUS_DATA 0x83`(31 字节)。无 ACK/队列。旧上位机继续发三门 `00` 当心跳会驱动到全开限位——必须改为重发真实期望百分比。
-
-## 系统与协议
-
-项目使用 EF2L45BG256B、25 MHz 时钟和 115200 8N1 UART。帧格式:
-
-```text
-A5 5A type payload_length payload crc16_low crc16_high
-```
-
-CRC 为 CRC-16/CCITT-FALSE。正式类型:`0x01 SET_ALL`、`0x02 GET_TEMPERATURE`、`0x03 GET_MOTOR_STATUS`、`0x82 TEMPERATURE_DATA`、`0x83 MOTOR_STATUS_DATA`。
-
-## 产品范围:四腔热控 + 腔体 1 三轴风门百分比定位
-
-- 4 路风扇 duty(0..100),各对应一腔。
-- 4 路 chamber PTC duty,各复制到 2 路物理 PTC PWM(8 路输出严格相等)。
-- 腔体 1:三轴步进风门 X/Y/Z,按闭合百分比开环定位(可并行;latest-wins)。
-- 温度:27 值 GET/响应不变。
-- 马达状态:31 字节 `MOTOR_STATUS_DATA` 可观测标定/运动/故障。
-- 无电磁铁进风门;字节 8 为 Z 轴闭合百分比。
-
-## SET_ALL(11 字节)
-
-| 偏移 | 内容 |
-| ---: | --- |
-| 0–3 | 腔体 1–4 风扇 |
-| 4–7 | 腔体 1–4 PTC |
-| 8 | 风门 Z 闭合百分比 0..100 |
-| 9 | 风门 X 闭合百分比 0..100 |
-| 10 | 风门 Y 闭合百分比 0..100 |
-
-旧 14 字节格式拒绝。SET_ALL 无回复。任一字段越界则整帧拒绝。
-
-## 风门与马达
-
-- 三轴编码均为闭合百分比:`0`=全开(认 open_limit),`100`=全关(认 close_limit),`1..99`=中间开环目标。
-- 中间目标:`clamp((travel*percent+50)//100, 1, travel-1)`;步频 1000 step/s;只计最终 gated STEP 上升沿。
-- 运动中新百分比 latest-wins;最多完成已开始的一步;无命令队列。
-- 电机 EN:CON120.2 → C11,板级 NPN 反相;FPGA 恒 1(`permanent_high`),座端 EN 永久有效。
-- 步进/方向球位:X CON104.2/3 → C12/B12;Y CON105.2/3 → L12/J11;Z CON106.2/3 → L14/K14。
-- **编译期唯一权威配置**(下标 X/Y/Z):`motors.dir_close_level`、`limits.limit_active_high`、`limits.close_limit_is_ls`。默认全 1/true。经正式 `generate_project` 生成 `P4_*_MASK`;`limits.active_level` 为 legacy/deprecated/non-authoritative,不控制 mask。
-
-## 六限位与运行期硬停
-
-每轴高低侧各一限位,`runtime_use=true`;默认生产极性为 FPGA 端 active high、LS=逻辑关闭端:
-
-| 轴 | LS | HS |
-| --- | --- | --- |
-| X | CON12.1 A5 | CON12.2 B6 |
-| Y | CON12.3 C8 | CON12.4 A8 |
-| Z | CON129.1 K16 | CON129.2 J15 |
-
-- **Startup 标定**:PTC=0、FAN=10;每轴独立 seek-close(≤5000)再 measure-open(≤5000);成功锁存 `travel_steps` 并停在全开;失败 FAULT 锁到复位;**无** 500 步 backoff;`startup_complete` 粘滞。
-- **运行期**:按逻辑运动方向选择对应逻辑限位;限位有效时该轴硬停(同步限位后立即截断当前 STEP 高脉冲);命令/watchdog/guard 优雅停不截断高脉冲。
-- 标定完成前:SET_ALL 可更新 FAN/PTC,门百分比忽略不缓存;GET_MOTOR_STATUS 允许;GET_TEMPERATURE 丢弃;看门狗不启用。
-
-## 输出与看门狗
-
-PTC/FAN 球位见 `project.json`。启动 PTC=0、FAN=10。看门狗 **30 s** → PTC=0、FAN=10(仅 `startup_complete` 后由合法 SET_ALL 喂狗)。
-
-## Hardware
-
-硬件验证:**NOT RUN**(未授权 COM/JTAG/烧录)。

+ 0 - 96
projects/registry.json

@@ -46,102 +46,6 @@
       "status": "CURRENT_PRODUCT_FULL_PENDING",
       "wire_contract": "contracts/6400-wire.yaml",
       "frame_protocol": "A5 5A | TYPE:u8 | LENGTH:u8 | PAYLOAD | CRC_L | CRC_H (CRC-16/CCITT-FALSE)"
-    },
-    "mrdimm": {
-      "alias": "mrdimm",
-      "project_id": "mrdimm-chamber",
-      "profile": "mrdimm-chamber",
-      "display_name": "MRDIMM FCB V1.2 chamber controller (single 8-bit frame protocol)",
-      "project_config": "projects/mrdimm-chamber/project.json",
-      "project_json": "projects/mrdimm-chamber/project.json",
-      "source_closure": "products/mrdimm-chamber/source-closure.json",
-      "wire_contract": "contracts/mrdimm-wire.yaml",
-      "top_module": "prod2u_mrdimm_rs232_only_top",
-      "top_file": "src/top/prod2u_mrdimm_rs232_only_top.v",
-      "status": "CURRENT_PRODUCT_FULL_PENDING",
-      "features": {
-        "motors": true,
-        "limits": true,
-        "twelve_logical_axes": true,
-        "finite_segments": true,
-        "variable_speed": true,
-        "startup_seek": false,
-        "motor_queue": true,
-        "events": false,
-        "percent_planner": false,
-        "s_curve": false,
-        "startup_calibration": false
-      },
-      "aliases": [
-        "mrdimm-chamber"
-      ],
-      "validation_profile": "mrdimm-chamber",
-      "semantic_profile": "mrdimm-chamber-v1",
-      "board": "FCB V1.2",
-      "requirements": "projects/mrdimm-chamber/requirements.zh-CN.md",
-      "generated_dir": "generated/mrdimm",
-      "params_header": "generated/mrdimm/prod2u_mrdimm_params.vh",
-      "host_contract": "generated/mrdimm/snapshot-layout.json",
-      "adc": "constraints/prod2u_mrdimm.adc",
-      "sdc": "constraints/prod2u_mrdimm.sdc",
-      "td_project": "td/prod2u_mrdimm.prj",
-      "td_syn_tcl": "td/syn/prod2u_mrdimm.tcl",
-      "td_phy_tcl": "td/phy/prod2u_mrdimm.tcl",
-      "td_bitgen_tcl": "td/bitgen/prod2u_mrdimm.tcl",
-      "verification_targets": "config/current-product-tests.json",
-      "release_pin_policy": "confirmed_exported_pads_only",
-      "production_bitstream": "requires_qualified_receipt",
-      "hardware_host_interfaces": [
-        "CON78_RS232_921600_8N1",
-        "CON140_TTL_921600_8N1"
-      ],
-      "unbound_interfaces": [],
-      "frame_protocol": "A5 5A | TYPE:u8 | LENGTH:u8 | PAYLOAD | CRC_L | CRC_H (CRC-16/CCITT-FALSE)"
-    },
-    "6400-v2": {
-      "alias": "6400-v2",
-      "aliases": [
-        "6400-v2.0",
-        "prod2u-6400-v2"
-      ],
-      "project_id": "6400-v2",
-      "profile": "6400-v2",
-      "validation_profile": "6400-v2",
-      "project_profile": "6400-v2",
-      "semantic_profile": "6400-v2",
-      "display_name": "6400 V2.0 controller (swapped fan pairs, three SSR heater channels, CT diagnostics)",
-      "project_config": "products/6400-v2/project.json",
-      "project_json": "products/6400-v2/project.json",
-      "verification_targets": "config/current-product-tests.json",
-      "features": {
-        "motors": false,
-        "limits": false,
-        "startup_calibration": false,
-        "get_motor_status": false
-      },
-      "requirements": "docs/evidence/6400-v2-electrical-alignment.md",
-      "source_closure": "products/6400-v2/source-closure.json",
-      "generated_dir": "generated/6400-v2",
-      "top_module": "prod2u_6400_v2_top",
-      "top_file": "src/top/prod2u_6400_v2_top.v",
-      "params_header": "generated/6400-v2/prod2u_6400_v2_params.vh",
-      "host_contract": "generated/6400-v2/host-contract.json",
-      "adc": "constraints/prod2u_6400_v2.adc",
-      "sdc": "constraints/prod2u_6400_v2.sdc",
-      "td_project": "td/prod2u_6400_v2.prj",
-      "td_syn_tcl": "td/syn/prod2u_6400_v2.tcl",
-      "td_phy_tcl": "td/phy/prod2u_6400_v2.tcl",
-      "td_bitgen_tcl": "td/bitgen/prod2u_6400_v2.tcl",
-      "release_pin_policy": "confirmed_exported_pads_only",
-      "production_bitstream": "requires_qualified_receipt",
-      "hardware_host_interfaces": [
-        "CON12_TTL_921600_8N1",
-        "CON134_RS232_921600_8N1"
-      ],
-      "board": "FCB V2.0",
-      "status": "CURRENT_PRODUCT_FULL_PENDING",
-      "wire_contract": "contracts/6400-v2-wire.yaml",
-      "frame_protocol": "A5 5A | TYPE:u8 | LENGTH:u8 | PAYLOAD | CRC_L | CRC_H (CRC-16/CCITT-FALSE)"
     }
   }
 }

+ 0 - 294
src/acquisition/bmc_ascii_poll.v

@@ -1,294 +0,0 @@
-`timescale 1ns/1ps
-
-// =============================================================================
-// BMC Temperature Poll over Independent 115200 8N1 BMC UART (CON77).
-//
-// Key Features:
-// 1. Triple-EOL Cycler:
-//    Alternates every round between CRLF (\r\n), LF (\n), and CR (\r)
-//    to diagnose BMC shell newline sensitivity.
-// 2. Space-Delimited 2-Hex-Digit Token Parser:
-//    Ignores command echoes (e.g. "0x36"), prompt words (e.g. "root@..."),
-//    and arbitrary non-data tokens. Only standalone 2-hex-digit tokens
-//    are recognized as data bytes.
-// 3. Empty DIMM (0xFF) Tolerance:
-//    Unpopulated memory slots return 0xFF. This is normal plant behavior
-//    and is NOT treated as a round-wide error. Valid temperatures (0..125 C)
-//    are committed to temp_ram, preserving all real readings.
-// 4. Raw Byte and Event Streaming:
-//    Provides real-time visibility ports for Host UART autonomous reporting.
-// =============================================================================
-
-module bmc_ascii_poll #(
-    parameter integer CLOCK_HZ                = 25000000,
-    parameter integer POLL_SECONDS            = 2,                    // 2 s between poll rounds
-    parameter integer ROUND_TIMEOUT_CLKS      = 12500000,             // 0.5 s timeout at 25 MHz
-    parameter integer INTER_BYTE_TIMEOUT_CLKS = 250000,
-    parameter [7:0]   COMMAND_EOL             = 8'h0A                 // Standard POSIX/Linux LF ('\n')
-) (
-    input  wire        clk,
-    input  wire        rst_n,
-
-    // BMC UART TX (to CON77)
-    output reg         tx_valid,
-    output reg  [7:0]  tx_data,
-    input  wire        tx_ready,
-
-    // BMC UART RX (from CON77)
-    input  wire        rx_valid,
-    input  wire [7:0]  rx_data,
-
-    // temp_ram write port (BMC channels 0..23)
-    output reg         wr_en,
-    output reg  [5:0]  wr_addr,
-    output reg  [7:0]  wr_data,
-
-    // Observability Ports
-    output reg  [15:0] poll_count,        // completed rounds
-    output reg         round_failed,      // 1 if 0 valid DIMMs were found
-    output wire [1:0]  eol_mode,          // Constant 1: Standard LF ('\n')
-    output reg         poll_start,        // 1-cycle pulse when poll begins
-    output reg         poll_done,         // 1-cycle pulse when poll commits
-    output reg  [4:0]  valid_count,       // valid (non-FF) DIMM count in round
-    output wire        raw_rx_valid,      // stream of raw bytes from BMC
-    output wire [7:0]  raw_rx_data
-);
-
-    assign eol_mode     = 2'd1; // 1 = LF ('\n')
-    assign raw_rx_valid = rx_valid;
-    assign raw_rx_data  = rx_data;
-
-    localparam [2:0] ST_WAIT         = 3'd0;
-    localparam [2:0] ST_SEND         = 3'd1;
-    localparam [2:0] ST_DRAIN        = 3'd2;
-    localparam [2:0] ST_RECV         = 3'd3;
-    localparam [2:0] ST_COMMIT       = 3'd4;
-    localparam [2:0] ST_COMMIT_PRIME = 3'd5;
-    localparam [2:0] ST_COMMIT_READ  = 3'd6;
-    localparam [2:0] ST_FLUSH        = 3'd7;
-
-    localparam [8*42-1:0] CMD_BASE     = "ipmitool raw 0x36 0x6c 0xdf 0xdd 0x00 0x03";
-    localparam [5:0]      COMMAND_LAST = 6'd42;
-
-    localparam integer DRAIN_CLKS = ((CLOCK_HZ * 10) / 115200 > 2) ? ((CLOCK_HZ * 10) / 115200) : 2;
-    localparam integer DRAIN_BITS = $clog2(DRAIN_CLKS + 1);
-
-    localparam integer POLL_CLKS = (CLOCK_HZ * POLL_SECONDS < 1) ? 1 : CLOCK_HZ * POLL_SECONDS;
-    localparam integer TIMER_MAX_1 = (POLL_CLKS >= ROUND_TIMEOUT_CLKS) ? POLL_CLKS : ROUND_TIMEOUT_CLKS;
-    localparam integer TIMER_MAX   = (TIMER_MAX_1 >= DRAIN_CLKS) ? TIMER_MAX_1 : DRAIN_CLKS;
-    localparam integer TIMER_BITS  = (TIMER_MAX <= 1) ? 1 : $clog2(TIMER_MAX);
-    /* verilator lint_off WIDTH */
-    localparam [TIMER_BITS-1:0] POLL_LAST  = POLL_CLKS - 1;
-    localparam [TIMER_BITS-1:0] ROUND_LAST = ROUND_TIMEOUT_CLKS - 1;
-    localparam [TIMER_BITS-1:0] DRAIN_LAST = DRAIN_CLKS - 1;
-    /* verilator lint_on WIDTH */
-
-    reg [2:0] state;
-    reg [5:0] command_index;
-    // Single shared timer across mutually exclusive ST_WAIT / ST_DRAIN / ST_RECV
-    reg [TIMER_BITS-1:0] timer_cnt;
-
-    // One small block RAM replaces the resettable 24-byte FF array. The
-    // completed-pair count defines the valid prefix, so RAM needs no reset.
-    reg       round_we;
-    reg [4:0] round_waddr;
-    reg [7:0] round_wdata;
-    wire [7:0] round_rdata;
-    reg [4:0] commit_index;
-
-    ef2_bram_dp #(.DATA_WIDTH(8), .ADDR_WIDTH(5), .DATA_DEPTH(24)) u_round_ram (
-        .clk(clk),
-        .a_en(round_we), .a_we(round_we), .a_addr(round_waddr),
-        .a_wdata(round_wdata), .a_rdata(),
-        .b_en(1'b1), .b_we(1'b0), .b_addr(commit_index),
-        .b_wdata(8'd0), .b_rdata(round_rdata)
-    );
-
-    // Word accumulator & pair decoder (len saturates at 3: only len==2 is valid)
-    reg [1:0] cur_word_len;
-    reg       cur_word_hex;
-    reg [7:0] cur_word_val;
-    reg [5:0] pair_index;
-    reg       pair_is_second;
-    reg [7:0] temp_first_byte;
-
-    // Single shared command byte lookup (used once in ST_SEND)
-    function [7:0] get_cmd_byte;
-        input [5:0] idx;
-        begin
-            if (idx < 6'd42) begin
-                get_cmd_byte = CMD_BASE[(8 * (6'd41 - idx)) +: 8];
-            end else begin
-                get_cmd_byte = COMMAND_EOL; // Fixed LF ('\n', 8'h0A)
-            end
-        end
-    endfunction
-
-    // Single shared RX byte feed (active in SEND/DRAIN/RECV, or synthetic LF in FLUSH)
-    wire       rx_active_state = (state == ST_SEND) || (state == ST_DRAIN) || (state == ST_RECV);
-    wire       rx_feed_en      = (rx_active_state && rx_valid) || (state == ST_FLUSH);
-    wire [7:0] rx_feed_byte    = (state == ST_FLUSH) ? 8'h0A : rx_data;
-    wire       rx_is_delim     = (rx_feed_byte == " ") || (rx_feed_byte == 8'h09) ||
-                                 (rx_feed_byte == 8'h0D) || (rx_feed_byte == 8'h0A);
-    wire       rx_is_digit     = (rx_feed_byte[7:4] == 4'h3) && (rx_feed_byte[3:0] <= 4'd9);
-    wire       rx_is_alpha_hex = ({rx_feed_byte[7:6], rx_feed_byte[4]} == 3'b010) &&
-                                 (rx_feed_byte[3:0] >= 4'd1) && (rx_feed_byte[3:0] <= 4'd6);
-    wire       rx_is_hex       = rx_is_digit || rx_is_alpha_hex;
-    wire [3:0] rx_hex_nibble   = rx_feed_byte[6] ? (rx_feed_byte[3:0] + 4'd9) : rx_feed_byte[3:0];
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            state           <= ST_WAIT;
-            command_index   <= 6'd0;
-            timer_cnt       <= {TIMER_BITS{1'b0}};
-            tx_valid        <= 1'b0;
-            tx_data         <= 8'd0;
-            wr_en           <= 1'b0;
-            wr_addr         <= 6'd0;
-            wr_data         <= 8'hff;
-            poll_count      <= 16'd0;
-            round_failed    <= 1'b0;
-            poll_start      <= 1'b0;
-            poll_done       <= 1'b0;
-            valid_count     <= 5'd0;
-            cur_word_len    <= 2'd0;
-            cur_word_hex    <= 1'b1;
-            cur_word_val    <= 8'd0;
-            pair_index      <= 6'd0;
-            pair_is_second  <= 1'b0;
-            temp_first_byte <= 8'hff;
-            commit_index    <= 5'd0;
-            round_we        <= 1'b0;
-            round_waddr     <= 5'd0;
-            round_wdata     <= 8'hff;
-        end else begin
-            round_we   <= 1'b0;
-            wr_en      <= 1'b0;
-            poll_start <= 1'b0;
-            poll_done  <= 1'b0;
-
-            // Single shared RX token/pair parser (replaces 4 duplicated copies)
-            if (rx_feed_en) begin
-                if (rx_is_delim) begin
-                    if ((cur_word_len == 2'd2) && cur_word_hex) begin
-                        if (!pair_is_second) begin
-                            temp_first_byte <= cur_word_val;
-                            pair_is_second  <= 1'b1;
-                        end else begin
-                            pair_is_second <= 1'b0;
-                            if (pair_index < 6'd24) begin
-                                round_we    <= 1'b1;
-                                round_waddr <= pair_index[4:0];
-                                if (temp_first_byte <= 8'd125) begin
-                                    round_wdata <= temp_first_byte;
-                                    valid_count <= valid_count + 1'b1;
-                                end else begin
-                                    round_wdata <= 8'hff;
-                                end
-                                pair_index <= pair_index + 1'b1;
-                            end
-                        end
-                    end
-                    cur_word_len <= 2'd0;
-                    cur_word_hex <= 1'b1;
-                    cur_word_val <= 8'd0;
-                end else begin
-                    if (cur_word_len != 2'd3) cur_word_len <= cur_word_len + 2'd1;
-                    if (rx_is_hex) begin
-                        cur_word_val <= {cur_word_val[3:0], rx_hex_nibble};
-                    end else begin
-                        cur_word_hex <= 1'b0;
-                    end
-                end
-            end
-
-            case (state)
-            ST_WAIT: begin
-                tx_valid <= 1'b0;
-                if (timer_cnt == POLL_LAST) begin
-                    timer_cnt       <= {TIMER_BITS{1'b0}};
-                    command_index   <= 6'd0;
-                    cur_word_len    <= 2'd0;
-                    cur_word_hex    <= 1'b1;
-                    cur_word_val    <= 8'd0;
-                    pair_index      <= 6'd0;
-                    pair_is_second  <= 1'b0;
-                    temp_first_byte <= 8'hff;
-                    valid_count     <= 5'd0;
-                    poll_start      <= 1'b1;
-                    state           <= ST_SEND;
-                end else begin
-                    timer_cnt <= timer_cnt + 1'b1;
-                end
-            end
-
-            ST_SEND: begin
-                timer_cnt <= {TIMER_BITS{1'b0}};
-                if (!tx_valid) begin
-                    tx_valid <= 1'b1;
-                    tx_data  <= get_cmd_byte(command_index);
-                end else if (tx_ready) begin
-                    tx_valid <= 1'b0;
-                    if (command_index >= COMMAND_LAST) begin
-                        state <= ST_DRAIN;
-                    end else begin
-                        command_index <= command_index + 1'b1;
-                    end
-                end
-            end
-
-            ST_DRAIN: begin
-                if (timer_cnt == DRAIN_LAST) begin
-                    timer_cnt <= {TIMER_BITS{1'b0}};
-                    state     <= ST_RECV;
-                end else begin
-                    timer_cnt <= timer_cnt + 1'b1;
-                end
-            end
-
-            ST_RECV: begin
-                if (timer_cnt == ROUND_LAST) begin
-                    timer_cnt <= {TIMER_BITS{1'b0}};
-                    state     <= ST_FLUSH;
-                end else begin
-                    timer_cnt <= timer_cnt + 1'b1;
-                end
-            end
-
-            // Flush any trailing unterminated 2-hex token via the shared RX parser.
-            ST_FLUSH: begin
-                commit_index <= 5'd0;
-                state        <= ST_COMMIT_PRIME;
-            end
-
-            // The flush may have queued the last pair write. Let that
-            // registered write reach RAM, then wait for its synchronous read.
-            ST_COMMIT_PRIME: state <= ST_COMMIT_READ;
-            ST_COMMIT_READ: state <= ST_COMMIT;
-
-            ST_COMMIT: begin
-                wr_en   <= 1'b1;
-                wr_addr <= {1'b0, commit_index};
-                // Only completed pairs from this poll are current; an absent
-                // or short reply must not republish last round's tail.
-                wr_data <= ({1'b0, commit_index} < pair_index) ?
-                    round_rdata : 8'hff;
-                if (commit_index == 5'd23) begin
-                    commit_index <= 5'd0;
-                    poll_count   <= poll_count + 1'b1;
-                    round_failed <= (valid_count == 5'd0);
-                    poll_done    <= 1'b1;
-                    timer_cnt    <= {TIMER_BITS{1'b0}};
-                    state        <= ST_WAIT;
-                end else begin
-                    commit_index <= commit_index + 1'b1;
-                    state        <= ST_COMMIT_READ;
-                end
-            end
-
-            default: state <= ST_WAIT;
-            endcase
-        end
-    end
-
-endmodule

+ 0 - 303
src/acquisition/bmc_ascii_snapshot.v

@@ -1,303 +0,0 @@
-`timescale 1ns/1ps
-
-// Streaming ASCII-hex decoder for one 24 x two-byte BMC line. Writes always
-// target the inactive bank; only an exact, valid 48-byte line flips active.
-module bmc_ascii_snapshot #(
-    parameter integer STALE_SECONDS = 3,
-    parameter integer INTER_BYTE_TIMEOUT_CLKS = 2500000,
-    parameter [15:0] INITIAL_EPOCH = 16'd0
-) (
-    input  wire        clk,
-    input  wire        rst_n,
-    input  wire        tick_1s,
-    input  wire        rx_valid,
-    input  wire [7:0]  rx_data,
-    input  wire        rx_framing_error,
-    input  wire        snapshot_lock,
-    input  wire        snapshot_lock_bank,
-    output reg         snapshot_commit,
-    output reg         parser_error,
-    output reg [15:0]  epoch,
-    output reg [15:0]  age_seconds,
-    output wire        stale,
-    output reg         active_bank,
-    output wire [23:0] active_valid_mask,
-    input  wire        control_bank,
-    input  wire [4:0]  control_index,
-    output reg [15:0]  control_raw,
-    output reg         control_valid,
-    input  wire        snapshot_bank,
-    input  wire [4:0]  snapshot_index,
-    output reg [15:0]  snapshot_raw,
-    output reg         snapshot_valid
-);
-    reg [23:0] valid0;
-    reg [23:0] valid1;
-    reg [5:0] byte_count;
-    reg [3:0] high_nibble;
-    reg have_high;
-    reg line_active;
-    reg line_bad;
-    reg line_format_bad;
-    reg [7:0] integer_byte;
-    reg echo_match;
-    localparam integer GAP_BITS = (INTER_BYTE_TIMEOUT_CLKS <= 1) ? 1 :
-        $clog2(INTER_BYTE_TIMEOUT_CLKS + 1);
-    reg [GAP_BITS-1:0] gap_counter;
-    reg init_active;
-    reg [4:0] init_index;
-    reg ram_write_en;
-    reg ram_write_bank;
-    reg [4:0] ram_write_addr;
-    reg [15:0] ram_write_data;
-    wire inactive_bank = ~active_bank;
-    wire write_blocked = snapshot_lock && (inactive_bank == snapshot_lock_bank);
-    /* verilator lint_off WIDTH */
-    wire gap_expired = gap_counter >= INTER_BYTE_TIMEOUT_CLKS - 1;
-    /* verilator lint_on WIDTH */
-
-    function is_hex;
-        input [7:0] value;
-        begin
-            is_hex = ((value >= "0") && (value <= "9")) ||
-                     ((value >= "a") && (value <= "f")) ||
-                     ((value >= "A") && (value <= "F"));
-        end
-    endfunction
-
-    function [3:0] hex_value;
-        input [7:0] value;
-        begin
-            if (value >= "0" && value <= "9")
-                hex_value = value[3:0];
-            else if (value >= "a" && value <= "f")
-                hex_value = value[3:0] + 4'd9;
-            else
-                hex_value = value[3:0] + 4'd9;
-        end
-    endfunction
-
-    function [7:0] echo_byte;
-        input [2:0] index;
-        begin
-            case (index)
-                3'd0: echo_byte = 8'h36;
-                3'd1: echo_byte = 8'h6c;
-                3'd2: echo_byte = 8'hdf;
-                3'd3: echo_byte = 8'hdd;
-                3'd4: echo_byte = 8'h00;
-                default: echo_byte = 8'h03;
-            endcase
-        end
-    endfunction
-
-    assign stale = (age_seconds >= STALE_SECONDS[15:0]);
-    assign active_valid_mask = active_bank ? valid1 : valid0;
-    wire bank0_write = init_active || (ram_write_en && !ram_write_bank);
-    wire bank1_write = init_active || (ram_write_en && ram_write_bank);
-    wire [4:0] bank0_b_addr = init_active ? init_index :
-        ((ram_write_en && !ram_write_bank) ? ram_write_addr : snapshot_index);
-    wire [4:0] bank1_b_addr = init_active ? init_index :
-        ((ram_write_en && ram_write_bank) ? ram_write_addr : snapshot_index);
-    wire [15:0] bank_write_data = init_active ? 16'd0 : ram_write_data;
-    wire [15:0] bank0_control_raw;
-    wire [15:0] bank1_control_raw;
-    wire [15:0] bank0_snapshot_raw;
-    wire [15:0] bank1_snapshot_raw;
-
-    ef2_bram_dp #(.DATA_WIDTH(16), .ADDR_WIDTH(5), .DATA_DEPTH(24)) u_bank0 (
-        .clk(clk), .a_en(1'b1), .a_we(1'b0), .a_addr(control_index),
-        .a_wdata(16'd0), .a_rdata(bank0_control_raw),
-        .b_en(1'b1), .b_we(bank0_write), .b_addr(bank0_b_addr),
-        .b_wdata(bank_write_data), .b_rdata(bank0_snapshot_raw)
-    );
-    ef2_bram_dp #(.DATA_WIDTH(16), .ADDR_WIDTH(5), .DATA_DEPTH(24)) u_bank1 (
-        .clk(clk), .a_en(1'b1), .a_we(1'b0), .a_addr(control_index),
-        .a_wdata(16'd0), .a_rdata(bank1_control_raw),
-        .b_en(1'b1), .b_we(bank1_write), .b_addr(bank1_b_addr),
-        .b_wdata(bank_write_data), .b_rdata(bank1_snapshot_raw)
-    );
-
-    always @* begin
-        control_raw = control_bank ? bank1_control_raw : bank0_control_raw;
-        control_valid = control_bank ? valid1[control_index] : valid0[control_index];
-        snapshot_raw = snapshot_bank ? bank1_snapshot_raw : bank0_snapshot_raw;
-        snapshot_valid = snapshot_bank ? valid1[snapshot_index] : valid0[snapshot_index];
-    end
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            snapshot_commit <= 1'b0;
-            parser_error <= 1'b0;
-            epoch <= INITIAL_EPOCH;
-            age_seconds <= 16'hffff;
-            active_bank <= 1'b0;
-            valid0 <= 24'd0;
-            valid1 <= 24'd0;
-            byte_count <= 6'd0;
-            high_nibble <= 4'd0;
-            have_high <= 1'b0;
-            line_active <= 1'b0;
-            line_bad <= 1'b0;
-            line_format_bad <= 1'b0;
-            integer_byte <= 8'd0;
-            echo_match <= 1'b1;
-            gap_counter <= {GAP_BITS{1'b0}};
-            init_active <= 1'b1;
-            init_index <= 5'd0;
-            ram_write_en <= 1'b0;
-            ram_write_bank <= 1'b0;
-            ram_write_addr <= 5'd0;
-            ram_write_data <= 16'd0;
-        end else begin
-            snapshot_commit <= 1'b0;
-            parser_error <= 1'b0;
-            ram_write_en <= 1'b0;
-            if (init_active) begin
-                if (init_index == 5'd23) begin
-                    init_active <= 1'b0;
-                    init_index <= 5'd0;
-                end else begin
-                    init_index <= init_index + 1'b1;
-                end
-            end else begin
-                if (tick_1s && age_seconds != 16'hffff)
-                    age_seconds <= age_seconds + 1'b1;
-                if (rx_framing_error) begin
-                    line_bad <= 1'b1;
-                    line_format_bad <= 1'b1;
-                    line_active <= 1'b1;
-                end
-                if (!rx_valid && line_active) begin
-                if (INTER_BYTE_TIMEOUT_CLKS <= 1 || gap_expired) begin
-                    byte_count <= 6'd0;
-                    have_high <= 1'b0;
-                    line_active <= 1'b0;
-                    line_bad <= 1'b0;
-                    line_format_bad <= 1'b0;
-                    integer_byte <= 8'd0;
-                    echo_match <= 1'b1;
-                    gap_counter <= {GAP_BITS{1'b0}};
-                    parser_error <= 1'b1;
-                end else begin
-                    gap_counter <= gap_counter + 1'b1;
-                end
-            end
-                if (rx_valid) begin
-                gap_counter <= {GAP_BITS{1'b0}};
-                if (is_hex(rx_data)) begin
-                    if (!line_active && !have_high) begin
-                        if (write_blocked)
-                            line_bad <= 1'b1;
-                        else if (active_bank)
-                            valid0 <= 24'd0;
-                        else
-                            valid1 <= 24'd0;
-                    end
-                    line_active <= 1'b1;
-                    if (!have_high) begin
-                        high_nibble <= hex_value(rx_data);
-                        have_high <= 1'b1;
-                    end else begin
-                        have_high <= 1'b0;
-                        if (byte_count < 6'd48) begin
-                            if (byte_count < 6)
-                                echo_match <= echo_match && ({high_nibble, hex_value(rx_data)} == echo_byte(byte_count[2:0]));
-                            if (byte_count[0] == 1'b0) begin
-                                integer_byte <= {high_nibble, hex_value(rx_data)};
-                            end else begin
-                                if (!write_blocked) begin
-                                    ram_write_en <= 1'b1;
-                                    ram_write_bank <= inactive_bank;
-                                    ram_write_addr <= byte_count[5:1];
-                                    ram_write_data <= {integer_byte, {high_nibble, hex_value(rx_data)}};
-                                end
-                                if ((integer_byte == 8'hff) && ({high_nibble, hex_value(rx_data)} == 8'hff)) begin
-                                if (active_bank)
-                                    valid0[byte_count[5:1]] <= 1'b0;
-                                else
-                                    valid1[byte_count[5:1]] <= 1'b0;
-                                end else if ((integer_byte == 8'hff) || ({high_nibble, hex_value(rx_data)} >= 8'd100)) begin
-                                    line_bad <= 1'b1;
-                                end else begin
-                                    if (active_bank)
-                                        valid0[byte_count[5:1]] <= 1'b1;
-                                    else
-                                        valid1[byte_count[5:1]] <= 1'b1;
-                                end
-                            end
-                            byte_count <= byte_count + 1'b1;
-                        end else begin
-                            line_bad <= 1'b1;
-                            line_format_bad <= 1'b1;
-                        end
-                    end
-                end else if ((rx_data == " ") || (rx_data == 8'h09)) begin
-                    if (have_high) begin
-                        line_bad <= 1'b1;
-                        line_format_bad <= 1'b1;
-                    end
-                    have_high <= 1'b0;
-                end else if ((rx_data == 8'h0d) || (rx_data == 8'h0a)) begin
-                    if (line_active) begin
-                        if ((byte_count == 6) && echo_match && !have_high && !line_format_bad) begin
-                            // Optional six-byte command echo is a separate line.
-                        end else if ((byte_count == 48) && !have_high && !line_bad && !line_format_bad) begin
-                            active_bank <= ~active_bank;
-                            epoch <= epoch + 1'b1;
-                            age_seconds <= 16'd0;
-                            snapshot_commit <= 1'b1;
-                        end else begin
-                            parser_error <= 1'b1;
-                        end
-                    end
-                    byte_count <= 6'd0;
-                    have_high <= 1'b0;
-                    line_active <= 1'b0;
-                    line_bad <= 1'b0;
-                    line_format_bad <= 1'b0;
-                    echo_match <= 1'b1;
-                    gap_counter <= {GAP_BITS{1'b0}};
-                end else begin
-                    line_active <= 1'b1;
-                    line_bad <= 1'b1;
-                    line_format_bad <= 1'b1;
-                    have_high <= 1'b0;
-                end
-                end
-            end
-        end
-    end
-
-`ifdef FORMAL
-    reg formal_past_valid;
-    initial formal_past_valid = 0;
-    always @(posedge clk) begin
-        formal_past_valid <= 1;
-        if (rst_n && formal_past_valid && $past(rst_n)) begin
-            // P08: outside deterministic initialization, the write-port
-            // decoder can only select the inactive bank.
-            if (!init_active) begin
-                assert(!(bank0_write && !active_bank));
-                assert(!(bank1_write && active_bank));
-                if (active_bank == $past(active_bank)) begin
-                if (active_bank)
-                    assert(valid1 == $past(valid1));
-                else
-                    assert(valid0 == $past(valid0));
-                end
-            end
-
-            // P09: a bank swap is one pointer flip paired with one epoch step.
-            if (active_bank != $past(active_bank)) begin
-                assert(snapshot_commit);
-                assert(epoch == $past(epoch) + 1'b1);
-            end
-            if (snapshot_commit)
-                assert(active_bank != $past(active_bank));
-            cover(snapshot_commit && active_bank != $past(active_bank));
-            cover(line_active && byte_count != 0);
-        end
-    end
-`endif
-endmodule

+ 0 - 85
src/acquisition/bmc_poll_engine.v

@@ -1,85 +0,0 @@
-`timescale 1ns/1ps
-
-module bmc_poll_engine #(
-    parameter integer CLOCK_HZ = 25000000,
-    parameter integer POLL_SECONDS = 1,
-    parameter integer STARTUP_WAKE_COUNT = 3,
-    parameter integer STARTUP_GAP_CLKS = 5000000,
-    parameter integer STARTUP_DELAY_CLKS = 12500000
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       tx_ready,
-    output reg        tx_valid,
-    output reg [7:0]  tx_data,
-    output reg [15:0] poll_count
-);
-    localparam [2:0] ST_WAKE = 3'd0;
-    localparam [2:0] ST_WAKE_GAP = 3'd1;
-    localparam [2:0] ST_START_DELAY = 3'd2;
-    localparam [2:0] ST_SEND = 3'd3;
-    localparam [2:0] ST_WAIT = 3'd4;
-    localparam [5:0] LAST_COMMAND_INDEX = 6'd42;
-    localparam integer POLL_CLKS = CLOCK_HZ * POLL_SECONDS;
-
-    reg [2:0] state;
-    reg [31:0] counter;
-    reg [5:0] command_index;
-    reg [2:0] wake_count;
-
-    function [7:0] command_char;
-        input [5:0] index;
-        begin
-            case (index)
-                0: command_char="i"; 1: command_char="p"; 2: command_char="m"; 3: command_char="i";
-                4: command_char="t"; 5: command_char="o"; 6: command_char="o"; 7: command_char="l";
-                8: command_char=" "; 9: command_char="r"; 10: command_char="a"; 11: command_char="w";
-                12: command_char=" "; 13: command_char="0"; 14: command_char="x"; 15: command_char="3";
-                16: command_char="6"; 17: command_char=" "; 18: command_char="0"; 19: command_char="x";
-                20: command_char="6"; 21: command_char="c"; 22: command_char=" "; 23: command_char="0";
-                24: command_char="x"; 25: command_char="d"; 26: command_char="f"; 27: command_char=" ";
-                28: command_char="0"; 29: command_char="x"; 30: command_char="d"; 31: command_char="d";
-                32: command_char=" "; 33: command_char="0"; 34: command_char="x"; 35: command_char="0";
-                36: command_char="0"; 37: command_char=" "; 38: command_char="0"; 39: command_char="x";
-                40: command_char="0"; 41: command_char="3"; default: command_char=8'h0a;
-            endcase
-        end
-    endfunction
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            state <= ST_WAKE;
-            counter <= 0;
-            command_index <= 0;
-            wake_count <= 0;
-            tx_valid <= 0;
-            tx_data <= 0;
-            poll_count <= 0;
-        end else begin
-            tx_valid <= 0;
-            case (state)
-                ST_WAKE: if (tx_ready) begin
-                    tx_valid <= 1;
-                    tx_data <= 8'h0d;
-                    wake_count <= wake_count + 1'b1;
-                    counter <= 0;
-                    state <= (wake_count + 1'b1 >= STARTUP_WAKE_COUNT[2:0]) ? ST_START_DELAY : ST_WAKE_GAP;
-                end
-                ST_WAKE_GAP: if (counter + 1 >= STARTUP_GAP_CLKS) begin counter <= 0; state <= ST_WAKE; end else counter <= counter + 1'b1;
-                ST_START_DELAY: if (counter + 1 >= STARTUP_DELAY_CLKS) begin counter <= 0; command_index <= 0; state <= ST_SEND; end else counter <= counter + 1'b1;
-                ST_SEND: if (tx_ready) begin
-                    tx_valid <= 1;
-                    tx_data <= command_char(command_index);
-                    if (command_index == LAST_COMMAND_INDEX) begin
-                        command_index <= 0;
-                        counter <= 0;
-                        poll_count <= poll_count + 1'b1;
-                        state <= ST_WAIT;
-                    end else command_index <= command_index + 1'b1;
-                end
-                ST_WAIT: if (counter + 1 >= POLL_CLKS) begin counter <= 0; state <= ST_SEND; end else counter <= counter + 1'b1;
-                default: state <= ST_WAKE;
-            endcase
-        end
-    end
-endmodule

+ 0 - 170
src/acquisition/ct7428_snapshot.v

@@ -1,170 +0,0 @@
-`timescale 1ns/1ps
-
-module ct7428_snapshot #(
-    parameter integer SCAN_PERIOD_CLKS = 2500000,
-    parameter integer STALE_SECONDS = 2
-) (
-    input  wire        clk,
-    input  wire        rst_n,
-    input  wire        tick_1s,
-    input  wire        snapshot_lock,
-    input  wire        snapshot_lock_bank,
-    output reg         request_valid,
-    input  wire        request_ready,
-    output reg [6:0]   device_addr,
-    output reg [7:0]   register_addr,
-    input  wire        response_valid,
-    output wire        response_ready,
-    input  wire [15:0] response_data,
-    input  wire [3:0]  response_error,
-    output reg         snapshot_commit,
-    output reg [15:0]  epoch,
-    output reg [15:0]  age_seconds,
-    output wire        stale,
-    output reg         active_bank,
-    output wire [26:0] active_valid_mask,
-    input  wire        control_bank,
-    input  wire [4:0]  control_index,
-    output reg [15:0]  control_raw,
-    output reg         control_valid,
-    input  wire        snapshot_bank,
-    input  wire [4:0]  snapshot_index,
-    output reg [15:0]  snapshot_raw,
-    output reg         snapshot_valid
-);
-    localparam ST_START = 2'd0;
-    localparam ST_REQUEST = 2'd1;
-    localparam ST_RESPONSE = 2'd2;
-    localparam ST_WAIT = 2'd3;
-    reg [1:0] state;
-    reg [4:0] index;
-    reg [21:0] wait_counter;
-    reg [26:0] valid0;
-    reg [26:0] valid1;
-    reg [26:0] valid_accum;
-    reg [3:0]  dev_reg;
-    reg init_active;
-    reg [4:0] init_index;
-    wire inactive_bank = ~active_bank;
-    wire write_blocked = snapshot_lock && (inactive_bank == snapshot_lock_bank);
-
-    assign response_ready = (state == ST_RESPONSE);
-    assign stale = age_seconds >= STALE_SECONDS[15:0];
-    assign active_valid_mask = active_bank ? valid1 : valid0;
-    wire sample_write = !init_active && state == ST_RESPONSE && response_valid;
-    wire bank0_write = init_active || (sample_write && !inactive_bank);
-    wire bank1_write = init_active || (sample_write && inactive_bank);
-    wire [4:0] bank_b_addr = init_active ? init_index :
-        (sample_write ? index : snapshot_index);
-    wire [15:0] bank_write_data = init_active ? 16'd0 : response_data;
-    wire [15:0] bank0_control_raw;
-    wire [15:0] bank1_control_raw;
-    wire [15:0] bank0_snapshot_raw;
-    wire [15:0] bank1_snapshot_raw;
-
-    ef2_bram_dp #(.DATA_WIDTH(16), .ADDR_WIDTH(5), .DATA_DEPTH(27)) u_bank0 (
-        .clk(clk), .a_en(1'b1), .a_we(1'b0), .a_addr(control_index),
-        .a_wdata(16'd0), .a_rdata(bank0_control_raw),
-        .b_en(1'b1), .b_we(bank0_write), .b_addr(bank_b_addr),
-        .b_wdata(bank_write_data), .b_rdata(bank0_snapshot_raw)
-    );
-    ef2_bram_dp #(.DATA_WIDTH(16), .ADDR_WIDTH(5), .DATA_DEPTH(27)) u_bank1 (
-        .clk(clk), .a_en(1'b1), .a_we(1'b0), .a_addr(control_index),
-        .a_wdata(16'd0), .a_rdata(bank1_control_raw),
-        .b_en(1'b1), .b_we(bank1_write), .b_addr(bank_b_addr),
-        .b_wdata(bank_write_data), .b_rdata(bank1_snapshot_raw)
-    );
-
-
-
-    always @* begin
-        control_raw = control_bank ? bank1_control_raw : bank0_control_raw;
-        control_valid = control_bank ? valid1[control_index] : valid0[control_index];
-        snapshot_raw = snapshot_bank ? bank1_snapshot_raw : bank0_snapshot_raw;
-        snapshot_valid = snapshot_bank ? valid1[snapshot_index] : valid0[snapshot_index];
-    end
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            state <= ST_START;
-            index <= 0;
-            wait_counter <= 0;
-            request_valid <= 0;
-            device_addr <= 7'h49;
-            register_addr <= 0;
-            snapshot_commit <= 0;
-            epoch <= 0;
-            age_seconds <= 16'hffff;
-            active_bank <= 0;
-            valid0 <= 0;
-            valid1 <= 0;
-            valid_accum <= 0;
-            dev_reg <= 0;
-            init_active <= 1'b1;
-            init_index <= 5'd0;
-        end else begin
-            snapshot_commit <= 0;
-            if (init_active) begin
-                request_valid <= 1'b0;
-                if (init_index == 5'd26) begin
-                    init_active <= 1'b0;
-                    init_index <= 5'd0;
-                    state <= ST_START;
-                end else begin
-                    init_index <= init_index + 1'b1;
-                end
-            end else begin
-                if (tick_1s && age_seconds != 16'hffff) age_seconds <= age_seconds + 1'b1;
-                case (state)
-                ST_START: begin
-                    index <= 0;
-                    dev_reg <= 4'd0;
-                    device_addr <= 7'h49;
-                    register_addr <= 8'd0;
-                    if (!write_blocked) begin
-                        if (active_bank) valid0 <= 0; else valid1 <= 0;
-                        valid_accum <= 27'd0;
-                        state <= ST_REQUEST;
-                    end
-                end
-                ST_REQUEST: begin
-                    request_valid <= 1;
-                    register_addr <= {4'd0, dev_reg};
-                    if (request_valid && request_ready) begin
-                        request_valid <= 0;
-                        state <= ST_RESPONSE;
-                    end
-                end
-                ST_RESPONSE: if (response_valid) begin
-                    valid_accum <= { (response_error == 4'd0), valid_accum[26:1] };
-                    if (dev_reg == 4'd8) begin
-                        dev_reg <= 4'd0;
-                        if (index == 5'd8) device_addr <= 7'h48;
-                        else if (index == 5'd17) device_addr <= 7'h4b;
-                    end else begin
-                        dev_reg <= dev_reg + 1'b1;
-                    end
-                    if (index == 26) begin
-                        if (active_bank) valid0 <= { (response_error == 4'd0), valid_accum[26:1] };
-                        else             valid1 <= { (response_error == 4'd0), valid_accum[26:1] };
-                        active_bank <= ~active_bank;
-                        epoch <= epoch + 1'b1;
-                        age_seconds <= 0;
-                        snapshot_commit <= 1;
-                        wait_counter <= 0;
-                        state <= ST_WAIT;
-                    end else begin
-                        index <= index + 1'b1;
-                        state <= ST_REQUEST;
-                    end
-                end
-                ST_WAIT: if (wait_counter + 1 >= SCAN_PERIOD_CLKS[21:0]) begin
-                    wait_counter <= 0;
-                    state <= ST_START;
-                end else wait_counter <= wait_counter + 1'b1;
-                default: state <= ST_START;
-                endcase
-            end
-        end
-    end
-endmodule

+ 0 - 43
src/actuator/buzzer_pwm_4khz.v

@@ -1,43 +0,0 @@
-`timescale 1ns/1ps
-
-// =============================================================================
-// Buzzer 4000 Hz / 80% Duty Square-Wave Generator (25 MHz single clock domain)
-//
-// At 25 MHz:
-//   - Period = 6250 clocks (250 us -> 4000 Hz)
-//   - High   = 5000 clocks (200 us -> 80% duty)
-//   - Low    = 1250 clocks ( 50 us -> 20% duty)
-// When disabled (enable == 0), in reset (!rst_n), or after watchdog timeout,
-// the output is held strictly LOW (1'b0) and the phase counter resets to 0.
-// =============================================================================
-module buzzer_pwm_4khz #(
-    parameter integer PERIOD_CLKS = 6250,
-    parameter integer HIGH_CLKS   = 5000
-) (
-    input  wire clk,
-    input  wire rst_n,
-    input  wire enable,
-    output reg  buzzer_out
-);
-    localparam integer CNT_W = $clog2(PERIOD_CLKS);
-    localparam [CNT_W-1:0] PERIOD_LAST = PERIOD_CLKS - 1;
-    localparam [CNT_W-1:0] HIGH_LIMIT  = HIGH_CLKS;
-
-    reg [CNT_W-1:0] cnt;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            cnt        <= {CNT_W{1'b0}};
-            buzzer_out <= 1'b0;
-        end else if (!enable) begin
-            cnt        <= {CNT_W{1'b0}};
-            buzzer_out <= 1'b0;
-        end else begin
-            buzzer_out <= (cnt < HIGH_LIMIT);
-            if (cnt == PERIOD_LAST)
-                cnt <= {CNT_W{1'b0}};
-            else
-                cnt <= cnt + {{(CNT_W-1){1'b0}}, 1'b1};
-        end
-    end
-endmodule

+ 0 - 25
src/actuator/fan_boot_safety_controller.v

@@ -1,25 +0,0 @@
-`timescale 1ns/1ps
-
-// Samples boot completion and fault state only on the common PWM boundary.
-// Reset keeps the board adapter in its full-speed request state.
-module fan_boot_safety_controller (
-    input  wire clk,
-    input  wire rst_n,
-    input  wire pwm_boundary_advance,
-    input  wire boot_init_complete,
-    input  wire bmc_stale,
-    input  wire global_fault,
-    output reg  boot_release,
-    output reg  force_full_speed
-);
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            boot_release <= 1'b0;
-            force_full_speed <= 1'b1;
-        end else if (pwm_boundary_advance) begin
-            if (boot_init_complete)
-                boot_release <= 1'b1;
-            force_full_speed <= bmc_stale || global_fault;
-        end
-    end
-endmodule

+ 0 - 428
src/actuator/mrdimm_actuator_core.v

@@ -1,428 +0,0 @@
-`timescale 1ns/1ps
-
-// =============================================================================
-// Product:       Prod2U MRDIMM / 8000 FCB V1.2
-// Module:        mrdimm_actuator_core (v3.1.0 BRAM-backed serial 12-axis engine)
-// Description:   Ultra-low-LUT time-multiplexed 12-axis finite-segment stepper
-//                engine. Per-axis 16-bit counters (rem_steps, half_period,
-//                timer, steps_done) and metadata (setup_timer, done_reason)
-//                reside in hard BRAM (4x EF2_PHY_BRAM32K + 1x EF2_LOGIC_BRAM 9K
-//                in TD; cycle-accurate behavioral arrays in simulation).
-//                A single shared 16-bit ALU scans axes 0..11 in 13 clocks per
-//                25-clock (1 us @ 25 MHz) tick, saving ~1,500 LUTs while
-//                preserving zero-jitter pulse widths, 10 us DIR setup, exact
-//                rising-edge step counts, directional limit aborts, latest-wins
-//                replacement, and 1-clock STOP_CLEAR / watchdog aborts.
-// =============================================================================
-
-module mrdimm_actuator_core #(
-    parameter integer AXIS_COUNT = 12,
-    parameter integer SLOTS_PER_AXIS = 1,
-    parameter [11:0]  DIR_INVERT_MASK = 12'h000
-) (
-    input  wire        clk,
-    input  wire        rst_n,
-    input  wire        tick_us,
-    input  wire        watchdog_expired,
-
-    // Enqueue interface (from transaction core during SET_ACCEPT)
-    input  wire        enqueue_we,
-    input  wire [3:0]  enqueue_axis,
-    input  wire [15:0] enqueue_steps,
-    input  wire [15:0] enqueue_half_period_us,
-    input  wire        enqueue_dir, // 0 = down, 1 = up
-    input  wire [11:0] stop_clear_mask,
-
-    // Capacity query (always ready, latest-wins)
-    output wire [11:0] axis_queue_full,
-
-    // Limit switch inputs (active high after 2-stage sync)
-    input  wire [11:0] limit_lower_raw,
-    input  wire [11:0] limit_upper_raw,
-    output wire [11:0] limit_lower_sync,
-    output wire [11:0] limit_upper_sync,
-
-    // Physical outputs (to open-drain gates via top)
-    output wire [11:0] step_out,
-    output wire [11:0] dir_out,
-    output wire [11:0] axis_active_out,
-
-    // Serial BRAM-backed DONE read interface (to Unified TX Arbiter)
-    output wire [11:0] done_pending,
-    input  wire [3:0]  done_rd_axis,
-    output wire        done_rd_busy,
-    output wire [1:0]  done_rd_reason,
-    output wire [15:0] done_rd_steps,
-    input  wire [11:0] done_ack
-);
-    assign axis_queue_full = 12'd0;
-
-    // Two-stage synchronizers for 24 limit inputs (synchronous reset safe on EF2)
-    reg [11:0] lower_s0, lower_s1;
-    reg [11:0] upper_s0, upper_s1;
-    always @(posedge clk) begin
-        if (!rst_n) begin
-            lower_s0 <= 12'd0;
-            lower_s1 <= 12'd0;
-            upper_s0 <= 12'd0;
-            upper_s1 <= 12'd0;
-        end else begin
-            lower_s0 <= limit_lower_raw;
-            lower_s1 <= lower_s0;
-            upper_s0 <= limit_upper_raw;
-            upper_s1 <= upper_s0;
-        end
-    end
-    assign limit_lower_sync = lower_s1;
-    assign limit_upper_sync = upper_s1;
-
-    // Compact per-axis FF bit-vectors (instant single-cycle STOP_CLEAR/WD/DONE)
-    reg [11:0] axis_active;
-    reg [11:0] axis_dir;
-    reg [11:0] axis_phase;
-    reg [11:0] step_out_r;
-    reg [11:0] done_pending_r;
-
-    assign step_out        = step_out_r;
-    assign dir_out         = axis_dir ^ DIR_INVERT_MASK;
-    assign done_pending    = done_pending_r;
-    assign axis_active_out = axis_active;
-
-    // Serial 12-axis scan pipeline
-    reg        tick_pending;
-    reg        scan_rd_valid;
-    reg [3:0]  scan_rd_axis;
-    reg        scan_pipe_valid;
-    reg [3:0]  scan_wr_axis;
-    reg [11:0] skip_mask;
-
-    // Arbiter may sample Port A whenever the scan is not actively driving Port A.
-    assign done_rd_busy = scan_rd_valid || scan_pipe_valid || tick_pending || tick_us;
-
-    wire [3:0]  port_a_addr = scan_rd_valid ? scan_rd_axis : done_rd_axis;
-    wire [15:0] rd_rem;
-    wire [15:0] rd_hp;
-    wire [15:0] rd_tmr;
-    wire [15:0] rd_steps;
-    wire [7:0]  rd_meta;
-
-    assign done_rd_reason = rd_meta[5:4];
-    assign done_rd_steps  = rd_steps;
-
-    // Shared input period subtractor
-    wire [15:0] enqueue_period_reload = (enqueue_half_period_us == 16'd0) ?
-        16'd0 : (enqueue_half_period_us - 16'd1);
-
-    // Single shared combinational ALU for scan writeback of `scan_wr_axis`
-    wire       cur_active = axis_active[scan_wr_axis];
-    wire       cur_dir    = axis_dir[scan_wr_axis];
-    wire       cur_phase  = axis_phase[scan_wr_axis];
-    wire       cur_lower  = lower_s1[scan_wr_axis];
-    wire       cur_upper  = upper_s1[scan_wr_axis];
-    wire [3:0] cur_setup  = rd_meta[3:0];
-
-    wire limit_hit = (!cur_dir && cur_lower) || (cur_dir && cur_upper);
-    wire [1:0] abort_reason = (cur_lower && cur_upper) ? 2'b11 :
-                              (!cur_dir ? 2'b01 : 2'b10);
-
-    wire scan_eval_en = !watchdog_expired && !enqueue_we && scan_pipe_valid &&
-                        cur_active && !skip_mask[scan_wr_axis] &&
-                        !stop_clear_mask[scan_wr_axis];
-
-    reg        nxt_active;
-    reg        nxt_phase;
-    reg        nxt_step;
-    reg        nxt_done_set;
-    reg [15:0] wb_rem;
-    reg [15:0] wb_hp;
-    reg [15:0] wb_tmr;
-    reg [15:0] wb_steps;
-    reg [7:0]  wb_meta;
-
-    always @(*) begin
-        nxt_active   = cur_active;
-        nxt_phase    = cur_phase;
-        nxt_step     = step_out_r[scan_wr_axis];
-        nxt_done_set = 1'b0;
-        wb_rem       = rd_rem;
-        wb_hp        = rd_hp;
-        wb_tmr       = rd_tmr;
-        wb_steps     = rd_steps;
-        wb_meta      = rd_meta;
-
-        if (limit_hit) begin
-            nxt_active   = 1'b0;
-            nxt_step     = 1'b0;
-            nxt_done_set = 1'b1;
-            wb_meta      = {2'b00, abort_reason, 4'd0};
-        end else if (cur_setup != 4'd0) begin
-            nxt_step = 1'b0;
-            wb_meta  = {2'b00, rd_meta[5:4], cur_setup - 4'd1};
-        end else if (rd_tmr == 16'd0) begin
-            wb_tmr = rd_hp;
-            if (!cur_phase) begin
-                nxt_phase = 1'b1;
-                nxt_step  = 1'b1;
-                wb_steps  = rd_steps + 16'd1;
-            end else begin
-                nxt_phase = 1'b0;
-                nxt_step  = 1'b0;
-                if (rd_rem == 16'd1) begin
-                    nxt_active   = 1'b0;
-                    wb_rem       = 16'd0;
-                    nxt_done_set = 1'b1;
-                    wb_meta      = {2'b00, 2'b00, 4'd0};
-                end else begin
-                    wb_rem = rd_rem - 16'd1;
-                end
-            end
-        end else begin
-            wb_tmr = rd_tmr - 16'd1;
-        end
-    end
-
-    // Port B write mux: enqueue_we takes priority over scan writeback (1-clock stall)
-    wire        enq_valid_write = !watchdog_expired && enqueue_we && !stop_clear_mask[enqueue_axis];
-    wire        port_b_we       = enq_valid_write || scan_eval_en;
-    wire [3:0]  port_b_addr     = enq_valid_write ? enqueue_axis          : scan_wr_axis;
-    wire [15:0] port_b_rem      = enq_valid_write ? enqueue_steps         : wb_rem;
-    wire [15:0] port_b_hp       = enq_valid_write ? enqueue_period_reload : wb_hp;
-    wire [15:0] port_b_tmr      = enq_valid_write ? enqueue_period_reload : wb_tmr;
-    wire [15:0] port_b_steps    = enq_valid_write ? 16'd0                 : wb_steps;
-    wire [7:0]  port_b_meta     = enq_valid_write ? {2'b00, 2'b00, 4'd10} : wb_meta;
-
-    // -------------------------------------------------------------------------
-    // Hard BRAM storage (4x BRAM32K for 16-bit tables + 1x BRAM9K for meta)
-    // -------------------------------------------------------------------------
-`ifdef PROD2U_TD_VENDOR_RAM
-    wire [10:0] addr_a_11 = {7'd0, port_a_addr};
-    wire [10:0] addr_b_11 = {7'd0, port_b_addr};
-
-    EF2_PHY_BRAM32K #(
-        .MODE("DP16K"), .DATA_WIDTH_A("16"), .DATA_WIDTH_B("16"),
-        .REGMODE_A("NOREG"), .REGMODE_B("NOREG"),
-        .WRITEMODE_A("NORMAL"), .WRITEMODE_B("NORMAL"), .SRMODE("ASYNC"),
-        .CSAMUX("1"), .CSBMUX("SIG"), .OCEAMUX("1"), .OCEBMUX("1"),
-        .RSTAMUX("0"), .RSTBMUX("0"), .CLKAMUX("SIG"), .CLKBMUX("SIG"),
-        .WEAMUX("0"), .WEBMUX("SIG")
-    ) u_bram_rem (
-        .doa(rd_rem), .dia(16'd0), .addra(addr_a_11), .bytea(1'b0), .bytewea(1'b0),
-        .csa(1'b1), .wea(1'b0), .clka(clk), .rsta(1'b0), .ocea(1'b1),
-        .dob(), .dib(port_b_rem), .addrb(addr_b_11), .byteb(1'b0), .byteweb(1'b0),
-        .csb(port_b_we), .web(port_b_we), .clkb(clk), .rstb(1'b0), .oceb(1'b1)
-    );
-
-    EF2_PHY_BRAM32K #(
-        .MODE("DP16K"), .DATA_WIDTH_A("16"), .DATA_WIDTH_B("16"),
-        .REGMODE_A("NOREG"), .REGMODE_B("NOREG"),
-        .WRITEMODE_A("NORMAL"), .WRITEMODE_B("NORMAL"), .SRMODE("ASYNC"),
-        .CSAMUX("1"), .CSBMUX("SIG"), .OCEAMUX("1"), .OCEBMUX("1"),
-        .RSTAMUX("0"), .RSTBMUX("0"), .CLKAMUX("SIG"), .CLKBMUX("SIG"),
-        .WEAMUX("0"), .WEBMUX("SIG")
-    ) u_bram_hp (
-        .doa(rd_hp), .dia(16'd0), .addra(addr_a_11), .bytea(1'b0), .bytewea(1'b0),
-        .csa(1'b1), .wea(1'b0), .clka(clk), .rsta(1'b0), .ocea(1'b1),
-        .dob(), .dib(port_b_hp), .addrb(addr_b_11), .byteb(1'b0), .byteweb(1'b0),
-        .csb(enq_valid_write), .web(enq_valid_write), .clkb(clk), .rstb(1'b0), .oceb(1'b1)
-    );
-
-    EF2_PHY_BRAM32K #(
-        .MODE("DP16K"), .DATA_WIDTH_A("16"), .DATA_WIDTH_B("16"),
-        .REGMODE_A("NOREG"), .REGMODE_B("NOREG"),
-        .WRITEMODE_A("NORMAL"), .WRITEMODE_B("NORMAL"), .SRMODE("ASYNC"),
-        .CSAMUX("1"), .CSBMUX("SIG"), .OCEAMUX("1"), .OCEBMUX("1"),
-        .RSTAMUX("0"), .RSTBMUX("0"), .CLKAMUX("SIG"), .CLKBMUX("SIG"),
-        .WEAMUX("0"), .WEBMUX("SIG")
-    ) u_bram_tmr (
-        .doa(rd_tmr), .dia(16'd0), .addra(addr_a_11), .bytea(1'b0), .bytewea(1'b0),
-        .csa(1'b1), .wea(1'b0), .clka(clk), .rsta(1'b0), .ocea(1'b1),
-        .dob(), .dib(port_b_tmr), .addrb(addr_b_11), .byteb(1'b0), .byteweb(1'b0),
-        .csb(port_b_we), .web(port_b_we), .clkb(clk), .rstb(1'b0), .oceb(1'b1)
-    );
-
-    EF2_PHY_BRAM32K #(
-        .MODE("DP16K"), .DATA_WIDTH_A("16"), .DATA_WIDTH_B("16"),
-        .REGMODE_A("NOREG"), .REGMODE_B("NOREG"),
-        .WRITEMODE_A("NORMAL"), .WRITEMODE_B("NORMAL"), .SRMODE("ASYNC"),
-        .CSAMUX("1"), .CSBMUX("SIG"), .OCEAMUX("1"), .OCEBMUX("1"),
-        .RSTAMUX("0"), .RSTBMUX("0"), .CLKAMUX("SIG"), .CLKBMUX("SIG"),
-        .WEAMUX("0"), .WEBMUX("SIG")
-    ) u_bram_steps (
-        .doa(rd_steps), .dia(16'd0), .addra(addr_a_11), .bytea(1'b0), .bytewea(1'b0),
-        .csa(1'b1), .wea(1'b0), .clka(clk), .rsta(1'b0), .ocea(1'b1),
-        .dob(), .dib(port_b_steps), .addrb(addr_b_11), .byteb(1'b0), .byteweb(1'b0),
-        .csb(port_b_we), .web(port_b_we), .clkb(clk), .rstb(1'b0), .oceb(1'b1)
-    );
-
-    EF2_LOGIC_BRAM #(
-        .DATA_WIDTH_A(8), .DATA_WIDTH_B(8),
-        .ADDR_WIDTH_A(4), .ADDR_WIDTH_B(4),
-        .DATA_DEPTH_A(16), .DATA_DEPTH_B(16),
-        .BYTE_ENABLE(0), .BYTE_A(1), .BYTE_B(1),
-        .MODE("DP"), .REGMODE_A("NOREG"), .REGMODE_B("NOREG"),
-        .WRITEMODE_A("NORMAL"), .WRITEMODE_B("NORMAL"),
-        .RESETMODE("ASYNC"), .DEBUGGABLE("NO"), .PACKABLE("NO"),
-        .FORCE_KEEP("OFF"), .INIT_FILE("NONE"), .FILL_ALL("NONE"),
-        .IMPLEMENT("9K")
-    ) u_bram_meta (
-        .dia(8'd0), .addra(port_a_addr), .cea(1'b1), .ocea(1'b1),
-        .clka(clk), .wea(1'b0), .rsta(1'b0), .bea(1'b1),
-        .dib(port_b_meta), .addrb(port_b_addr), .ceb(port_b_we), .oceb(1'b1),
-        .clkb(clk), .web(port_b_we), .rstb(1'b0), .beb(1'b1),
-        .doa(rd_meta), .dob()
-    );
-`else
-    reg [15:0] mem_rem   [0:15];
-    reg [15:0] mem_hp    [0:15];
-    reg [15:0] mem_tmr   [0:15];
-    reg [15:0] mem_steps [0:15];
-    reg [7:0]  mem_meta  [0:15];
-    reg [15:0] rd_rem_r, rd_hp_r, rd_tmr_r, rd_steps_r;
-    reg [7:0]  rd_meta_r;
-
-    assign rd_rem   = rd_rem_r;
-    assign rd_hp    = rd_hp_r;
-    assign rd_tmr   = rd_tmr_r;
-    assign rd_steps = rd_steps_r;
-    assign rd_meta  = rd_meta_r;
-
-    integer init_k;
-    initial begin
-        for (init_k = 0; init_k < 16; init_k = init_k + 1) begin
-            mem_rem[init_k]   = 16'd0;
-            mem_hp[init_k]    = 16'd0;
-            mem_tmr[init_k]   = 16'd0;
-            mem_steps[init_k] = 16'd0;
-            mem_meta[init_k]  = 8'd0;
-        end
-        rd_rem_r   = 16'd0;
-        rd_hp_r    = 16'd0;
-        rd_tmr_r   = 16'd0;
-        rd_steps_r = 16'd0;
-        rd_meta_r  = 8'd0;
-    end
-
-    always @(posedge clk) begin
-        rd_rem_r   <= mem_rem[port_a_addr];
-        rd_hp_r    <= mem_hp[port_a_addr];
-        rd_tmr_r   <= mem_tmr[port_a_addr];
-        rd_steps_r <= mem_steps[port_a_addr];
-        rd_meta_r  <= mem_meta[port_a_addr];
-        if (port_b_we) begin
-            mem_rem[port_b_addr]   <= port_b_rem;
-            mem_tmr[port_b_addr]   <= port_b_tmr;
-            mem_steps[port_b_addr] <= port_b_steps;
-            mem_meta[port_b_addr]  <= port_b_meta;
-        end
-        if (enq_valid_write) begin
-            mem_hp[port_b_addr] <= port_b_hp;
-        end
-    end
-`endif
-
-    // -------------------------------------------------------------------------
-    // Control state machine & compact FF bit-vector updates
-    // -------------------------------------------------------------------------
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            axis_active     <= 12'd0;
-            axis_dir        <= 12'd0;
-            axis_phase      <= 12'd0;
-            step_out_r      <= 12'd0;
-            done_pending_r  <= 12'd0;
-            tick_pending    <= 1'b0;
-            scan_rd_valid   <= 1'b0;
-            scan_rd_axis    <= 4'd0;
-            scan_pipe_valid <= 1'b0;
-            scan_wr_axis    <= 4'd0;
-            skip_mask       <= 12'd0;
-        end else if (watchdog_expired) begin
-            axis_active     <= 12'd0;
-            step_out_r      <= 12'd0;
-            done_pending_r  <= 12'd0;
-            tick_pending    <= 1'b0;
-            scan_rd_valid   <= 1'b0;
-            scan_pipe_valid <= 1'b0;
-            skip_mask       <= 12'd0;
-        end else begin
-            // Clear DONE pending flags acknowledged by arbiter
-            if (done_ack != 12'd0)
-                done_pending_r <= done_pending_r & ~done_ack;
-
-            // Scan writeback updates for scan_wr_axis
-            if (scan_eval_en) begin
-                axis_active[scan_wr_axis] <= nxt_active;
-                axis_phase[scan_wr_axis]  <= nxt_phase;
-                step_out_r[scan_wr_axis]  <= nxt_step;
-                if (nxt_done_set)
-                    done_pending_r[scan_wr_axis] <= 1'b1;
-            end
-
-            // Latest-wins enqueue updates (override scan on same cycle)
-            if (enqueue_we) begin
-                done_pending_r[enqueue_axis] <= 1'b0;
-                axis_phase[enqueue_axis]     <= 1'b0;
-                step_out_r[enqueue_axis]     <= 1'b0;
-                if (enqueue_steps == 16'd0) begin
-                    axis_active[enqueue_axis] <= 1'b0;
-                end else begin
-                    axis_active[enqueue_axis] <= 1'b1;
-                    axis_dir[enqueue_axis]    <= enqueue_dir;
-                end
-                if (scan_rd_valid || scan_pipe_valid || tick_pending || tick_us)
-                    skip_mask[enqueue_axis] <= 1'b1;
-            end
-
-            // Immediate 1-clock STOP_CLEAR for masked axes (highest priority over enqueue/scan)
-            if (stop_clear_mask != 12'd0) begin
-                axis_active    <= (axis_active    & ~stop_clear_mask);
-                step_out_r     <= (step_out_r     & ~stop_clear_mask);
-                done_pending_r <= (done_pending_r & ~stop_clear_mask);
-                if (scan_rd_valid || scan_pipe_valid || tick_pending || tick_us)
-                    skip_mask <= skip_mask | stop_clear_mask;
-            end
-
-            // Latch incoming 1 us tick
-            if (tick_us)
-                tick_pending <= 1'b1;
-
-            // Scan pipeline sequencing
-            if (scan_rd_valid || scan_pipe_valid) begin
-                if (enqueue_we && scan_pipe_valid) begin
-                    // Port B was used by enqueue_we; rewind 1 axis (unless it was
-                    // the freshly enqueued axis itself, which is now in skip_mask).
-                    scan_pipe_valid <= 1'b0;
-                    if (enqueue_axis == scan_wr_axis) begin
-                        if (scan_wr_axis == 4'd11) begin
-                            scan_rd_valid <= 1'b0;
-                            skip_mask     <= 12'd0;
-                        end else begin
-                            scan_rd_valid <= 1'b1;
-                            scan_rd_axis  <= scan_wr_axis + 4'd1;
-                        end
-                    end else begin
-                        scan_rd_valid <= 1'b1;
-                        scan_rd_axis  <= scan_wr_axis;
-                    end
-                end else begin
-                    scan_pipe_valid <= scan_rd_valid;
-                    scan_wr_axis    <= scan_rd_axis;
-                    if (scan_rd_valid) begin
-                        if (scan_rd_axis == 4'd11)
-                            scan_rd_valid <= 1'b0;
-                        else
-                            scan_rd_axis <= scan_rd_axis + 4'd1;
-                    end else begin
-                        // Final writeback cycle (axis 11) just completed
-                        skip_mask <= 12'd0;
-                    end
-                end
-            end else if ((tick_pending || tick_us) && !enqueue_we) begin
-                tick_pending    <= 1'b0;
-                scan_rd_valid   <= 1'b1;
-                scan_rd_axis    <= 4'd0;
-                scan_pipe_valid <= 1'b0;
-            end
-        end
-    end
-endmodule

+ 0 - 75
src/actuator/ssr_time_proportion.v

@@ -1,75 +0,0 @@
-`timescale 1ns/1ps
-// Three DC SSR heater controls at 20 Hz, matching PTC/fan frequency.
-// Common free-running phase (reuses shared PWM phase when USE_EXT_PHASE=1 to
-// avoid duplicating the 14-bit+7-bit divider); independent percentages;
-// SSR2 is one physical output shared by chambers 2+3.
-module ssr_time_proportion #(
-    parameter integer PHASE_CLKS = 12500, // 500 us at 25 MHz; 100 steps = 50 ms (20 Hz)
-    parameter integer USE_EXT_PHASE = 0
-)(
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       stage_we,
-    input  wire [5:0] stage_addr,
-    input  wire [7:0] stage_data,
-    input  wire       commit,
-    input  wire       invalidate,
-    input  wire [6:0] ext_phase,
-    output wire [2:0] ssr_on
-);
-    wire [6:0] cur_phase;
-
-    generate
-        if (USE_EXT_PHASE != 0) begin : g_ext_phase
-            assign cur_phase = ext_phase;
-        end else begin : g_int_phase
-            localparam integer TICK_WIDTH = (PHASE_CLKS > 1) ? $clog2(PHASE_CLKS) : 1;
-            reg [TICK_WIDTH-1:0] tick;
-            reg [6:0]            phase;
-            assign cur_phase = phase;
-            always @(posedge clk or negedge rst_n) begin
-                if (!rst_n) begin
-                    tick  <= {TICK_WIDTH{1'b0}};
-                    phase <= 7'd0;
-                end else if (tick == PHASE_CLKS - 1) begin
-                    tick  <= {TICK_WIDTH{1'b0}};
-                    phase <= (phase == 7'd99) ? 7'd0 : phase + 7'd1;
-                end else begin
-                    tick  <= tick + 1'b1;
-                end
-            end
-        end
-    endgenerate
-
-    reg [6:0] staged0, staged1, staged2;
-    reg [6:0] active0, active1, active2;
-    reg       valid;
-
-    assign ssr_on[0] = valid && (cur_phase < active0);
-    assign ssr_on[1] = valid && (cur_phase < active1);
-    assign ssr_on[2] = valid && (cur_phase < active2);
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            staged0 <= 7'd0; staged1 <= 7'd0; staged2 <= 7'd0;
-            active0 <= 7'd0; active1 <= 7'd0; active2 <= 7'd0;
-            valid   <= 1'b0;
-        end else begin
-            if (stage_we) begin
-                case (stage_addr)
-                    6'd32: staged0 <= stage_data[6:0];
-                    6'd33: staged1 <= stage_data[6:0];
-                    6'd34: staged2 <= stage_data[6:0];
-                    default: ;
-                endcase
-            end
-            if (invalidate) valid <= 1'b0;
-            if (commit) begin
-                active0 <= staged0;
-                active1 <= staged1;
-                active2 <= staged2;
-                valid   <= 1'b1;
-            end
-        end
-    end
-endmodule

+ 0 - 59
src/common/ef2_bram_128k.v

@@ -1,59 +0,0 @@
-`timescale 1ns/1ps
-
-// EF2 128K single-port on-chip RAM wrapper (4096 x 32-bit words = 131072 bits).
-// In simulation: cycle-accurate behavioral model with 1-clock synchronous read latency.
-// In TD synthesis: maps directly to EF2_PHY_BRAM128K hard macro.
-module ef2_bram_128k #(
-    parameter integer ADDR_WIDTH = 12, // Up to 12 bits (4096 words)
-    parameter integer DATA_DEPTH = 4096
-) (
-    input  wire                  clk,
-    input  wire                  en,
-    input  wire                  we,
-    input  wire [ADDR_WIDTH-1:0] addr,
-    input  wire [31:0]           wdata,
-    output wire [31:0]           rdata,
-    input  wire [3:0]            webyte
-);
-`ifdef PROD2U_TD_VENDOR_RAM
-    wire [11:0] addr_12 = {{(12-ADDR_WIDTH){1'b0}}, addr};
-
-    EF2_PHY_BRAM128K #(
-        .MODE("SP"),
-        .REGMODE("NOREG"),
-        .WRITEMODE("NORMAL"),
-        .SRMODE("ASYNC"),
-        .CEMUX("1"),
-        .OCEMUX("1"),
-        .RSTMUX("0"),
-        .CLKMUX("SIG"),
-        .WEMUX("SIG")
-    ) u_bram128k (
-        .do(rdata), .di(wdata), .addr(addr_12), .webyte(webyte),
-        .ce(en), .oce(1'b1), .clk(clk), .we(we), .rst(1'b0)
-    );
-`else
-    reg [31:0] mem [0:DATA_DEPTH-1];
-    reg [31:0] dout;
-    assign rdata = dout;
-
-    integer i;
-    initial begin
-        for (i = 0; i < DATA_DEPTH; i = i + 1)
-            mem[i] = 32'd0;
-        dout = 32'd0;
-    end
-
-    always @(posedge clk) begin
-        if (en) begin
-            dout <= mem[addr];
-            if (we) begin
-                if (webyte[0]) mem[addr][7:0]   <= wdata[7:0];
-                if (webyte[1]) mem[addr][15:8]  <= wdata[15:8];
-                if (webyte[2]) mem[addr][23:16] <= wdata[23:16];
-                if (webyte[3]) mem[addr][31:24] <= wdata[31:24];
-            end
-        end
-    end
-`endif
-endmodule

+ 0 - 87
src/common/ef2_bram_256k.v

@@ -1,87 +0,0 @@
-`timescale 1ns/1ps
-
-// EF2 256K true-dual-port on-chip RAM wrapper (8192 x 32-bit words = 262144 bits).
-// In simulation: cycle-accurate behavioral model with 1-clock synchronous read latency.
-// In TD synthesis: maps directly to EF2_PHY_BRAM256K hard macro.
-module ef2_bram_256k #(
-    parameter integer ADDR_WIDTH = 13, // Up to 13 bits (8192 words)
-    parameter integer DATA_DEPTH = 8192
-) (
-    input  wire                  clk,
-    input  wire                  a_en,
-    input  wire                  a_we,
-    input  wire [ADDR_WIDTH-1:0] a_addr,
-    input  wire [31:0]           a_wdata,
-    output wire [31:0]           a_rdata,
-    input  wire [3:0]            a_webyte,
-    input  wire                  b_en,
-    input  wire                  b_we,
-    input  wire [ADDR_WIDTH-1:0] b_addr,
-    input  wire [31:0]           b_wdata,
-    output wire [31:0]           b_rdata,
-    input  wire [3:0]            b_webyte
-);
-`ifdef PROD2U_TD_VENDOR_RAM
-    wire [12:0] a_addr_13 = {{(13-ADDR_WIDTH){1'b0}}, a_addr};
-    wire [12:0] b_addr_13 = {{(13-ADDR_WIDTH){1'b0}}, b_addr};
-
-    EF2_PHY_BRAM256K #(
-        .MODE("DP"),
-        .REGMODE_A("NOREG"),
-        .REGMODE_B("NOREG"),
-        .WRITEMODE_A("NORMAL"),
-        .WRITEMODE_B("NORMAL"),
-        .SRMODE("ASYNC"),
-        .CEAMUX("1"),
-        .CEBMUX("1"),
-        .OCEAMUX("1"),
-        .OCEBMUX("1"),
-        .RSTAMUX("0"),
-        .RSTBMUX("0"),
-        .CLKAMUX("SIG"),
-        .CLKBMUX("SIG"),
-        .WEAMUX("SIG"),
-        .WEBMUX("SIG")
-    ) u_bram256k (
-        .doa(a_rdata), .dia(a_wdata), .addra(a_addr_13), .weabyte(a_webyte),
-        .cea(a_en), .ocea(1'b1), .clka(clk), .wea(a_we), .rsta(1'b0),
-        .dob(b_rdata), .dib(b_wdata), .addrb(b_addr_13), .webbyte(b_webyte),
-        .ceb(b_en), .oceb(1'b1), .clkb(clk), .web(b_we), .rstb(1'b0)
-    );
-`else
-    reg [31:0] mem [0:DATA_DEPTH-1];
-    reg [31:0] a_dout;
-    reg [31:0] b_dout;
-    assign a_rdata = a_dout;
-    assign b_rdata = b_dout;
-
-    integer i;
-    initial begin
-        for (i = 0; i < DATA_DEPTH; i = i + 1)
-            mem[i] = 32'd0;
-        a_dout = 32'd0;
-        b_dout = 32'd0;
-    end
-
-    always @(posedge clk) begin
-        if (a_en) begin
-            a_dout <= mem[a_addr];
-            if (a_we) begin
-                if (a_webyte[0]) mem[a_addr][7:0]   <= a_wdata[7:0];
-                if (a_webyte[1]) mem[a_addr][15:8]  <= a_wdata[15:8];
-                if (a_webyte[2]) mem[a_addr][23:16] <= a_wdata[23:16];
-                if (a_webyte[3]) mem[a_addr][31:24] <= a_wdata[31:24];
-            end
-        end
-        if (b_en) begin
-            b_dout <= mem[b_addr];
-            if (b_we) begin
-                if (b_webyte[0]) mem[b_addr][7:0]   <= b_wdata[7:0];
-                if (b_webyte[1]) mem[b_addr][15:8]  <= b_wdata[15:8];
-                if (b_webyte[2]) mem[b_addr][23:16] <= b_wdata[23:16];
-                if (b_webyte[3]) mem[b_addr][31:24] <= b_wdata[31:24];
-            end
-        end
-    end
-`endif
-endmodule

+ 0 - 79
src/common/ef2_bram_32k.v

@@ -1,79 +0,0 @@
-`timescale 1ns/1ps
-
-// EF2 32K true-dual-port on-chip RAM wrapper (2048 x 16-bit words = 32768 bits).
-// In simulation: cycle-accurate behavioral model with 1-clock synchronous read latency.
-// In TD synthesis: maps directly to EF2_PHY_BRAM32K hard macro.
-module ef2_bram_32k #(
-    parameter integer ADDR_WIDTH = 11, // Up to 11 bits (2048 words)
-    parameter integer DATA_DEPTH = 2048
-) (
-    input  wire                  clk,
-    input  wire                  a_en,
-    input  wire                  a_we,
-    input  wire [ADDR_WIDTH-1:0] a_addr,
-    input  wire [15:0]           a_wdata,
-    output wire [15:0]           a_rdata,
-    input  wire                  b_en,
-    input  wire                  b_we,
-    input  wire [ADDR_WIDTH-1:0] b_addr,
-    input  wire [15:0]           b_wdata,
-    output wire [15:0]           b_rdata
-);
-`ifdef PROD2U_TD_VENDOR_RAM
-    wire [10:0] a_addr_11 = {{(11-ADDR_WIDTH){1'b0}}, a_addr};
-    wire [10:0] b_addr_11 = {{(11-ADDR_WIDTH){1'b0}}, b_addr};
-
-    EF2_PHY_BRAM32K #(
-        .MODE("DP16K"),
-        .DATA_WIDTH_A("16"),
-        .DATA_WIDTH_B("16"),
-        .REGMODE_A("NOREG"),
-        .REGMODE_B("NOREG"),
-        .WRITEMODE_A("NORMAL"),
-        .WRITEMODE_B("NORMAL"),
-        .SRMODE("ASYNC"),
-        .CSAMUX("1"),
-        .CSBMUX("1"),
-        .OCEAMUX("1"),
-        .OCEBMUX("1"),
-        .RSTAMUX("0"),
-        .RSTBMUX("0"),
-        .CLKAMUX("SIG"),
-        .CLKBMUX("SIG"),
-        .WEAMUX("SIG"),
-        .WEBMUX("SIG")
-    ) u_bram32k (
-        .doa(a_rdata), .dia(a_wdata), .addra(a_addr_11), .bytea(1'b0), .bytewea(1'b0),
-        .csa(a_en), .wea(a_we), .clka(clk), .rsta(1'b0), .ocea(1'b1),
-        .dob(b_rdata), .dib(b_wdata), .addrb(b_addr_11), .byteb(1'b0), .byteweb(1'b0),
-        .csb(b_en), .web(b_we), .clkb(clk), .rstb(1'b0), .oceb(1'b1)
-    );
-`else
-    reg [15:0] mem [0:DATA_DEPTH-1];
-    reg [15:0] a_dout;
-    reg [15:0] b_dout;
-    assign a_rdata = a_dout;
-    assign b_rdata = b_dout;
-
-    integer i;
-    initial begin
-        for (i = 0; i < DATA_DEPTH; i = i + 1)
-            mem[i] = 16'd0;
-        a_dout = 16'd0;
-        b_dout = 16'd0;
-    end
-
-    always @(posedge clk) begin
-        if (a_en) begin
-            a_dout <= mem[a_addr];
-            if (a_we)
-                mem[a_addr] <= a_wdata;
-        end
-        if (b_en) begin
-            b_dout <= mem[b_addr];
-            if (b_we)
-                mem[b_addr] <= b_wdata;
-        end
-    end
-`endif
-endmodule

+ 0 - 115
src/common/ef2_history_brams.v

@@ -1,115 +0,0 @@
-`timescale 1ns/1ps
-
-module ef2_history_brams #(
-    parameter integer AXIS_COUNT = 12,
-    parameter integer AW = (AXIS_COUNT <= 1) ? 1 : $clog2(AXIS_COUNT)
-) (
-    input  wire          clk,
-    // Limit history write
-    input  wire          lim_we,
-    input  wire [AW-1:0] lim_waxis,
-    input  wire [159:0]  lim_wdata,
-    // Limit history read
-    input  wire [AW-1:0] lim_raxis,
-    output wire [159:0]  lim_rdata,
-    // Done history write
-    input  wire          done_we,
-    input  wire [AW-1:0] done_waxis,
-    input  wire [127:0]  done_wdata,
-    // Done history read
-    input  wire [AW-1:0] done_raxis,
-    output wire [127:0]  done_rdata
-);
-`ifdef PROD2U_TD_VENDOR_RAM
-    wire [10:0] lim_wa_11 = {{(11-AW){1'b0}}, lim_waxis};
-    wire [10:0] lim_ra_11 = {{(11-AW){1'b0}}, lim_raxis};
-    wire [10:0] done_wa_11 = {{(11-AW){1'b0}}, done_waxis};
-    wire [10:0] done_ra_11 = {{(11-AW){1'b0}}, done_raxis};
-    wire [3:0]  lim_wa_4  = {{(4-AW){1'b0}}, lim_waxis};
-    wire [3:0]  lim_ra_4  = {{(4-AW){1'b0}}, lim_raxis};
-    wire [3:0]  done_wa_4 = {{(4-AW){1'b0}}, done_waxis};
-    wire [3:0]  done_ra_4 = {{(4-AW){1'b0}}, done_raxis};
-
-    genvar i;
-
-    // --- LIMIT HISTORY: 160 bits = 4x BRAM32K (128 bits) + 2x BRAM9K (32 bits) ---
-    // 4x BRAM32K for lim_wdata[127:0]
-    generate for (i = 0; i < 4; i = i + 1) begin: g_lim_b32
-        EF2_PHY_BRAM32K #(
-            .MODE("DP32K"),
-            .DATA_WIDTH_A("32"), .DATA_WIDTH_B("32"),
-            .REGMODE_A("NOREG"), .REGMODE_B("NOREG"),
-            .WRITEMODE_A("NORMAL"), .WRITEMODE_B("NORMAL"),
-            .SRMODE("ASYNC"),
-            .CSAMUX("1"), .CSBMUX("1"),
-            .OCEAMUX("1"), .OCEBMUX("1"),
-            .RSTAMUX("0"), .RSTBMUX("0"),
-            .CLKAMUX("SIG"), .CLKBMUX("SIG"),
-            .WEAMUX("SIG"), .WEBMUX("SIG")
-        ) u_bram_lim_32 (
-            .doa(), .dia(lim_wdata[i*32+:32]), .addra(lim_wa_11), .bytea(1'b0), .bytewea(1'b0),
-            .csa(1'b1), .wea(lim_we), .clka(clk), .rsta(1'b0), .ocea(1'b1),
-            .dob(lim_rdata[i*32+:32]), .dib(32'd0), .addrb(lim_ra_11), .byteb(1'b0), .byteweb(1'b0),
-            .csb(1'b1), .web(1'b0), .clkb(clk), .rstb(1'b0), .oceb(1'b1)
-        );
-    end endgenerate
-
-    // 2x BRAM9K for lim_wdata[159:128] (each 16 bits)
-    generate for (i = 0; i < 2; i = i + 1) begin: g_lim_b9
-        ef2_bram_dp #(
-            .DATA_WIDTH(16), .ADDR_WIDTH(4), .DATA_DEPTH(16)
-        ) u_bram_lim_9 (
-            .clk(clk),
-            .a_en(lim_we), .a_we(lim_we), .a_addr(lim_wa_4), .a_wdata(lim_wdata[128 + i*16+:16]), .a_rdata(),
-            .b_en(1'b1), .b_we(1'b0), .b_addr(lim_ra_4), .b_wdata(16'd0), .b_rdata(lim_rdata[128 + i*16+:16])
-        );
-    end endgenerate
-
-    // --- DONE HISTORY: 128 bits = 2x BRAM32K (64 bits) + 4x BRAM9K (64 bits) ---
-    // 2x BRAM32K for done_wdata[63:0]
-    generate for (i = 0; i < 2; i = i + 1) begin: g_done_b32
-        EF2_PHY_BRAM32K #(
-            .MODE("DP32K"),
-            .DATA_WIDTH_A("32"), .DATA_WIDTH_B("32"),
-            .REGMODE_A("NOREG"), .REGMODE_B("NOREG"),
-            .WRITEMODE_A("NORMAL"), .WRITEMODE_B("NORMAL"),
-            .SRMODE("ASYNC"),
-            .CSAMUX("1"), .CSBMUX("1"),
-            .OCEAMUX("1"), .OCEBMUX("1"),
-            .RSTAMUX("0"), .RSTBMUX("0"),
-            .CLKAMUX("SIG"), .CLKBMUX("SIG"),
-            .WEAMUX("SIG"), .WEBMUX("SIG")
-        ) u_bram_done_32 (
-            .doa(), .dia(done_wdata[i*32+:32]), .addra(done_wa_11), .bytea(1'b0), .bytewea(1'b0),
-            .csa(1'b1), .wea(done_we), .clka(clk), .rsta(1'b0), .ocea(1'b1),
-            .dob(done_rdata[i*32+:32]), .dib(32'd0), .addrb(done_ra_11), .byteb(1'b0), .byteweb(1'b0),
-            .csb(1'b1), .web(1'b0), .clkb(clk), .rstb(1'b0), .oceb(1'b1)
-        );
-    end endgenerate
-
-    // 4x BRAM9K for done_wdata[127:64] (each 16 bits)
-    generate for (i = 0; i < 4; i = i + 1) begin: g_done_b9
-        ef2_bram_dp #(
-            .DATA_WIDTH(16), .ADDR_WIDTH(4), .DATA_DEPTH(16)
-        ) u_bram_done_9 (
-            .clk(clk),
-            .a_en(done_we), .a_we(done_we), .a_addr(done_wa_4), .a_wdata(done_wdata[64 + i*16+:16]), .a_rdata(),
-            .b_en(1'b1), .b_we(1'b0), .b_addr(done_ra_4), .b_wdata(16'd0), .b_rdata(done_rdata[64 + i*16+:16])
-        );
-    end endgenerate
-`else
-    reg [159:0] lim_mem [0:AXIS_COUNT-1];
-    reg [127:0] done_mem [0:AXIS_COUNT-1];
-    reg [159:0] lim_dout;
-    reg [127:0] done_dout;
-    assign lim_rdata = lim_dout;
-    assign done_rdata = done_dout;
-
-    always @(posedge clk) begin
-        if (lim_we) lim_mem[lim_waxis] <= lim_wdata;
-        lim_dout <= lim_mem[lim_raxis];
-        if (done_we) done_mem[done_waxis] <= done_wdata;
-        done_dout <= done_mem[done_raxis];
-    end
-`endif
-endmodule

+ 0 - 57
src/common/payload_ram.v

@@ -1,57 +0,0 @@
-`timescale 1ns/1ps
-
-module payload_ram #(
-    // Active Prod2U SET_ALL payload is 11 bytes; reject larger defaults.
-    parameter integer DEPTH = 11,
-    parameter integer ADDR_WIDTH = 8,
-    // Small p4 payload storage is deliberately register-backed.  The
-    // inferred device RAM data-input path had a 3 ps hold miss in TD; the
-    // registered implementation preserves the synchronous write/read
-    // contract while avoiding that hard macro boundary.  Existing 6400
-    // callers retain the RAM inference default.
-    parameter integer REGISTERED_RAM = 0,
-    parameter integer SYNC_READ = 0
-) (
-    input  wire                  clk,
-    input  wire                  wr_en,
-    input  wire [ADDR_WIDTH-1:0] wr_addr,
-    input  wire [7:0]            wr_data,
-    input  wire [ADDR_WIDTH-1:0] rd_addr,
-    output wire [7:0]            rd_data
-);
-    localparam integer INDEX_BITS = (DEPTH <= 1) ? 1 : $clog2(DEPTH);
-    /* verilator lint_off WIDTH */
-    wire wr_in_range = wr_addr < DEPTH;
-    wire rd_in_range = rd_addr < DEPTH;
-    /* verilator lint_on WIDTH */
-
-    generate
-        if(SYNC_READ != 0)begin:g_sync_ram
-            wire [7:0] ram_data;
-            reg read_valid;
-            ef2_bram_dp #(.DATA_WIDTH(8),.ADDR_WIDTH(INDEX_BITS),.DATA_DEPTH(DEPTH)) u_memory (
-                .clk(clk),.a_en(wr_en && wr_in_range),.a_we(wr_en && wr_in_range),
-                .a_addr(wr_addr[INDEX_BITS-1:0]),.a_wdata(wr_data),.a_rdata(),
-                .b_en(1'b1),.b_we(1'b0),.b_addr(rd_addr[INDEX_BITS-1:0]),.b_wdata(8'd0),.b_rdata(ram_data)
-            );
-            always @(posedge clk)read_valid<=rd_in_range;
-            assign rd_data=read_valid ? ram_data : 8'hFF;
-        end else if (REGISTERED_RAM != 0) begin : g_registered_ram
-            // Keep this as a flat vector rather than an unpacked array so
-            // vendor inference cannot turn the tiny p4 mailbox into a RAM
-            // macro again.  The variable part-select is still a plain
-            // flip-flop write/read bank and has identical cycle semantics.
-            reg [(DEPTH*8)-1:0] flat_memory;
-            always @(posedge clk) begin
-                if (wr_en && wr_in_range) flat_memory[wr_addr[INDEX_BITS-1:0] * 8 +: 8] <= wr_data;
-            end
-            assign rd_data = rd_in_range ? flat_memory[rd_addr[INDEX_BITS-1:0] * 8 +: 8] : 8'hFF;
-        end else begin : g_inferred_ram
-            reg [7:0] memory [0:DEPTH-1];
-            always @(posedge clk) begin
-                if (wr_en && wr_in_range) memory[wr_addr[INDEX_BITS-1:0]] <= wr_data;
-            end
-            assign rd_data = rd_in_range ? memory[rd_addr[INDEX_BITS-1:0]] : 8'hFF;
-        end
-    endgenerate
-endmodule

+ 0 - 140
src/common/prod2u_active_debug_engine.v

@@ -1,140 +0,0 @@
-`timescale 1ns/1ps
-
-// =============================================================================
-// Active Debug and Telemetry Burst Engine for Prod2U CPLD.
-//
-// Periodically (default: 500 ms) transmits an autonomous diagnostic
-// and status telemetry burst over Host TX line when the bus is idle.
-//
-// Burst Format (45 bytes):
-//   [0..3]:   55 55 55 55 (Preamble sync square wave)
-//   [4..7]:   AA AA AA AA (Inverted square wave)
-//   [8..9]:   00 00
-//   [10..11]: FF FF
-//   [12..36]: "[PROD2U MRDIMM-V1.2 OK]\r\n" (ASCII human-readable banner)
-//   [37..42]: A5 5A 51 00 81 20 (Standard Prod2U binary BEACON frame)
-//   [43..44]: \r\n (Trailing delimiter so line-buffered tools flush immediately)
-//
-// Safety:
-//   - Yields immediately if core_tx_busy is high (Host reply / Motor done takes priority).
-//   - Output multiplexed cleanly with zero glitch.
-// =============================================================================
-
-module prod2u_active_debug_engine #(
-    parameter integer CLOCK_HZ     = 25000000,
-    parameter integer BAUD_RATE    = 115200,
-    parameter integer CLKS_PER_BIT = CLOCK_HZ / BAUD_RATE,
-    parameter integer PERIOD_CLKS  = CLOCK_HZ * 5 // 5.0s
-) (
-    input  wire clk,
-    input  wire rst_n,
-
-    // Core transmission interface (from host_uart_endpoint)
-    input  wire core_tx_line,
-    input  wire core_tx_busy,
-
-    // Multiplexed output to physical pins
-    output wire tx_line_o,
-    output wire active_transmitting
-);
-    localparam [1:0] S_IDLE    = 2'd0;
-    localparam [1:0] S_WAIT_TX = 2'd1;
-
-    reg [1:0]  state;
-    reg [27:0] timer_cnt;
-    reg [5:0]  rom_idx;
-    reg        tx_start;
-    reg [7:0]  tx_byte;
-    wire       tx_busy;
-    wire       tx_done;
-    wire       diag_tx_pin;
-
-    reg [7:0] rom_data [0:44];
-
-    initial begin
-        rom_data[0]  = 8'h55; rom_data[1]  = 8'h55; rom_data[2]  = 8'h55; rom_data[3]  = 8'h55;
-        rom_data[4]  = 8'hAA; rom_data[5]  = 8'hAA; rom_data[6]  = 8'hAA; rom_data[7]  = 8'hAA;
-        rom_data[8]  = 8'h00; rom_data[9]  = 8'h00;
-        rom_data[10] = 8'hFF; rom_data[11] = 8'hFF;
-        rom_data[12] = "[";   rom_data[13] = "P";   rom_data[14] = "R";   rom_data[15] = "O";
-        rom_data[16] = "D";   rom_data[17] = "2";   rom_data[18] = "U";   rom_data[19] = " ";
-        rom_data[20] = "M";   rom_data[21] = "R";   rom_data[22] = "D";   rom_data[23] = "I";
-        rom_data[24] = "M";   rom_data[25] = "M";   rom_data[26] = "-";   rom_data[27] = "V";
-        rom_data[28] = "1";   rom_data[29] = ".";   rom_data[30] = "2";   rom_data[31] = " ";
-        rom_data[32] = "O";   rom_data[33] = "K";   rom_data[34] = "]";
-        rom_data[35] = 8'h0D; rom_data[36] = 8'h0A; // \r\n
-        rom_data[37] = 8'hA5; rom_data[38] = 8'h5A; // Preamble
-        rom_data[39] = 8'h51; // TYPE: BEACON
-        rom_data[40] = 8'h00; // LEN: 0
-        rom_data[41] = 8'h81; // CRC_L (0x2081)
-        rom_data[42] = 8'h20; // CRC_H
-        rom_data[43] = 8'h0D; rom_data[44] = 8'h0A; // \r\n
-    end
-
-    uart_tx_byte #(
-        .CLKS_PER_BIT(CLKS_PER_BIT)
-    ) u_diag_tx (
-        .clk(clk),
-        .rst_n(rst_n),
-        .byte_valid(tx_start),
-        .byte_data(tx_byte),
-        .tx_o(diag_tx_pin),
-        .busy(tx_busy),
-        .byte_done(tx_done)
-    );
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            timer_cnt <= 28'd0;
-            state     <= S_IDLE;
-            rom_idx   <= 6'd0;
-            tx_start  <= 1'b0;
-            tx_byte   <= 8'd0;
-        end else begin
-            tx_start <= 1'b0;
-
-            // Free running timer
-            if (timer_cnt < PERIOD_CLKS - 1) begin
-                timer_cnt <= timer_cnt + 28'd1;
-            end else begin
-                timer_cnt <= 28'd0;
-            end
-
-            case (state)
-                S_IDLE: begin
-                    if ((timer_cnt == PERIOD_CLKS - 1) && !core_tx_busy) begin
-                        rom_idx  <= 6'd0;
-                        tx_byte  <= rom_data[0];
-                        tx_start <= 1'b1;
-                        state    <= S_WAIT_TX;
-                    end
-                end
-
-                S_WAIT_TX: begin
-                    if (core_tx_busy) begin
-                        // Core needs to send high priority response: complete current byte then yield
-                        if (tx_done) begin
-                            state <= S_IDLE;
-                        end
-                    end else if (tx_done) begin
-                        if (rom_idx < 6'd44) begin
-                            rom_idx  <= rom_idx + 6'd1;
-                            tx_byte  <= rom_data[rom_idx + 6'd1];
-                            tx_start <= 1'b1;
-                            state    <= S_WAIT_TX;
-                        end else begin
-                            state <= S_IDLE;
-                        end
-                    end
-                end
-
-                default: state <= S_IDLE;
-            endcase
-        end
-    end
-
-    wire is_active = (state != S_IDLE) || tx_busy;
-    assign active_transmitting = is_active;
-    assign tx_line_o = is_active ? diag_tx_pin : core_tx_line;
-
-endmodule

+ 0 - 84
src/common/uart_rx_byte_fractional.v

@@ -1,84 +0,0 @@
-`timescale 1ns/1ps
-
-// Candidate-B Host receiver. A phase accumulator schedules 27/28-clock bit
-// intervals for 25 MHz / 921600 without a PLL.
-module uart_rx_byte_fractional #(
-    parameter integer CLOCK_HZ = 25000000,
-    parameter integer BAUD = 921600
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       rx_i,
-    output reg        byte_valid,
-    output reg [7:0]  byte_data,
-    output reg        framing_error
-);
-    localparam [1:0] ST_IDLE = 2'd0;
-    localparam [1:0] ST_START = 2'd1;
-    localparam [1:0] ST_DATA = 2'd2;
-    localparam [1:0] ST_STOP = 2'd3;
-
-    (* async_reg = "true" *) reg [1:0] rx_sync_pipe;
-    reg [1:0] state;
-    reg [31:0] phase_accumulator;
-    reg [2:0] bit_index;
-    reg [7:0] data_reg;
-    wire [32:0] phase_sum = {1'b0, phase_accumulator} + BAUD;
-    wire [32:0] clock_hz_extended = {1'b0, CLOCK_HZ[31:0]};
-    wire [31:0] phase_remainder = phase_sum[31:0] - CLOCK_HZ[31:0];
-    wire phase_tick = phase_sum >= clock_hz_extended;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            rx_sync_pipe <= 2'b11;
-            state <= ST_IDLE;
-            phase_accumulator <= 0;
-            bit_index <= 0;
-            data_reg <= 0;
-            byte_valid <= 0;
-            byte_data <= 0;
-            framing_error <= 0;
-        end else begin
-            rx_sync_pipe <= {rx_sync_pipe[0], rx_i};
-            byte_valid <= 0;
-            framing_error <= 0;
-            case (state)
-                ST_IDLE: begin
-                    phase_accumulator <= 0;
-                    if (!rx_sync_pipe[1]) begin
-                        phase_accumulator <= CLOCK_HZ / 2;
-                        state <= ST_START;
-                    end
-                end
-                ST_START: begin
-                    if (phase_tick) begin
-                        phase_accumulator <= phase_remainder;
-                        if (!rx_sync_pipe[1]) begin
-                            bit_index <= 0;
-                            state <= ST_DATA;
-                        end else state <= ST_IDLE;
-                    end else phase_accumulator <= phase_sum[31:0];
-                end
-                ST_DATA: begin
-                    if (phase_tick) begin
-                        phase_accumulator <= phase_remainder;
-                        data_reg[bit_index] <= rx_sync_pipe[1];
-                        if (bit_index == 7) state <= ST_STOP;
-                        else bit_index <= bit_index + 1'b1;
-                    end else phase_accumulator <= phase_sum[31:0];
-                end
-                ST_STOP: begin
-                    if (phase_tick) begin
-                        phase_accumulator <= phase_remainder;
-                        state <= ST_IDLE;
-                        if (rx_sync_pipe[1]) begin
-                            byte_data <= data_reg;
-                            byte_valid <= 1;
-                        end else framing_error <= 1;
-                    end else phase_accumulator <= phase_sum[31:0];
-                end
-                default: state <= ST_IDLE;
-            endcase
-        end
-    end
-endmodule

+ 0 - 57
src/common/uart_tx_byte_fractional.v

@@ -1,57 +0,0 @@
-`timescale 1ns/1ps
-
-// Candidate-B Host transmitter. A phase accumulator schedules 27/28-clock bit
-// intervals for 25 MHz / 921600 without a PLL.
-module uart_tx_byte_fractional #(
-    parameter integer CLOCK_HZ = 25000000,
-    parameter integer BAUD = 921600
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       byte_valid,
-    input  wire [7:0] byte_data,
-    output reg        tx_o,
-    output reg        busy,
-    output reg        byte_done
-);
-    reg [9:0] frame_bits;
-    reg [3:0] bit_index;
-    reg [31:0] phase_accumulator;
-    wire [32:0] phase_sum = {1'b0, phase_accumulator} + BAUD;
-    wire [32:0] clock_hz_extended = {1'b0, CLOCK_HZ[31:0]};
-    wire [31:0] phase_remainder = phase_sum[31:0] - CLOCK_HZ[31:0];
-    wire phase_tick = phase_sum >= clock_hz_extended;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            frame_bits <= 10'h3ff;
-            bit_index <= 0;
-            phase_accumulator <= 0;
-            tx_o <= 1;
-            busy <= 0;
-            byte_done <= 0;
-        end else begin
-            byte_done <= 0;
-            if (!busy) begin
-                tx_o <= 1;
-                phase_accumulator <= 0;
-                if (byte_valid) begin
-                    frame_bits <= {1'b1, byte_data, 1'b0};
-                    bit_index <= 0;
-                    tx_o <= 0;
-                    busy <= 1;
-                end
-            end else if (phase_tick) begin
-                phase_accumulator <= phase_remainder;
-                if (bit_index == 9) begin
-                    tx_o <= 1;
-                    busy <= 0;
-                    byte_done <= 1;
-                end else begin
-                    bit_index <= bit_index + 1'b1;
-                    tx_o <= frame_bits[bit_index + 1'b1];
-                end
-            end else phase_accumulator <= phase_sum[31:0];
-        end
-    end
-endmodule

+ 0 - 40
src/control/manual_set_all_bank.v

@@ -1,40 +0,0 @@
-`timescale 1ns/1ps
-
-// Complete validated SET_ALL vectors stage here. The active pointer changes
-// only after all 32 addresses have been written; partial frames are invisible.
-module manual_set_all_bank (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       write_enable,
-    input  wire [4:0] write_address,
-    input  wire [7:0] write_data,
-    input  wire       commit,
-    output wire       commit_applied,
-    output reg        active_bank,
-    input  wire [4:0] read_address,
-    output wire [7:0] read_data
-);
-    reg [7:0] bank0 [0:31];
-    reg [7:0] bank1 [0:31];
-    reg [31:0] inactive_written;
-    wire accepted_write = write_enable && write_data <= 100;
-    assign commit_applied = commit && (&inactive_written);
-    assign read_data = active_bank ? bank1[read_address] : bank0[read_address];
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            active_bank <= 0;
-            inactive_written <= 0;
-        end else begin
-            if (accepted_write) begin
-                if (active_bank) bank0[write_address] <= write_data;
-                else bank1[write_address] <= write_data;
-                inactive_written[write_address] <= 1;
-            end
-            if (commit_applied) begin
-                active_bank <= ~active_bank;
-                inactive_written <= 0;
-            end
-        end
-    end
-endmodule

+ 0 - 134
src/control/mrdimm_output_core.v

@@ -1,134 +0,0 @@
-`timescale 1ns/1ps
-
-// MRDIMM thermal output core (2026 contract, section 10.1).
-//
-// Eight logical outputs: FAN0..3 (addrs 0..3) and chamber PTC0..3
-// (addrs 4..7), connector-side duty percent 0..100.  The physical PTC8
-// duplication (each logical PTC drives two physical channels per the
-// V1.2 board map) is wired in the production top, not here.
-//
-// Lease semantics:
-//   - Reset/boot: FAN 20, PTC 0, lease inactive, remaining 0.
-//   - A legal SET_ALL commit atomically applies all 8 duties and reloads
-//     the 30 s lease (same-cycle commit wins over expiry).
-//   - OUTPUT_KEEPALIVE reloads the lease only when one is active; the
-//     command core enforces that, this module just counts.
-//   - Expiry: applied FAN 20, PTC 0.  Motors, queues and counters are
-//     untouched by this module (it has no motor interface at all).
-//   - No temperature-based override, no PID, no BMC dependency.
-//
-// PWM: 500 Hz at 25 MHz -> 50000 clock period; on-time = duty * 500
-// clocks.  Duty 0 is continuously low, 100 continuously high.
-module mrdimm_output_core #(
-    parameter [7:0] BOOT_FAN_PERCENT = 8'd20,
-    parameter [7:0] BOOT_PTC_PERCENT = 8'd0,
-    parameter [7:0] EXPIRE_FAN_PERCENT = 8'd20,
-    parameter [7:0] EXPIRE_PTC_PERCENT = 8'd0,
-    parameter [7:0] LEASE_SECONDS = 8'd30,
-    parameter integer PWM_PERIOD_CLKS = 1250000,
-    parameter integer PWM_CLKS_PER_PERCENT = 12500
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       tick_1s,
-    // command core staging + commit
-    input  wire       wr_en,
-    input  wire [2:0] wr_addr,
-    input  wire [7:0] wr_data,
-    input  wire       commit,
-    output reg        commit_done,
-    output reg        commit_ok,
-    input  wire       keepalive_reload,
-    // applied duties (percent, connector side)
-    output reg [31:0] applied_fan,
-    output reg [31:0] applied_ptc,
-    output reg [31:0] requested_fan,
-    output reg [31:0] requested_ptc,
-    output wire [3:0] manual_active,       // per group: bit0 fan, bit1 ptc
-    output wire       lease_active,
-    output reg [7:0]  watchdog_remaining,
-    // PWM carrier outputs (active high at this level; board polarity is
-    // a top-level adapter concern, same as 6400)
-    output wire [3:0] fan_pwm_on,
-    output wire [3:0] ptc_pwm_on
-);
-    reg [7:0] staging [0:7];
-    reg lease_armed;     // a commit has happened and the lease counts down
-    wire pwm_phase_advance;
-    wire pwm_scan_idle;
-    wire [2:0] pwm_addr;
-    reg [7:0] pwm_duty;
-    wire [7:0] pwm_bitmap;
-    reg pending_commit;
-    reg pending_expire;
-    always @(posedge clk) pwm_duty<=pwm_addr<4 ? applied_fan[pwm_addr[1:0]*8 +:8] : applied_ptc[pwm_addr[1:0]*8 +:8];
-    pwm_bitmap_engine #(.CHANNEL_COUNT(8),.ADDR_WIDTH(3),.PTC_PHASE_CLKS(PWM_CLKS_PER_PERCENT),
-        .FAN_PHASE_CLKS(PWM_CLKS_PER_PERCENT),.RESET_FAN_DUTY(BOOT_FAN_PERCENT),.RESET_FAN_MASK(8'h0F)) u_pwm (
-        .clk(clk),.rst_n(rst_n),.runtime_duty_ready(rst_n),.duty_rd_addr(pwm_addr),.duty_rd_data(pwm_duty),
-        .logical_bitmap(pwm_bitmap),.phase_boundary(),.phase_boundary_advance(pwm_phase_advance),.deadline_miss(),.phase_value(),.scan_idle(pwm_scan_idle));
-    assign fan_pwm_on=pwm_bitmap[3:0];assign ptc_pwm_on=pwm_bitmap[7:4];
-    integer i;
-
-    assign lease_active = lease_armed;
-    assign manual_active = {1'b0, lease_armed, lease_armed, lease_armed};
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            for (i = 0; i < 8; i = i + 1) staging[i] <= 8'd0;
-            applied_fan[0*8 +:8] <= BOOT_FAN_PERCENT; applied_fan[1*8 +:8] <= BOOT_FAN_PERCENT;
-            applied_fan[2*8 +:8] <= BOOT_FAN_PERCENT; applied_fan[3*8 +:8] <= BOOT_FAN_PERCENT;
-            applied_ptc[0*8 +:8] <= BOOT_PTC_PERCENT; applied_ptc[1*8 +:8] <= BOOT_PTC_PERCENT;
-            applied_ptc[2*8 +:8] <= BOOT_PTC_PERCENT; applied_ptc[3*8 +:8] <= BOOT_PTC_PERCENT;
-            for(i=0;i<4;i=i+1) begin requested_fan[i*8 +:8]<=BOOT_FAN_PERCENT;requested_ptc[i*8 +:8]<=BOOT_PTC_PERCENT;end
-            lease_armed <= 1'b0;
-            watchdog_remaining <= 8'd0;
-            commit_done <= 1'b0;
-            commit_ok <= 1'b0;
-            pending_commit <= 1'b0;
-            pending_expire <= 1'b0;
-        end else begin
-            commit_done <= 1'b0;
-            commit_ok <= 1'b0;
-            if (wr_en) staging[wr_addr] <= wr_data;
-
-            if (commit) pending_commit <= 1'b1;
-
-            if ((commit || pending_commit) && pwm_scan_idle) begin
-                for (i = 0; i < 4; i = i + 1) begin
-                    applied_fan[i*8 +:8] <= staging[i];
-                    applied_ptc[i*8 +:8] <= staging[i + 4];
-                    requested_fan[i*8 +:8] <= staging[i];
-                    requested_ptc[i*8 +:8] <= staging[i + 4];
-                end
-                lease_armed <= 1'b1;
-                watchdog_remaining <= LEASE_SECONDS;
-                commit_done <= 1'b1;
-                commit_ok <= 1'b1;
-                pending_commit <= 1'b0;
-                pending_expire <= 1'b0;
-            end else if (pending_expire && pwm_scan_idle) begin
-                applied_fan[0*8 +:8] <= EXPIRE_FAN_PERCENT; applied_fan[1*8 +:8] <= EXPIRE_FAN_PERCENT;
-                applied_fan[2*8 +:8] <= EXPIRE_FAN_PERCENT; applied_fan[3*8 +:8] <= EXPIRE_FAN_PERCENT;
-                applied_ptc[0*8 +:8] <= EXPIRE_PTC_PERCENT; applied_ptc[1*8 +:8] <= EXPIRE_PTC_PERCENT;
-                applied_ptc[2*8 +:8] <= EXPIRE_PTC_PERCENT; applied_ptc[3*8 +:8] <= EXPIRE_PTC_PERCENT;
-                lease_armed <= 1'b0;
-                watchdog_remaining <= 8'd0;
-                pending_expire <= 1'b0;
-            end
-
-            if (tick_1s && lease_armed && !keepalive_reload && !commit && !pending_commit) begin
-                if (watchdog_remaining > 8'd1) begin
-                    watchdog_remaining <= watchdog_remaining - 8'd1;
-                end else begin
-                    pending_expire <= 1'b1;
-                end
-            end
-
-            if (keepalive_reload && lease_armed && !commit && !pending_commit) begin
-                watchdog_remaining <= LEASE_SECONDS;
-                pending_expire <= 1'b0;
-            end
-        end
-    end
-
-endmodule

+ 0 - 520
src/control/mrdimm_transaction_core.v

@@ -1,520 +0,0 @@
-`timescale 1ns / 1ps
-// =============================================================================
-// Product:       Prod2U MRDIMM V1.2
-// Module:        mrdimm_transaction_core (v3.1.0)
-// Description:   Transaction admission, atomic SET_ALL validation (69B canonical
-//                with byte 68 = buzzer_ctrl; legacy 68B accepted with buzzer=0),
-//                STOP_CLEAR, watchdog reload, 65B GET_ALL dispatch (including
-//                hood_switch sampled only on GET_ALL + buzzer_state), and
-//                always-on lightweight periodic BEACON (0x51) + 8B DIAG (0x52).
-// =============================================================================
-
-module mrdimm_transaction_core #(
-    parameter ADDR_WIDTH = 8,
-    parameter [31:0] BEACON_PERIOD = 32'd125_000_000
-)(
-    input  wire        clk,
-    input  wire        rst_n,
-
-    // Host Request Interface
-    input  wire        req_valid,
-    input  wire [7:0]  req_type,
-    input  wire [7:0]  req_length,
-    output reg         req_ready,
-
-    // Request RAM Read Port
-    output reg  [7:0]  req_ram_rd_addr,
-    input  wire [7:0]  req_ram_rd_data,
-
-    // Watchdog interface
-    output reg         watchdog_reload,
-    input  wire        watchdog_expired,
-
-    // Duty Register Bank staging interface (4 FAN, 4 PTC)
-    output reg         stage_we,
-    output reg  [2:0]  stage_addr,
-    output reg  [7:0]  stage_data,
-    output reg         stage_commit,
-
-    // Actuator Core Command Interface (12 axes)
-    output reg         act_enqueue_we,
-    output reg  [3:0]  act_enqueue_axis,
-    output reg  [15:0] act_enqueue_steps,
-    output reg  [15:0] act_enqueue_half_period_us,
-    output reg         act_enqueue_dir,
-    output reg  [11:0] act_stop_clear_mask,
-    input  wire [11:0] act_axis_queue_full,
-
-    // Minimal buzzer output & lightweight diagnostic status inputs
-    output reg         buzzer_ctrl_out,
-    input  wire        diag_bank_valid,
-    input  wire [11:0] diag_motor_active,
-
-    // GET_DATA assembly trigger & status
-    output reg         get_data_start,
-    input  wire        get_data_done,
-
-    // Reply RAM write port (NACK / PING / lightweight 8B DIAG)
-    output reg         nack_reply_we,
-    output reg  [7:0]  nack_reply_addr,
-    output reg  [7:0]  nack_reply_data,
-
-    // Unified TX Arbiter group interface
-    output reg         group_valid,
-    output reg         group_second,
-    output reg  [7:0]  group_type,
-    output reg  [7:0]  group_length,
-    output reg  [7:0]  second_type,
-    output reg  [7:0]  second_length,
-    output reg  [ADDR_WIDTH-1:0] group_base,
-    output reg  [ADDR_WIDTH-1:0] second_base,
-    input  wire        group_done
-);
-    localparam [3:0] ST_IDLE            = 4'd0;
-    localparam [3:0] ST_VAL_DUTY_PRE    = 4'd1;
-    localparam [3:0] ST_VAL_DUTY_READ   = 4'd2;
-    localparam [3:0] ST_VAL_AXIS_PRE    = 4'd3;
-    localparam [3:0] ST_VAL_AXIS_READ   = 4'd4;
-    localparam [3:0] ST_VAL_BUZZ_PRE    = 4'd5;
-    localparam [3:0] ST_VAL_BUZZ_READ   = 4'd6;
-    localparam [3:0] ST_APPLY_DUTY_PRE  = 4'd7;
-    localparam [3:0] ST_APPLY_DUTY_READ = 4'd8;
-    localparam [3:0] ST_APPLY_AXIS_PRE  = 4'd9;
-    localparam [3:0] ST_APPLY_AXIS_READ = 4'd10;
-    localparam [3:0] ST_WAIT_GET_DATA   = 4'd11;
-    localparam [3:0] ST_NACK_WRITE      = 4'd12;
-    localparam [3:0] ST_WAIT_GROUP      = 4'd13;
-    localparam [3:0] ST_PING_PRE        = 4'd14;
-    localparam [3:0] ST_PING_WRITE      = 4'd15;
-
-    // Sub-mode flag: reuses ST_PING_WRITE for 8B lightweight DIAG write (saves state bits)
-    reg        diag_write_mode;
-    reg [3:0]  state;
-    reg [7:0]  active_req_type;
-    reg [7:0]  active_req_len;
-    reg [7:0]  nack_reason;
-    reg [3:0]  idx;
-    reg [2:0]  slot_byte;
-    reg        nack_write_step;
-    reg        stage_buzzer;
-
-    reg [7:0]  slot_action;
-    reg [15:0] slot_steps;
-    reg [15:0] slot_half;
-
-    localparam integer BEACON_BITS = (BEACON_PERIOD <= 32'd2) ? 2 : $clog2(BEACON_PERIOD);
-    /* verilator lint_off WIDTH */
-    localparam [BEACON_BITS-1:0] BEACON_LAST = BEACON_PERIOD - 32'd1;
-    /* verilator lint_on WIDTH */
-
-    reg [BEACON_BITS-1:0] beacon_cnt;
-    reg                   beacon_trigger;
-
-    wire [7:0] diag_flags = {4'b0, buzzer_ctrl_out, watchdog_expired, diag_bank_valid, (diag_motor_active != 12'd0)};
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            state                      <= ST_IDLE;
-            diag_write_mode            <= 1'b0;
-            req_ready                  <= 1'b0;
-            req_ram_rd_addr            <= 8'd0;
-            watchdog_reload            <= 1'b0;
-            stage_we                   <= 1'b0;
-            stage_addr                 <= 3'd0;
-            stage_data                 <= 8'd0;
-            stage_commit               <= 1'b0;
-            act_enqueue_we             <= 1'b0;
-            act_enqueue_axis           <= 4'd0;
-            act_enqueue_steps          <= 16'd0;
-            act_enqueue_half_period_us <= 16'd0;
-            act_enqueue_dir            <= 1'b0;
-            act_stop_clear_mask        <= 12'd0;
-            buzzer_ctrl_out            <= 1'b0;
-            stage_buzzer               <= 1'b0;
-            get_data_start             <= 1'b0;
-            nack_reply_we              <= 1'b0;
-            nack_reply_addr            <= 8'd0;
-            nack_reply_data            <= 8'd0;
-            group_valid                <= 1'b0;
-            group_second               <= 1'b0;
-            group_type                 <= 8'd0;
-            group_length               <= 8'd0;
-            second_type                <= 8'd0;
-            second_length              <= 8'd0;
-            group_base                 <= {ADDR_WIDTH{1'b0}};
-            second_base                <= {ADDR_WIDTH{1'b0}};
-            active_req_type            <= 8'd0;
-            active_req_len             <= 8'd0;
-            nack_reason                <= 8'd0;
-            idx                        <= 4'd0;
-            slot_byte                  <= 3'd0;
-            nack_write_step            <= 1'b0;
-            slot_action                <= 8'd0;
-            slot_steps                 <= 16'd0;
-            slot_half                  <= 16'd0;
-            beacon_cnt                 <= {BEACON_BITS{1'b0}};
-            beacon_trigger             <= 1'b0;
-        end else begin
-            watchdog_reload     <= 1'b0;
-            stage_we            <= 1'b0;
-            stage_commit        <= 1'b0;
-            act_enqueue_we      <= 1'b0;
-            act_stop_clear_mask <= 12'd0;
-            get_data_start      <= 1'b0;
-            nack_reply_we       <= 1'b0;
-            req_ready           <= 1'b0;
-
-            if (watchdog_expired && !watchdog_reload)
-                buzzer_ctrl_out <= 1'b0;
-
-            if (BEACON_PERIOD != 32'd0) begin
-                if (beacon_cnt == BEACON_LAST) begin
-                    beacon_cnt     <= {BEACON_BITS{1'b0}};
-                    beacon_trigger <= 1'b1;
-                end else begin
-                    beacon_cnt <= beacon_cnt + {{(BEACON_BITS-1){1'b0}}, 1'b1};
-                end
-            end
-
-            case (state)
-                ST_IDLE: begin
-                    diag_write_mode <= 1'b0;
-                    if (req_valid) begin
-                        beacon_trigger  <= 1'b0;
-                        active_req_type <= req_type;
-                        active_req_len  <= req_length;
-                        if (req_type == 8'h01) begin
-                            if (req_length != 8'd68 && req_length != 8'd69) begin
-                                nack_reason     <= 8'd2;
-                                nack_write_step <= 1'b0;
-                                state           <= ST_NACK_WRITE;
-                            end else begin
-                                stage_buzzer    <= 1'b0;
-                                idx             <= 4'd0;
-                                req_ram_rd_addr <= 8'd0;
-                                state           <= ST_VAL_DUTY_PRE;
-                            end
-                        end else if (req_type == 8'h02) begin
-                            if (req_length != 8'd0) begin
-                                nack_reason     <= 8'd2;
-                                nack_write_step <= 1'b0;
-                                state           <= ST_NACK_WRITE;
-                            end else begin
-                                watchdog_reload <= 1'b1;
-                                get_data_start  <= 1'b1;
-                                req_ready       <= 1'b1;
-                                state           <= ST_WAIT_GET_DATA;
-                            end
-                        end else if (req_type == 8'h03) begin
-                            if (req_length != 8'd0 && req_length != 8'd4) begin
-                                nack_reason     <= 8'd2;
-                                nack_write_step <= 1'b0;
-                                state           <= ST_NACK_WRITE;
-                            end else if (req_length == 8'd0) begin
-                                watchdog_reload <= 1'b1;
-                                req_ready       <= 1'b1;
-                                group_type      <= 8'h83;
-                                group_length    <= 8'd0;
-                                group_second    <= 1'b0;
-                                group_base      <= {ADDR_WIDTH{1'b0}};
-                                group_valid     <= 1'b1;
-                                state           <= ST_WAIT_GROUP;
-                            end else begin
-                                watchdog_reload <= 1'b1;
-                                idx             <= 4'd0;
-                                req_ram_rd_addr <= 8'd0;
-                                state           <= ST_PING_PRE;
-                            end
-                        end else begin
-                            nack_reason     <= 8'd1;
-                            nack_write_step <= 1'b0;
-                            state           <= ST_NACK_WRITE;
-                        end
-                    end else if (beacon_trigger) begin
-                        // Always-on lightweight debug output: BEACON (0x51, 0B) +
-                        // DIAGNOSTIC (0x52, 8B) without feeding watchdog or sampling hood_switch.
-                        beacon_cnt      <= {BEACON_BITS{1'b0}};
-                        beacon_trigger  <= 1'b0;
-                        diag_write_mode <= 1'b1;
-                        idx             <= 4'd0;
-                        state           <= ST_PING_WRITE;
-                    end
-                end
-
-                ST_VAL_DUTY_PRE: state <= ST_VAL_DUTY_READ;
-
-                ST_VAL_DUTY_READ: begin
-                    if (req_ram_rd_data > 8'd100) begin
-                        nack_reason     <= 8'd3;
-                        nack_write_step <= 1'b0;
-                        state           <= ST_NACK_WRITE;
-                    end else if (idx == 4'd7) begin
-                        idx             <= 4'd0;
-                        slot_byte       <= 3'd0;
-                        req_ram_rd_addr <= 8'd8;
-                        state           <= ST_VAL_AXIS_PRE;
-                    end else begin
-                        idx             <= idx + 4'd1;
-                        req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                        state           <= ST_VAL_DUTY_PRE;
-                    end
-                end
-
-                ST_VAL_AXIS_PRE: state <= ST_VAL_AXIS_READ;
-
-                ST_VAL_AXIS_READ: begin
-                    case (slot_byte)
-                        3'd0: begin
-                            if (req_ram_rd_data != 8'h00 && req_ram_rd_data != 8'h01 &&
-                                req_ram_rd_data != 8'h02 && req_ram_rd_data != 8'hFF) begin
-                                nack_reason     <= 8'd3;
-                                nack_write_step <= 1'b0;
-                                state           <= ST_NACK_WRITE;
-                            end else begin
-                                slot_action     <= req_ram_rd_data;
-                                slot_byte       <= 3'd1;
-                                req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                                state           <= ST_VAL_AXIS_PRE;
-                            end
-                        end
-                        3'd1: begin
-                            slot_steps[7:0] <= req_ram_rd_data;
-                            slot_byte       <= 3'd2;
-                            req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                            state           <= ST_VAL_AXIS_PRE;
-                        end
-                        3'd2: begin
-                            slot_steps[15:8] <= req_ram_rd_data;
-                            slot_byte        <= 3'd3;
-                            req_ram_rd_addr  <= req_ram_rd_addr + 8'd1;
-                            state            <= ST_VAL_AXIS_PRE;
-                        end
-                        3'd3: begin
-                            slot_half[7:0]  <= req_ram_rd_data;
-                            slot_byte       <= 3'd4;
-                            req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                            state           <= ST_VAL_AXIS_PRE;
-                        end
-                        3'd4: begin
-                            slot_half[15:8] <= req_ram_rd_data;
-                            if ((slot_action == 8'h01 || slot_action == 8'h02) &&
-                                (slot_steps == 16'd0 || {req_ram_rd_data, slot_half[7:0]} == 16'd0)) begin
-                                nack_reason     <= 8'd3;
-                                nack_write_step <= 1'b0;
-                                state           <= ST_NACK_WRITE;
-                            end else if ((slot_action == 8'h01 || slot_action == 8'h02) &&
-                                         act_axis_queue_full[idx]) begin
-                                nack_reason     <= 8'd4;
-                                nack_write_step <= 1'b0;
-                                state           <= ST_NACK_WRITE;
-                            end else if (idx == 4'd11) begin
-                                if (active_req_len == 8'd69) begin
-                                    req_ram_rd_addr <= 8'd68;
-                                    state           <= ST_VAL_BUZZ_PRE;
-                                end else begin
-                                    // Legacy 68B SET_ALL accepted (buzzer defaults to 0)
-                                    watchdog_reload <= 1'b1;
-                                    req_ready       <= 1'b1;
-                                    idx             <= 4'd0;
-                                    req_ram_rd_addr <= 8'd0;
-                                    state           <= ST_APPLY_DUTY_PRE;
-                                end
-                            end else begin
-                                idx             <= idx + 4'd1;
-                                slot_byte       <= 3'd0;
-                                req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                                state           <= ST_VAL_AXIS_PRE;
-                            end
-                        end
-                        default: state <= ST_IDLE;
-                    endcase
-                end
-
-                ST_VAL_BUZZ_PRE: state <= ST_VAL_BUZZ_READ;
-
-                ST_VAL_BUZZ_READ: begin
-                    if (req_ram_rd_data[7:1] != 7'd0) begin
-                        nack_reason     <= 8'd3;
-                        nack_write_step <= 1'b0;
-                        state           <= ST_NACK_WRITE;
-                    end else begin
-                        stage_buzzer    <= req_ram_rd_data[0];
-                        watchdog_reload <= 1'b1;
-                        req_ready       <= 1'b1;
-                        idx             <= 4'd0;
-                        req_ram_rd_addr <= 8'd0;
-                        state           <= ST_APPLY_DUTY_PRE;
-                    end
-                end
-
-                ST_APPLY_DUTY_PRE: state <= ST_APPLY_DUTY_READ;
-
-                ST_APPLY_DUTY_READ: begin
-                    stage_we   <= 1'b1;
-                    stage_addr <= idx[2:0];
-                    stage_data <= req_ram_rd_data;
-                    if (idx == 4'd7) begin
-                        stage_commit    <= 1'b1;
-                        buzzer_ctrl_out <= stage_buzzer;
-                        group_type      <= 8'h81;
-                        group_length    <= 8'd0;
-                        group_second    <= 1'b0;
-                        group_base      <= {ADDR_WIDTH{1'b0}};
-                        group_valid     <= 1'b1;
-                        idx             <= 4'd0;
-                        slot_byte       <= 3'd0;
-                        req_ram_rd_addr <= 8'd8;
-                        state           <= ST_APPLY_AXIS_PRE;
-                    end else begin
-                        idx             <= idx + 4'd1;
-                        req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                        state           <= ST_APPLY_DUTY_PRE;
-                    end
-                end
-
-                ST_APPLY_AXIS_PRE: state <= ST_APPLY_AXIS_READ;
-
-                ST_APPLY_AXIS_READ: begin
-                    case (slot_byte)
-                        3'd0: begin
-                            slot_action     <= req_ram_rd_data;
-                            slot_byte       <= 3'd1;
-                            req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                            state           <= ST_APPLY_AXIS_PRE;
-                        end
-                        3'd1: begin
-                            slot_steps[7:0] <= req_ram_rd_data;
-                            slot_byte       <= 3'd2;
-                            req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                            state           <= ST_APPLY_AXIS_PRE;
-                        end
-                        3'd2: begin
-                            slot_steps[15:8] <= req_ram_rd_data;
-                            slot_byte        <= 3'd3;
-                            req_ram_rd_addr  <= req_ram_rd_addr + 8'd1;
-                            state            <= ST_APPLY_AXIS_PRE;
-                        end
-                        3'd3: begin
-                            slot_half[7:0]  <= req_ram_rd_data;
-                            slot_byte       <= 3'd4;
-                            req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                            state           <= ST_APPLY_AXIS_PRE;
-                        end
-                        3'd4: begin
-                            if (slot_action == 8'hFF) begin
-                                act_stop_clear_mask[idx] <= 1'b1;
-                            end else if (slot_action == 8'h01 || slot_action == 8'h02) begin
-                                act_enqueue_we             <= 1'b1;
-                                act_enqueue_axis           <= idx;
-                                act_enqueue_steps          <= slot_steps;
-                                act_enqueue_half_period_us <= {req_ram_rd_data, slot_half[7:0]};
-                                act_enqueue_dir            <= (slot_action == 8'h02);
-                            end
-                            if (idx == 4'd11) begin
-                                state <= ST_WAIT_GROUP;
-                            end else begin
-                                idx             <= idx + 4'd1;
-                                slot_byte       <= 3'd0;
-                                req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                                state           <= ST_APPLY_AXIS_PRE;
-                            end
-                        end
-                        default: state <= ST_IDLE;
-                    endcase
-                end
-
-                ST_WAIT_GET_DATA: begin
-                    if (get_data_done) begin
-                        group_type    <= 8'h82;
-                        group_length  <= 8'd0;
-                        group_second  <= 1'b1;
-                        group_base    <= {ADDR_WIDTH{1'b0}};
-                        second_type   <= 8'h42;
-                        second_length <= 8'd65;
-                        second_base   <= {ADDR_WIDTH{1'b0}};
-                        group_valid   <= 1'b1;
-                        state         <= ST_WAIT_GROUP;
-                    end
-                end
-
-                ST_NACK_WRITE: begin
-                    req_ready     <= 1'b1;
-                    nack_reply_we <= 1'b1;
-                    if (!nack_write_step) begin
-                        nack_reply_addr <= 8'd0;
-                        nack_reply_data <= active_req_type;
-                        nack_write_step <= 1'b1;
-                    end else begin
-                        nack_reply_addr <= 8'd1;
-                        nack_reply_data <= nack_reason;
-                        group_type      <= 8'hC0;
-                        group_length    <= 8'd2;
-                        group_second    <= 1'b0;
-                        group_base      <= {ADDR_WIDTH{1'b0}};
-                        group_valid     <= 1'b1;
-                        state           <= ST_WAIT_GROUP;
-                    end
-                end
-
-                ST_PING_PRE: state <= ST_PING_WRITE;
-
-                ST_PING_WRITE: begin
-                    nack_reply_we <= 1'b1;
-                    if (diag_write_mode) begin
-                        // 8-byte lightweight MRDIMM passive debug frame at reply_ram[96..103]
-                        nack_reply_addr <= 8'd96 + {4'd0, idx};
-                        case (idx[2:0])
-                            3'd0: nack_reply_data <= 8'd2;   // format 2 = MRDIMM lean diag
-                            3'd1: nack_reply_data <= 8'h80;  // board_id = MRDIMM/8000
-                            3'd2: nack_reply_data <= 8'd3;   // fw major = 3
-                            3'd3: nack_reply_data <= 8'd3;   // fw minor = 3
-                            3'd4: nack_reply_data <= 8'd0;   // fw patch = 0
-                            3'd5: nack_reply_data <= diag_flags;
-                            3'd6: nack_reply_data <= diag_motor_active[7:0];
-                            default: nack_reply_data <= {4'b0, diag_motor_active[11:8]};
-                        endcase
-                        if (idx == 4'd7) begin
-                            diag_write_mode <= 1'b0;
-                            group_type      <= 8'h51;
-                            group_length    <= 8'd0;
-                            group_second    <= 1'b1;
-                            group_base      <= {ADDR_WIDTH{1'b0}};
-                            second_type     <= 8'h52;
-                            second_length   <= 8'd8;
-                            second_base     <= 8'd96;
-                            group_valid     <= 1'b1;
-                            state           <= ST_WAIT_GROUP;
-                        end else begin
-                            idx <= idx + 4'd1;
-                        end
-                    end else begin
-                        nack_reply_addr <= {4'd0, idx};
-                        nack_reply_data <= req_ram_rd_data;
-                        if (idx == 4'd3) begin
-                            req_ready    <= 1'b1;
-                            group_type   <= 8'h83;
-                            group_length <= 8'd4;
-                            group_second <= 1'b0;
-                            group_base   <= {ADDR_WIDTH{1'b0}};
-                            group_valid  <= 1'b1;
-                            state        <= ST_WAIT_GROUP;
-                        end else begin
-                            idx             <= idx + 4'd1;
-                            req_ram_rd_addr <= req_ram_rd_addr + 8'd1;
-                            state           <= ST_PING_PRE;
-                        end
-                    end
-                end
-
-                ST_WAIT_GROUP: begin
-                    if (group_done) begin
-                        group_valid <= 1'b0;
-                        state       <= ST_IDLE;
-                    end
-                end
-
-                default: state <= ST_IDLE;
-            endcase
-        end
-    end
-endmodule

+ 0 - 89
src/control/stimulus_atomic_bank.v

@@ -1,89 +0,0 @@
-`timescale 1ns/1ps
-
-// Identification-only 32-channel stimulus storage. Host writes always stage
-// into the inactive bank; a commit changes the active vector only after every
-// address has received an in-range value.
-module stimulus_atomic_bank (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       write_enable,
-    input  wire [4:0] write_address,
-    input  wire [7:0] write_data,
-    input  wire       stimulus_commit,
-    output wire       commit_applied,
-    output reg        active_bank,
-    input  wire       read_bank,
-    input  wire [4:0] read_address,
-    output wire [7:0] read_data
-);
-    reg [7:0] bank0 [0:31];
-    reg [7:0] bank1 [0:31];
-    reg [31:0] inactive_written;
-
-    wire accepted_write = write_enable && write_data <= 100;
-    assign commit_applied = stimulus_commit && (&inactive_written);
-
-    assign read_data = read_bank ? bank1[read_address] : bank0[read_address];
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            active_bank <= 1'b0;
-            inactive_written <= 32'd0;
-        end else begin
-            if (accepted_write) begin
-                if (active_bank)
-                    bank0[write_address] <= write_data;
-                else
-                    bank1[write_address] <= write_data;
-                inactive_written[write_address] <= 1'b1;
-            end
-            if (commit_applied) begin
-                active_bank <= ~active_bank;
-                // The old active bank is now the new inactive staging bank.
-                // It must receive a fresh complete 32-byte vector before it
-                // can ever become active again.
-                inactive_written <= 32'd0;
-            end
-        end
-    end
-
-`ifdef FORMAL
-    (* anyconst *) reg [4:0] formal_address;
-    reg formal_past_valid;
-    reg formal_active_valid;
-    wire [7:0] formal_active_data = active_bank ?
-        bank1[formal_address] : bank0[formal_address];
-    wire [7:0] formal_inactive_data = active_bank ?
-        bank0[formal_address] : bank1[formal_address];
-    initial formal_past_valid = 1'b0;
-    initial formal_active_valid = 1'b0;
-    always @(posedge clk) begin
-        formal_past_valid <= 1'b1;
-        assume(formal_address < 32);
-        if (!rst_n)
-            formal_active_valid <= 1'b0;
-        else if (commit_applied)
-            formal_active_valid <= 1'b1;
-        if (inactive_written[formal_address])
-            assert(formal_inactive_data <= 100);
-        if (formal_active_valid)
-            assert(formal_active_data <= 100);
-        if (formal_past_valid && $past(rst_n) && rst_n) begin
-            if ($past(commit_applied))
-                assert(active_bank != $past(active_bank));
-            else begin
-                assert(active_bank == $past(active_bank));
-                // Inactive-bank writes are never visible through the active
-                // vector before an explicit atomic pointer commit.
-                assert(formal_active_data == $past(formal_active_data));
-            end
-            if ($past(stimulus_commit) && !$past(commit_applied))
-                assert(active_bank == $past(active_bank));
-            if (formal_active_valid && !$past(formal_active_valid)) begin
-                assert($past(commit_applied));
-                assert(formal_active_data <= 100);
-            end
-        end
-    end
-`endif
-endmodule

+ 0 - 282
src/control/thermal_control_core.v

@@ -1,282 +0,0 @@
-`timescale 1ns/1ps
-`include "generated/6400/prod2u_6400_v1_params.vh"
-
-// 6400 production control core: SAFE + MANUAL SET_ALL only.
-// No automatic controller, target temperature, or controller state is present.
-module thermal_control_core #(
-    parameter integer WATCHDOG_TICKS_OVERRIDE = 0,
-    parameter [7:0] FAN_SAFE_DUTY = `FAN_SAFE_DUTY,
-    parameter [7:0] WATCHDOG_SECONDS = `SET_ALL_WATCHDOG_SECONDS
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       tick_1s,
-    input  wire       manual_wr_en,
-    input  wire [4:0] manual_wr_addr,
-    input  wire [7:0] manual_wr_data,
-    input  wire       manual_commit,
-    output reg        manual_commit_done,
-    output reg        manual_commit_ok,
-    // OUTPUT_KEEPALIVE reload: reloads the 30 s lease only when one is
-    // already active; never starts a lease, never touches outputs.
-    input  wire       watchdog_keepalive,
-    input  wire [15:0] bmc_epoch,
-    input  wire        bmc_stale,
-    input  wire [23:0] bmc_valid_mask,
-    output wire [4:0] bmc_rd_index,
-    input  wire [15:0] bmc_rd_raw,
-    input  wire        bmc_rd_valid,
-    input  wire [15:0] ct_epoch,
-    input  wire        ct_stale,
-    input  wire [26:0] ct_valid_mask,
-    input  wire        snapshot_lock,
-    input  wire        snapshot_lock_bank,
-    input  wire [4:0] pwm_rd_addr,
-    output wire [7:0] pwm_rd_data,
-    input  wire       snapshot_output_bank,
-    input  wire [4:0] snapshot_rd_addr,
-    output wire [7:0] snapshot_requested_data,
-    output wire [7:0] snapshot_applied_data,
-    output reg        active_output_bank,
-    output reg [2:0]  control_state,
-    output reg [7:0]  current_target_celsius,
-    output reg [15:0] control_epoch,
-    output reg [23:0] safety_override_mask,
-    output reg [3:0]  lane_fault_mask,
-    output reg        global_fault,
-    output reg        output_commit,
-    output wire       watchdog_active,
-    output reg [7:0]  watchdog_remaining,
-    output wire       manual_mode,
-    output wire       hard_protect,
-    input  wire       pwm_phase_boundary,
-    input  wire       pwm_scan_idle,
-    output reg        boot_init_complete
-);
-    localparam [2:0] OWNER_SAFE = `FB_OWNER_SAFE;
-    localparam [2:0] OWNER_MANUAL = `FB_OWNER_MANUAL;
-    localparam [3:0] W_INIT = 0, W_IDLE = 1, W_MANUAL_COPY = 2,
-        W_SAFE_FILL = 3, W_APPLY_PREFETCH = 4, W_APPLY_WRITE = 5,
-        W_SAFETY_PREFETCH = 6, W_SAFETY_CHECK = 7, W_COMMIT_WAIT = 8;
-    localparam [1:0] COMMIT_NONE = 0, COMMIT_MANUAL = 1, COMMIT_SAFE = 2, COMMIT_PROTECTION=3;
-    localparam [7:0] WATCHDOG_LOAD = WATCHDOG_TICKS_OVERRIDE != 0 ?
-        WATCHDOG_TICKS_OVERRIDE[7:0] : WATCHDOG_SECONDS;
-
-    reg [3:0] work_state;
-    reg [1:0] commit_kind;
-    reg [4:0] work_index;
-    reg [15:0] last_bmc_epoch;
-    reg manual_pending;
-    reg safe_pending;
-    reg [3:0] epoch_hard_mask;
-    reg [3:0] scan_lane_mask;
-    reg [3:0] lane_release_unused [0:3];
-    reg output_init_write;
-    reg [4:0] output_init_addr;
-    reg [15:0] output_init_data;
-    reg output_control_write;
-    reg [4:0] output_control_addr;
-    reg [15:0] output_control_data;
-    reg [4:0] output_control_read_addr;
-    wire [7:0] output_control_requested;
-    wire manual_bank_active;
-    wire manual_commit_applied;
-    wire [7:0] manual_data;
-    wire [15:0] bmc_celsius = {8'd0, bmc_rd_raw[15:8]};
-    wire [1:0] scan_lane = (work_index < 6) ? 0 : (work_index < 12) ? 1 :
-        (work_index < 18) ? 2 : 3;
-    wire [3:0] scan_lane_bit = 4'b0001 << scan_lane;
-    wire scan_over76 = bmc_rd_valid && (bmc_celsius >= 16'd76);
-    wire scan_over77 = bmc_rd_valid && (bmc_celsius >= 16'd77);
-    wire [3:0] scan_hard_final = epoch_hard_mask |
-        (scan_over77 ? scan_lane_bit : 4'd0);
-    wire scan_any_final = (|safety_override_mask) || scan_over76 || (|scan_hard_final);
-
-    assign bmc_rd_index = work_index;
-    assign manual_mode = control_state == OWNER_MANUAL;
-    assign hard_protect = |lane_fault_mask;
-    assign watchdog_active = manual_mode && (watchdog_remaining != 0);
-
-    manual_set_all_bank u_manual_bank (
-        .clk(clk), .rst_n(rst_n), .write_enable(manual_wr_en),
-        .write_address(manual_wr_addr), .write_data(manual_wr_data),
-        .commit(manual_commit), .commit_applied(manual_commit_applied),
-        .active_bank(manual_bank_active), .read_address(work_index), .read_data(manual_data)
-    );
-
-    thermal_output_banks u_output_banks (
-        .clk(clk), .active_bank(active_output_bank),
-        .init_write(output_init_write), .init_addr(output_init_addr), .init_data(output_init_data),
-        .control_bank(~active_output_bank), .control_read_addr(output_control_read_addr),
-        .copy_read_active(!snapshot_lock && (work_state==W_APPLY_PREFETCH || work_state==W_APPLY_WRITE)),
-        .control_write(output_control_write), .control_write_addr(output_control_addr),
-        .control_write_data(output_control_data), .pwm_addr(pwm_rd_addr), .pwm_applied(pwm_rd_data),
-        .snapshot_bank(snapshot_output_bank), .snapshot_addr(snapshot_rd_addr),
-        .snapshot_requested(snapshot_requested_data), .snapshot_applied(snapshot_applied_data),
-        .control_requested(output_control_requested)
-    );
-
-    integer i;
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            active_output_bank <= 1'b0;
-            control_state <= OWNER_SAFE;
-            current_target_celsius <= 8'd0;
-            control_epoch <= 16'd0;
-            safety_override_mask <= 24'd0;
-            lane_fault_mask <= 4'd0;
-            global_fault <= 1'b0;
-            output_commit <= 1'b0;
-            manual_commit_done <= 1'b0;
-            manual_commit_ok <= 1'b0;
-            watchdog_remaining <= 8'd0;
-            boot_init_complete <= 1'b0;
-            work_state <= W_INIT;
-            commit_kind <= COMMIT_NONE;
-            work_index <= 5'd0;
-            last_bmc_epoch <= 16'd0;
-            manual_pending <= 1'b0;
-            safe_pending <= 1'b0;
-            epoch_hard_mask <= 4'd0;
-            scan_lane_mask <= 4'd0;
-            output_init_write <= 1'b0;
-            output_init_addr <= 5'd0;
-            output_init_data <= 16'd0;
-            output_control_write <= 1'b0;
-            output_control_addr <= 5'd0;
-            output_control_data <= 16'd0;
-            output_control_read_addr <= 5'd0;
-            for (i = 0; i < 4; i = i + 1) lane_release_unused[i] <= 0;
-        end else begin
-            output_commit <= 1'b0;
-            manual_commit_done <= 1'b0;
-            manual_commit_ok <= 1'b0;
-            output_init_write <= 1'b0;
-            output_control_write <= 1'b0;
-            if (manual_commit_applied) begin
-                manual_pending <= 1'b1;
-            end
-            if (watchdog_keepalive && watchdog_active) begin
-                // A keepalive reload on the same tick as a would-be timeout
-                // wins, mirroring the SET_ALL commit priority.
-                watchdog_remaining <= WATCHDOG_LOAD;
-            end else if (watchdog_active && tick_1s) begin
-                if (watchdog_remaining > 1) watchdog_remaining <= watchdog_remaining - 1'b1;
-                else begin watchdog_remaining <= 0; safe_pending <= 1'b1; end
-            end
-            case (work_state)
-                W_INIT: begin
-                    output_init_write <= 1'b1;
-                    output_init_addr <= work_index;
-                    output_init_data <= (work_index < 24) ? 16'h0000 : {FAN_SAFE_DUTY, FAN_SAFE_DUTY};
-                    if (work_index == 31) begin
-                        work_index <= 0; boot_init_complete <= 1'b1; work_state <= W_IDLE;
-                    end else work_index <= work_index + 1'b1;
-                end
-                W_IDLE: begin
-                    if (!bmc_stale && (bmc_epoch != last_bmc_epoch)) begin
-                        last_bmc_epoch <= bmc_epoch;
-                        work_index <= 0; epoch_hard_mask <= lane_fault_mask; scan_lane_mask <= 0;
-                        work_state <= W_SAFETY_PREFETCH;
-                    end else if (manual_pending) begin
-                        manual_pending <= 0; work_index <= 0; commit_kind <= COMMIT_MANUAL;
-                        work_state <= W_MANUAL_COPY;
-                    end else if (safe_pending) begin
-                        safe_pending <= 0; work_index <= 0; commit_kind <= COMMIT_SAFE;
-                        work_state <= W_SAFE_FILL;
-                    end
-                end
-                W_MANUAL_COPY: begin
-                    if (hard_protect) begin
-                        manual_commit_done <= 1'b1; manual_commit_ok <= 1'b0;
-                        commit_kind <= COMMIT_NONE; work_state <= W_IDLE;
-                    end else begin
-                        output_control_write <= 1'b1;
-                        output_control_addr <= work_index;
-                        if (work_index < 24)
-                            output_control_data <= {manual_data,
-                                safety_override_mask[work_index] ? 8'd0 : manual_data};
-                        else
-                            output_control_data <= {manual_data,
-                                lane_fault_mask[work_index[1:0]] ? 8'd100 : manual_data};
-                        if (work_index == 31) begin work_index <= 0; work_state <= W_COMMIT_WAIT; end
-                        else work_index <= work_index + 1'b1;
-                    end
-                end
-                W_SAFE_FILL: begin
-                    output_control_write <= 1'b1;
-                    output_control_addr <= work_index;
-                    output_control_data <= (work_index < 24) ? 16'h0000 :
-                        {FAN_SAFE_DUTY, lane_fault_mask[work_index[1:0]] ? 8'd100 : FAN_SAFE_DUTY};
-                    if (work_index == 31) begin work_index <= 0; work_state <= W_COMMIT_WAIT; end
-                    else work_index <= work_index + 1'b1;
-                end
-                W_SAFETY_PREFETCH: begin
-                    work_state <= W_SAFETY_CHECK;
-                end
-                W_SAFETY_CHECK: begin
-                    if (scan_over76) safety_override_mask[work_index] <= 1'b1;
-                    if (scan_over77) epoch_hard_mask <= epoch_hard_mask | scan_lane_bit;
-                    if (work_index == 23) begin
-                        lane_fault_mask <= scan_hard_final;
-                        safety_override_mask<=safety_override_mask | (scan_over76 ? (24'd1<<work_index) : 24'd0) |
-                            {{6{scan_hard_final[3]}},{6{scan_hard_final[2]}},{6{scan_hard_final[1]}},{6{scan_hard_final[0]}}};
-                        work_index <= 0;
-                        output_control_read_addr <= 0;
-                        work_state <= W_APPLY_PREFETCH;
-                    end else begin
-                        work_index <= work_index + 1'b1;
-                        work_state <= W_SAFETY_PREFETCH;
-                    end
-                end
-                W_APPLY_PREFETCH: begin
-                    output_control_read_addr <= work_index;
-                    if(!snapshot_lock) work_state <= W_APPLY_WRITE;
-                end
-                W_APPLY_WRITE: begin
-                    if(snapshot_lock) work_state<=W_APPLY_PREFETCH;
-                    else begin
-                    output_control_write <= 1'b1;
-                    output_control_addr <= work_index;
-                    if (work_index < 24)
-                        output_control_data <= {output_control_requested,
-                            safety_override_mask[work_index] ? 8'd0 : output_control_requested};
-                    else
-                        output_control_data <= {output_control_requested,
-                            lane_fault_mask[work_index[1:0]] ? 8'd100 : output_control_requested};
-                    if (work_index == 31) begin
-                        work_index <= 0; commit_kind <= COMMIT_PROTECTION; work_state <= W_COMMIT_WAIT;
-                    end else begin
-                        work_index <= work_index + 1'b1;
-                        output_control_read_addr <= work_index + 1'b1;
-                        work_state <= W_APPLY_PREFETCH;
-                    end
-                    end
-                end
-                W_COMMIT_WAIT: begin
-                    if(commit_kind==COMMIT_MANUAL && !bmc_stale && bmc_epoch!=last_bmc_epoch) begin
-                        manual_pending<=1;commit_kind<=COMMIT_NONE;last_bmc_epoch<=bmc_epoch;
-                        work_index<=0;epoch_hard_mask<=lane_fault_mask;work_state<=W_SAFETY_PREFETCH;
-                    end else if (pwm_phase_boundary && pwm_scan_idle && !snapshot_lock) begin
-                        active_output_bank <= ~active_output_bank;
-                        output_commit <= 1'b1;
-                        control_epoch <= control_epoch + 1'b1;
-                        if (commit_kind == COMMIT_MANUAL) begin
-                            manual_commit_done <= 1'b1; manual_commit_ok <= 1'b1;
-                            control_state <= OWNER_MANUAL; watchdog_remaining <= WATCHDOG_LOAD;
-                            global_fault <= 1'b0;
-                            safe_pending<=0;
-                        end else if(commit_kind==COMMIT_SAFE) begin
-                            control_state <= OWNER_SAFE; watchdog_remaining <= 0;
-                            global_fault <= |lane_fault_mask;
-                        end else begin
-                            global_fault<=|lane_fault_mask;
-                        end
-                        commit_kind <= COMMIT_NONE; work_state <= W_IDLE;
-                    end
-                end
-                default: work_state <= W_INIT;
-            endcase
-        end
-    end
-endmodule

+ 0 - 81
src/control/thermal_output_banks.v

@@ -1,81 +0,0 @@
-`timescale 1ns/1ps
-
-// Two 32 x 16 embedded-RAM banks.  Each word is {requested, applied}.
-// The active bank serves PWM plus snapshot reads; the inactive bank serves
-// the sequential controller read/write path.  A pointer flip is the commit.
-module thermal_output_banks (
-    input  wire        clk,
-    input  wire        active_bank,
-    input  wire        init_write,
-    input  wire [4:0]  init_addr,
-    input  wire [15:0] init_data,
-    input  wire        control_bank,
-    input  wire        copy_read_active,
-    input  wire [4:0]  control_read_addr,
-    input  wire        control_write,
-    input  wire [4:0]  control_write_addr,
-    input  wire [15:0] control_write_data,
-    input  wire [4:0]  pwm_addr,
-    output wire [7:0]  pwm_applied,
-    input  wire        snapshot_bank,
-    input  wire [4:0]  snapshot_addr,
-    output wire [7:0]  snapshot_requested,
-    output wire [7:0]  snapshot_applied,
-    output wire [7:0]  control_requested
-);
-    wire bank0_active = !active_bank;
-    wire bank1_active = active_bank;
-    wire [4:0] bank0_a_addr = bank0_active ? pwm_addr : control_read_addr;
-    wire [4:0] bank1_a_addr = bank1_active ? pwm_addr : control_read_addr;
-    wire bank0_write = init_write || (control_write && !control_bank);
-    wire bank1_write = init_write || (control_write && control_bank);
-    wire [4:0] bank0_b_addr = init_write ? init_addr :
-        ((control_write && !control_bank) ? control_write_addr : ((copy_read_active && bank0_active) ? control_read_addr : snapshot_addr));
-    wire [4:0] bank1_b_addr = init_write ? init_addr :
-        ((control_write && control_bank) ? control_write_addr : ((copy_read_active && bank1_active) ? control_read_addr : snapshot_addr));
-    wire [15:0] bank_write_data = init_write ? init_data : control_write_data;
-    wire [15:0] bank0_a_data;
-    wire [15:0] bank1_a_data;
-    wire [15:0] bank0_b_data;
-    wire [15:0] bank1_b_data;
-    reg active_bank_read;
-    reg control_bank_read;
-    // Port-A data arrives one clock after its address.  Delay both selectors
-    // by the same clock so a bank-pointer commit cannot pair the new selector
-    // with the previous bank's address/result.
-    wire [7:0] active_applied = active_bank_read ?
-        bank1_a_data[7:0] : bank0_a_data[7:0];
-    wire [7:0] control_requested_word = active_bank_read ?
-        bank1_b_data[15:8] : bank0_b_data[15:8];
-    wire [15:0] snapshot_word = snapshot_bank ? bank1_b_data : bank0_b_data;
-
-    assign pwm_applied = active_applied;
-    assign control_requested = control_requested_word;
-    assign snapshot_requested = snapshot_word[15:8];
-    assign snapshot_applied = snapshot_word[7:0];
-
-    always @(posedge clk) begin
-        active_bank_read <= active_bank;
-        control_bank_read <= control_bank;
-    end
-
-    ef2_bram_dp #(.DATA_WIDTH(16), .ADDR_WIDTH(5), .DATA_DEPTH(32)) u_bank0 (
-        .clk(clk), .a_en(1'b1), .a_we(1'b0), .a_addr(bank0_a_addr),
-        .a_wdata(16'd0), .a_rdata(bank0_a_data),
-        .b_en(1'b1), .b_we(bank0_write), .b_addr(bank0_b_addr),
-        .b_wdata(bank_write_data), .b_rdata(bank0_b_data)
-    );
-    ef2_bram_dp #(.DATA_WIDTH(16), .ADDR_WIDTH(5), .DATA_DEPTH(32)) u_bank1 (
-        .clk(clk), .a_en(1'b1), .a_we(1'b0), .a_addr(bank1_a_addr),
-        .a_wdata(16'd0), .a_rdata(bank1_a_data),
-        .b_en(1'b1), .b_we(bank1_write), .b_addr(bank1_b_addr),
-        .b_wdata(bank_write_data), .b_rdata(bank1_b_data)
-    );
-
-`ifdef FORMAL
-    always @(posedge clk) begin
-        if (!init_write && control_write)
-            assert(control_bank != active_bank);
-    end
-`endif
-endmodule

+ 0 - 67
src/diag/prod2u_mrdimm_uart_diag_115200_top.v

@@ -1,67 +0,0 @@
-`timescale 1ns/1ps
-// =============================================================================
-// Prod2U MRDIMM V1.2 Minimal Safe UART Diagnostic Top (115200 Baud)
-//
-// Target: EF2L45BG256B @ 25 MHz
-// Fixed safe outputs:
-//   - PTC 0..23 = 0 (OFF, 0% power)
-//   - motor_en_n = 0 (board NMOS off; connector EN released), all STEP/DIR low
-//   - FAN outputs safe default
-// Fixed periodic burst: 55 AA 00 FF + ASCII banner + legal A5 5A frame
-// =============================================================================
-
-module prod2u_mrdimm_uart_diag_115200_top (
-    input  wire        sys_clk,
-
-    // Host RS-232 & TTL ports
-    input  wire        host_rs232_rx,
-    output wire        host_rs232_tx,
-    input  wire        host_ttl_rx,
-    output wire        host_ttl_tx,
-
-    // Sensor I2C bus (safe high-Z / pullup)
-    inout  wire        temp_scl,
-    inout  wire        temp_sda,
-
-    // Limit switches (inputs, passive)
-    input  wire [2:0]  limit_lower_raw,
-    input  wire [2:0]  limit_upper_raw,
-
-    // Safe Actuator Outputs
-    output wire [23:0] ptc_pwm_out,
-    output wire [3:0]  fan_pwm_out,
-    output wire        motor_en_n,
-    output wire        x_step,
-    output wire        x_dir,
-    output wire        y_step,
-    output wire        y_dir,
-    output wire        z_step,
-    output wire        z_dir
-);
-
-    prod2u_mrdimm_uart_diag_top #(
-        .CLOCK_HZ(25000000),
-        .BAUD_RATE(115200),
-        .CLKS_PER_BIT(217)
-    ) u_diag_core (
-        .sys_clk(sys_clk),
-        .host_rs232_rx(host_rs232_rx),
-        .host_rs232_tx(host_rs232_tx),
-        .host_ttl_rx(host_ttl_rx),
-        .host_ttl_tx(host_ttl_tx),
-        .temp_scl(temp_scl),
-        .temp_sda(temp_sda),
-        .limit_lower_raw(limit_lower_raw),
-        .limit_upper_raw(limit_upper_raw),
-        .ptc_pwm_out(ptc_pwm_out),
-        .fan_pwm_out(fan_pwm_out),
-        .motor_en_n(motor_en_n),
-        .x_step(x_step),
-        .x_dir(x_dir),
-        .y_step(y_step),
-        .y_dir(y_dir),
-        .z_step(z_step),
-        .z_dir(z_dir)
-    );
-
-endmodule

+ 0 - 47
src/diag/prod2u_mrdimm_uart_diag_230400_top.v

@@ -1,47 +0,0 @@
-`timescale 1ns/1ps
-// Prod2U MRDIMM V1.2 Minimal Safe UART Diagnostic Top (230400 Baud)
-module prod2u_mrdimm_uart_diag_230400_top (
-    input  wire        sys_clk,
-    input  wire        host_rs232_rx,
-    output wire        host_rs232_tx,
-    input  wire        host_ttl_rx,
-    output wire        host_ttl_tx,
-    inout  wire        temp_scl,
-    inout  wire        temp_sda,
-    input  wire [2:0]  limit_lower_raw,
-    input  wire [2:0]  limit_upper_raw,
-    output wire [23:0] ptc_pwm_out,
-    output wire [3:0]  fan_pwm_out,
-    output wire        motor_en_n,
-    output wire        x_step,
-    output wire        x_dir,
-    output wire        y_step,
-    output wire        y_dir,
-    output wire        z_step,
-    output wire        z_dir
-);
-    prod2u_mrdimm_uart_diag_top #(
-        .CLOCK_HZ(25000000),
-        .BAUD_RATE(230400),
-        .CLKS_PER_BIT(109)
-    ) u_diag_core (
-        .sys_clk(sys_clk),
-        .host_rs232_rx(host_rs232_rx),
-        .host_rs232_tx(host_rs232_tx),
-        .host_ttl_rx(host_ttl_rx),
-        .host_ttl_tx(host_ttl_tx),
-        .temp_scl(temp_scl),
-        .temp_sda(temp_sda),
-        .limit_lower_raw(limit_lower_raw),
-        .limit_upper_raw(limit_upper_raw),
-        .ptc_pwm_out(ptc_pwm_out),
-        .fan_pwm_out(fan_pwm_out),
-        .motor_en_n(motor_en_n),
-        .x_step(x_step),
-        .x_dir(x_dir),
-        .y_step(y_step),
-        .y_dir(y_dir),
-        .z_step(z_step),
-        .z_dir(z_dir)
-    );
-endmodule

+ 0 - 67
src/diag/prod2u_mrdimm_uart_diag_921600_top.v

@@ -1,67 +0,0 @@
-`timescale 1ns/1ps
-// =============================================================================
-// Prod2U MRDIMM V1.2 Minimal Safe UART Diagnostic Top (921600 Baud)
-//
-// Target: EF2L45BG256B @ 25 MHz
-// Fixed safe outputs:
-//   - PTC 0..23 = 0 (OFF, 0% power)
-//   - motor_en_n = 0 (board NMOS off; connector EN released), all STEP/DIR low
-//   - FAN outputs safe default
-// Fixed periodic burst: 55 AA 00 FF + ASCII banner + legal A5 5A frame
-// =============================================================================
-
-module prod2u_mrdimm_uart_diag_921600_top (
-    input  wire        sys_clk,
-
-    // Host RS-232 & TTL ports
-    input  wire        host_rs232_rx,
-    output wire        host_rs232_tx,
-    input  wire        host_ttl_rx,
-    output wire        host_ttl_tx,
-
-    // Sensor I2C bus (safe high-Z / pullup)
-    inout  wire        temp_scl,
-    inout  wire        temp_sda,
-
-    // Limit switches (inputs, passive)
-    input  wire [2:0]  limit_lower_raw,
-    input  wire [2:0]  limit_upper_raw,
-
-    // Safe Actuator Outputs
-    output wire [23:0] ptc_pwm_out,
-    output wire [3:0]  fan_pwm_out,
-    output wire        motor_en_n,
-    output wire        x_step,
-    output wire        x_dir,
-    output wire        y_step,
-    output wire        y_dir,
-    output wire        z_step,
-    output wire        z_dir
-);
-
-    prod2u_mrdimm_uart_diag_top #(
-        .CLOCK_HZ(25000000),
-        .BAUD_RATE(921600),
-        .CLKS_PER_BIT(27)
-    ) u_diag_core (
-        .sys_clk(sys_clk),
-        .host_rs232_rx(host_rs232_rx),
-        .host_rs232_tx(host_rs232_tx),
-        .host_ttl_rx(host_ttl_rx),
-        .host_ttl_tx(host_ttl_tx),
-        .temp_scl(temp_scl),
-        .temp_sda(temp_sda),
-        .limit_lower_raw(limit_lower_raw),
-        .limit_upper_raw(limit_upper_raw),
-        .ptc_pwm_out(ptc_pwm_out),
-        .fan_pwm_out(fan_pwm_out),
-        .motor_en_n(motor_en_n),
-        .x_step(x_step),
-        .x_dir(x_dir),
-        .y_step(y_step),
-        .y_dir(y_dir),
-        .z_step(z_step),
-        .z_dir(z_dir)
-    );
-
-endmodule

+ 0 - 277
src/diag/prod2u_mrdimm_uart_diag_top.v

@@ -1,277 +0,0 @@
-`timescale 1ns/1ps
-// =============================================================================
-// Prod2U MRDIMM V1.2 Minimal Safe UART Diagnostic Firmware Top
-//
-// Build Profiles:
-//   - 921600 Baud (CLKS_PER_BIT = 27 @ 25MHz)
-//   - 115200 Baud (CLKS_PER_BIT = 217 @ 25MHz)
-//
-// Safety Guarantees:
-//   1. All 24 physical PTC pins are explicitly driven LOW (0% duty, OFF).
-//   2. All motor STEP lines are LOW, DIR lines LOW, motor_en_n = 0 (board NMOS off; connector EN released).
-//   3. All FAN PWM outputs driven to safe default.
-//   4. Periodic fixed-pattern transmission: 55 / AA / 00 / FF + ASCII banner + Frame.
-//   5. RX byte counter and direct loopback on RS-232 / TTL.
-// =============================================================================
-
-module prod2u_mrdimm_uart_diag_top #(
-    parameter CLOCK_HZ     = 25000000,
-    parameter BAUD_RATE    = 921600,
-    parameter CLKS_PER_BIT = CLOCK_HZ / BAUD_RATE // 27 for 921600, 217 for 115200
-) (
-    input  wire        sys_clk,
-
-    // Host RS-232 & TTL ports
-    input  wire        host_rs232_rx,
-    output wire        host_rs232_tx,
-    input  wire        host_ttl_rx,
-    output wire        host_ttl_tx,
-
-    // Sensor I2C bus (safe high-Z / pullup)
-    inout  wire        temp_scl,
-    inout  wire        temp_sda,
-
-    // Limit switches (inputs, passive)
-    input  wire [2:0]  limit_lower_raw,
-    input  wire [2:0]  limit_upper_raw,
-
-    // Safe Actuator Outputs
-    output wire [23:0] ptc_pwm_out,
-    output wire [3:0]  fan_pwm_out,
-    output wire        motor_en_n,
-    output wire        x_step,
-    output wire        x_dir,
-    output wire        y_step,
-    output wire        y_dir,
-    output wire        z_step,
-    output wire        z_dir
-);
-
-    // =========================================================================
-    // 1. Strict Output Pin Safety Enforcement
-    // =========================================================================
-    // PTC is active-high: 0 is completely OFF (no heater power).
-    assign ptc_pwm_out = 24'b0;
-
-    // C11 drives an inverting NMOS: 0 releases CON120.2; no STEP pulses.
-    assign motor_en_n  = 1'b0;
-    assign x_step      = 1'b0;
-    assign x_dir       = 1'b0;
-    assign y_step      = 1'b0;
-    assign y_dir       = 1'b0;
-    assign z_step      = 1'b0;
-    assign z_dir       = 1'b0;
-
-    // Fan board inverts: FPGA 1 -> connector PWM low (0% request).
-    assign fan_pwm_out = 4'b1111;
-
-    // I2C high-Z
-    assign temp_scl = 1'bz;
-    assign temp_sda = 1'bz;
-
-    // =========================================================================
-    // 2. Power-On Reset Generation
-    // =========================================================================
-    reg [15:0] por_cnt = 16'd0;
-    reg        rst_n   = 1'b0;
-    always @(posedge sys_clk) begin
-        if (por_cnt < 16'd25000) begin // 1ms POR
-            por_cnt <= por_cnt + 16'd1;
-            rst_n   <= 1'b0;
-        end else begin
-            rst_n   <= 1'b1;
-        end
-    end
-
-    // =========================================================================
-    // 3. UART RX Byte Receivers (RS-232 and TTL)
-    // =========================================================================
-    wire [7:0] rs232_rx_data;
-    wire       rs232_rx_valid;
-    wire       rs232_rx_err;
-
-    uart_rx_byte #(
-        .CLKS_PER_BIT(CLKS_PER_BIT)
-    ) u_rx_rs232 (
-        .clk(sys_clk),
-        .rst_n(rst_n),
-        .rx_i(host_rs232_rx),
-        .byte_data(rs232_rx_data),
-        .byte_valid(rs232_rx_valid),
-        .framing_error(rs232_rx_err)
-    );
-
-    wire [7:0] ttl_rx_data;
-    wire       ttl_rx_valid;
-    wire       ttl_rx_err;
-
-    uart_rx_byte #(
-        .CLKS_PER_BIT(CLKS_PER_BIT)
-    ) u_rx_ttl (
-        .clk(sys_clk),
-        .rst_n(rst_n),
-        .rx_i(host_ttl_rx),
-        .byte_data(ttl_rx_data),
-        .byte_valid(ttl_rx_valid),
-        .framing_error(ttl_rx_err)
-    );
-
-    // RX Statistics
-    reg [31:0] rx_byte_count = 32'd0;
-    reg [31:0] rx_err_count  = 32'd0;
-    always @(posedge sys_clk or negedge rst_n) begin
-        if (!rst_n) begin
-            rx_byte_count <= 32'd0;
-            rx_err_count  <= 32'd0;
-        end else begin
-            if (rs232_rx_valid || ttl_rx_valid)
-                rx_byte_count <= rx_byte_count + 32'd1;
-            if (rs232_rx_err || ttl_rx_err)
-                rx_err_count  <= rx_err_count + 32'd1;
-        end
-    end
-
-    // =========================================================================
-    // 4. Diagnostic Pattern Generator and Transmitter
-    // =========================================================================
-    reg [7:0]  tx_byte = 8'd0;
-    reg        tx_start = 1'b0;
-    wire       tx_busy;
-    wire       tx_pin_out;
-
-    uart_tx_byte #(
-        .CLKS_PER_BIT(CLKS_PER_BIT)
-    ) u_tx_host (
-        .clk(sys_clk),
-        .rst_n(rst_n),
-        .byte_data(tx_byte),
-        .byte_valid(tx_start),
-        .busy(tx_busy),
-        .tx_o(tx_pin_out),
-        .byte_done()
-    );
-
-    // Broadcast TX to both RS-232 and TTL ports
-    assign host_rs232_tx = tx_pin_out;
-    assign host_ttl_tx   = tx_pin_out;
-
-    // Periodic transmit timer: 500ms cycle (12,500,000 clocks)
-    localparam [31:0] CYCLE_TICKS = (CLOCK_HZ / 2); // 0.5 sec
-    reg [31:0] timer_cnt = 32'd0;
-    reg [15:0] seq_counter = 16'd0;
-
-    // Diagnostic State Machine
-    localparam [2:0] S_IDLE     = 3'd0;
-    localparam [2:0] S_SEND_ROM = 3'd1;
-    localparam [2:0] S_WAIT_TX  = 3'd2;
-    localparam [2:0] S_LOOPBACK = 3'd3;
-
-    reg [2:0]  diag_state = S_IDLE;
-    reg [5:0]  rom_idx = 6'd0;
-    reg [7:0]  echo_byte = 8'd0;
-    reg        echo_pending = 1'b0;
-
-    // 32-byte ROM pattern
-    // [0..3]: 55 55 55 55 (square wave)
-    // [4..7]: AA AA AA AA (inverse square wave)
-    // [8..9]: 00 00
-    // [10..11]: FF FF
-    // [12..17]: "DIAG="
-    // [18..23]: "921600" or "115200"
-    // [24..25]: "\r\n"
-    // [26..31]: Standard 6-byte beacon frame: A5 5A 51 00 CRC_L CRC_H
-    // CRC-16/CCITT-FALSE over (51 00):
-    // 51 00 -> CRC = 0x2081 -> CRC_L = 81, CRC_H = 20
-    reg [7:0] rom_data [0:31];
-    initial begin
-        rom_data[0]  = 8'h55; rom_data[1]  = 8'h55; rom_data[2]  = 8'h55; rom_data[3]  = 8'h55;
-        rom_data[4]  = 8'hAA; rom_data[5]  = 8'hAA; rom_data[6]  = 8'hAA; rom_data[7]  = 8'hAA;
-        rom_data[8]  = 8'h00; rom_data[9]  = 8'h00;
-        rom_data[10] = 8'hFF; rom_data[11] = 8'hFF;
-        rom_data[12] = "D";   rom_data[13] = "I";   rom_data[14] = "A";   rom_data[15] = "G";
-        rom_data[16] = "=";   rom_data[17] = "0" + ((BAUD_RATE / 100000) % 10);
-        rom_data[18] = "0" + ((BAUD_RATE / 10000) % 10);
-        rom_data[19] = "0" + ((BAUD_RATE / 1000) % 10);
-        rom_data[20] = "0" + ((BAUD_RATE / 100) % 10);
-        rom_data[21] = "0" + ((BAUD_RATE / 10) % 10);
-        rom_data[22] = "0" + ((BAUD_RATE / 1) % 10);
-        rom_data[23] = "\r";  rom_data[24] = "\n";
-        rom_data[25] = 8'hA5; rom_data[26] = 8'h5A; // Preamble
-        rom_data[27] = 8'h51; // TYPE: DIAG_BEACON
-        rom_data[28] = 8'h00; // LEN: 0
-        rom_data[29] = 8'h81; // CRC_L (CRC16-CCITT of 51 00 is 0x2081)
-        rom_data[30] = 8'h20; // CRC_H
-        rom_data[31] = 8'h0A; // Newline delimiter
-    end
-
-    always @(posedge sys_clk or negedge rst_n) begin
-        if (!rst_n) begin
-            timer_cnt    <= 32'd0;
-            seq_counter  <= 16'd0;
-            diag_state   <= S_IDLE;
-            rom_idx      <= 6'd0;
-            tx_start     <= 1'b0;
-            tx_byte      <= 8'd0;
-            echo_byte    <= 8'd0;
-            echo_pending <= 1'b0;
-        end else begin
-            tx_start <= 1'b0;
-
-            // Latch incoming byte for echo loopback
-            if (rs232_rx_valid) begin
-                echo_byte    <= rs232_rx_data;
-                echo_pending <= 1'b1;
-            end else if (ttl_rx_valid) begin
-                echo_byte    <= ttl_rx_data;
-                echo_pending <= 1'b1;
-            end
-
-            // Cycle timer
-            if (timer_cnt < CYCLE_TICKS - 1) begin
-                timer_cnt <= timer_cnt + 32'd1;
-            end else begin
-                timer_cnt <= 32'd0;
-            end
-
-            case (diag_state)
-                S_IDLE: begin
-                    // Prioritize immediate echo if a byte was received
-                    if (echo_pending && !tx_busy) begin
-                        echo_pending <= 1'b0;
-                        tx_byte      <= echo_byte;
-                        tx_start     <= 1'b1;
-                        diag_state   <= S_WAIT_TX;
-                    end else if (timer_cnt == 32'd0 && !tx_busy) begin
-                        // Start transmitting ROM pattern burst
-                        seq_counter <= seq_counter + 16'd1;
-                        rom_idx     <= 6'd0;
-                        tx_byte     <= rom_data[0];
-                        tx_start    <= 1'b1;
-                        diag_state  <= S_SEND_ROM;
-                    end
-                end
-
-                S_SEND_ROM: begin
-                    if (!tx_busy && !tx_start) begin
-                        if (rom_idx < 6'd31) begin
-                            rom_idx    <= rom_idx + 6'd1;
-                            tx_byte    <= rom_data[rom_idx + 6'd1];
-                            tx_start   <= 1'b1;
-                        end else begin
-                            diag_state <= S_IDLE;
-                        end
-                    end
-                end
-
-                S_WAIT_TX: begin
-                    if (!tx_busy && !tx_start) begin
-                        diag_state <= S_IDLE;
-                    end
-                end
-
-                default: diag_state <= S_IDLE;
-            endcase
-        end
-    end
-
-endmodule

+ 0 - 84
src/generated/6400/prod2u_6400_front_back_params.vh

@@ -1,84 +0,0 @@
-// Generated from 6400 project.json. Do not edit.
-`define FB_CLOCK_HZ 25000000
-`define P4_CLOCK_HZ 25000000
-`define P4_UART_BAUD 115200
-`define P4_UART_CLKS_PER_BIT 217
-`define P4_PTC_COUNT 24
-`define P4_FAN_COUNT 8
-`define P4_OUTPUT_CHANNEL_COUNT 32
-`define P4_PWM_PROTOCOL_WIDTH 8
-`define P4_PWM_INTERNAL_WIDTH 7
-`define P4_PWM_MAX_DUTY 100
-`define P4_PWM_PHASE_COUNT 100
-`define P4_PWM_FREQUENCY_HZ 20
-`define P4_PWM_PHASE_CLKS 12500
-`define P4_PWM_PERIOD_CLKS 1250000
-`define P4_CMD_SET_ALL 8'h01
-`define P4_CMD_GET_TEMPERATURE 8'h02
-`define P4_CMD_TEMPERATURE_DATA 8'h82
-`define P4_RSP_TEMPERATURE 8'h82
-`define P4_SET_ALL_PAYLOAD_LENGTH 32
-`define P4_FRAME_INTER_BYTE_TIMEOUT_CYCLES 250000
-`define P4_TEMPERATURE_COUNT 27
-`define P4_TEMP_MAX_CELSIUS 150
-`define P4_PTC_DEFAULT_TARGET 8'h00
-`define P4_FAN_DEFAULT_TARGET 8'h0A
-`define P4_WATCHDOG_TIMEOUT_SECONDS 30
-`define P4_WATCHDOG_TICK_US 500
-`define P4_WATCHDOG_TICK_CLKS 12500
-`define P4_WATCHDOG_TIMEOUT_TICKS 60000
-`define P4_WATCHDOG_PTC_TARGET 8'h00
-`define P4_WATCHDOG_FAN_TARGET 8'h0A
-`define P4_TEMP_DEVICE_ADDR_0 7'h49
-`define P4_TEMP_DEVICE_ADDR_1 7'h48
-`define P4_TEMP_DEVICE_ADDR_2 7'h4B
-`define P4_TEMP_REGISTER_0 8'h00
-`define P4_TEMP_REGISTER_1 8'h01
-`define P4_TEMP_REGISTER_2 8'h02
-`define P4_TEMP_REGISTER_3 8'h03
-`define P4_TEMP_REGISTER_4 8'h04
-`define P4_TEMP_REGISTER_5 8'h05
-`define P4_TEMP_REGISTER_6 8'h06
-`define P4_TEMP_REGISTER_7 8'h07
-`define P4_TEMP_REGISTER_8 8'h08
-`define FB_CLOCK_HZ 25000000
-`define FB_UART_BAUD 115200
-`define FB_UART_CLKS_PER_BIT 217
-`define FB_PTC_COUNT 24
-`define FB_FAN_COUNT 8
-`define FB_OUTPUT_CHANNEL_COUNT 32
-`define FB_PWM_PROTOCOL_WIDTH 8
-`define FB_PWM_INTERNAL_WIDTH 7
-`define FB_PWM_MAX_DUTY 100
-`define FB_PWM_PHASE_COUNT 100
-`define FB_PWM_FREQUENCY_HZ 20
-`define FB_PWM_PHASE_CLKS 12500
-`define FB_PWM_PERIOD_CLKS 1250000
-`define FB_CMD_SET_ALL 8'h01
-`define FB_CMD_GET_TEMPERATURE 8'h02
-`define FB_CMD_TEMPERATURE_DATA 8'h82
-`define FB_RSP_TEMPERATURE 8'h82
-`define FB_SET_ALL_PAYLOAD_LENGTH 32
-`define FB_FRAME_INTER_BYTE_TIMEOUT_CYCLES 250000
-`define FB_TEMPERATURE_COUNT 27
-`define FB_TEMP_MAX_CELSIUS 150
-`define FB_PTC_DEFAULT_TARGET 8'h00
-`define FB_FAN_DEFAULT_TARGET 8'h0A
-`define FB_WATCHDOG_TIMEOUT_SECONDS 30
-`define FB_WATCHDOG_TICK_US 500
-`define FB_WATCHDOG_TICK_CLKS 12500
-`define FB_WATCHDOG_TIMEOUT_TICKS 60000
-`define FB_WATCHDOG_PTC_TARGET 8'h00
-`define FB_WATCHDOG_FAN_TARGET 8'h0A
-`define FB_TEMP_DEVICE_ADDR_0 7'h49
-`define FB_TEMP_DEVICE_ADDR_1 7'h48
-`define FB_TEMP_DEVICE_ADDR_2 7'h4B
-`define FB_TEMP_REGISTER_0 8'h00
-`define FB_TEMP_REGISTER_1 8'h01
-`define FB_TEMP_REGISTER_2 8'h02
-`define FB_TEMP_REGISTER_3 8'h03
-`define FB_TEMP_REGISTER_4 8'h04
-`define FB_TEMP_REGISTER_5 8'h05
-`define FB_TEMP_REGISTER_6 8'h06
-`define FB_TEMP_REGISTER_7 8'h07
-`define FB_TEMP_REGISTER_8 8'h08

+ 0 - 101
src/generated/prod2u_door_temp_params.vh

@@ -1,101 +0,0 @@
-// Generated from project.json. Do not edit.
-`define P4_AXIS_COUNT 3
-`define P4_LIMIT_COUNT 6
-`define P4_RUNTIME_LIMIT_USE 1
-`define P4_LIMIT_ACTIVE_HIGH_MASK 3'b111
-`define P4_DIR_CLOSE_LEVEL_MASK 3'b111
-`define P4_CLOSE_LIMIT_IS_LS_MASK 3'b111
-`define P4_CLOCK_HZ 25000000
-`define P4_UART_BAUD 115200
-`define P4_UART_CLKS_PER_BIT 217
-`define P4_PTC_COUNT 8
-`define P4_FAN_COUNT 4
-`define P4_OUTPUT_CHANNEL_COUNT 12
-`define P4_PWM_PROTOCOL_WIDTH 8
-`define P4_PWM_INTERNAL_WIDTH 7
-`define P4_PWM_MAX_DUTY 100
-`define P4_PWM_PHASE_COUNT 100
-`define P4_PWM_FREQUENCY_HZ 20
-`define P4_PWM_SLOT_CLKS 1042
-`define P4_CMD_SET_ALL 8'h01
-`define P4_CMD_GET_TEMPERATURE 8'h02
-`define P4_CMD_GET_MOTOR_STATUS 8'h03
-`define P4_CMD_TEMPERATURE_DATA 8'h82
-`define P4_CMD_MOTOR_STATUS_DATA 8'h83
-`define P4_RSP_TEMPERATURE 8'h82
-`define P4_RSP_MOTOR_STATUS 8'h83
-`define P4_SET_ALL_PAYLOAD_LENGTH 11
-`define P4_CHAMBER_PTC_COUNT 4
-`define P4_SET_ALL_FAN_OFFSET 0
-`define P4_SET_ALL_CHAMBER_PTC_OFFSET 4
-`define P4_SET_ALL_Z_DOOR_OFFSET 8
-`define P4_SET_ALL_EXHAUST_X_OFFSET 9
-`define P4_SET_ALL_EXHAUST_Y_OFFSET 10
-`define P4_DOOR_PERCENT_MIN 0
-`define P4_DOOR_PERCENT_MAX 100
-`define P4_OPEN_ENDPOINT_PERCENT 0
-`define P4_CLOSE_ENDPOINT_PERCENT 100
-`define P4_MID_PERCENT_MIN 1
-`define P4_MID_PERCENT_MAX 99
-`define P4_MOTOR_STATUS_PAYLOAD_LENGTH 31
-`define P4_MOTOR_STATUS_FRAME_LENGTH 37
-`define P4_MOTOR_OPEN_DIR 1'b0
-`define P4_MOTOR_CLOSE_DIR 1'b1
-`define P4_FRAME_INTER_BYTE_TIMEOUT_CYCLES 250000
-`define P4_MOTOR_STEP_RATE_HZ 1000
-`define P4_MOTOR_STEP_HALF_CYCLES 12500
-`define P4_MOTION_SERVICE_US 25
-`define P4_MOTION_SERVICE_CLKS 625
-`define P4_PHASE_FACTOR 5120
-`define P4_PROFILE_FULL 256
-`define P4_CAL_RAMP_UNIT 8
-`define P4_MOTOR_DIR_SETUP_CYCLES 25000
-`define P4_MOTOR_DIR_SETUP_TICKS 2
-`define P4_TEMPERATURE_COUNT 27
-`define P4_TEMPERATURE_COUNT_BYTE 8'h1B
-`define P4_TEMPERATURE_FRAME_LENGTH 33
-`define P4_TEMP_MAX_CELSIUS 150
-`define P4_PTC_ACTIVE_HIGH 1
-`define P4_FAN_ACTIVE_HIGH 0
-`define P4_PTC_DEFAULT_TARGET 8'h00
-`define P4_FAN_DEFAULT_TARGET 8'h0A
-`define P4_WATCHDOG_TIMEOUT_SECONDS 30
-`define P4_WATCHDOG_TICK_US 500
-`define P4_WATCHDOG_TICK_CLKS 12500
-`define P4_WATCHDOG_TIMEOUT_TICKS 60000
-`define P4_WATCHDOG_ENABLE_AFTER_STARTUP 1
-`define P4_WATCHDOG_PTC_TARGET 8'h00
-`define P4_WATCHDOG_FAN_TARGET 8'h0A
-`define P4_STARTUP_ENABLED 1
-`define P4_STARTUP_DIR_MASK 3'b111
-`define P4_CAL_MAX_STEPS 5000
-`define P4_CAL_MIN_TRAVEL 2
-`define P4_ENDPOINT_GUARD_EXTRA 500
-`define P4_ENDPOINT_GUARD_MAX 5500
-`define P4_STARTUP_STEP_RATE_HZ 1000
-`define P4_MOTOR_ENABLE_POLICY_PERMANENT_HIGH 1
-`define P4_STATE_CAL_SEEK_CLOSE 8'd0
-`define P4_STATE_CAL_MEASURE_OPEN 8'd1
-`define P4_STATE_IDLE 8'd2
-`define P4_STATE_MOVE_OPEN 8'd3
-`define P4_STATE_MOVE_CLOSE 8'd4
-`define P4_STATE_WAIT_REPLAN 8'd5
-`define P4_STATE_FAULT 8'd6
-`define P4_FAULT_NONE 8'd0
-`define P4_FAULT_BOTH_LIMITS_ACTIVE 8'd1
-`define P4_FAULT_CAL_CLOSE_TIMEOUT 8'd2
-`define P4_FAULT_CAL_OPEN_TIMEOUT 8'd3
-`define P4_FAULT_INVALID_ZERO_OR_TINY_TRAVEL 8'd4
-`define P4_FAULT_ENDPOINT_TIMEOUT 8'd5
-`define P4_TEMP_DEVICE_ADDR_0 7'h49
-`define P4_TEMP_DEVICE_ADDR_1 7'h48
-`define P4_TEMP_DEVICE_ADDR_2 7'h4B
-`define P4_TEMP_REGISTER_0 8'h00
-`define P4_TEMP_REGISTER_1 8'h01
-`define P4_TEMP_REGISTER_2 8'h02
-`define P4_TEMP_REGISTER_3 8'h03
-`define P4_TEMP_REGISTER_4 8'h04
-`define P4_TEMP_REGISTER_5 8'h05
-`define P4_TEMP_REGISTER_6 8'h06
-`define P4_TEMP_REGISTER_7 8'h07
-`define P4_TEMP_REGISTER_8 8'h08

+ 0 - 921
src/legacy/modules/door_axis_controller.v

@@ -1,921 +0,0 @@
-`timescale 1ns/1ps
-
-// Per-axis door percent FSM: cal seek-close → measure-open, then runtime
-// mid/endpoint motion with latest-wins replan. Position only on gated_step_rise.
-module door_axis_controller #(
-    parameter integer AXIS_ID = 0,
-    parameter integer MAX_CAL_STEPS = 5000,
-    parameter integer MIN_TRAVEL = 2,
-    parameter integer ENDPOINT_GUARD_EXTRA = 500,
-    parameter integer DIR_SETUP_TICKS = 2,
-    parameter integer PERCENT_MAX = 100,
-    parameter integer CAL_RAMP_UNIT = 8
-) (
-    input  wire        clk,
-    input  wire        rst_n,
-    input  wire        open_limit,
-    input  wire        close_limit,
-    input  wire        limit_sync_valid,
-    input  wire        cal_enable,
-    input  wire        gated_step,
-    input  wire        gated_step_rise,
-    input  wire        tick_500us,
-    input  wire        step_toggle_pulse,
-    input  wire        request_valid,
-    input  wire [7:0]  requested_percent_in,
-    input  wire        watchdog_stop,
-    input  wire [20:0] rate_quantum_in,
-    input  wire        rate_quantum_valid,
-    output reg         planner_req,
-    output wire [7:0]  planner_percent,
-    output wire [12:0] planner_travel,
-    input  wire        planner_done,
-    input  wire [1:0]  planner_done_axis,
-    input  wire [7:0]  planner_done_percent,
-    input  wire [12:0] planner_result,
-    output reg         step,
-    output reg         dir_close,
-    output reg  [2:0]  status_state,
-    output reg  [7:0]  status_flags,
-    output reg  [7:0]  status_requested_percent,
-    output reg  [12:0] status_current,
-    output reg  [12:0] status_target,
-    output reg  [12:0] status_travel,
-    output reg  [7:0]  status_fault_code,
-    output wire        calibrated,
-    output wire        faulted,
-    output wire        terminal,
-    output wire        axis_moving,
-    output wire        axis_allow_rise,
-    output wire        axis_in_calibration,
-    output wire        axis_endpoint_crawl,
-    output wire        axis_dda_run,
-    output reg  [3:0]  profile_level,
-    output reg  [12:0] profile_distance,
-    output reg  [12:0] profile_done_steps,
-    output reg  [12:0] profile_ramp_unit,
-    output reg  [20:0] rate_quantum
-);
-    localparam [2:0] ST_CAL_SEEK_CLOSE   = 3'd0;
-    localparam [2:0] ST_CAL_MEASURE_OPEN = 3'd1;
-    localparam [2:0] ST_IDLE             = 3'd2;
-    localparam [2:0] ST_MOVE_OPEN        = 3'd3;
-    localparam [2:0] ST_MOVE_CLOSE       = 3'd4;
-    localparam [2:0] ST_WAIT_REPLAN      = 3'd5;
-    localparam [2:0] ST_FAULT            = 3'd6;
-
-    localparam [2:0] FC_NONE              = 3'd0;
-    localparam [2:0] FC_BOTH_LIMITS       = 3'd1;
-    localparam [2:0] FC_CAL_CLOSE_TIMEOUT = 3'd2;
-    localparam [2:0] FC_CAL_OPEN_TIMEOUT  = 3'd3;
-    localparam [2:0] FC_TINY_TRAVEL       = 3'd4;
-    localparam [2:0] FC_ENDPOINT_TIMEOUT  = 3'd5;
-
-    localparam [2:0] PH_NONE       = 3'd0;
-    localparam [2:0] PH_DIR_SETUP  = 3'd1;
-    localparam [2:0] PH_RUN        = 3'd2;
-    localparam [2:0] PH_DRAIN_HIGH = 3'd3;
-
-    localparam integer CNT_W = 13;
-    localparam [CNT_W-1:0] MAX_STEPS_W = MAX_CAL_STEPS[CNT_W-1:0];
-    localparam [CNT_W-1:0] MIN_TRAVEL_W = MIN_TRAVEL[CNT_W-1:0];
-
-    reg        calibrated_r;
-    reg [2:0]  fault_code;
-    reg [CNT_W-1:0] travel_steps;
-    reg [CNT_W-1:0] current_position;
-    reg [CNT_W-1:0] target_position;
-    reg [7:0]  requested_percent;
-    reg        replan_pending;
-    reg        endpoint_mode;          // target is 0%/100% (estimated endpoint)
-    reg        endpoint_crawl_active;  // past estimate; level-0 search for real limit
-    reg        target_valid;
-    reg        moving;
-    reg [2:0]  phase;
-    reg [3:0]  setup_count;
-    reg [CNT_W-1:0] motion_count;
-    reg        allow_rise;
-    reg        stop_after_budget;
-    reg        cal_started;
-    reg        need_planner;
-    reg        wd_stopped;
-    reg        open_limit_armed;
-    reg        close_limit_armed;
-    // Cached L*unit for O(1) S-curve climb/drop (avoids 15-iter combo unroll).
-    reg [CNT_W-1:0] profile_level_thresh;
-
-    assign calibrated = calibrated_r;
-    assign faulted = (status_state == ST_FAULT);
-    assign terminal = ((status_state == ST_IDLE) && calibrated_r) || (status_state == ST_FAULT);
-    assign planner_percent = requested_percent;
-    assign planner_travel = travel_steps;
-
-    wire both_limits = open_limit && close_limit;
-    wire mid_request = (requested_percent > 8'd0) && (requested_percent < PERCENT_MAX[7:0]);
-    wire is_open_endpoint = (requested_percent == 8'd0);
-    wire is_close_endpoint = (requested_percent == PERCENT_MAX[7:0]);
-    wire planner_accept = planner_done && (planner_done_axis == AXIS_ID[1:0]) &&
-        (planner_done_percent == requested_percent) && calibrated_r &&
-        (status_state != ST_FAULT) && mid_request && need_planner;
-    wire [CNT_W-1:0] guard_limit = travel_steps + ENDPOINT_GUARD_EXTRA[CNT_W-1:0];
-    wire in_calibration = (status_state == ST_CAL_SEEK_CLOSE) ||
-                          (status_state == ST_CAL_MEASURE_OPEN);
-    assign axis_moving = moving;
-    assign axis_allow_rise = allow_rise && !stop_after_budget;
-    assign axis_in_calibration = in_calibration;
-    assign axis_endpoint_crawl = endpoint_crawl_active && moving && calibrated_r;
-    // DDA only while producing/consuming half-cycles; DIR_SETUP clears phase via !active.
-    assign axis_dda_run = (phase == PH_RUN) || (phase == PH_DRAIN_HIGH);
-
-    // Incremental level matching min(15, floor(done/u), floor((rem-1)/u)).
-    // One add/compare per rise (no 15-iter combinational scan).
-
-    function automatic [CNT_W-1:0] f_ramp_unit;
-        input [CNT_W-1:0] distance_i;
-        reg [CNT_W-1:0] u;
-        begin
-            if (distance_i == {CNT_W{1'b0}})
-                f_ramp_unit = {{(CNT_W-1){1'b0}}, 1'b1};
-            else begin
-                u = (distance_i + 7'd63) >> 6;
-                f_ramp_unit = (u == {CNT_W{1'b0}}) ? {{(CNT_W-1){1'b0}}, 1'b1} : u;
-            end
-        end
-    endfunction
-
-    function automatic [CNT_W-1:0] f_abs_delta;
-        input [CNT_W-1:0] a;
-        input [CNT_W-1:0] b;
-        begin
-            f_abs_delta = (a > b) ? (a - b) : (b - a);
-        end
-    endfunction
-    wire open_assert_event = open_limit && open_limit_armed;
-    wire close_assert_event = close_limit && close_limit_armed;
-    wire departing_close_source =
-        calibrated_r && !in_calibration &&
-        ((status_state == ST_MOVE_OPEN) || (moving && !dir_close));
-    wire departing_open_source =
-        calibrated_r && !in_calibration &&
-        ((status_state == ST_MOVE_CLOSE) || (moving && dir_close));
-    wire close_snap_accept =
-        calibrated_r && !in_calibration &&
-        close_assert_event && !departing_close_source;
-    wire open_snap_accept =
-        calibrated_r && !in_calibration &&
-        open_assert_event && !departing_open_source;
-    // Pre-NBA view: single-limit coordinate disagrees with accepted snap event.
-    wire limit_pos_mismatch =
-        (close_snap_accept && (current_position != travel_steps)) ||
-        (open_snap_accept && (current_position != {CNT_W{1'b0}}));
-
-    // Combinational endpoint-effective coordinate for same-cycle planner decisions.
-    // Use held source limit (not only one-shot snap): departure may consume arm
-    // without snapping, so a later mid accept while close_limit stays high must
-    // still treat the axis as at travel (never MOVE_CLOSE into the close limit).
-    wire close_source_hold =
-        calibrated_r && !in_calibration && close_limit && !departing_close_source;
-    wire open_source_hold =
-        calibrated_r && !in_calibration && open_limit && !departing_open_source;
-    wire [CNT_W-1:0] effective_current_position =
-        close_source_hold ? travel_steps :
-        open_source_hold ? {CNT_W{1'b0}} :
-        current_position;
-
-    // Distinguish request bookkeeping from material replan preempt.
-    // Idempotent same-percent heartbeat must not occupy the exclusive FSM branch.
-    wire request_seen = request_valid && calibrated_r;
-    wire idle_not_satisfied =
-        (status_state == ST_IDLE) && (
-            ((requested_percent_in == 8'd0) && !open_limit) ||
-            ((requested_percent_in == PERCENT_MAX[7:0]) && !close_limit) ||
-            ((requested_percent_in > 8'd0) &&
-             (requested_percent_in < PERCENT_MAX[7:0]) &&
-             (current_position != target_position))
-        );
-    wire request_requires_replan = request_seen && (
-        (requested_percent_in != requested_percent) ||
-        wd_stopped ||
-        // Limit snap forces resume only when this cycle cannot accept a matching
-        // planner result (which uses effective_current_position for DIR).
-        (limit_pos_mismatch && !planner_accept) ||
-        idle_not_satisfied
-    );
-
-    always @* begin
-        status_requested_percent = requested_percent;
-        status_current = current_position;
-        status_target = target_position;
-        status_travel = travel_steps;
-        status_fault_code = {5'd0, fault_code};
-        status_flags = {
-            1'b0,
-            replan_pending,
-            target_valid,
-            endpoint_mode,
-            moving,
-            calibrated_r,
-            close_limit,
-            open_limit
-        };
-    end
-
-    // Shared STEP half-period helper: returns next step level
-    function automatic step_toggle;
-        input cur_step;
-        input do_allow_rise;
-        begin
-            if (cur_step)
-                step_toggle = 1'b0;
-            else if (do_allow_rise)
-                step_toggle = 1'b1;
-            else
-                step_toggle = 1'b0;
-        end
-    endfunction
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            status_state <= ST_CAL_SEEK_CLOSE;
-            calibrated_r <= 1'b0;
-            fault_code <= FC_NONE;
-            travel_steps <= {CNT_W{1'b0}};
-            current_position <= {CNT_W{1'b0}};
-            target_position <= {CNT_W{1'b0}};
-            requested_percent <= 8'd0;
-            replan_pending <= 1'b0;
-            endpoint_mode <= 1'b0;
-            endpoint_crawl_active <= 1'b0;
-            target_valid <= 1'b0;
-            moving <= 1'b0;
-            phase <= PH_NONE;
-            setup_count <= 4'd0;
-            motion_count <= {CNT_W{1'b0}};
-            allow_rise <= 1'b0;
-            stop_after_budget <= 1'b0;
-            cal_started <= 1'b0;
-            need_planner <= 1'b0;
-            planner_req <= 1'b0;
-            step <= 1'b0;
-            dir_close <= 1'b1;
-            wd_stopped <= 1'b0;
-            open_limit_armed <= 1'b1;
-            close_limit_armed <= 1'b1;
-            profile_level <= 4'd0;
-            profile_level_thresh <= {CNT_W{1'b0}};
-            profile_distance <= {CNT_W{1'b0}};
-            profile_done_steps <= {CNT_W{1'b0}};
-            profile_ramp_unit <= {{(CNT_W-1){1'b0}}, 1'b1};
-            rate_quantum <= 21'd64; // level-0 scale until shared builder refreshes
-        end else if (both_limits) begin
-            status_state <= ST_FAULT;
-            fault_code <= FC_BOTH_LIMITS;
-            step <= 1'b0;
-            phase <= PH_NONE;
-            moving <= 1'b0;
-            allow_rise <= 1'b0;
-            stop_after_budget <= 1'b0;
-            planner_req <= 1'b0;
-            need_planner <= 1'b0;
-            replan_pending <= 1'b0;
-            if (request_valid)
-                requested_percent <= requested_percent_in;
-        end else if (status_state == ST_FAULT) begin
-            step <= 1'b0;
-            moving <= 1'b0;
-            planner_req <= 1'b0;
-            if (request_valid)
-                requested_percent <= requested_percent_in;
-        end else begin
-            // ----------------------------------------------------------
-            // 1) Position / cal / guard counts on gated rise (always)
-            // ----------------------------------------------------------
-            if (gated_step_rise) begin
-                if (status_state == ST_CAL_SEEK_CLOSE ||
-                    status_state == ST_CAL_MEASURE_OPEN) begin
-                    motion_count <= motion_count + 1'b1;
-                    // Calibration soft-start: every CAL_RAMP_UNIT rises bump level.
-                    if (profile_level < 4'd15) begin
-                        if (profile_done_steps + 1'b1 >= CAL_RAMP_UNIT[CNT_W-1:0]) begin
-                            profile_done_steps <= {CNT_W{1'b0}};
-                            profile_level <= profile_level + 1'b1;
-                        end else begin
-                            profile_done_steps <= profile_done_steps + 1'b1;
-                        end
-                    end
-                end else if (calibrated_r) begin
-                    if (endpoint_mode)
-                        motion_count <= motion_count + 1'b1;
-                    if (dir_close) begin
-                        if (current_position < travel_steps)
-                            current_position <= current_position + 1'b1;
-                    end else begin
-                        if (current_position != {CNT_W{1'b0}})
-                            current_position <= current_position - 1'b1;
-                    end
-                    // Runtime S-curve on gated rises (mid + endpoint estimate phase).
-                    // Endpoint crawl holds level 0 after estimate is reached.
-                    if (moving && !endpoint_crawl_active) begin
-                        begin : sc_rise
-                            reg [CNT_W-1:0] done_n;
-                            reg [CNT_W-1:0] rem_n;
-                            reg [CNT_W-1:0] rem_term;
-                            reg [CNT_W-1:0] next_thr;
-                            done_n = profile_done_steps + 1'b1;
-                            rem_n = (profile_distance > done_n) ?
-                                    (profile_distance - done_n) : {CNT_W{1'b0}};
-                            rem_term = (rem_n < {{(CNT_W-1){1'b0}}, 1'b1}) ?
-                                       {CNT_W{1'b0}} : (rem_n - {{(CNT_W-1){1'b0}}, 1'b1});
-                            profile_done_steps <= done_n;
-                            if (profile_ramp_unit == {CNT_W{1'b0}}) begin
-                                profile_level <= 4'd0;
-                                profile_level_thresh <= {CNT_W{1'b0}};
-                            end else if ((profile_level != 4'd0) &&
-                                         (rem_term < profile_level_thresh)) begin
-                                profile_level <= profile_level - 4'd1;
-                                profile_level_thresh <=
-                                    profile_level_thresh - profile_ramp_unit;
-                            end else if (profile_level < 4'd15) begin
-                                next_thr = profile_level_thresh + profile_ramp_unit;
-                                if ((done_n >= next_thr) && (rem_term >= next_thr)) begin
-                                    profile_level <= profile_level + 4'd1;
-                                    profile_level_thresh <= next_thr;
-                                end
-                            end
-                        end
-                    end else if (moving && endpoint_crawl_active) begin
-                        profile_level <= 4'd0;
-                        profile_level_thresh <= {CNT_W{1'b0}};
-                    end
-                end
-            end
-            if (rate_quantum_valid)
-                rate_quantum <= rate_quantum_in;
-
-            // ----------------------------------------------------------
-            // 1b) One-shot single-limit snap (consumes assertion interval).
-            // Departure from a consumed source limit must not overwrite §1.
-            // ----------------------------------------------------------
-            if (!open_limit)
-                open_limit_armed <= 1'b1;
-            if (!close_limit)
-                close_limit_armed <= 1'b1;
-            if (open_assert_event)
-                open_limit_armed <= 1'b0;
-            if (close_assert_event)
-                close_limit_armed <= 1'b0;
-
-            if (close_snap_accept)
-                current_position <= travel_steps;
-            else if (open_snap_accept)
-                current_position <= {CNT_W{1'b0}};
-
-            // ----------------------------------------------------------
-            // 2a) Non-destructive request bookkeeping (idempotent OK).
-            // Does not occupy the exclusive FSM branch — heartbeat may
-            // coexist with planner_accept / tick_500us / limit progression.
-            // ----------------------------------------------------------
-            if (request_seen) begin
-                requested_percent <= requested_percent_in;
-                wd_stopped <= 1'b0;
-            end
-
-            // ----------------------------------------------------------
-            // 2b) Material host replan only (latest-wins). Preempts tick.
-            // Same-percent heartbeat does NOT enter this branch.
-            // ----------------------------------------------------------
-            if (request_requires_replan) begin
-                replan_pending <= 1'b1;
-                planner_req <= 1'b0;
-                need_planner <= 1'b0;
-                allow_rise <= 1'b0;
-                // Materially new percent or forced replan: old target invalid
-                target_valid <= 1'b0;
-                if (gated_step || step) begin
-                    phase <= PH_DRAIN_HIGH;
-                    status_state <= ST_WAIT_REPLAN;
-                end else begin
-                    step <= 1'b0;
-                    phase <= PH_NONE;
-                    moving <= 1'b0;
-                    status_state <= ST_WAIT_REPLAN;
-                end
-
-            // ----------------------------------------------------------
-            // 3) Watchdog graceful stop (suppressed by same-cycle SET_ALL)
-            // Latch drain once; while PH_DRAIN_HIGH, fall through to §8 so
-            // tick_500us can pull STEP low even if watchdog_stop stays high.
-            // ----------------------------------------------------------
-            end else if (watchdog_stop && calibrated_r && !in_calibration &&
-                         !wd_stopped && !request_seen &&
-                         !(status_state == ST_WAIT_REPLAN && phase == PH_DRAIN_HIGH)) begin
-                allow_rise <= 1'b0;
-                planner_req <= 1'b0;
-                need_planner <= 1'b0;
-                if (gated_step || step) begin
-                    phase <= PH_DRAIN_HIGH;
-                    status_state <= ST_WAIT_REPLAN;
-                    replan_pending <= 1'b0;
-                end else begin
-                    step <= 1'b0;
-                    phase <= PH_NONE;
-                    moving <= 1'b0;
-                    status_state <= ST_IDLE;
-                    wd_stopped <= 1'b1;
-                    replan_pending <= 1'b0;
-                end
-
-            // ----------------------------------------------------------
-            // 4) Planner result (uses effective_current_position for DIR)
-            // ----------------------------------------------------------
-            end else if (planner_accept) begin
-                planner_req <= 1'b0;
-                need_planner <= 1'b0;
-                replan_pending <= 1'b0;
-                target_position <= planner_result;
-                target_valid <= 1'b1;
-                endpoint_mode <= 1'b0;
-                endpoint_crawl_active <= 1'b0;
-                motion_count <= {CNT_W{1'b0}};
-                step <= 1'b0;
-                setup_count <= 4'd0;
-                allow_rise <= 1'b0;
-                stop_after_budget <= 1'b0;
-                begin : sc_init_plan
-                    reg [CNT_W-1:0] dist_n;
-                    reg [CNT_W-1:0] unit_n;
-                    dist_n = f_abs_delta(planner_result, effective_current_position);
-                    unit_n = f_ramp_unit(dist_n);
-                    profile_distance <= dist_n;
-                    profile_ramp_unit <= unit_n;
-                    profile_done_steps <= {CNT_W{1'b0}};
-                    // done==0 ⇒ level 0 (same as prior full scan).
-                    profile_level <= 4'd0;
-                    profile_level_thresh <= {CNT_W{1'b0}};
-                end
-                if (planner_result == effective_current_position) begin
-                    status_state <= ST_IDLE;
-                    moving <= 1'b0;
-                    phase <= PH_NONE;
-                end else if (planner_result > effective_current_position) begin
-                    dir_close <= 1'b1;
-                    phase <= PH_DIR_SETUP;
-                    moving <= 1'b1;
-                    status_state <= ST_MOVE_CLOSE;
-                end else begin
-                    dir_close <= 1'b0;
-                    phase <= PH_DIR_SETUP;
-                    moving <= 1'b1;
-                    status_state <= ST_MOVE_OPEN;
-                end
-
-            // ----------------------------------------------------------
-            // 5) Calibration start
-            // ----------------------------------------------------------
-            end else if (!cal_started) begin
-                if (limit_sync_valid && cal_enable) begin
-                    cal_started <= 1'b1;
-                    motion_count <= {CNT_W{1'b0}};
-                    setup_count <= 4'd0;
-                    allow_rise <= 1'b0;
-                    stop_after_budget <= 1'b0;
-                    step <= 1'b0;
-                    phase <= PH_DIR_SETUP;
-                    moving <= 1'b1;
-                    profile_level <= 4'd0;
-                    profile_level_thresh <= {CNT_W{1'b0}};
-                    profile_done_steps <= {CNT_W{1'b0}};
-                    profile_distance <= {CNT_W{1'b0}};
-                    profile_ramp_unit <= CAL_RAMP_UNIT[CNT_W-1:0];
-                    if (close_limit) begin
-                        dir_close <= 1'b0;
-                        status_state <= ST_CAL_MEASURE_OPEN;
-                    end else begin
-                        dir_close <= 1'b1;
-                        status_state <= ST_CAL_SEEK_CLOSE;
-                    end
-                end
-
-            // ----------------------------------------------------------
-            // 6) CAL_SEEK_CLOSE
-            // ----------------------------------------------------------
-            end else if (status_state == ST_CAL_SEEK_CLOSE) begin
-                if (close_limit) begin
-                    step <= 1'b0;
-                    allow_rise <= 1'b0;
-                    stop_after_budget <= 1'b0;
-                    motion_count <= {CNT_W{1'b0}};
-                    setup_count <= 4'd0;
-                    dir_close <= 1'b0;
-                    phase <= PH_DIR_SETUP;
-                    moving <= 1'b1;
-                    // Rebuild soft-start for measure-open (no S decelerate claimed).
-                    profile_level <= 4'd0;
-                    profile_level_thresh <= {CNT_W{1'b0}};
-                    profile_done_steps <= {CNT_W{1'b0}};
-                    status_state <= ST_CAL_MEASURE_OPEN;
-                end else if (stop_after_budget && !gated_step && !step) begin
-                    status_state <= ST_FAULT;
-                    fault_code <= FC_CAL_CLOSE_TIMEOUT;
-                    moving <= 1'b0;
-                    phase <= PH_NONE;
-                end else begin
-                    // Use post-rise count: if count already at max, stop new rises
-                    if ((motion_count >= MAX_STEPS_W) ||
-                        (gated_step_rise && (motion_count + 1'b1 >= MAX_STEPS_W))) begin
-                        allow_rise <= 1'b0;
-                        stop_after_budget <= 1'b1;
-                    end
-                    if (phase == PH_DIR_SETUP) begin
-                        step <= 1'b0;
-                        if (tick_500us) begin
-                            if (setup_count + 1'b1 >= DIR_SETUP_TICKS[3:0]) begin
-                                phase <= PH_RUN;
-                                setup_count <= 4'd0;
-                                allow_rise <= !stop_after_budget && (motion_count < MAX_STEPS_W);
-                            end else begin
-                                setup_count <= setup_count + 1'b1;
-                            end
-                        end
-                    end else if (step_toggle_pulse) begin
-                        step <= step_toggle(step, allow_rise && !stop_after_budget &&
-                                            (motion_count < MAX_STEPS_W));
-                    end
-                end
-
-            // ----------------------------------------------------------
-            // 7) CAL_MEASURE_OPEN
-            // ----------------------------------------------------------
-            end else if (status_state == ST_CAL_MEASURE_OPEN) begin
-                if (open_limit) begin
-                    // motion_count already includes this cycle's rise (NBA: see old+1)
-                    // Use effective count: if rise this cycle, +1 on current
-                    if (gated_step_rise) begin
-                        // effective = motion_count+1 (scheduled); compare with that
-                        if (((motion_count + 1'b1) >= MIN_TRAVEL_W) &&
-                            ((motion_count + 1'b1) <= MAX_STEPS_W)) begin
-                            travel_steps <= motion_count + 1'b1;
-                            current_position <= {CNT_W{1'b0}};
-                            target_position <= {CNT_W{1'b0}};
-                            requested_percent <= 8'd0;
-                            calibrated_r <= 1'b1;
-                            fault_code <= FC_NONE;
-                            target_valid <= 1'b1;
-                            endpoint_mode <= 1'b1;
-                            endpoint_crawl_active <= 1'b0;
-                            step <= 1'b0;
-                            phase <= PH_NONE;
-                            moving <= 1'b0;
-                            allow_rise <= 1'b0;
-                            stop_after_budget <= 1'b0;
-                            status_state <= ST_IDLE;
-                        end else begin
-                            status_state <= ST_FAULT;
-                            fault_code <= FC_TINY_TRAVEL;
-                            step <= 1'b0;
-                            moving <= 1'b0;
-                            phase <= PH_NONE;
-                        end
-                    end else begin
-                        if ((motion_count >= MIN_TRAVEL_W) &&
-                            (motion_count <= MAX_STEPS_W)) begin
-                            travel_steps <= motion_count;
-                            current_position <= {CNT_W{1'b0}};
-                            target_position <= {CNT_W{1'b0}};
-                            requested_percent <= 8'd0;
-                            calibrated_r <= 1'b1;
-                            fault_code <= FC_NONE;
-                            target_valid <= 1'b1;
-                            endpoint_mode <= 1'b1;
-                            endpoint_crawl_active <= 1'b0;
-                            step <= 1'b0;
-                            phase <= PH_NONE;
-                            moving <= 1'b0;
-                            allow_rise <= 1'b0;
-                            stop_after_budget <= 1'b0;
-                            status_state <= ST_IDLE;
-                        end else begin
-                            status_state <= ST_FAULT;
-                            fault_code <= FC_TINY_TRAVEL;
-                            step <= 1'b0;
-                            moving <= 1'b0;
-                            phase <= PH_NONE;
-                        end
-                    end
-                end else if (stop_after_budget && !gated_step && !step) begin
-                    status_state <= ST_FAULT;
-                    fault_code <= FC_CAL_OPEN_TIMEOUT;
-                    moving <= 1'b0;
-                    phase <= PH_NONE;
-                end else begin
-                    if ((motion_count >= MAX_STEPS_W) ||
-                        (gated_step_rise && (motion_count + 1'b1 >= MAX_STEPS_W))) begin
-                        allow_rise <= 1'b0;
-                        stop_after_budget <= 1'b1;
-                    end
-                    if (phase == PH_DIR_SETUP) begin
-                        step <= 1'b0;
-                        if (tick_500us) begin
-                            if (setup_count + 1'b1 >= DIR_SETUP_TICKS[3:0]) begin
-                                phase <= PH_RUN;
-                                allow_rise <= !stop_after_budget && (motion_count < MAX_STEPS_W);
-                            end else begin
-                                setup_count <= setup_count + 1'b1;
-                            end
-                        end
-                    end else if (step_toggle_pulse) begin
-                        step <= step_toggle(step, allow_rise && !stop_after_budget &&
-                                            (motion_count < MAX_STEPS_W));
-                    end
-                end
-
-            // ----------------------------------------------------------
-            // 8) WAIT_REPLAN / drain / decide
-            // ----------------------------------------------------------
-            end else if (status_state == ST_WAIT_REPLAN) begin
-                if (phase == PH_DRAIN_HIGH) begin
-                    if (step_toggle_pulse)
-                        step <= step_toggle(step, 1'b0);
-                    if (!gated_step && !step) begin
-                        step <= 1'b0;
-                        phase <= PH_NONE;
-                        moving <= 1'b0;
-                        if (watchdog_stop) begin
-                            status_state <= ST_IDLE;
-                            wd_stopped <= 1'b1;
-                            replan_pending <= 1'b0;
-                        end else begin
-                            replan_pending <= 1'b1;
-                        end
-                    end
-                end else if (replan_pending) begin
-                    replan_pending <= 1'b0;
-                    if (is_open_endpoint) begin
-                        endpoint_mode <= 1'b1;
-                        target_position <= {CNT_W{1'b0}};
-                        target_valid <= 1'b1;
-                        need_planner <= 1'b0;
-                        planner_req <= 1'b0;
-                        if (open_limit) begin
-                            current_position <= {CNT_W{1'b0}};
-                            endpoint_crawl_active <= 1'b0;
-                            profile_level <= 4'd0;
-                            profile_level_thresh <= {CNT_W{1'b0}};
-                            profile_done_steps <= {CNT_W{1'b0}};
-                            profile_distance <= {CNT_W{1'b0}};
-                            status_state <= ST_IDLE;
-                            moving <= 1'b0;
-                            step <= 1'b0;
-                            phase <= PH_NONE;
-                        end else begin
-                            begin : sc_init_open_ep
-                                reg [CNT_W-1:0] dist_n;
-                                reg [CNT_W-1:0] unit_n;
-                                dist_n = f_abs_delta(effective_current_position, {CNT_W{1'b0}});
-                                unit_n = f_ramp_unit(dist_n);
-                                profile_distance <= dist_n;
-                                profile_ramp_unit <= unit_n;
-                                profile_done_steps <= {CNT_W{1'b0}};
-                                profile_level <= 4'd0;
-                                profile_level_thresh <= {CNT_W{1'b0}};
-                                // Already at estimate with no limit → crawl immediately.
-                                endpoint_crawl_active <= (dist_n == {CNT_W{1'b0}});
-                            end
-                            motion_count <= {CNT_W{1'b0}};
-                            dir_close <= 1'b0;
-                            step <= 1'b0;
-                            setup_count <= 4'd0;
-                            allow_rise <= 1'b0;
-                            stop_after_budget <= 1'b0;
-                            phase <= PH_DIR_SETUP;
-                            moving <= 1'b1;
-                            status_state <= ST_MOVE_OPEN;
-                        end
-                    end else if (is_close_endpoint) begin
-                        endpoint_mode <= 1'b1;
-                        target_position <= travel_steps;
-                        target_valid <= 1'b1;
-                        need_planner <= 1'b0;
-                        planner_req <= 1'b0;
-                        if (close_limit) begin
-                            current_position <= travel_steps;
-                            endpoint_crawl_active <= 1'b0;
-                            profile_level <= 4'd0;
-                            profile_level_thresh <= {CNT_W{1'b0}};
-                            profile_done_steps <= {CNT_W{1'b0}};
-                            profile_distance <= {CNT_W{1'b0}};
-                            status_state <= ST_IDLE;
-                            moving <= 1'b0;
-                            step <= 1'b0;
-                            phase <= PH_NONE;
-                        end else begin
-                            begin : sc_init_close_ep
-                                reg [CNT_W-1:0] dist_n;
-                                reg [CNT_W-1:0] unit_n;
-                                dist_n = f_abs_delta(effective_current_position, travel_steps);
-                                unit_n = f_ramp_unit(dist_n);
-                                profile_distance <= dist_n;
-                                profile_ramp_unit <= unit_n;
-                                profile_done_steps <= {CNT_W{1'b0}};
-                                profile_level <= 4'd0;
-                                profile_level_thresh <= {CNT_W{1'b0}};
-                                endpoint_crawl_active <= (dist_n == {CNT_W{1'b0}});
-                            end
-                            motion_count <= {CNT_W{1'b0}};
-                            dir_close <= 1'b1;
-                            step <= 1'b0;
-                            setup_count <= 4'd0;
-                            allow_rise <= 1'b0;
-                            stop_after_budget <= 1'b0;
-                            phase <= PH_DIR_SETUP;
-                            moving <= 1'b1;
-                            status_state <= ST_MOVE_CLOSE;
-                        end
-                    end else begin
-                        endpoint_mode <= 1'b0;
-                        endpoint_crawl_active <= 1'b0;
-                        need_planner <= 1'b1;
-                        planner_req <= 1'b1;
-                        moving <= 1'b0;
-                        step <= 1'b0;
-                        phase <= PH_NONE;
-                    end
-                end
-
-            // ----------------------------------------------------------
-            // 9) MOVE_OPEN / MOVE_CLOSE
-            // ----------------------------------------------------------
-            end else if ((status_state == ST_MOVE_OPEN) ||
-                         (status_state == ST_MOVE_CLOSE)) begin
-                if (endpoint_mode) begin
-                    if ((dir_close && close_limit) || (!dir_close && open_limit)) begin
-                        step <= 1'b0;
-                        allow_rise <= 1'b0;
-                        stop_after_budget <= 1'b0;
-                        endpoint_crawl_active <= 1'b0;
-                        phase <= PH_NONE;
-                        moving <= 1'b0;
-                        if (dir_close) begin
-                            current_position <= travel_steps;
-                            target_position <= travel_steps;
-                        end else begin
-                            current_position <= {CNT_W{1'b0}};
-                            target_position <= {CNT_W{1'b0}};
-                        end
-                        status_state <= ST_IDLE;
-                    end else if (stop_after_budget && !gated_step && !step) begin
-                        status_state <= ST_FAULT;
-                        fault_code <= FC_ENDPOINT_TIMEOUT;
-                        endpoint_crawl_active <= 1'b0;
-                        moving <= 1'b0;
-                        phase <= PH_NONE;
-                        step <= 1'b0;
-                    end else if (!endpoint_crawl_active) begin
-                        // Phase A: normal S-curve to estimated 0/travel.
-                        if ((current_position == target_position) ||
-                            (gated_step_rise && dir_close &&
-                             (current_position + 1'b1 == target_position)) ||
-                            (gated_step_rise && !dir_close &&
-                             (current_position - 1'b1 == target_position))) begin
-                            // Estimate reached; target limit still missing → crawl.
-                            endpoint_crawl_active <= 1'b1;
-                            profile_level <= 4'd0;
-                            profile_level_thresh <= {CNT_W{1'b0}};
-                            allow_rise <= !stop_after_budget && (motion_count < guard_limit);
-                            if (phase == PH_DIR_SETUP) begin
-                                step <= 1'b0;
-                                if (tick_500us) begin
-                                    if (setup_count + 1'b1 >= DIR_SETUP_TICKS[3:0]) begin
-                                        phase <= PH_RUN;
-                                        allow_rise <= 1'b1;
-                                    end else begin
-                                        setup_count <= setup_count + 1'b1;
-                                    end
-                                end
-                            end else if (step_toggle_pulse) begin
-                                step <= step_toggle(step, allow_rise && !stop_after_budget &&
-                                                    (motion_count < guard_limit));
-                            end
-                        end else begin
-                            if ((motion_count >= guard_limit) ||
-                                (gated_step_rise && (motion_count + 1'b1 >= guard_limit))) begin
-                                allow_rise <= 1'b0;
-                                stop_after_budget <= 1'b1;
-                            end
-                            if (phase == PH_DIR_SETUP) begin
-                                step <= 1'b0;
-                                if (tick_500us) begin
-                                    if (setup_count + 1'b1 >= DIR_SETUP_TICKS[3:0]) begin
-                                        phase <= PH_RUN;
-                                        allow_rise <= 1'b1;
-                                    end else begin
-                                        setup_count <= setup_count + 1'b1;
-                                    end
-                                end
-                            end else if (phase == PH_DRAIN_HIGH) begin
-                                if (step_toggle_pulse)
-                                    step <= step_toggle(step, 1'b0);
-                            end else if (step_toggle_pulse) begin
-                                step <= step_toggle(step, allow_rise && !stop_after_budget &&
-                                                    (motion_count < guard_limit));
-                            end
-                        end
-                    end else begin
-                        // Phase B: level-0 crawl until real limit or travel+500.
-                        if ((motion_count >= guard_limit) ||
-                            (gated_step_rise && (motion_count + 1'b1 >= guard_limit))) begin
-                            allow_rise <= 1'b0;
-                            stop_after_budget <= 1'b1;
-                        end
-                        if (phase == PH_DIR_SETUP) begin
-                            step <= 1'b0;
-                            if (tick_500us) begin
-                                if (setup_count + 1'b1 >= DIR_SETUP_TICKS[3:0]) begin
-                                    phase <= PH_RUN;
-                                    allow_rise <= 1'b1;
-                                end else begin
-                                    setup_count <= setup_count + 1'b1;
-                                end
-                            end
-                        end else if (phase == PH_DRAIN_HIGH) begin
-                            if (step_toggle_pulse)
-                                step <= step_toggle(step, 1'b0);
-                        end else if (step_toggle_pulse) begin
-                            step <= step_toggle(step, allow_rise && !stop_after_budget &&
-                                                (motion_count < guard_limit));
-                        end
-                    end
-                end else begin
-                    // Mid-percent motion
-                    if ((dir_close && close_limit) || (!dir_close && open_limit)) begin
-                        step <= 1'b0;
-                        allow_rise <= 1'b0;
-                        if (dir_close)
-                            current_position <= travel_steps;
-                        else
-                            current_position <= {CNT_W{1'b0}};
-                        replan_pending <= 1'b1;
-                        need_planner <= 1'b0;
-                        planner_req <= 1'b0;
-                        phase <= PH_NONE;
-                        moving <= 1'b0;
-                        status_state <= ST_WAIT_REPLAN;
-                    end else begin
-                        // Effective current after this cycle's rise
-                        // Completion: compare using updated position intent
-                        if ((current_position == target_position) ||
-                            (gated_step_rise && dir_close &&
-                             (current_position + 1'b1 == target_position)) ||
-                            (gated_step_rise && !dir_close &&
-                             (current_position - 1'b1 == target_position))) begin
-                            allow_rise <= 1'b0;
-                            if (step || gated_step) begin
-                                phase <= PH_DRAIN_HIGH;
-                                if (step_toggle_pulse)
-                                    step <= step_toggle(step, 1'b0);
-                            end else begin
-                                step <= 1'b0;
-                                phase <= PH_NONE;
-                                moving <= 1'b0;
-                                status_state <= ST_IDLE;
-                            end
-                        end else if (phase == PH_DIR_SETUP) begin
-                            step <= 1'b0;
-                            if (tick_500us) begin
-                                if (setup_count + 1'b1 >= DIR_SETUP_TICKS[3:0]) begin
-                                    phase <= PH_RUN;
-                                    allow_rise <= 1'b1;
-                                end else begin
-                                    setup_count <= setup_count + 1'b1;
-                                end
-                            end
-                        end else if (phase == PH_DRAIN_HIGH) begin
-                            if (step_toggle_pulse)
-                                step <= step_toggle(step, 1'b0);
-                            if (!step && !gated_step) begin
-                                moving <= 1'b0;
-                                status_state <= ST_IDLE;
-                                phase <= PH_NONE;
-                            end
-                        end else if (step_toggle_pulse) begin
-                            step <= step_toggle(step, allow_rise);
-                        end
-                    end
-                end
-
-            // ----------------------------------------------------------
-            // 10) IDLE
-            // ----------------------------------------------------------
-            end else if (status_state == ST_IDLE) begin
-                step <= 1'b0;
-                moving <= 1'b0;
-                if (open_snap_accept)
-                    current_position <= {CNT_W{1'b0}};
-                if (close_snap_accept)
-                    current_position <= travel_steps;
-                if (replan_pending)
-                    status_state <= ST_WAIT_REPLAN;
-            end
-        end
-    end
-endmodule

+ 0 - 91
src/legacy/modules/door_calibration_sequencer.v

@@ -1,91 +0,0 @@
-`timescale 1ns/1ps
-
-// Serial X→Y→Z calibration grant. Only one axis may run calibration motion.
-module door_calibration_sequencer (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       limit_sync_valid,
-    input  wire       term_x,
-    input  wire       term_y,
-    input  wire       term_z,
-    input  wire       cal_ok_x,
-    input  wire       cal_ok_y,
-    input  wire       cal_ok_z,
-    input  wire       profile_busy,
-    input  wire       profile_done,
-    output reg  [2:0] cal_enable,
-    output reg        profile_start,
-    output reg        profile_ready,
-    output reg        all_axes_terminal
-);
-    localparam [2:0]
-        S_WAIT_SYNC = 3'd0,
-        S_X         = 3'd1,
-        S_Y         = 3'd2,
-        S_Z         = 3'd3,
-        S_PROFILE   = 3'd4,
-        S_DONE      = 3'd5;
-
-    reg [2:0] state;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            state <= S_WAIT_SYNC;
-            cal_enable <= 3'b000;
-            profile_start <= 1'b0;
-            profile_ready <= 1'b0;
-            all_axes_terminal <= 1'b0;
-        end else begin
-            profile_start <= 1'b0;
-            all_axes_terminal <= term_x && term_y && term_z;
-            case (state)
-                S_WAIT_SYNC: begin
-                    cal_enable <= 3'b000;
-                    if (limit_sync_valid) begin
-                        state <= S_X;
-                        cal_enable <= 3'b001;
-                    end
-                end
-                S_X: begin
-                    cal_enable <= 3'b001;
-                    if (term_x) begin
-                        state <= S_Y;
-                        cal_enable <= 3'b010;
-                    end
-                end
-                S_Y: begin
-                    cal_enable <= 3'b010;
-                    if (term_y) begin
-                        state <= S_Z;
-                        cal_enable <= 3'b100;
-                    end
-                end
-                S_Z: begin
-                    cal_enable <= 3'b100;
-                    if (term_z) begin
-                        cal_enable <= 3'b000;
-                        if (cal_ok_x || cal_ok_y || cal_ok_z) begin
-                            state <= S_PROFILE;
-                            profile_start <= 1'b1;
-                        end else begin
-                            // No successful axis: still complete so UART/FAN/PTC unlock.
-                            state <= S_DONE;
-                            profile_ready <= 1'b1;
-                        end
-                    end
-                end
-                S_PROFILE: begin
-                    cal_enable <= 3'b000;
-                    if (profile_done && !profile_busy) begin
-                        state <= S_DONE;
-                        profile_ready <= 1'b1;
-                    end
-                end
-                default: begin
-                    cal_enable <= 3'b000;
-                    profile_ready <= 1'b1;
-                end
-            endcase
-        end
-    end
-endmodule

+ 0 - 447
src/legacy/modules/door_motion_controller.v

@@ -1,447 +0,0 @@
-`timescale 1ns/1ps
-
-// Three-axis door motion: Scheme A full-feature
-// - per-axis safety kernels
-// - serial X→Y→Z calibration
-// - shared 25 us DDA (active A1 sequential) + shared profile/rate builders
-module door_motion_controller #(
-    parameter integer MAX_CAL_STEPS = 5000,
-    parameter integer MIN_TRAVEL = 2,
-    parameter integer ENDPOINT_GUARD_EXTRA = 500,
-    parameter integer DIR_SETUP_TICKS = 2,
-    parameter integer PERCENT_MAX = 100,
-    parameter integer STATUS_PAYLOAD_LENGTH = 31,
-    parameter integer MOTION_SERVICE_CLKS = 625,
-    parameter integer PHASE_FACTOR = 5120,
-    parameter integer CAL_RAMP_UNIT = 8
-) (
-    input  wire        clk,
-    input  wire        rst_n,
-    input  wire        tick_500us,
-    input  wire        limit_sync_valid,
-    input  wire [2:0]  open_limit,
-    input  wire [2:0]  close_limit,
-    input  wire [2:0]  gated_step,
-    input  wire [2:0]  gated_step_rise,
-    input  wire        motor_request_valid,
-    input  wire [7:0]  percent_x,
-    input  wire [7:0]  percent_y,
-    input  wire [7:0]  percent_z,
-    input  wire        watchdog_stop,
-    input  wire        watchdog_tripped,
-    output wire [2:0]  step,
-    output wire [2:0]  dir_close,
-    output reg         startup_complete,
-    output wire [2:0]  calibrated_mask,
-    output wire [2:0]  fault_mask,
-    input  wire        status_capture,
-    input  wire [7:0]  status_rd_addr,
-    output wire [7:0]  status_rd_data
-);
-    wire        planner_start;
-    wire [1:0]  planner_axis_id;
-    wire [7:0]  planner_percent_i;
-    wire [12:0] planner_travel_i;
-    wire        planner_busy;
-    wire        planner_done;
-    wire [12:0] planner_result;
-    wire [1:0]  planner_done_axis;
-    wire [7:0]  planner_done_percent;
-
-    wire        req_x, req_y, req_z;
-    wire [7:0]  pct_req_x, pct_req_y, pct_req_z;
-    wire [12:0] trav_req_x, trav_req_y, trav_req_z;
-
-    wire [2:0]  st_state_x, st_state_y, st_state_z;
-    wire [7:0]  st_flags_x, st_flags_y, st_flags_z;
-    wire [7:0]  st_pct_x, st_pct_y, st_pct_z;
-    wire [12:0] st_cur_x, st_cur_y, st_cur_z;
-    wire [12:0] st_tgt_x, st_tgt_y, st_tgt_z;
-    wire [12:0] st_trav_x, st_trav_y, st_trav_z;
-    wire [7:0]  st_fault_x, st_fault_y, st_fault_z;
-    wire        cal_x, cal_y, cal_z;
-    wire        fault_x, fault_y, fault_z;
-    wire        term_x, term_y, term_z;
-    wire        mov_x, mov_y, mov_z;
-    wire        allow_x, allow_y, allow_z;
-    wire        in_cal_x, in_cal_y, in_cal_z;
-    wire        crawl_x, crawl_y, crawl_z;
-    wire        dda_run_x, dda_run_y, dda_run_z;
-    wire [3:0]  lvl_x, lvl_y, lvl_z;
-    wire [20:0] rq_x, rq_y, rq_z;
-
-    wire [2:0]  cal_enable;
-    wire        profile_start;
-    wire        profile_ready;
-    wire        profile_busy;
-    wire        profile_done;
-    wire [12:0] max_travel;
-    wire [24:0] phase_threshold;
-    wire        service_ce;
-    wire [2:0]  toggle_pulse;
-    wire        dda_busy;
-    wire        dda_overrun;
-
-    wire        all_axes_terminal_unused;
-    wire [12:0] profile_distance_unused_x;
-    wire [12:0] profile_done_steps_unused_x;
-    wire [12:0] profile_ramp_unit_unused_x;
-    wire [12:0] profile_distance_unused_y;
-    wire [12:0] profile_done_steps_unused_y;
-    wire [12:0] profile_ramp_unit_unused_y;
-    wire [12:0] profile_distance_unused_z;
-    wire [12:0] profile_done_steps_unused_z;
-    wire [12:0] profile_ramp_unit_unused_z;
-
-    // Shared rate refresh: travel * profile_scale[level] (or scale alone in cal).
-    // Exact 21-bit product via door_rate_quantum_dispatcher (atomic launch record).
-    wire        rate_busy;
-    wire        rate_done;
-    wire [1:0]  rate_axis_done;
-    wire [12:0] rate_travel_done;
-    wire [8:0]  rate_scale_done;
-    wire [20:0] rate_result;
-    wire        rate_valid_x;
-    wire        rate_valid_y;
-    wire        rate_valid_z;
-
-    function automatic [8:0] f_profile_scale;
-        input [3:0] level;
-        begin
-            case (level)
-                4'd0:  f_profile_scale = 9'd64;
-                4'd1:  f_profile_scale = 9'd66;
-                4'd2:  f_profile_scale = 9'd73;
-                4'd3:  f_profile_scale = 9'd84;
-                4'd4:  f_profile_scale = 9'd98;
-                4'd5:  f_profile_scale = 9'd114;
-                4'd6:  f_profile_scale = 9'd132;
-                4'd7:  f_profile_scale = 9'd150;
-                4'd8:  f_profile_scale = 9'd170;
-                4'd9:  f_profile_scale = 9'd188;
-                4'd10: f_profile_scale = 9'd206;
-                4'd11: f_profile_scale = 9'd222;
-                4'd12: f_profile_scale = 9'd236;
-                4'd13: f_profile_scale = 9'd247;
-                4'd14: f_profile_scale = 9'd254;
-                default: f_profile_scale = 9'd256;
-            endcase
-        end
-    endfunction
-
-    assign calibrated_mask = {cal_z, cal_y, cal_x};
-    assign fault_mask = {fault_z, fault_y, fault_x};
-
-    door_percent_planner u_planner (
-        .clk(clk), .rst_n(rst_n),
-        .start(planner_start),
-        .axis_id(planner_axis_id),
-        .percent(planner_percent_i),
-        .travel(planner_travel_i),
-        .busy(planner_busy),
-        .done(planner_done),
-        .result(planner_result),
-        .done_axis_id(planner_done_axis),
-        .done_percent(planner_done_percent)
-    );
-
-    reg        grant_start;
-    reg [1:0]  grant_axis;
-    reg [7:0]  grant_percent;
-    reg [12:0] grant_travel;
-    reg [2:0]  grant_hold;
-
-    assign planner_start = grant_start;
-    assign planner_axis_id = grant_axis;
-    assign planner_percent_i = grant_percent;
-    assign planner_travel_i = grant_travel;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            grant_start <= 1'b0;
-            grant_axis <= 2'd0;
-            grant_percent <= 8'd0;
-            grant_travel <= 13'd0;
-            grant_hold <= 3'b000;
-        end else begin
-            grant_start <= 1'b0;
-            if (!req_x) grant_hold[0] <= 1'b0;
-            if (!req_y) grant_hold[1] <= 1'b0;
-            if (!req_z) grant_hold[2] <= 1'b0;
-            if (!planner_busy && !grant_start) begin
-                if (req_x && !grant_hold[0]) begin
-                    grant_start <= 1'b1;
-                    grant_hold[0] <= 1'b1;
-                    grant_axis <= 2'd0;
-                    grant_percent <= pct_req_x;
-                    grant_travel <= trav_req_x;
-                end else if (req_y && !grant_hold[1]) begin
-                    grant_start <= 1'b1;
-                    grant_hold[1] <= 1'b1;
-                    grant_axis <= 2'd1;
-                    grant_percent <= pct_req_y;
-                    grant_travel <= trav_req_y;
-                end else if (req_z && !grant_hold[2]) begin
-                    grant_start <= 1'b1;
-                    grant_hold[2] <= 1'b1;
-                    grant_axis <= 2'd2;
-                    grant_percent <= pct_req_z;
-                    grant_travel <= trav_req_z;
-                end
-            end
-        end
-    end
-
-    door_motion_service_tick #(.SERVICE_CLKS(MOTION_SERVICE_CLKS)) u_svc (
-        .clk(clk), .rst_n(rst_n), .service_ce(service_ce)
-    );
-
-    door_calibration_sequencer u_cal_seq (
-        .clk(clk), .rst_n(rst_n),
-        .limit_sync_valid(limit_sync_valid),
-        .term_x(term_x), .term_y(term_y), .term_z(term_z),
-        .cal_ok_x(cal_x), .cal_ok_y(cal_y), .cal_ok_z(cal_z),
-        .profile_busy(profile_busy),
-        .profile_done(profile_done),
-        .cal_enable(cal_enable),
-        .profile_start(profile_start),
-        .profile_ready(profile_ready),
-        .all_axes_terminal(all_axes_terminal_unused)
-    );
-
-    door_profile_quantum_builder #(
-        .PHASE_FACTOR(PHASE_FACTOR)
-    ) u_profile (
-        .clk(clk), .rst_n(rst_n),
-        .start(profile_start),
-        .travel_x(st_trav_x), .travel_y(st_trav_y), .travel_z(st_trav_z),
-        .cal_ok_x(cal_x), .cal_ok_y(cal_y), .cal_ok_z(cal_z),
-        .busy(profile_busy), .done(profile_done),
-        .max_travel(max_travel),
-        .phase_threshold(phase_threshold)
-    );
-
-    wire [2:0] dda_active = {dda_run_z, dda_run_y, dda_run_x};
-    wire [2:0] dda_allow = {allow_z, allow_y, allow_x};
-    wire [2:0] dda_cal   = {in_cal_z, in_cal_y, in_cal_x};
-
-
-    door_shared_dda_scheduler #(
-        .CAL_PHASE_THRESHOLD(PHASE_FACTOR)
-    ) u_dda (
-        .clk(clk), .rst_n(rst_n),
-        .service_ce(service_ce),
-        .active(dda_active),
-        .allow_toggle(dda_allow),
-        .cal_mode(dda_cal),
-        .rate0(rq_x), .rate1(rq_y), .rate2(rq_z),
-        .phase_threshold(phase_threshold),
-        .toggle_pulse(toggle_pulse),
-        .busy(dda_busy),
-        .service_overrun(dda_overrun)
-    );
-
-    wire [8:0] scale_x_w = f_profile_scale(crawl_x ? 4'd0 : lvl_x);
-    wire [8:0] scale_y_w = f_profile_scale(crawl_y ? 4'd0 : lvl_y);
-    wire [8:0] scale_z_w = f_profile_scale(crawl_z ? 4'd0 : lvl_z);
-
-    // Round-robin shared rate builder with atomic launch record (no axis-tag skew).
-    door_rate_quantum_dispatcher u_rate_disp (
-        .clk(clk), .rst_n(rst_n),
-        .travel_x(st_trav_x), .travel_y(st_trav_y), .travel_z(st_trav_z),
-        .scale_x(scale_x_w),
-        .scale_y(scale_y_w),
-        .scale_z(scale_z_w),
-        .cal_x(in_cal_x), .cal_y(in_cal_y), .cal_z(in_cal_z),
-        .busy(rate_busy),
-        .done(rate_done),
-        .rate_valid_x(rate_valid_x),
-        .rate_valid_y(rate_valid_y),
-        .rate_valid_z(rate_valid_z),
-        .axis_id_out(rate_axis_done),
-        .travel_out(rate_travel_done),
-        .scale_out(rate_scale_done),
-        .product(rate_result)
-    );
-
-    // Silence unused capture ports (identity checked in dedicated TB).
-    wire _unused_rate_tags = |{rate_travel_done, rate_scale_done, rate_busy};
-
-    door_axis_controller #(
-        .AXIS_ID(0),
-        .MAX_CAL_STEPS(MAX_CAL_STEPS),
-        .MIN_TRAVEL(MIN_TRAVEL),
-        .ENDPOINT_GUARD_EXTRA(ENDPOINT_GUARD_EXTRA),
-        .DIR_SETUP_TICKS(DIR_SETUP_TICKS),
-        .PERCENT_MAX(PERCENT_MAX),
-        .CAL_RAMP_UNIT(CAL_RAMP_UNIT)
-    ) u_axis_x (
-        .clk(clk), .rst_n(rst_n),
-        .open_limit(open_limit[0]), .close_limit(close_limit[0]),
-        .limit_sync_valid(limit_sync_valid),
-        .cal_enable(cal_enable[0]),
-        .gated_step(gated_step[0]), .gated_step_rise(gated_step_rise[0]),
-        .tick_500us(tick_500us),
-        .step_toggle_pulse(toggle_pulse[0]),
-        .request_valid(motor_request_valid),
-        .requested_percent_in(percent_x),
-        .watchdog_stop(watchdog_stop),
-        .rate_quantum_in(rate_result),
-        .rate_quantum_valid(rate_valid_x),
-        .planner_req(req_x),
-        .planner_percent(pct_req_x),
-        .planner_travel(trav_req_x),
-        .planner_done(planner_done),
-        .planner_done_axis(planner_done_axis),
-        .planner_done_percent(planner_done_percent),
-        .planner_result(planner_result),
-        .step(step[0]), .dir_close(dir_close[0]),
-        .status_state(st_state_x), .status_flags(st_flags_x),
-        .status_requested_percent(st_pct_x),
-        .status_current(st_cur_x), .status_target(st_tgt_x),
-        .status_travel(st_trav_x), .status_fault_code(st_fault_x),
-        .calibrated(cal_x), .faulted(fault_x), .terminal(term_x),
-        .axis_moving(mov_x), .axis_allow_rise(allow_x),
-        .axis_in_calibration(in_cal_x), .axis_endpoint_crawl(crawl_x),
-        .axis_dda_run(dda_run_x),
-        .profile_level(lvl_x),
-        .profile_distance(profile_distance_unused_x), .profile_done_steps(profile_done_steps_unused_x), .profile_ramp_unit(profile_ramp_unit_unused_x),
-        .rate_quantum(rq_x)
-    );
-
-    door_axis_controller #(
-        .AXIS_ID(1),
-        .MAX_CAL_STEPS(MAX_CAL_STEPS),
-        .MIN_TRAVEL(MIN_TRAVEL),
-        .ENDPOINT_GUARD_EXTRA(ENDPOINT_GUARD_EXTRA),
-        .DIR_SETUP_TICKS(DIR_SETUP_TICKS),
-        .PERCENT_MAX(PERCENT_MAX),
-        .CAL_RAMP_UNIT(CAL_RAMP_UNIT)
-    ) u_axis_y (
-        .clk(clk), .rst_n(rst_n),
-        .open_limit(open_limit[1]), .close_limit(close_limit[1]),
-        .limit_sync_valid(limit_sync_valid),
-        .cal_enable(cal_enable[1]),
-        .gated_step(gated_step[1]), .gated_step_rise(gated_step_rise[1]),
-        .tick_500us(tick_500us),
-        .step_toggle_pulse(toggle_pulse[1]),
-        .request_valid(motor_request_valid),
-        .requested_percent_in(percent_y),
-        .watchdog_stop(watchdog_stop),
-        .rate_quantum_in(rate_result),
-        .rate_quantum_valid(rate_valid_y),
-        .planner_req(req_y),
-        .planner_percent(pct_req_y),
-        .planner_travel(trav_req_y),
-        .planner_done(planner_done),
-        .planner_done_axis(planner_done_axis),
-        .planner_done_percent(planner_done_percent),
-        .planner_result(planner_result),
-        .step(step[1]), .dir_close(dir_close[1]),
-        .status_state(st_state_y), .status_flags(st_flags_y),
-        .status_requested_percent(st_pct_y),
-        .status_current(st_cur_y), .status_target(st_tgt_y),
-        .status_travel(st_trav_y), .status_fault_code(st_fault_y),
-        .calibrated(cal_y), .faulted(fault_y), .terminal(term_y),
-        .axis_moving(mov_y), .axis_allow_rise(allow_y),
-        .axis_in_calibration(in_cal_y), .axis_endpoint_crawl(crawl_y),
-        .axis_dda_run(dda_run_y),
-        .profile_level(lvl_y),
-        .profile_distance(profile_distance_unused_y), .profile_done_steps(profile_done_steps_unused_y), .profile_ramp_unit(profile_ramp_unit_unused_y),
-        .rate_quantum(rq_y)
-    );
-
-    door_axis_controller #(
-        .AXIS_ID(2),
-        .MAX_CAL_STEPS(MAX_CAL_STEPS),
-        .MIN_TRAVEL(MIN_TRAVEL),
-        .ENDPOINT_GUARD_EXTRA(ENDPOINT_GUARD_EXTRA),
-        .DIR_SETUP_TICKS(DIR_SETUP_TICKS),
-        .PERCENT_MAX(PERCENT_MAX),
-        .CAL_RAMP_UNIT(CAL_RAMP_UNIT)
-    ) u_axis_z (
-        .clk(clk), .rst_n(rst_n),
-        .open_limit(open_limit[2]), .close_limit(close_limit[2]),
-        .limit_sync_valid(limit_sync_valid),
-        .cal_enable(cal_enable[2]),
-        .gated_step(gated_step[2]), .gated_step_rise(gated_step_rise[2]),
-        .tick_500us(tick_500us),
-        .step_toggle_pulse(toggle_pulse[2]),
-        .request_valid(motor_request_valid),
-        .requested_percent_in(percent_z),
-        .watchdog_stop(watchdog_stop),
-        .rate_quantum_in(rate_result),
-        .rate_quantum_valid(rate_valid_z),
-        .planner_req(req_z),
-        .planner_percent(pct_req_z),
-        .planner_travel(trav_req_z),
-        .planner_done(planner_done),
-        .planner_done_axis(planner_done_axis),
-        .planner_done_percent(planner_done_percent),
-        .planner_result(planner_result),
-        .step(step[2]), .dir_close(dir_close[2]),
-        .status_state(st_state_z), .status_flags(st_flags_z),
-        .status_requested_percent(st_pct_z),
-        .status_current(st_cur_z), .status_target(st_tgt_z),
-        .status_travel(st_trav_z), .status_fault_code(st_fault_z),
-        .calibrated(cal_z), .faulted(fault_z), .terminal(term_z),
-        .axis_moving(mov_z), .axis_allow_rise(allow_z),
-        .axis_in_calibration(in_cal_z), .axis_endpoint_crawl(crawl_z),
-        .axis_dda_run(dda_run_z),
-        .profile_level(lvl_z),
-        .profile_distance(profile_distance_unused_z), .profile_done_steps(profile_done_steps_unused_z), .profile_ramp_unit(profile_ramp_unit_unused_z),
-        .rate_quantum(rq_z)
-    );
-
-    // startup_complete only after serial cal terminal + profile ready
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n)
-            startup_complete <= 1'b0;
-        else if (!startup_complete && profile_ready && term_x && term_y && term_z)
-            startup_complete <= 1'b1;
-    end
-
-    reg [7:0] snap [0:30];
-    integer si;
-    assign status_rd_data = (status_rd_addr < STATUS_PAYLOAD_LENGTH[7:0]) ?
-                            snap[status_rd_addr] : 8'd0;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            for (si = 0; si < STATUS_PAYLOAD_LENGTH; si = si + 1)
-                snap[si] <= 8'd0;
-        end else if (status_capture) begin
-            snap[0] <= {watchdog_tripped, startup_complete, fault_mask, calibrated_mask};
-            snap[1]  <= {5'd0, st_state_x};
-            snap[2]  <= st_flags_x;
-            snap[3]  <= st_pct_x;
-            snap[4]  <= st_cur_x[7:0];
-            snap[5]  <= {3'd0, st_cur_x[12:8]};
-            snap[6]  <= st_tgt_x[7:0];
-            snap[7]  <= {3'd0, st_tgt_x[12:8]};
-            snap[8]  <= st_trav_x[7:0];
-            snap[9]  <= {3'd0, st_trav_x[12:8]};
-            snap[10] <= st_fault_x;
-            snap[11] <= {5'd0, st_state_y};
-            snap[12] <= st_flags_y;
-            snap[13] <= st_pct_y;
-            snap[14] <= st_cur_y[7:0];
-            snap[15] <= {3'd0, st_cur_y[12:8]};
-            snap[16] <= st_tgt_y[7:0];
-            snap[17] <= {3'd0, st_tgt_y[12:8]};
-            snap[18] <= st_trav_y[7:0];
-            snap[19] <= {3'd0, st_trav_y[12:8]};
-            snap[20] <= st_fault_y;
-            snap[21] <= {5'd0, st_state_z};
-            snap[22] <= st_flags_z;
-            snap[23] <= st_pct_z;
-            snap[24] <= st_cur_z[7:0];
-            snap[25] <= {3'd0, st_cur_z[12:8]};
-            snap[26] <= st_tgt_z[7:0];
-            snap[27] <= {3'd0, st_tgt_z[12:8]};
-            snap[28] <= st_trav_z[7:0];
-            snap[29] <= {3'd0, st_trav_z[12:8]};
-            snap[30] <= st_fault_z;
-        end
-    end
-endmodule

+ 0 - 28
src/legacy/modules/door_motion_service_tick.v

@@ -1,28 +0,0 @@
-`timescale 1ns/1ps
-
-// Motion service clock-enable: default 25 us @ 25 MHz => 625 clocks.
-module door_motion_service_tick #(
-    parameter integer SERVICE_CLKS = 625
-) (
-    input  wire clk,
-    input  wire rst_n,
-    output reg  service_ce
-);
-    localparam integer CNT_W = 16;
-    reg [CNT_W-1:0] cnt;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            cnt <= {CNT_W{1'b0}};
-            service_ce <= 1'b0;
-        end else begin
-            if (cnt + 1'b1 >= SERVICE_CLKS[CNT_W-1:0]) begin
-                cnt <= {CNT_W{1'b0}};
-                service_ce <= 1'b1;
-            end else begin
-                cnt <= cnt + 1'b1;
-                service_ce <= 1'b0;
-            end
-        end
-    end
-endmodule

+ 0 - 84
src/legacy/modules/door_percent_planner.v

@@ -1,84 +0,0 @@
-`timescale 1ns/1ps
-
-// Shared iterative half-up percent → steps planner (no DSP).
-// result = clamp(round_half_up(travel * percent / 100), 1, travel-1)
-module door_percent_planner (
-    input  wire        clk,
-    input  wire        rst_n,
-    input  wire        start,
-    input  wire [1:0]  axis_id,
-    input  wire [7:0]  percent,
-    input  wire [12:0] travel,
-    output reg         busy,
-    output reg         done,
-    output reg  [12:0] result,
-    output reg  [1:0]  done_axis_id,
-    output reg  [7:0]  done_percent
-);
-    reg [7:0]  acc;
-    reg [12:0] remaining;
-    reg [12:0] accum_result;
-    reg [12:0] travel_latched;
-    reg [7:0]  percent_latched;
-    reg [1:0]  axis_latched;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            busy <= 1'b0;
-            done <= 1'b0;
-            result <= 13'd0;
-            done_axis_id <= 2'd0;
-            done_percent <= 8'd0;
-            acc <= 8'd0;
-            remaining <= 13'd0;
-            accum_result <= 13'd0;
-            travel_latched <= 13'd0;
-            percent_latched <= 8'd0;
-            axis_latched <= 2'd0;
-        end else begin
-            done <= 1'b0;
-            if (start && !busy) begin
-                busy <= 1'b1;
-                accum_result <= 13'd0;
-                acc <= 8'd50;
-                remaining <= travel;
-                travel_latched <= travel;
-                percent_latched <= percent;
-                axis_latched <= axis_id;
-                // Degenerate travel: finish immediately with clamped mid (1 if travel>=2 else 0).
-                if (travel == 13'd0) begin
-                    busy <= 1'b0;
-                    done <= 1'b1;
-                    result <= 13'd0;
-                    done_axis_id <= axis_id;
-                    done_percent <= percent;
-                end
-            end else if (busy) begin
-                if (remaining != 13'd0) begin
-                    if ((acc + percent_latched) >= 8'd100) begin
-                        acc <= acc + percent_latched - 8'd100;
-                        accum_result <= accum_result + 13'd1;
-                    end else begin
-                        acc <= acc + percent_latched;
-                    end
-                    remaining <= remaining - 13'd1;
-                end else begin
-                    // Clamp mid targets to 1 .. travel-1
-                    if (travel_latched <= 13'd1) begin
-                        result <= 13'd0;
-                    end else if (accum_result < 13'd1) begin
-                        result <= 13'd1;
-                    end else if (accum_result >= travel_latched) begin
-                        result <= travel_latched - 13'd1;
-                    end else begin
-                        result <= accum_result;
-                    end
-                    done_axis_id <= axis_latched;
-                    done_percent <= percent_latched;
-                    busy <= 1'b0;
-                    done <= 1'b1;
-                end
-            end
-        end
-    end
-endmodule

+ 0 - 81
src/legacy/modules/door_profile_quantum_builder.v

@@ -1,81 +0,0 @@
-`timescale 1ns/1ps
-
-// Shared max_travel * PHASE_FACTOR builder (shift-add). 25-bit threshold.
-module door_profile_quantum_builder #(
-    parameter integer TRAVEL_WIDTH = 13,
-    parameter integer PHASE_FACTOR = 5120,
-    parameter integer THRESH_WIDTH = 25
-) (
-    input  wire                         clk,
-    input  wire                         rst_n,
-    input  wire                         start,
-    input  wire [TRAVEL_WIDTH-1:0]      travel_x,
-    input  wire [TRAVEL_WIDTH-1:0]      travel_y,
-    input  wire [TRAVEL_WIDTH-1:0]      travel_z,
-    input  wire                         cal_ok_x,
-    input  wire                         cal_ok_y,
-    input  wire                         cal_ok_z,
-    output reg                          busy,
-    output reg                          done,
-    output reg [TRAVEL_WIDTH-1:0]       max_travel,
-    output reg [THRESH_WIDTH-1:0]       phase_threshold
-);
-    reg [TRAVEL_WIDTH-1:0] mul_a;
-    reg [THRESH_WIDTH-1:0] mul_b;
-    reg [THRESH_WIDTH-1:0] mul_acc;
-    reg [3:0]              mul_bit;
-
-    function automatic [TRAVEL_WIDTH-1:0] f_max3;
-        input [TRAVEL_WIDTH-1:0] a, b, c;
-        reg [TRAVEL_WIDTH-1:0] m;
-        begin
-            m = a;
-            if (b > m) m = b;
-            if (c > m) m = c;
-            f_max3 = m;
-        end
-    endfunction
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            busy <= 1'b0;
-            done <= 1'b0;
-            max_travel <= {TRAVEL_WIDTH{1'b0}};
-            phase_threshold <= {THRESH_WIDTH{1'b0}};
-            mul_a <= {TRAVEL_WIDTH{1'b0}};
-            mul_b <= {THRESH_WIDTH{1'b0}};
-            mul_acc <= {THRESH_WIDTH{1'b0}};
-            mul_bit <= 4'd0;
-        end else begin
-            done <= 1'b0;
-            if (start && !busy) begin
-                busy <= 1'b1;
-                max_travel <= f_max3(
-                    cal_ok_x ? travel_x : {TRAVEL_WIDTH{1'b0}},
-                    cal_ok_y ? travel_y : {TRAVEL_WIDTH{1'b0}},
-                    cal_ok_z ? travel_z : {TRAVEL_WIDTH{1'b0}}
-                );
-                mul_a <= f_max3(
-                    cal_ok_x ? travel_x : {TRAVEL_WIDTH{1'b0}},
-                    cal_ok_y ? travel_y : {TRAVEL_WIDTH{1'b0}},
-                    cal_ok_z ? travel_z : {TRAVEL_WIDTH{1'b0}}
-                );
-                mul_b <= PHASE_FACTOR[THRESH_WIDTH-1:0];
-                mul_acc <= {THRESH_WIDTH{1'b0}};
-                mul_bit <= 4'd0;
-            end else if (busy) begin
-                if (mul_bit == 4'd13) begin
-                    phase_threshold <= mul_acc;
-                    busy <= 1'b0;
-                    done <= 1'b1;
-                end else begin
-                    if (mul_a[0])
-                        mul_acc <= mul_acc + mul_b;
-                    mul_a <= {1'b0, mul_a[TRAVEL_WIDTH-1:1]};
-                    mul_b <= {mul_b[THRESH_WIDTH-2:0], 1'b0};
-                    mul_bit <= mul_bit + 1'b1;
-                end
-            end
-        end
-    end
-endmodule

+ 0 - 53
src/legacy/modules/door_rate_quantum_builder.v

@@ -1,53 +0,0 @@
-`timescale 1ns/1ps
-
-// Shared travel × profile_scale builder.
-// One registered multiply (TD may map to DSP); exact for travel 0..5000, scale 0..256.
-// Max 5000*256 = 1_280_000 < 2^21.
-module door_rate_quantum_builder #(
-    parameter integer TRAVEL_WIDTH = 13,
-    parameter integer SCALE_WIDTH  = 9,
-    parameter integer PROD_WIDTH   = 21
-) (
-    input  wire                         clk,
-    input  wire                         rst_n,
-    input  wire                         start,
-    input  wire [1:0]                   axis_id_in,
-    input  wire [TRAVEL_WIDTH-1:0]      travel_in,
-    input  wire [SCALE_WIDTH-1:0]       scale_in,
-    output reg                          busy,
-    output reg                          done,
-    output reg  [1:0]                   axis_id_out,
-    output reg  [TRAVEL_WIDTH-1:0]      travel_out,
-    output reg  [SCALE_WIDTH-1:0]       scale_out,
-    output reg  [PROD_WIDTH-1:0]        product
-);
-    // Widen operands so the inferred product covers PROD_WIDTH without wrap.
-    wire [PROD_WIDTH-1:0] travel_z =
-        {{(PROD_WIDTH-TRAVEL_WIDTH){1'b0}}, travel_in};
-    wire [PROD_WIDTH-1:0] scale_z =
-        {{(PROD_WIDTH-SCALE_WIDTH){1'b0}}, scale_in};
-    wire [PROD_WIDTH-1:0] prod_w = travel_z * scale_z;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            busy <= 1'b0;
-            done <= 1'b0;
-            axis_id_out <= 2'd0;
-            travel_out <= {TRAVEL_WIDTH{1'b0}};
-            scale_out <= {SCALE_WIDTH{1'b0}};
-            product <= {PROD_WIDTH{1'b0}};
-        end else begin
-            done <= 1'b0;
-            if (start && !busy) begin
-                busy <= 1'b1;
-                axis_id_out <= axis_id_in;
-                travel_out <= travel_in;
-                scale_out <= scale_in;
-                product <= prod_w;
-            end else if (busy) begin
-                busy <= 1'b0;
-                done <= 1'b1;
-            end
-        end
-    end
-endmodule

+ 0 - 111
src/legacy/modules/door_rate_quantum_dispatcher.v

@@ -1,111 +0,0 @@
-`timescale 1ns/1ps
-
-// Shared rate-quantum launch + builder wrapper.
-// Atomic launch record (axis/travel/scale) held stable until builder accepts.
-// Round-robin cursor (rate_next_axis) is never connected to builder axis_id_in.
-module door_rate_quantum_dispatcher (
-    input  wire        clk,
-    input  wire        rst_n,
-    input  wire [12:0] travel_x,
-    input  wire [12:0] travel_y,
-    input  wire [12:0] travel_z,
-    input  wire [8:0]  scale_x,
-    input  wire [8:0]  scale_y,
-    input  wire [8:0]  scale_z,
-    input  wire        cal_x,
-    input  wire        cal_y,
-    input  wire        cal_z,
-    output wire        busy,
-    output wire        done,
-    output wire        rate_valid_x,
-    output wire        rate_valid_y,
-    output wire        rate_valid_z,
-    output wire [1:0]  axis_id_out,
-    output wire [12:0] travel_out,
-    output wire [8:0]  scale_out,
-    output wire [20:0] product
-);
-    reg         rate_start;
-    reg [1:0]   rate_next_axis;
-    reg [1:0]   rate_launch_axis;
-    reg [12:0]  rate_launch_travel;
-    reg [8:0]   rate_launch_scale;
-    wire        rate_busy;
-    wire        rate_done;
-    wire [1:0]  rate_axis_done;
-    wire [12:0] rate_travel_done;
-    wire [8:0]  rate_scale_done;
-    wire [20:0] rate_result;
-    reg         rate_valid;
-    reg [1:0]   rate_axis_busy;
-
-    reg [12:0] travel_sel;
-    reg [8:0]  scale_sel;
-
-    always @(*) begin
-        case (rate_next_axis)
-            2'd0: begin
-                travel_sel = cal_x ? 13'd1 : ((travel_x == 0) ? 13'd1 : travel_x);
-                scale_sel = scale_x;
-            end
-            2'd1: begin
-                travel_sel = cal_y ? 13'd1 : ((travel_y == 0) ? 13'd1 : travel_y);
-                scale_sel = scale_y;
-            end
-            default: begin
-                travel_sel = cal_z ? 13'd1 : ((travel_z == 0) ? 13'd1 : travel_z);
-                scale_sel = scale_z;
-            end
-        endcase
-    end
-
-    door_rate_quantum_builder u_rate_q (
-        .clk(clk), .rst_n(rst_n),
-        .start(rate_start),
-        .axis_id_in(rate_launch_axis),
-        .travel_in(rate_launch_travel),
-        .scale_in(rate_launch_scale),
-        .busy(rate_busy),
-        .done(rate_done),
-        .axis_id_out(rate_axis_done),
-        .travel_out(rate_travel_done),
-        .scale_out(rate_scale_done),
-        .product(rate_result)
-    );
-
-    assign busy = rate_busy;
-    assign done = rate_done;
-    assign axis_id_out = rate_axis_done;
-    assign travel_out = rate_travel_done;
-    assign scale_out = rate_scale_done;
-    assign product = rate_result;
-    assign rate_valid_x = rate_valid && (rate_axis_busy == 2'd0);
-    assign rate_valid_y = rate_valid && (rate_axis_busy == 2'd1);
-    assign rate_valid_z = rate_valid && (rate_axis_busy == 2'd2);
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            rate_start <= 1'b0;
-            rate_valid <= 1'b0;
-            rate_next_axis <= 2'd0;
-            rate_launch_axis <= 2'd0;
-            rate_launch_travel <= 13'd0;
-            rate_launch_scale <= 9'd0;
-            rate_axis_busy <= 2'd0;
-        end else begin
-            rate_start <= 1'b0;
-            rate_valid <= rate_done;
-            if (rate_done)
-                rate_axis_busy <= rate_axis_done;
-
-            // Atomic launch: hold axis/travel/scale together; cursor is not the tag.
-            if (!rate_busy && !rate_start) begin
-                rate_launch_axis <= rate_next_axis;
-                rate_launch_travel <= travel_sel;
-                rate_launch_scale <= scale_sel;
-                rate_start <= 1'b1;
-                rate_next_axis <= (rate_next_axis == 2'd2) ? 2'd0 : (rate_next_axis + 1'b1);
-            end
-        end
-    end
-endmodule

+ 0 - 150
src/legacy/modules/door_shared_dda_scheduler.v

@@ -1,150 +0,0 @@
-`timescale 1ns/1ps
-
-// 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.
-// Drain semantics (Round-4): phase always wraps when active && sum>=thr;
-// toggle fires on wrap without allow_toggle (axis helper gates rises; high drain
-// must still receive pulses). service_pending sticky + overrun when busy.
-
-module door_shared_dda_scheduler #(
-    parameter integer TRAVEL_WIDTH = 13,
-    parameter integer PHASE_WIDTH  = 26,
-    parameter integer RATE_WIDTH   = 21,
-    parameter integer THRESH_WIDTH = 25,
-    parameter integer CAL_PHASE_THRESHOLD = 5120
-) (
-    input  wire                         clk,
-    input  wire                         rst_n,
-    input  wire                         service_ce,
-    input  wire [2:0]                   active,
-    input  wire [2:0]                   allow_toggle,
-    input  wire [2:0]                   cal_mode,
-    input  wire [RATE_WIDTH-1:0]        rate0,
-    input  wire [RATE_WIDTH-1:0]        rate1,
-    input  wire [RATE_WIDTH-1:0]        rate2,
-    input  wire [THRESH_WIDTH-1:0]      phase_threshold,
-    output reg  [2:0]                   toggle_pulse,
-    output reg                          busy,
-    output wire                         service_overrun
-);
-    localparam [1:0] ST_IDLE = 2'd0,
-                     ST_X    = 2'd1,
-                     ST_Y    = 2'd2,
-                     ST_Z    = 2'd3;
-
-    reg [1:0] state;
-    reg [PHASE_WIDTH-1:0] phase0, phase1, phase2;
-    reg service_pending;
-    reg overrun_r;
-    wire _unused_allow = |allow_toggle;
-
-    assign service_overrun = overrun_r;
-
-    wire [PHASE_WIDTH-1:0] thr_run =
-        {{(PHASE_WIDTH-THRESH_WIDTH){1'b0}}, phase_threshold};
-    wire [PHASE_WIDTH-1:0] thr_cal = CAL_PHASE_THRESHOLD[PHASE_WIDTH-1:0];
-
-    // Phase always advances/wraps when enabled; allow only gates fire.
-    function automatic [PHASE_WIDTH-1:0] f_next;
-        input [PHASE_WIDTH-1:0] ph;
-        input [RATE_WIDTH-1:0]  rate;
-        input [PHASE_WIDTH-1:0] thr;
-        input                   en;
-        reg   [PHASE_WIDTH-1:0] sum;
-        begin
-            if (!en) begin
-                f_next = {PHASE_WIDTH{1'b0}};
-            end else begin
-                sum = ph + {{(PHASE_WIDTH-RATE_WIDTH){1'b0}}, rate};
-                if (sum >= thr)
-                    f_next = sum - thr;
-                else
-                    f_next = sum;
-            end
-        end
-    endfunction
-
-    // Fire on wrap whenever active. Axis helper gates rises via allow_rise and
-    // always accepts a pulse to drain STEP high (!allow must not stick high).
-    function automatic f_fire;
-        input [PHASE_WIDTH-1:0] ph;
-        input [RATE_WIDTH-1:0]  rate;
-        input [PHASE_WIDTH-1:0] thr;
-        input                   en;
-        reg   [PHASE_WIDTH-1:0] sum;
-        begin
-            sum = ph + {{(PHASE_WIDTH-RATE_WIDTH){1'b0}}, rate};
-            f_fire = en && (sum >= thr);
-        end
-    endfunction
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            state <= ST_IDLE;
-            phase0 <= {PHASE_WIDTH{1'b0}};
-            phase1 <= {PHASE_WIDTH{1'b0}};
-            phase2 <= {PHASE_WIDTH{1'b0}};
-            toggle_pulse <= 3'b000;
-            busy <= 1'b0;
-            service_pending <= 1'b0;
-            overrun_r <= 1'b0;
-        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;
-                service_pending <= 1'b1;
-            end
-
-            case (state)
-                ST_IDLE: begin
-                    busy <= 1'b0;
-                    if (service_pending) begin
-                        service_pending <= 1'b0;
-                        busy <= 1'b1;
-                        state <= ST_X;
-                    end
-                end
-                ST_X: begin
-                    begin : ax0
-                        reg [PHASE_WIDTH-1:0] thr;
-                        thr = cal_mode[0] ? thr_cal : thr_run;
-                        toggle_pulse[0] <= f_fire(phase0, rate0, thr, active[0]);
-                        phase0 <= f_next(phase0, rate0, thr, active[0]);
-                    end
-                    state <= ST_Y;
-                end
-                ST_Y: begin
-                    begin : ax1
-                        reg [PHASE_WIDTH-1:0] thr;
-                        thr = cal_mode[1] ? thr_cal : thr_run;
-                        toggle_pulse[1] <= f_fire(phase1, rate1, thr, active[1]);
-                        phase1 <= f_next(phase1, rate1, thr, active[1]);
-                    end
-                    state <= ST_Z;
-                end
-                default: begin
-                    begin : ax2
-                        reg [PHASE_WIDTH-1:0] thr;
-                        thr = cal_mode[2] ? thr_cal : thr_run;
-                        toggle_pulse[2] <= f_fire(phase2, rate2, thr, active[2]);
-                        phase2 <= f_next(phase2, rate2, thr, active[2]);
-                    end
-                    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
-    end
-endmodule

+ 0 - 50
src/legacy/modules/host_watchdog.v

@@ -1,50 +0,0 @@
-`timescale 1ns/1ps
-
-module host_watchdog #(
-    parameter integer TIMEOUT_TICKS = 60_000
-) (
-    input  wire clk,
-    input  wire rst_n,
-    input  wire enable,
-    input  wire tick_500us,
-    input  wire valid_set_all_commit,
-    output reg  watchdog_active,
-    output reg  timeout_event
-);
-    localparam integer COUNTER_BITS = (TIMEOUT_TICKS <= 1) ? 1 : $clog2(TIMEOUT_TICKS + 1);
-    reg [COUNTER_BITS-1:0] tick_count;
-    reg enable_d;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            tick_count <= {COUNTER_BITS{1'b0}};
-            watchdog_active <= 1'b0;
-            timeout_event <= 1'b0;
-            enable_d <= 1'b0;
-        end else begin
-            timeout_event <= 1'b0;
-            enable_d <= enable;
-
-            if (!enable) begin
-                // Disabled: clear counter and active; do not trip
-                tick_count <= {COUNTER_BITS{1'b0}};
-                watchdog_active <= 1'b0;
-            end else if (valid_set_all_commit) begin
-                // Feed has priority over same-cycle timeout
-                tick_count <= {COUNTER_BITS{1'b0}};
-                watchdog_active <= 1'b0;
-            end else if (!enable_d && enable) begin
-                // 0→1: start full timeout from zero
-                tick_count <= {COUNTER_BITS{1'b0}};
-                watchdog_active <= 1'b0;
-            end else if (tick_500us && !watchdog_active) begin
-                if (tick_count >= TIMEOUT_TICKS - 1) begin
-                    watchdog_active <= 1'b1;
-                    timeout_event <= 1'b1;
-                end else begin
-                    tick_count <= tick_count + 1'b1;
-                end
-            end
-        end
-    end
-endmodule

+ 0 - 51
src/legacy/modules/output_target_ram.v

@@ -1,51 +0,0 @@
-`timescale 1ns/1ps
-
-// Shadow writes become visible to the PWM path only on commit.  rd_data is
-// registered, so the target read contract is one system-clock cycle.
-module output_target_ram #(
-    parameter integer DEPTH = 12,
-    parameter integer PTC_COUNT = 8,
-    parameter integer ADDR_WIDTH = (DEPTH <= 1) ? 1 : $clog2(DEPTH),
-    parameter [7:0] BOOT_PTC_TARGET = 8'd0,
-    parameter [7:0] BOOT_FAN_TARGET = 8'd10,
-    parameter [7:0] WATCHDOG_PTC_TARGET = 8'd0,
-    parameter [7:0] WATCHDOG_FAN_TARGET = 8'd20
-) (
-    input  wire                  clk,
-    input  wire                  rst_n,
-    input  wire                  wr_en,
-    input  wire [ADDR_WIDTH-1:0] wr_addr,
-    input  wire [7:0]            wr_data,
-    input  wire                  commit,
-    input  wire                  watchdog_active,
-    input  wire [ADDR_WIDTH-1:0] rd_addr,
-    output reg  [7:0]            rd_data
-);
-    (* ram_style = "block" *) reg [7:0] shadow_memory [0:DEPTH-1];
-    (* ram_style = "block" *) reg [7:0] active_memory [0:DEPTH-1];
-    integer index;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            rd_data <= BOOT_PTC_TARGET;
-            for (index = 0; index < DEPTH; index = index + 1) begin
-                shadow_memory[index] <= (index < PTC_COUNT) ? BOOT_PTC_TARGET : BOOT_FAN_TARGET;
-                active_memory[index] <= (index < PTC_COUNT) ? BOOT_PTC_TARGET : BOOT_FAN_TARGET;
-            end
-        end else begin
-            if (wr_en && (wr_addr < DEPTH)) shadow_memory[wr_addr] <= wr_data;
-            if (commit) begin
-                for (index = 0; index < DEPTH; index = index + 1)
-                    active_memory[index] <= shadow_memory[index];
-            end
-            if (rd_addr < DEPTH) begin
-                if (watchdog_active)
-                    rd_data <= (rd_addr < PTC_COUNT) ? WATCHDOG_PTC_TARGET : WATCHDOG_FAN_TARGET;
-                else
-                    rd_data <= active_memory[rd_addr];
-            end else begin
-                rd_data <= 8'd0;
-            end
-        end
-    end
-endmodule

+ 0 - 68
src/legacy/modules/pwm_phase_scan_scheduler.v

@@ -1,68 +0,0 @@
-`timescale 1ns/1ps
-
-// Shared 500 Hz phase-scan PWM: one 0..99 phase, one 0..499 phase clock,
-// one duty comparator. Physical pins update during a short scan window;
-// they do not all change on the same system clock.
-module pwm_phase_scan_scheduler #(
-    parameter integer CHANNEL_COUNT = 32,
-    parameter integer PHASE_COUNT = 100,
-    parameter integer PHASE_CLKS = 500,
-    parameter integer ADDR_WIDTH = 5
-) (
-    input  wire                         clk,
-    input  wire                         rst_n,
-    output wire [ADDR_WIDTH-1:0]        target_rd_addr,
-    input  wire [7:0]                   target_rd_data,
-    output reg  [CHANNEL_COUNT-1:0]     logical_pwm_on,
-    output wire                         scan_idle
-);
-    localparam integer PHASE_BITS = (PHASE_COUNT <= 1) ? 1 : $clog2(PHASE_COUNT);
-    localparam integer SLOT_BITS = (PHASE_CLKS <= 1) ? 1 : $clog2(PHASE_CLKS);
-    localparam [ADDR_WIDTH-1:0] LAST_CH = CHANNEL_COUNT - 1;
-    localparam [PHASE_BITS-1:0] LAST_PHASE = PHASE_COUNT - 1;
-    localparam [SLOT_BITS-1:0] LAST_SLOT = PHASE_CLKS - 1;
-
-    reg [PHASE_BITS-1:0] phase;
-    reg [SLOT_BITS-1:0] phase_clk;
-    reg [ADDR_WIDTH-1:0] scan_idx;
-    reg [ADDR_WIDTH-1:0] issued_addr;
-    reg scanning;
-    reg issued;
-
-    assign target_rd_addr = scan_idx;
-    assign scan_idle = ~scanning && ~issued;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            phase <= {PHASE_BITS{1'b0}};
-            phase_clk <= {SLOT_BITS{1'b0}};
-            scan_idx <= {ADDR_WIDTH{1'b0}};
-            issued_addr <= {ADDR_WIDTH{1'b0}};
-            scanning <= 1'b1;
-            issued <= 1'b0;
-            // phase 0 + FAN default 10% => logical on; PTC default 0 => off
-            logical_pwm_on <= {{8{1'b1}}, {24{1'b0}}};
-        end else if (phase_clk == LAST_SLOT) begin
-            phase_clk <= {SLOT_BITS{1'b0}};
-            phase <= (phase == LAST_PHASE) ? {PHASE_BITS{1'b0}} : (phase + 1'b1);
-            scan_idx <= {ADDR_WIDTH{1'b0}};
-            issued_addr <= {ADDR_WIDTH{1'b0}};
-            scanning <= 1'b1;
-            issued <= 1'b0;
-        end else begin
-            phase_clk <= phase_clk + 1'b1;
-            if (issued)
-                logical_pwm_on[issued_addr] <= (target_rd_data > {{(8-PHASE_BITS){1'b0}}, phase});
-            if (scanning) begin
-                issued <= 1'b1;
-                issued_addr <= scan_idx;
-                if (scan_idx == LAST_CH)
-                    scanning <= 1'b0;
-                else
-                    scan_idx <= scan_idx + 1'b1;
-            end else begin
-                issued <= 1'b0;
-            end
-        end
-    end
-endmodule

+ 0 - 55
src/legacy/modules/pwm_scheduler.v

@@ -1,55 +0,0 @@
-`timescale 1ns/1ps
-
-// Logical PWM scheduler.  Project polarity and channel meaning belong to the
-// top-level adapter; this module only scans twelve logical duty values.
-module pwm_scheduler #(
-    parameter integer CHANNEL_COUNT = 12,
-    parameter integer PWM_BITS = 8,
-    parameter integer PWM_DUTY_WIDTH = 7,
-    parameter integer PWM_PHASE_COUNT = 100,
-    parameter integer PWM_SLOT_CLKS = 1042
-) (
-    input  wire                         clk,
-    input  wire                         rst_n,
-    output wire [(CHANNEL_COUNT <= 1 ? 1 : $clog2(CHANNEL_COUNT))-1:0] target_rd_addr,
-    input  wire [PWM_BITS-1:0]           target_rd_data,
-    output reg  [CHANNEL_COUNT-1:0]     logical_pwm_on
-);
-    localparam integer CHANNEL_BITS = (CHANNEL_COUNT <= 1) ? 1 : $clog2(CHANNEL_COUNT);
-    localparam integer PHASE_BITS = (PWM_PHASE_COUNT <= 1) ? 1 : $clog2(PWM_PHASE_COUNT);
-    localparam integer SLOT_BITS = (PWM_SLOT_CLKS <= 1) ? 1 : $clog2(PWM_SLOT_CLKS);
-
-    reg [CHANNEL_BITS-1:0] current_channel;
-    reg [PHASE_BITS-1:0] phase;
-    reg [SLOT_BITS-1:0] slot_counter;
-    wire [PWM_DUTY_WIDTH-1:0] selected_duty = target_rd_data[PWM_DUTY_WIDTH-1:0];
-    wire logical_on = selected_duty > phase;
-
-    assign target_rd_addr = current_channel;
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            current_channel <= {CHANNEL_BITS{1'b0}};
-            phase <= {PHASE_BITS{1'b0}};
-            slot_counter <= {SLOT_BITS{1'b0}};
-            logical_pwm_on <= {CHANNEL_COUNT{1'b0}};
-        end else if (slot_counter < PWM_SLOT_CLKS - 1) begin
-            slot_counter <= slot_counter + 1'b1;
-        end else begin
-            slot_counter <= {SLOT_BITS{1'b0}};
-            // The synchronous RAM has already seen current_channel during
-            // the preceding clock in this slot, so the returned data belongs
-            // to the channel currently being completed.
-            logical_pwm_on[current_channel] <= logical_on;
-            if (current_channel == CHANNEL_COUNT - 1) begin
-                current_channel <= {CHANNEL_BITS{1'b0}};
-                if (phase == PWM_PHASE_COUNT - 1)
-                    phase <= {PHASE_BITS{1'b0}};
-                else
-                    phase <= phase + 1'b1;
-            end else begin
-                current_channel <= current_channel + 1'b1;
-            end
-        end
-    end
-endmodule

+ 0 - 18
src/legacy/modules/temperature_ram.v

@@ -1,18 +0,0 @@
-`timescale 1ns/1ps
-
-module temperature_ram #(
-    parameter integer DEPTH = 27
-) (
-    input  wire       clk,
-    input  wire       wr_en,
-    input  wire [4:0] wr_addr,
-    input  wire [7:0] wr_data,
-    input  wire [4:0] rd_addr,
-    output wire [7:0] rd_data
-);
-    (* ram_style = "block" *) reg [7:0] memory [0:DEPTH-1];
-    always @(posedge clk) begin
-        if (wr_en && wr_addr < DEPTH) memory[wr_addr] <= wr_data;
-    end
-    assign rd_data = (rd_addr < DEPTH) ? memory[rd_addr] : 8'hFF;
-endmodule

+ 0 - 118
src/legacy/modules/temperature_reader.v

@@ -1,118 +0,0 @@
-`timescale 1ns/1ps
-
-module temperature_reader #(
-    parameter integer TEMPERATURE_COUNT = 27,
-    parameter integer MAX_CELSIUS = 150,
-    parameter [6:0] DEVICE_ADDR_0 = 7'h49,
-    parameter [6:0] DEVICE_ADDR_1 = 7'h48,
-    parameter [6:0] DEVICE_ADDR_2 = 7'h4B,
-    parameter [7:0] REGISTER_0 = 8'h00,
-    parameter [7:0] REGISTER_1 = 8'h01,
-    parameter [7:0] REGISTER_2 = 8'h02,
-    parameter [7:0] REGISTER_3 = 8'h03,
-    parameter [7:0] REGISTER_4 = 8'h04,
-    parameter [7:0] REGISTER_5 = 8'h05,
-    parameter [7:0] REGISTER_6 = 8'h06,
-    parameter [7:0] REGISTER_7 = 8'h07,
-    parameter [7:0] REGISTER_8 = 8'h08
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       start,
-    output reg        busy,
-    output reg        done,
-    output wire       request_valid,
-    input  wire       request_ready,
-    output reg [6:0]  device_addr,
-    output reg [7:0] register_addr,
-    input  wire       response_valid,
-    output wire       response_ready,
-    input  wire [15:0] response_data,
-    input  wire [3:0] response_error,
-    output reg        wr_en,
-    output reg [4:0]  wr_addr,
-    output reg [7:0]  wr_data
-);
-    localparam [1:0] ST_IDLE = 2'd0;
-    localparam [1:0] ST_REQUEST = 2'd1;
-    localparam [1:0] ST_RESPONSE = 2'd2;
-    localparam [1:0] ST_DONE = 2'd3;
-    reg [1:0] state;
-    reg [1:0] sensor_index;
-    reg [3:0] register_index;
-    reg [4:0] slot_index;
-    wire [8:0] integer_temperature = response_data[15:7];
-    wire response_bad = (response_error != 0) || response_data[15] || (integer_temperature > MAX_CELSIUS);
-
-    assign request_valid = (state == ST_REQUEST);
-    assign response_ready = (state == ST_RESPONSE);
-    always @* begin
-        case (register_index)
-            4'd0: register_addr = REGISTER_0;
-            4'd1: register_addr = REGISTER_1;
-            4'd2: register_addr = REGISTER_2;
-            4'd3: register_addr = REGISTER_3;
-            4'd4: register_addr = REGISTER_4;
-            4'd5: register_addr = REGISTER_5;
-            4'd6: register_addr = REGISTER_6;
-            4'd7: register_addr = REGISTER_7;
-            default: register_addr = REGISTER_8;
-        endcase
-    end
-
-    always @* begin
-        case (sensor_index)
-            2'd0: device_addr = DEVICE_ADDR_0;
-            2'd1: device_addr = DEVICE_ADDR_1;
-            default: device_addr = DEVICE_ADDR_2;
-        endcase
-    end
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            state <= ST_IDLE;
-            sensor_index <= 0;
-            register_index <= 0;
-            slot_index <= 0;
-            busy <= 1'b0;
-            done <= 1'b0;
-            wr_en <= 1'b0;
-            wr_addr <= 0;
-            wr_data <= 0;
-        end else begin
-            done <= 1'b0;
-            wr_en <= 1'b0;
-            case (state)
-                ST_IDLE: if (start) begin
-                    sensor_index <= 0;
-                    register_index <= 0;
-                    slot_index <= 0;
-                    busy <= 1'b1;
-                    state <= ST_REQUEST;
-                end
-                ST_REQUEST: if (request_ready) state <= ST_RESPONSE;
-                ST_RESPONSE: if (response_valid) begin
-                    wr_en <= 1'b1;
-                    wr_addr <= slot_index;
-                    wr_data <= response_bad ? 8'hFF : integer_temperature[7:0];
-                    if (slot_index == TEMPERATURE_COUNT - 1) begin
-                        state <= ST_DONE;
-                    end else begin
-                        slot_index <= slot_index + 1'b1;
-                        if (register_index == 8) begin
-                            register_index <= 0;
-                            sensor_index <= sensor_index + 1'b1;
-                        end else register_index <= register_index + 1'b1;
-                        state <= ST_REQUEST;
-                    end
-                end
-                ST_DONE: begin
-                    busy <= 1'b0;
-                    done <= 1'b1;
-                    state <= ST_IDLE;
-                end
-                default: state <= ST_IDLE;
-            endcase
-        end
-    end
-endmodule

+ 0 - 253
src/legacy/project/command_controller.v

@@ -1,253 +0,0 @@
-`timescale 1ns/1ps
-
-module command_controller #(
-    parameter integer PTC_COUNT = 8,
-    parameter integer FAN_COUNT = 4,
-    parameter integer CHAMBER_PTC_COUNT = 4,
-    parameter integer SET_ALL_PAYLOAD_LENGTH = 11,
-    parameter integer FAN_OFFSET = 0,
-    parameter integer CHAMBER_PTC_OFFSET = 4,
-    parameter integer Z_DOOR_OFFSET = 8,
-    parameter integer EXHAUST_X_OFFSET = 9,
-    parameter integer EXHAUST_Y_OFFSET = 10,
-    parameter [7:0]   CMD_GET_TEMPERATURE = 8'h02,
-    parameter [7:0]   CMD_GET_MOTOR_STATUS = 8'h03,
-    parameter [7:0]   RSP_TEMPERATURE = 8'h82,
-    parameter [7:0]   RSP_MOTOR_STATUS = 8'h83,
-    parameter integer TEMP_PAYLOAD_LENGTH = 27,
-    parameter integer MOTOR_STATUS_PAYLOAD_LENGTH = 31,
-    parameter integer DOOR_PERCENT_MAX = 100
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       frame_valid,
-    output wire       frame_ready,
-    output wire       frame_accept_enable,
-    input  wire [7:0] frame_type,
-    input  wire [7:0] frame_length,
-    output reg  [7:0] payload_read_addr,
-    input  wire [7:0] payload_read_data,
-    output reg        target_wr_en,
-    output reg  [3:0] target_wr_addr,
-    output reg  [7:0] target_wr_data,
-    output reg        valid_set_all_commit,
-    // Door percent (byte8=Z, byte9=X, byte10=Y)
-    output reg  [7:0] door_percent_z,
-    output reg  [7:0] door_percent_x,
-    output reg  [7:0] door_percent_y,
-    output reg        motor_request_valid,
-    input  wire       startup_complete,
-    output reg        temperature_start,
-    input  wire       temperature_done,
-    output reg        status_capture,
-    output reg        tx_start,
-    output reg  [7:0] tx_frame_type,
-    output reg  [7:0] tx_payload_length,
-    output reg        tx_payload_is_status, // 0=temperature RAM, 1=motor status snap
-    input  wire       tx_done,
-    output wire       busy
-);
-    localparam [3:0] ST_IDLE = 4'd0;
-    localparam [3:0] ST_VALIDATE_FAN = 4'd1;
-    localparam [3:0] ST_VALIDATE_PTC = 4'd2;
-    localparam [3:0] ST_VALIDATE_Z = 4'd3;
-    localparam [3:0] ST_VALIDATE_X = 4'd4;
-    localparam [3:0] ST_VALIDATE_Y = 4'd5;
-    localparam [3:0] ST_WRITE_FAN = 4'd6;
-    localparam [3:0] ST_WRITE_PTC = 4'd7;
-    localparam [3:0] ST_COMMIT = 4'd8;
-    localparam [3:0] ST_TEMPERATURE = 4'd9;
-    localparam [3:0] ST_STATUS_CAPTURE = 4'd10;
-    localparam [3:0] ST_TX = 4'd11;
-    localparam [3:0] ST_DRAIN = 4'd12;
-
-    reg [3:0] state;
-    reg [2:0] validate_index;
-    reg [2:0] write_index;
-    reg [7:0] fan_values [0:3];
-    reg [7:0] ptc_values [0:3];
-    reg [1:0] ptc_write_phase;
-
-    assign frame_ready = (state == ST_IDLE) || (state == ST_DRAIN);
-    assign frame_accept_enable = (state == ST_IDLE);
-    assign busy = (state != ST_IDLE);
-
-    always @* begin
-        case (state)
-            ST_VALIDATE_FAN: payload_read_addr = FAN_OFFSET + validate_index;
-            ST_VALIDATE_PTC: payload_read_addr = CHAMBER_PTC_OFFSET + validate_index;
-            ST_VALIDATE_Z: payload_read_addr = Z_DOOR_OFFSET;
-            ST_VALIDATE_X: payload_read_addr = EXHAUST_X_OFFSET;
-            ST_VALIDATE_Y: payload_read_addr = EXHAUST_Y_OFFSET;
-            ST_WRITE_FAN: payload_read_addr = FAN_OFFSET + write_index;
-            ST_WRITE_PTC: payload_read_addr = CHAMBER_PTC_OFFSET + write_index;
-            default: payload_read_addr = 8'd0;
-        endcase
-    end
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            state <= ST_IDLE;
-            validate_index <= 3'd0;
-            write_index <= 3'd0;
-            ptc_write_phase <= 2'd0;
-            door_percent_z <= 8'd0;
-            door_percent_x <= 8'd0;
-            door_percent_y <= 8'd0;
-            valid_set_all_commit <= 1'b0;
-            motor_request_valid <= 1'b0;
-            target_wr_en <= 1'b0;
-            target_wr_addr <= 4'd0;
-            target_wr_data <= 8'd0;
-            temperature_start <= 1'b0;
-            status_capture <= 1'b0;
-            tx_start <= 1'b0;
-            tx_frame_type <= RSP_TEMPERATURE;
-            tx_payload_length <= TEMP_PAYLOAD_LENGTH[7:0];
-            tx_payload_is_status <= 1'b0;
-        end else begin
-            valid_set_all_commit <= 1'b0;
-            motor_request_valid <= 1'b0;
-            target_wr_en <= 1'b0;
-            temperature_start <= 1'b0;
-            status_capture <= 1'b0;
-            tx_start <= 1'b0;
-
-            case (state)
-                ST_IDLE: begin
-                    if (frame_valid) begin
-                        if ((frame_type == 8'h01) &&
-                            (frame_length == SET_ALL_PAYLOAD_LENGTH[7:0])) begin
-                            validate_index <= 3'd0;
-                            state <= ST_VALIDATE_FAN;
-                        end else if ((frame_type == CMD_GET_TEMPERATURE) &&
-                                     (frame_length == 8'd0)) begin
-                            if (startup_complete) begin
-                                temperature_start <= 1'b1;
-                                tx_frame_type <= RSP_TEMPERATURE;
-                                tx_payload_length <= TEMP_PAYLOAD_LENGTH[7:0];
-                                tx_payload_is_status <= 1'b0;
-                                state <= ST_TEMPERATURE;
-                            end else begin
-                                // Pre-startup GET_TEMP: silent drain
-                                state <= ST_DRAIN;
-                            end
-                        end else if ((frame_type == CMD_GET_MOTOR_STATUS) &&
-                                     (frame_length == 8'd0)) begin
-                            status_capture <= 1'b1;
-                            tx_frame_type <= RSP_MOTOR_STATUS;
-                            tx_payload_length <= MOTOR_STATUS_PAYLOAD_LENGTH[7:0];
-                            tx_payload_is_status <= 1'b1;
-                            state <= ST_STATUS_CAPTURE;
-                        end else begin
-                            state <= ST_DRAIN;
-                        end
-                    end
-                end
-                ST_VALIDATE_FAN: begin
-                    if (payload_read_data > 8'd100) begin
-                        state <= ST_DRAIN;
-                    end else begin
-                        fan_values[validate_index] <= payload_read_data;
-                        if (validate_index == FAN_COUNT - 1) begin
-                            validate_index <= 3'd0;
-                            state <= ST_VALIDATE_PTC;
-                        end else begin
-                            validate_index <= validate_index + 1'b1;
-                        end
-                    end
-                end
-                ST_VALIDATE_PTC: begin
-                    if (payload_read_data > 8'd100) begin
-                        state <= ST_DRAIN;
-                    end else begin
-                        ptc_values[validate_index] <= payload_read_data;
-                        if (validate_index == CHAMBER_PTC_COUNT - 1) begin
-                            state <= ST_VALIDATE_Z;
-                        end else begin
-                            validate_index <= validate_index + 1'b1;
-                        end
-                    end
-                end
-                ST_VALIDATE_Z: begin
-                    if (payload_read_data > DOOR_PERCENT_MAX[7:0]) begin
-                        state <= ST_DRAIN;
-                    end else begin
-                        door_percent_z <= payload_read_data;
-                        state <= ST_VALIDATE_X;
-                    end
-                end
-                ST_VALIDATE_X: begin
-                    if (payload_read_data > DOOR_PERCENT_MAX[7:0]) begin
-                        state <= ST_DRAIN;
-                    end else begin
-                        door_percent_x <= payload_read_data;
-                        state <= ST_VALIDATE_Y;
-                    end
-                end
-                ST_VALIDATE_Y: begin
-                    if (payload_read_data > DOOR_PERCENT_MAX[7:0]) begin
-                        state <= ST_DRAIN;
-                    end else begin
-                        door_percent_y <= payload_read_data;
-                        write_index <= 3'd0;
-                        ptc_write_phase <= 2'd0;
-                        state <= ST_WRITE_FAN;
-                    end
-                end
-                ST_WRITE_FAN: begin
-                    target_wr_en <= 1'b1;
-                    target_wr_addr <= PTC_COUNT + write_index;
-                    target_wr_data <= fan_values[write_index];
-                    if (write_index == FAN_COUNT - 1) begin
-                        write_index <= 3'd0;
-                        state <= ST_WRITE_PTC;
-                    end else begin
-                        write_index <= write_index + 1'b1;
-                    end
-                end
-                ST_WRITE_PTC: begin
-                    target_wr_en <= 1'b1;
-                    target_wr_data <= ptc_values[write_index];
-                    if (ptc_write_phase == 2'd0) begin
-                        target_wr_addr <= {1'b0, write_index[1:0], 1'b0};
-                        ptc_write_phase <= 2'd1;
-                    end else begin
-                        target_wr_addr <= {1'b0, write_index[1:0], 1'b1};
-                        ptc_write_phase <= 2'd0;
-                        if (write_index == CHAMBER_PTC_COUNT - 1) begin
-                            state <= ST_COMMIT;
-                        end else begin
-                            write_index <= write_index + 1'b1;
-                        end
-                    end
-                end
-                ST_COMMIT: begin
-                    // Sample pre-edge startup_complete at commit: same-edge rise
-                    // still reads 0 (NBA); commit-minus-one already-1 submits motors.
-                    valid_set_all_commit <= 1'b1;
-                    if (startup_complete) begin
-                        motor_request_valid <= 1'b1;
-                    end
-                    state <= ST_DRAIN;
-                end
-                ST_TEMPERATURE: begin
-                    if (temperature_done) begin
-                        tx_start <= 1'b1;
-                        state <= ST_TX;
-                    end
-                end
-                ST_STATUS_CAPTURE: begin
-                    // One-cycle gap after capture before tx_start (frame_tx latency)
-                    tx_start <= 1'b1;
-                    state <= ST_TX;
-                end
-                ST_TX: begin
-                    if (tx_done) state <= ST_DRAIN;
-                end
-                ST_DRAIN: state <= ST_IDLE;
-                default: state <= ST_DRAIN;
-            endcase
-        end
-    end
-endmodule

+ 0 - 51
src/legacy/project/prod2u_6400_adapter.v

@@ -1,51 +0,0 @@
-`timescale 1ns/1ps
-
-module prod2u_6400_adapter #(
-    parameter integer SET_ALL_PAYLOAD_LENGTH = 32,
-    parameter integer TEMP_PAYLOAD_LENGTH = 27,
-    parameter [7:0]   CMD_SET_ALL = 8'h01,
-    parameter [7:0]   CMD_GET_TEMPERATURE = 8'h02,
-    parameter [7:0]   RSP_TEMPERATURE = 8'h82,
-    parameter integer DUTY_MAX = 100
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       frame_valid,
-    output wire       frame_ready,
-    output wire       frame_accept_enable,
-    input  wire [7:0] frame_type,
-    input  wire [7:0] frame_length,
-    output wire [7:0] payload_read_addr,
-    input  wire [7:0] payload_read_data,
-    output wire       target_wr_en,
-    output wire [4:0] target_wr_addr,
-    output wire [7:0] target_wr_data,
-    output wire       valid_set_all_commit,
-    output wire       temperature_start,
-    input  wire       temperature_done,
-    output wire       tx_start,
-    output wire [7:0] tx_frame_type,
-    output wire [7:0] tx_payload_length,
-    input  wire       tx_done,
-    output wire       busy
-);
-    prod2u_6400_command_controller #(
-        .SET_ALL_PAYLOAD_LENGTH(SET_ALL_PAYLOAD_LENGTH),
-        .TEMP_PAYLOAD_LENGTH(TEMP_PAYLOAD_LENGTH),
-        .CMD_SET_ALL(CMD_SET_ALL),
-        .CMD_GET_TEMPERATURE(CMD_GET_TEMPERATURE),
-        .RSP_TEMPERATURE(RSP_TEMPERATURE),
-        .DUTY_MAX(DUTY_MAX)
-    ) controller (
-        .clk(clk), .rst_n(rst_n),
-        .frame_valid(frame_valid), .frame_ready(frame_ready),
-        .frame_accept_enable(frame_accept_enable),
-        .frame_type(frame_type), .frame_length(frame_length),
-        .payload_read_addr(payload_read_addr), .payload_read_data(payload_read_data),
-        .target_wr_en(target_wr_en), .target_wr_addr(target_wr_addr),
-        .target_wr_data(target_wr_data), .valid_set_all_commit(valid_set_all_commit),
-        .temperature_start(temperature_start), .temperature_done(temperature_done),
-        .tx_start(tx_start), .tx_frame_type(tx_frame_type),
-        .tx_payload_length(tx_payload_length), .tx_done(tx_done), .busy(busy)
-    );
-endmodule

+ 0 - 121
src/legacy/project/prod2u_6400_command_controller.v

@@ -1,121 +0,0 @@
-`timescale 1ns/1ps
-
-// 6400 SET_ALL: walk payload RAM 0..31, write inactive bank, commit next state.
-// Invalid values reject the whole frame without commit or watchdog feed.
-module prod2u_6400_command_controller #(
-    parameter integer SET_ALL_PAYLOAD_LENGTH = 32,
-    parameter integer TEMP_PAYLOAD_LENGTH = 27,
-    parameter [7:0]   CMD_SET_ALL = 8'h01,
-    parameter [7:0]   CMD_GET_TEMPERATURE = 8'h02,
-    parameter [7:0]   RSP_TEMPERATURE = 8'h82,
-    parameter integer DUTY_MAX = 100
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       frame_valid,
-    output wire       frame_ready,
-    output wire       frame_accept_enable,
-    input  wire [7:0] frame_type,
-    input  wire [7:0] frame_length,
-    output reg  [7:0] payload_read_addr,
-    input  wire [7:0] payload_read_data,
-    output reg        target_wr_en,
-    output reg  [4:0] target_wr_addr,
-    output reg  [7:0] target_wr_data,
-    output reg        valid_set_all_commit,
-    output reg        temperature_start,
-    input  wire       temperature_done,
-    output reg        tx_start,
-    output reg  [7:0] tx_frame_type,
-    output reg  [7:0] tx_payload_length,
-    input  wire       tx_done,
-    output wire       busy
-);
-    localparam [2:0] ST_IDLE = 3'd0;
-    localparam [2:0] ST_CHECK = 3'd1;
-    localparam [2:0] ST_COMMIT = 3'd2;
-    localparam [2:0] ST_TEMPERATURE = 3'd3;
-    localparam [2:0] ST_TX = 3'd4;
-    localparam [2:0] ST_DRAIN = 3'd5;
-    localparam integer LAST_INDEX = SET_ALL_PAYLOAD_LENGTH - 1;
-
-    reg [2:0] state;
-    reg [5:0] index;
-
-    assign frame_ready = (state == ST_IDLE) || (state == ST_DRAIN);
-    assign frame_accept_enable = (state == ST_IDLE);
-    assign busy = (state != ST_IDLE);
-
-    always @* begin
-        payload_read_addr = {2'b00, index};
-    end
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            state <= ST_IDLE;
-            index <= 6'd0;
-            target_wr_en <= 1'b0;
-            target_wr_addr <= 5'd0;
-            target_wr_data <= 8'd0;
-            valid_set_all_commit <= 1'b0;
-            temperature_start <= 1'b0;
-            tx_start <= 1'b0;
-            tx_frame_type <= RSP_TEMPERATURE;
-            tx_payload_length <= TEMP_PAYLOAD_LENGTH[7:0];
-        end else begin
-            valid_set_all_commit <= 1'b0;
-            target_wr_en <= 1'b0;
-            temperature_start <= 1'b0;
-            tx_start <= 1'b0;
-
-            case (state)
-                ST_IDLE: begin
-                    if (frame_valid) begin
-                        if ((frame_type == CMD_SET_ALL) &&
-                            (frame_length == SET_ALL_PAYLOAD_LENGTH[7:0])) begin
-                            index <= 6'd0;
-                            state <= ST_CHECK;
-                        end else if ((frame_type == CMD_GET_TEMPERATURE) &&
-                                     (frame_length == 8'd0)) begin
-                            temperature_start <= 1'b1;
-                            tx_frame_type <= RSP_TEMPERATURE;
-                            tx_payload_length <= TEMP_PAYLOAD_LENGTH[7:0];
-                            state <= ST_TEMPERATURE;
-                        end else begin
-                            state <= ST_DRAIN;
-                        end
-                    end
-                end
-                ST_CHECK: begin
-                    if (payload_read_data > DUTY_MAX[7:0]) begin
-                        state <= ST_DRAIN;
-                    end else begin
-                        target_wr_en <= 1'b1;
-                        target_wr_addr <= index[4:0];
-                        target_wr_data <= payload_read_data;
-                        if (index == LAST_INDEX[5:0]) begin
-                            state <= ST_COMMIT;
-                        end else begin
-                            index <= index + 1'b1;
-                        end
-                    end
-                end
-                ST_COMMIT: begin
-                    valid_set_all_commit <= 1'b1;
-                    state <= ST_DRAIN;
-                end
-                ST_TEMPERATURE: begin
-                    if (temperature_done) begin
-                        tx_start <= 1'b1;
-                        state <= ST_TX;
-                    end
-                end
-                ST_TX: begin
-                    if (tx_done) state <= ST_DRAIN;
-                end
-                ST_DRAIN: state <= ST_IDLE;
-                default: state <= ST_DRAIN;
-            endcase
-        end
-    end
-endmodule

+ 0 - 88
src/legacy/project/project_adapter.v

@@ -1,88 +0,0 @@
-`timescale 1ns/1ps
-
-module project_adapter #(
-    parameter integer PTC_COUNT = 8,
-    parameter integer FAN_COUNT = 4,
-    parameter integer CHAMBER_PTC_COUNT = 4,
-    parameter integer SET_ALL_PAYLOAD_LENGTH = 11,
-    parameter integer FAN_OFFSET = 0,
-    parameter integer CHAMBER_PTC_OFFSET = 4,
-    parameter integer Z_DOOR_OFFSET = 8,
-    parameter integer EXHAUST_X_OFFSET = 9,
-    parameter integer EXHAUST_Y_OFFSET = 10,
-    parameter [7:0]   CMD_GET_TEMPERATURE = 8'h02,
-    parameter [7:0]   CMD_GET_MOTOR_STATUS = 8'h03,
-    parameter [7:0]   RSP_TEMPERATURE = 8'h82,
-    parameter [7:0]   RSP_MOTOR_STATUS = 8'h83,
-    parameter integer TEMP_PAYLOAD_LENGTH = 27,
-    parameter integer MOTOR_STATUS_PAYLOAD_LENGTH = 31,
-    parameter integer DOOR_PERCENT_MAX = 100
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       frame_valid,
-    output wire       frame_ready,
-    output wire       frame_accept_enable,
-    input  wire [7:0] frame_type,
-    input  wire [7:0] frame_length,
-    output wire [7:0] payload_read_addr,
-    input  wire [7:0] payload_read_data,
-    output wire       target_wr_en,
-    output wire [3:0] target_wr_addr,
-    output wire [7:0] target_wr_data,
-    output wire       valid_set_all_commit,
-    output wire       motor_request_valid,
-    output wire [7:0] door_percent_x,
-    output wire [7:0] door_percent_y,
-    output wire [7:0] door_percent_z,
-    input  wire       startup_complete,
-    output wire       temperature_start,
-    input  wire       temperature_done,
-    output wire       status_capture,
-    output wire       tx_start,
-    output wire [7:0] tx_frame_type,
-    output wire [7:0] tx_payload_length,
-    output wire       tx_payload_is_status,
-    input  wire       tx_done,
-    output wire       busy
-);
-    command_controller #(
-        .PTC_COUNT(PTC_COUNT),
-        .FAN_COUNT(FAN_COUNT),
-        .CHAMBER_PTC_COUNT(CHAMBER_PTC_COUNT),
-        .SET_ALL_PAYLOAD_LENGTH(SET_ALL_PAYLOAD_LENGTH),
-        .FAN_OFFSET(FAN_OFFSET),
-        .CHAMBER_PTC_OFFSET(CHAMBER_PTC_OFFSET),
-        .Z_DOOR_OFFSET(Z_DOOR_OFFSET),
-        .EXHAUST_X_OFFSET(EXHAUST_X_OFFSET),
-        .EXHAUST_Y_OFFSET(EXHAUST_Y_OFFSET),
-        .CMD_GET_TEMPERATURE(CMD_GET_TEMPERATURE),
-        .CMD_GET_MOTOR_STATUS(CMD_GET_MOTOR_STATUS),
-        .RSP_TEMPERATURE(RSP_TEMPERATURE),
-        .RSP_MOTOR_STATUS(RSP_MOTOR_STATUS),
-        .TEMP_PAYLOAD_LENGTH(TEMP_PAYLOAD_LENGTH),
-        .MOTOR_STATUS_PAYLOAD_LENGTH(MOTOR_STATUS_PAYLOAD_LENGTH),
-        .DOOR_PERCENT_MAX(DOOR_PERCENT_MAX)
-    ) controller (
-        .clk(clk), .rst_n(rst_n),
-        .frame_valid(frame_valid), .frame_ready(frame_ready),
-        .frame_accept_enable(frame_accept_enable),
-        .frame_type(frame_type), .frame_length(frame_length),
-        .payload_read_addr(payload_read_addr), .payload_read_data(payload_read_data),
-        .target_wr_en(target_wr_en), .target_wr_addr(target_wr_addr),
-        .target_wr_data(target_wr_data),
-        .valid_set_all_commit(valid_set_all_commit),
-        .door_percent_z(door_percent_z),
-        .door_percent_x(door_percent_x),
-        .door_percent_y(door_percent_y),
-        .motor_request_valid(motor_request_valid),
-        .startup_complete(startup_complete),
-        .temperature_start(temperature_start), .temperature_done(temperature_done),
-        .status_capture(status_capture),
-        .tx_start(tx_start),
-        .tx_frame_type(tx_frame_type),
-        .tx_payload_length(tx_payload_length),
-        .tx_payload_is_status(tx_payload_is_status),
-        .tx_done(tx_done), .busy(busy)
-    );
-endmodule

+ 0 - 215
src/legacy/top/prod2u_6400_front_back_top.v

@@ -1,215 +0,0 @@
-`timescale 1ns/1ps
-`include "src/generated/6400/prod2u_6400_front_back_params.vh"
-
-module prod2u_6400_front_back_top (
-    input  wire        sys_clk,
-    input  wire        host_uart_rx,
-    output wire        host_uart_tx,
-    output wire [23:0] ptc_pwm_out,
-    output wire [7:0]  fan_pwm_out,
-    inout  wire        temp_scl,
-    inout  wire        temp_sda
-);
-    wire sys_rst_n;
-    wire uart_rx_valid;
-    wire [7:0] uart_rx_data;
-    wire uart_framing_error;
-    wire frame_valid;
-    wire frame_ready;
-    wire frame_accept_enable;
-    wire [7:0] frame_type;
-    wire [7:0] frame_length;
-    wire [7:0] payload_read_addr;
-    wire [7:0] payload_read_data;
-    wire payload_wr_en;
-    wire [7:0] payload_wr_addr;
-    wire [7:0] payload_wr_data;
-    wire [4:0] target_rd_addr;
-    wire [7:0] target_rd_data;
-    wire target_wr_en;
-    wire [4:0] target_wr_addr;
-    wire [7:0] target_wr_data;
-    wire valid_set_all_commit;
-    wire temperature_start;
-    wire temperature_done;
-    wire tx_start;
-    wire tx_done;
-    wire [7:0] tx_frame_type;
-    wire [7:0] tx_payload_length;
-    wire adapter_busy;
-    wire [7:0] temperature_wr_data;
-    wire [4:0] temperature_wr_addr;
-    wire temperature_wr_en;
-    wire [7:0] temperature_rd_data;
-    wire frame_tx_busy;
-    wire frame_tx_byte_valid;
-    wire [7:0] frame_tx_byte_data;
-    wire frame_tx_byte_ready;
-    wire [7:0] frame_tx_payload_addr;
-    wire uart_tx_busy;
-    wire uart_tx_byte_done;
-    wire i2c_request_valid;
-    wire i2c_request_ready;
-    wire [6:0] i2c_device_addr;
-    wire [7:0] i2c_register_addr;
-    wire i2c_response_valid;
-    wire i2c_response_ready;
-    wire [15:0] i2c_response_data;
-    wire [3:0] i2c_response_error;
-    wire i2c_busy;
-    wire i2c_scl_drive_low;
-    wire i2c_sda_drive_low;
-    wire temperature_busy;
-    wire tick_500us;
-    wire watchdog_active;
-    wire watchdog_timeout_event;
-    wire [31:0] logical_pwm_on;
-    wire scan_idle;
-
-    assign temp_scl = i2c_scl_drive_low ? 1'b0 : 1'bz;
-    assign temp_sda = i2c_sda_drive_low ? 1'b0 : 1'bz;
-    assign ptc_pwm_out = logical_pwm_on[23:0];
-    assign fan_pwm_out = ~logical_pwm_on[31:24];
-    assign frame_tx_byte_ready = !uart_tx_busy;
-
-    prod2u_por #(.POR_CYCLES(1024)) u_por (
-        .sys_clk(sys_clk), .sys_rst_n(sys_rst_n)
-    );
-
-    shared_500us_tick #(
-        .CLOCK_HZ(`FB_CLOCK_HZ), .TICK_US(`FB_WATCHDOG_TICK_US)
-    ) u_shared_tick (
-        .clk(sys_clk), .rst_n(sys_rst_n), .tick(tick_500us)
-    );
-
-    host_watchdog #(
-        .TIMEOUT_TICKS(`FB_WATCHDOG_TIMEOUT_TICKS)
-    ) u_watchdog (
-        .clk(sys_clk), .rst_n(sys_rst_n),
-        .enable(1'b1),
-        .tick_500us(tick_500us),
-        .valid_set_all_commit(valid_set_all_commit),
-        .watchdog_active(watchdog_active), .timeout_event(watchdog_timeout_event)
-    );
-
-    uart_rx_byte #(.CLKS_PER_BIT(`FB_UART_CLKS_PER_BIT)) u_uart_rx (
-        .clk(sys_clk), .rst_n(sys_rst_n), .rx_i(host_uart_rx),
-        .byte_valid(uart_rx_valid), .byte_data(uart_rx_data),
-        .framing_error(uart_framing_error)
-    );
-
-    frame_rx #(.MAX_PAYLOAD(`FB_SET_ALL_PAYLOAD_LENGTH),
-        .INTER_BYTE_TIMEOUT_CYCLES(`FB_FRAME_INTER_BYTE_TIMEOUT_CYCLES)) u_frame_rx (
-        .clk(sys_clk), .rst_n(sys_rst_n),
-        .byte_valid(uart_rx_valid), .byte_data(uart_rx_data),
-        .accept_enable(frame_accept_enable), .frame_valid(frame_valid),
-        .frame_ready(frame_ready), .frame_type(frame_type), .frame_length(frame_length),
-        .payload_read_addr(payload_read_addr), .payload_read_data(payload_read_data),
-        .payload_wr_en(payload_wr_en), .payload_wr_addr(payload_wr_addr),
-        .payload_wr_data(payload_wr_data)
-    );
-
-    payload_ram #(.DEPTH(`FB_SET_ALL_PAYLOAD_LENGTH), .ADDR_WIDTH(8)) u_payload_ram (
-        .clk(sys_clk), .wr_en(payload_wr_en), .wr_addr(payload_wr_addr),
-        .wr_data(payload_wr_data), .rd_addr(payload_read_addr),
-        .rd_data(payload_read_data)
-    );
-
-    prod2u_6400_adapter #(
-        .SET_ALL_PAYLOAD_LENGTH(`FB_SET_ALL_PAYLOAD_LENGTH),
-        .TEMP_PAYLOAD_LENGTH(`FB_TEMPERATURE_COUNT),
-        .CMD_SET_ALL(`FB_CMD_SET_ALL),
-        .CMD_GET_TEMPERATURE(`FB_CMD_GET_TEMPERATURE),
-        .RSP_TEMPERATURE(`FB_RSP_TEMPERATURE)
-    ) u_adapter (
-        .clk(sys_clk), .rst_n(sys_rst_n), .frame_valid(frame_valid),
-        .frame_ready(frame_ready), .frame_accept_enable(frame_accept_enable),
-        .frame_type(frame_type), .frame_length(frame_length),
-        .payload_read_addr(payload_read_addr), .payload_read_data(payload_read_data),
-        .target_wr_en(target_wr_en), .target_wr_addr(target_wr_addr),
-        .target_wr_data(target_wr_data), .valid_set_all_commit(valid_set_all_commit),
-        .temperature_start(temperature_start), .temperature_done(temperature_done),
-        .tx_start(tx_start), .tx_frame_type(tx_frame_type),
-        .tx_payload_length(tx_payload_length), .tx_done(tx_done), .busy(adapter_busy)
-    );
-
-    double_bank_target_store #(
-        .DEPTH(`FB_OUTPUT_CHANNEL_COUNT), .PTC_COUNT(`FB_PTC_COUNT),
-        .BOOT_PTC_TARGET(`FB_PTC_DEFAULT_TARGET),
-        .BOOT_FAN_TARGET(`FB_FAN_DEFAULT_TARGET),
-        .WATCHDOG_PTC_TARGET(`FB_WATCHDOG_PTC_TARGET),
-        .WATCHDOG_FAN_TARGET(`FB_WATCHDOG_FAN_TARGET)
-    ) u_target_store (
-        .clk(sys_clk), .rst_n(sys_rst_n), .wr_en(target_wr_en),
-        .wr_addr(target_wr_addr), .wr_data(target_wr_data),
-        .commit(valid_set_all_commit), .scan_idle(scan_idle),
-        .watchdog_active(watchdog_active),
-        .rd_addr(target_rd_addr), .rd_data(target_rd_data)
-    );
-
-    pwm_phase_scan_scheduler #(
-        .CHANNEL_COUNT(`FB_OUTPUT_CHANNEL_COUNT),
-        .PHASE_COUNT(`FB_PWM_PHASE_COUNT),
-        .PHASE_CLKS(`FB_PWM_PHASE_CLKS)
-    ) u_pwm (
-        .clk(sys_clk), .rst_n(sys_rst_n),
-        .target_rd_addr(target_rd_addr), .target_rd_data(target_rd_data),
-        .logical_pwm_on(logical_pwm_on), .scan_idle(scan_idle)
-    );
-
-    temperature_reader #(
-        .TEMPERATURE_COUNT(`FB_TEMPERATURE_COUNT), .MAX_CELSIUS(`FB_TEMP_MAX_CELSIUS),
-        .DEVICE_ADDR_0(`FB_TEMP_DEVICE_ADDR_0), .DEVICE_ADDR_1(`FB_TEMP_DEVICE_ADDR_1),
-        .DEVICE_ADDR_2(`FB_TEMP_DEVICE_ADDR_2), .REGISTER_0(`FB_TEMP_REGISTER_0),
-        .REGISTER_1(`FB_TEMP_REGISTER_1), .REGISTER_2(`FB_TEMP_REGISTER_2),
-        .REGISTER_3(`FB_TEMP_REGISTER_3), .REGISTER_4(`FB_TEMP_REGISTER_4),
-        .REGISTER_5(`FB_TEMP_REGISTER_5), .REGISTER_6(`FB_TEMP_REGISTER_6),
-        .REGISTER_7(`FB_TEMP_REGISTER_7), .REGISTER_8(`FB_TEMP_REGISTER_8)
-    ) u_temperature_reader (
-        .clk(sys_clk), .rst_n(sys_rst_n), .start(temperature_start),
-        .busy(temperature_busy), .done(temperature_done),
-        .request_valid(i2c_request_valid), .request_ready(i2c_request_ready),
-        .device_addr(i2c_device_addr), .register_addr(i2c_register_addr),
-        .response_valid(i2c_response_valid), .response_ready(i2c_response_ready),
-        .response_data(i2c_response_data), .response_error(i2c_response_error),
-        .wr_en(temperature_wr_en), .wr_addr(temperature_wr_addr),
-        .wr_data(temperature_wr_data)
-    );
-
-    temperature_ram #(.DEPTH(`FB_TEMPERATURE_COUNT)) u_temperature_ram (
-        .clk(sys_clk), .wr_en(temperature_wr_en), .wr_addr(temperature_wr_addr),
-        .wr_data(temperature_wr_data), .rd_addr(frame_tx_payload_addr[4:0]),
-        .rd_data(temperature_rd_data)
-    );
-
-    i2c_word_reader #(.HALF_PERIOD_CLKS(125), .TIMEOUT_CLKS(25000)) u_temperature_i2c (
-        .clk(sys_clk), .rst_n(sys_rst_n), .request_valid(i2c_request_valid),
-        .request_ready(i2c_request_ready), .request_device_addr(i2c_device_addr),
-        .request_register(i2c_register_addr), .response_valid(i2c_response_valid),
-        .response_ready(i2c_response_ready), .response_data(i2c_response_data),
-        .response_error(i2c_response_error), .busy(i2c_busy), .scl_i(temp_scl),
-        .sda_i(temp_sda), .scl_drive_low(i2c_scl_drive_low),
-        .sda_drive_low(i2c_sda_drive_low)
-    );
-
-    frame_tx #(.PAYLOAD_IDX_BITS(5)) u_frame_tx (
-        .clk(sys_clk), .rst_n(sys_rst_n), .start(tx_start),
-        .frame_type(tx_frame_type),
-        .payload_length(tx_payload_length),
-        .busy(frame_tx_busy),
-        .byte_valid(frame_tx_byte_valid), .byte_data(frame_tx_byte_data),
-        .byte_ready(frame_tx_byte_ready), .payload_addr(frame_tx_payload_addr),
-        .payload_data(temperature_rd_data), .done(tx_done)
-    );
-
-    uart_tx_byte #(.CLKS_PER_BIT(`FB_UART_CLKS_PER_BIT)) u_uart_tx (
-        .clk(sys_clk), .rst_n(sys_rst_n),
-        .byte_valid(frame_tx_byte_valid && frame_tx_byte_ready),
-        .byte_data(frame_tx_byte_data), .tx_o(host_uart_tx),
-        .busy(uart_tx_busy), .byte_done(uart_tx_byte_done)
-    );
-
-    wire unused_inputs = &{1'b0, uart_framing_error, frame_tx_busy, adapter_busy,
-        i2c_busy, temperature_busy, uart_tx_byte_done, tick_500us,
-        watchdog_timeout_event};
-endmodule

+ 0 - 24
src/legacy/top/prod2u_6400_identification_top.v

@@ -1,24 +0,0 @@
-`timescale 1ns/1ps
-
-module prod2u_6400_identification_top (
-    input wire sys_clk,
-    input wire host_rs232_rx,
-    output wire host_rs232_tx,
-    input wire bmc_rs232_rx,
-    output wire bmc_rs232_tx,
-    output wire [23:0] ptc_pwm_out,
-    output wire [3:0] front_fan_pwm_out,
-    output wire [3:0] rear_fan_pwm_out,
-    inout wire temp_scl,
-    inout wire temp_sda
-);
-    wire host_ttl_tx_unused;
-
-    prod2u_6400_v1_top #(.ENABLE_STIMULUS(1)) core (
-        .sys_clk(sys_clk), .host_rs232_rx(host_rs232_rx), .host_rs232_tx(host_rs232_tx),
-        .host_ttl_rx(1'b1), .host_ttl_tx(host_ttl_tx_unused),
-        .bmc_rs232_rx(bmc_rs232_rx), .bmc_rs232_tx(bmc_rs232_tx),
-        .ptc_pwm_out(ptc_pwm_out), .front_fan_pwm_out(front_fan_pwm_out),
-        .rear_fan_pwm_out(rear_fan_pwm_out), .temp_scl(temp_scl), .temp_sda(temp_sda)
-    );
-endmodule

+ 0 - 428
src/legacy/top/prod2u_p4_normal_v3_top.v

@@ -1,428 +0,0 @@
-`timescale 1ns/1ps
-`include "src/generated/prod2u_door_temp_params.vh"
-
-module prod2u_p4_normal_v3_top #(
-    parameter integer SHARED_TICK_CLOCK_HZ = `P4_CLOCK_HZ,
-    parameter integer MOTION_SERVICE_CLKS = `P4_MOTION_SERVICE_CLKS
-) (
-    input  wire       sys_clk,
-    input  wire       host_uart_rx,
-    output wire       host_uart_tx,
-    output wire [7:0] ptc_pwm_out,
-    output wire [3:0] fan_pwm_out,
-    output wire       motor_en_n,
-    output wire       x_step,
-    output wire       x_dir,
-    output wire       y_step,
-    output wire       y_dir,
-    output wire       z_step,
-    output wire       z_dir,
-    input  wire       x_limit_ls,
-    input  wire       x_limit_hs,
-    input  wire       y_limit_ls,
-    input  wire       y_limit_hs,
-    input  wire       z_limit_ls,
-    input  wire       z_limit_hs,
-    inout  wire       temp_scl,
-    inout  wire       temp_sda
-);
-    generate
-        if (`P4_AXIS_COUNT != 3) begin : gen_bad_axis
-            ERROR_production_requires_P4_AXIS_COUNT_3 bad_axis();
-        end
-    endgenerate
-
-    localparam integer AXIS_COUNT = `P4_AXIS_COUNT;
-    localparam [AXIS_COUNT-1:0] LIMIT_ACTIVE_HIGH = `P4_LIMIT_ACTIVE_HIGH_MASK;
-    localparam [AXIS_COUNT-1:0] DIR_CLOSE_LEVEL = `P4_DIR_CLOSE_LEVEL_MASK;
-    localparam [AXIS_COUNT-1:0] CLOSE_LIMIT_IS_LS = `P4_CLOSE_LIMIT_IS_LS_MASK;
-
-    wire sys_rst_n;
-    wire uart_rx_valid;
-    wire [7:0] uart_rx_data;
-    wire uart_framing_error;
-    wire frame_valid;
-    wire frame_ready;
-    wire frame_accept_enable;
-    wire host_frame_accept_enable;
-    wire [7:0] frame_type;
-    wire [7:0] frame_length;
-    wire [7:0] payload_read_addr;
-    wire [7:0] payload_read_data;
-    wire payload_wr_en;
-    wire [7:0] payload_wr_addr;
-    wire [7:0] payload_wr_data;
-    wire [3:0] target_rd_addr;
-    wire [7:0] target_rd_data;
-    wire target_wr_en;
-    wire [3:0] target_wr_addr;
-    wire [7:0] target_wr_data;
-    wire valid_set_all_commit;
-    wire motor_request_valid;
-    wire [7:0] door_percent_x;
-    wire [7:0] door_percent_y;
-    wire [7:0] door_percent_z;
-    wire startup_complete;
-    wire [AXIS_COUNT-1:0] engine_step;
-    wire [AXIS_COUNT-1:0] engine_dir;
-
-    (* async_reg = "true" *) reg x_limit_ls_sync0, x_limit_ls_sync1;
-    (* async_reg = "true" *) reg x_limit_hs_sync0, x_limit_hs_sync1;
-    (* async_reg = "true" *) reg y_limit_ls_sync0, y_limit_ls_sync1;
-    (* async_reg = "true" *) reg y_limit_hs_sync0, y_limit_hs_sync1;
-    (* async_reg = "true" *) reg z_limit_ls_sync0, z_limit_ls_sync1;
-    (* async_reg = "true" *) reg z_limit_hs_sync0, z_limit_hs_sync1;
-    wire [AXIS_COUNT-1:0] limit_ls_sync;
-    wire [AXIS_COUNT-1:0] limit_hs_sync;
-    wire [AXIS_COUNT-1:0] ls_reached;
-    wire [AXIS_COUNT-1:0] hs_reached;
-    wire [AXIS_COUNT-1:0] close_limit;
-    wire [AXIS_COUNT-1:0] open_limit;
-    wire [AXIS_COUNT-1:0] selected_limit;
-    wire [AXIS_COUNT-1:0] gated_step;
-    reg  [AXIS_COUNT-1:0] gated_step_prev;
-    wire [AXIS_COUNT-1:0] gated_step_rise;
-    reg        limit_sync_valid;
-    reg [1:0]  limit_sync_valid_cnt;
-
-    wire temperature_start;
-    wire temperature_done;
-    wire tx_start;
-    wire tx_done;
-    wire [7:0] tx_frame_type;
-    wire [7:0] tx_payload_length;
-    wire tx_payload_is_status;
-    wire status_capture;
-    wire adapter_busy;
-    wire [7:0] temperature_wr_data;
-    wire [4:0] temperature_wr_addr;
-    wire temperature_wr_en;
-    wire [7:0] temperature_rd_data;
-    wire [7:0] status_rd_data;
-    wire [7:0] frame_tx_payload_data;
-    wire frame_tx_busy;
-    wire frame_tx_byte_valid;
-    wire [7:0] frame_tx_byte_data;
-    wire frame_tx_byte_ready;
-    wire [7:0] frame_tx_payload_addr;
-    wire uart_tx_busy;
-    wire uart_tx_byte_done;
-    wire i2c_request_valid;
-    wire i2c_request_ready;
-    wire [6:0] i2c_device_addr;
-    wire [7:0] i2c_register_addr;
-    wire i2c_response_valid;
-    wire i2c_response_ready;
-    wire [15:0] i2c_response_data;
-    wire [3:0] i2c_response_error;
-    wire i2c_busy;
-    wire i2c_scl_drive_low;
-    wire i2c_sda_drive_low;
-    wire temperature_busy;
-    wire tick_500us;
-    wire watchdog_active;
-    wire watchdog_timeout_event;
-    wire [11:0] logical_pwm_on;
-    wire [2:0] calibrated_mask;
-    wire [2:0] fault_mask;
-    wire watchdog_feed;
-    wire frame_rx_crc_start_unused;
-    wire frame_rx_crc_data_valid_unused;
-    wire [7:0] frame_rx_crc_data_unused;
-    wire frame_tx_crc_start_unused;
-    wire frame_tx_crc_data_valid_unused;
-    wire [7:0] frame_tx_crc_data_unused;
-
-    assign temp_scl = i2c_scl_drive_low ? 1'b0 : 1'bz;
-    assign temp_sda = i2c_sda_drive_low ? 1'b0 : 1'bz;
-    assign motor_en_n = 1'b1;
-    assign ptc_pwm_out = logical_pwm_on[7:0];
-    assign fan_pwm_out = ~logical_pwm_on[11:8];
-    // Host-only accept (no startup_done AND-gate); command path gates GET_TEMP / motors.
-    assign frame_accept_enable = host_frame_accept_enable;
-    assign watchdog_feed = valid_set_all_commit & startup_complete;
-    assign frame_tx_payload_data = tx_payload_is_status ? status_rd_data : temperature_rd_data;
-    assign frame_tx_byte_ready = !uart_tx_busy;
-
-    assign limit_ls_sync = {z_limit_ls_sync1, y_limit_ls_sync1, x_limit_ls_sync1};
-    assign limit_hs_sync = {z_limit_hs_sync1, y_limit_hs_sync1, x_limit_hs_sync1};
-
-    genvar gi;
-    generate
-        for (gi = 0; gi < AXIS_COUNT; gi = gi + 1) begin : gen_limit_normalize
-            assign ls_reached[gi] =
-                LIMIT_ACTIVE_HIGH[gi] ? limit_ls_sync[gi] : ~limit_ls_sync[gi];
-            assign hs_reached[gi] =
-                LIMIT_ACTIVE_HIGH[gi] ? limit_hs_sync[gi] : ~limit_hs_sync[gi];
-            assign close_limit[gi] =
-                CLOSE_LIMIT_IS_LS[gi] ? ls_reached[gi] : hs_reached[gi];
-            assign open_limit[gi] =
-                CLOSE_LIMIT_IS_LS[gi] ? hs_reached[gi] : ls_reached[gi];
-            assign gated_step_rise[gi] = gated_step[gi] & ~gated_step_prev[gi];
-        end
-    endgenerate
-
-    prod2u_runtime_step_limit_gate #(.AXIS_COUNT(AXIS_COUNT)) u_step_limit_gate (
-        .clk(sys_clk),
-        .rst_n(sys_rst_n),
-        .engine_step(engine_step),
-        .engine_dir(engine_dir),
-        .close_limit(close_limit),
-        .open_limit(open_limit),
-        .selected_limit(selected_limit),
-        .gated_step(gated_step)
-    );
-
-    assign x_step = gated_step[0];
-    assign y_step = gated_step[1];
-    assign z_step = gated_step[2];
-    assign x_dir = engine_dir[0] ? DIR_CLOSE_LEVEL[0] : ~DIR_CLOSE_LEVEL[0];
-    assign y_dir = engine_dir[1] ? DIR_CLOSE_LEVEL[1] : ~DIR_CLOSE_LEVEL[1];
-    assign z_dir = engine_dir[2] ? DIR_CLOSE_LEVEL[2] : ~DIR_CLOSE_LEVEL[2];
-
-    always @(posedge sys_clk or negedge sys_rst_n) begin
-        if (!sys_rst_n) begin
-            x_limit_ls_sync0 <= ~LIMIT_ACTIVE_HIGH[0];
-            x_limit_ls_sync1 <= ~LIMIT_ACTIVE_HIGH[0];
-            x_limit_hs_sync0 <= ~LIMIT_ACTIVE_HIGH[0];
-            x_limit_hs_sync1 <= ~LIMIT_ACTIVE_HIGH[0];
-            y_limit_ls_sync0 <= ~LIMIT_ACTIVE_HIGH[1];
-            y_limit_ls_sync1 <= ~LIMIT_ACTIVE_HIGH[1];
-            y_limit_hs_sync0 <= ~LIMIT_ACTIVE_HIGH[1];
-            y_limit_hs_sync1 <= ~LIMIT_ACTIVE_HIGH[1];
-            z_limit_ls_sync0 <= ~LIMIT_ACTIVE_HIGH[2];
-            z_limit_ls_sync1 <= ~LIMIT_ACTIVE_HIGH[2];
-            z_limit_hs_sync0 <= ~LIMIT_ACTIVE_HIGH[2];
-            z_limit_hs_sync1 <= ~LIMIT_ACTIVE_HIGH[2];
-            limit_sync_valid <= 1'b0;
-            limit_sync_valid_cnt <= 2'd0;
-            gated_step_prev <= {AXIS_COUNT{1'b0}};
-        end else begin
-            x_limit_ls_sync0 <= x_limit_ls;
-            x_limit_ls_sync1 <= x_limit_ls_sync0;
-            x_limit_hs_sync0 <= x_limit_hs;
-            x_limit_hs_sync1 <= x_limit_hs_sync0;
-            y_limit_ls_sync0 <= y_limit_ls;
-            y_limit_ls_sync1 <= y_limit_ls_sync0;
-            y_limit_hs_sync0 <= y_limit_hs;
-            y_limit_hs_sync1 <= y_limit_hs_sync0;
-            z_limit_ls_sync0 <= z_limit_ls;
-            z_limit_ls_sync1 <= z_limit_ls_sync0;
-            z_limit_hs_sync0 <= z_limit_hs;
-            z_limit_hs_sync1 <= z_limit_hs_sync0;
-            gated_step_prev <= gated_step;
-            if (!limit_sync_valid) begin
-                if (limit_sync_valid_cnt < 2'd3) begin
-                    limit_sync_valid_cnt <= limit_sync_valid_cnt + 1'b1;
-                end else begin
-                    limit_sync_valid <= 1'b1;
-                end
-            end
-        end
-    end
-
-    prod2u_por #(.POR_CYCLES(1024)) u_por (
-        .sys_clk(sys_clk), .sys_rst_n(sys_rst_n)
-    );
-
-    shared_500us_tick #(
-        .CLOCK_HZ(SHARED_TICK_CLOCK_HZ), .TICK_US(`P4_WATCHDOG_TICK_US)
-    ) u_shared_tick (
-        .clk(sys_clk), .rst_n(sys_rst_n), .tick(tick_500us)
-    );
-
-    host_watchdog #(
-        .TIMEOUT_TICKS(`P4_WATCHDOG_TIMEOUT_TICKS)
-    ) u_watchdog (
-        .clk(sys_clk), .rst_n(sys_rst_n),
-        .enable(startup_complete),
-        .tick_500us(tick_500us),
-        .valid_set_all_commit(watchdog_feed),
-        .watchdog_active(watchdog_active), .timeout_event(watchdog_timeout_event)
-    );
-
-    uart_rx_byte #(.CLKS_PER_BIT(`P4_UART_CLKS_PER_BIT)) u_uart_rx (
-        .clk(sys_clk), .rst_n(sys_rst_n), .rx_i(host_uart_rx),
-        .byte_valid(uart_rx_valid), .byte_data(uart_rx_data),
-        .framing_error(uart_framing_error)
-    );
-
-    frame_rx #(.MAX_PAYLOAD(`P4_SET_ALL_PAYLOAD_LENGTH),
-        .INTER_BYTE_TIMEOUT_CYCLES(`P4_FRAME_INTER_BYTE_TIMEOUT_CYCLES)) u_frame_rx (
-        .clk(sys_clk), .rst_n(sys_rst_n),
-        .byte_valid(uart_rx_valid), .byte_data(uart_rx_data),
-        .accept_enable(frame_accept_enable), .frame_valid(frame_valid),
-        .frame_ready(frame_ready), .frame_type(frame_type), .frame_length(frame_length),
-        .payload_read_addr(payload_read_addr), .payload_read_data(payload_read_data),
-        .payload_wr_en(payload_wr_en), .payload_wr_addr(payload_wr_addr),
-        .payload_wr_data(payload_wr_data),
-        .crc_start_o(frame_rx_crc_start_unused),
-        .crc_data_valid_o(frame_rx_crc_data_valid_unused),
-        .crc_data_o(frame_rx_crc_data_unused),
-        .crc_busy_i(1'b0), .crc_data_done_i(1'b0), .crc_value_i(16'hFFFF)
-    );
-
-    payload_ram #(.DEPTH(`P4_SET_ALL_PAYLOAD_LENGTH), .ADDR_WIDTH(8), .REGISTERED_RAM(1)) u_payload_ram (
-        .clk(sys_clk), .wr_en(payload_wr_en), .wr_addr(payload_wr_addr),
-        .wr_data(payload_wr_data), .rd_addr(payload_read_addr),
-        .rd_data(payload_read_data)
-    );
-
-    project_adapter #(
-        .PTC_COUNT(`P4_PTC_COUNT),
-        .FAN_COUNT(`P4_FAN_COUNT),
-        .CHAMBER_PTC_COUNT(`P4_CHAMBER_PTC_COUNT),
-        .SET_ALL_PAYLOAD_LENGTH(`P4_SET_ALL_PAYLOAD_LENGTH),
-        .FAN_OFFSET(`P4_SET_ALL_FAN_OFFSET),
-        .CHAMBER_PTC_OFFSET(`P4_SET_ALL_CHAMBER_PTC_OFFSET),
-        .Z_DOOR_OFFSET(`P4_SET_ALL_Z_DOOR_OFFSET),
-        .EXHAUST_X_OFFSET(`P4_SET_ALL_EXHAUST_X_OFFSET),
-        .EXHAUST_Y_OFFSET(`P4_SET_ALL_EXHAUST_Y_OFFSET),
-        .CMD_GET_TEMPERATURE(`P4_CMD_GET_TEMPERATURE),
-        .CMD_GET_MOTOR_STATUS(`P4_CMD_GET_MOTOR_STATUS),
-        .RSP_TEMPERATURE(`P4_RSP_TEMPERATURE),
-        .RSP_MOTOR_STATUS(`P4_RSP_MOTOR_STATUS),
-        .TEMP_PAYLOAD_LENGTH(`P4_TEMPERATURE_COUNT),
-        .MOTOR_STATUS_PAYLOAD_LENGTH(`P4_MOTOR_STATUS_PAYLOAD_LENGTH),
-        .DOOR_PERCENT_MAX(`P4_DOOR_PERCENT_MAX)
-    ) u_project_adapter (
-        .clk(sys_clk), .rst_n(sys_rst_n), .frame_valid(frame_valid),
-        .frame_ready(frame_ready), .frame_accept_enable(host_frame_accept_enable),
-        .frame_type(frame_type), .frame_length(frame_length),
-        .payload_read_addr(payload_read_addr), .payload_read_data(payload_read_data),
-        .target_wr_en(target_wr_en), .target_wr_addr(target_wr_addr),
-        .target_wr_data(target_wr_data), .valid_set_all_commit(valid_set_all_commit),
-        .motor_request_valid(motor_request_valid),
-        .door_percent_x(door_percent_x),
-        .door_percent_y(door_percent_y),
-        .door_percent_z(door_percent_z),
-        .startup_complete(startup_complete),
-        .temperature_start(temperature_start), .temperature_done(temperature_done),
-        .status_capture(status_capture),
-        .tx_start(tx_start),
-        .tx_frame_type(tx_frame_type),
-        .tx_payload_length(tx_payload_length),
-        .tx_payload_is_status(tx_payload_is_status),
-        .tx_done(tx_done), .busy(adapter_busy)
-    );
-
-    door_motion_controller #(
-        .MAX_CAL_STEPS(`P4_CAL_MAX_STEPS),
-        .MIN_TRAVEL(`P4_CAL_MIN_TRAVEL),
-        .ENDPOINT_GUARD_EXTRA(`P4_ENDPOINT_GUARD_EXTRA),
-        .DIR_SETUP_TICKS(`P4_MOTOR_DIR_SETUP_TICKS),
-        .PERCENT_MAX(`P4_DOOR_PERCENT_MAX),
-        .STATUS_PAYLOAD_LENGTH(`P4_MOTOR_STATUS_PAYLOAD_LENGTH),
-        .MOTION_SERVICE_CLKS(MOTION_SERVICE_CLKS),
-        .PHASE_FACTOR(`P4_PHASE_FACTOR),
-        .CAL_RAMP_UNIT(`P4_CAL_RAMP_UNIT)
-    ) u_door_motion (
-        .clk(sys_clk), .rst_n(sys_rst_n),
-        .tick_500us(tick_500us),
-        .limit_sync_valid(limit_sync_valid),
-        .open_limit(open_limit),
-        .close_limit(close_limit),
-        .gated_step(gated_step),
-        .gated_step_rise(gated_step_rise),
-        .motor_request_valid(motor_request_valid),
-        .percent_x(door_percent_x),
-        .percent_y(door_percent_y),
-        .percent_z(door_percent_z),
-        .watchdog_stop(watchdog_active),
-        .watchdog_tripped(watchdog_active),
-        .step(engine_step),
-        .dir_close(engine_dir),
-        .startup_complete(startup_complete),
-        .calibrated_mask(calibrated_mask),
-        .fault_mask(fault_mask),
-        .status_capture(status_capture),
-        .status_rd_addr(frame_tx_payload_addr),
-        .status_rd_data(status_rd_data)
-    );
-
-    output_target_ram #(
-        .DEPTH(`P4_OUTPUT_CHANNEL_COUNT), .PTC_COUNT(`P4_PTC_COUNT),
-        .BOOT_PTC_TARGET(`P4_PTC_DEFAULT_TARGET),
-        .BOOT_FAN_TARGET(`P4_FAN_DEFAULT_TARGET),
-        .WATCHDOG_PTC_TARGET(`P4_WATCHDOG_PTC_TARGET),
-        .WATCHDOG_FAN_TARGET(`P4_WATCHDOG_FAN_TARGET)
-    ) u_target_ram (
-        .clk(sys_clk), .rst_n(sys_rst_n), .wr_en(target_wr_en),
-        .wr_addr(target_wr_addr), .wr_data(target_wr_data),
-        .commit(valid_set_all_commit), .watchdog_active(watchdog_active),
-        .rd_addr(target_rd_addr), .rd_data(target_rd_data)
-    );
-
-    pwm_scheduler #(
-        .CHANNEL_COUNT(`P4_OUTPUT_CHANNEL_COUNT), .PWM_BITS(`P4_PWM_PROTOCOL_WIDTH),
-        .PWM_DUTY_WIDTH(`P4_PWM_INTERNAL_WIDTH),
-        .PWM_PHASE_COUNT(`P4_PWM_PHASE_COUNT),
-        .PWM_SLOT_CLKS(`P4_PWM_SLOT_CLKS)
-    ) u_pwm_scheduler (
-        .clk(sys_clk), .rst_n(sys_rst_n), .target_rd_addr(target_rd_addr),
-        .target_rd_data(target_rd_data), .logical_pwm_on(logical_pwm_on)
-    );
-
-    temperature_reader #(
-        .TEMPERATURE_COUNT(`P4_TEMPERATURE_COUNT), .MAX_CELSIUS(`P4_TEMP_MAX_CELSIUS),
-        .DEVICE_ADDR_0(`P4_TEMP_DEVICE_ADDR_0), .DEVICE_ADDR_1(`P4_TEMP_DEVICE_ADDR_1),
-        .DEVICE_ADDR_2(`P4_TEMP_DEVICE_ADDR_2), .REGISTER_0(`P4_TEMP_REGISTER_0),
-        .REGISTER_1(`P4_TEMP_REGISTER_1), .REGISTER_2(`P4_TEMP_REGISTER_2),
-        .REGISTER_3(`P4_TEMP_REGISTER_3), .REGISTER_4(`P4_TEMP_REGISTER_4),
-        .REGISTER_5(`P4_TEMP_REGISTER_5), .REGISTER_6(`P4_TEMP_REGISTER_6),
-        .REGISTER_7(`P4_TEMP_REGISTER_7), .REGISTER_8(`P4_TEMP_REGISTER_8)
-    ) u_temperature_reader (
-        .clk(sys_clk), .rst_n(sys_rst_n), .start(temperature_start),
-        .busy(temperature_busy), .done(temperature_done),
-        .request_valid(i2c_request_valid), .request_ready(i2c_request_ready),
-        .device_addr(i2c_device_addr), .register_addr(i2c_register_addr),
-        .response_valid(i2c_response_valid), .response_ready(i2c_response_ready),
-        .response_data(i2c_response_data), .response_error(i2c_response_error),
-        .wr_en(temperature_wr_en), .wr_addr(temperature_wr_addr),
-        .wr_data(temperature_wr_data)
-    );
-
-    temperature_ram #(.DEPTH(`P4_TEMPERATURE_COUNT)) u_temperature_ram (
-        .clk(sys_clk), .wr_en(temperature_wr_en), .wr_addr(temperature_wr_addr),
-        .wr_data(temperature_wr_data), .rd_addr(frame_tx_payload_addr[4:0]),
-        .rd_data(temperature_rd_data)
-    );
-
-    i2c_word_reader #(.HALF_PERIOD_CLKS(125), .TIMEOUT_CLKS(25000)) u_temperature_i2c (
-        .clk(sys_clk), .rst_n(sys_rst_n), .request_valid(i2c_request_valid),
-        .request_ready(i2c_request_ready), .request_device_addr(i2c_device_addr),
-        .request_register(i2c_register_addr), .response_valid(i2c_response_valid),
-        .response_ready(i2c_response_ready), .response_data(i2c_response_data),
-        .response_error(i2c_response_error), .busy(i2c_busy), .scl_i(temp_scl),
-        .sda_i(temp_sda), .scl_drive_low(i2c_scl_drive_low),
-        .sda_drive_low(i2c_sda_drive_low)
-    );
-
-    frame_tx #(.PAYLOAD_IDX_BITS(5)) u_frame_tx (
-        .clk(sys_clk), .rst_n(sys_rst_n), .start(tx_start),
-        .frame_type(tx_frame_type),
-        .payload_length(tx_payload_length),
-        .busy(frame_tx_busy),
-        .byte_valid(frame_tx_byte_valid), .byte_data(frame_tx_byte_data),
-        .byte_ready(frame_tx_byte_ready), .payload_addr(frame_tx_payload_addr),
-        .payload_data(frame_tx_payload_data), .done(tx_done),
-        .crc_start_o(frame_tx_crc_start_unused),
-        .crc_data_valid_o(frame_tx_crc_data_valid_unused),
-        .crc_data_o(frame_tx_crc_data_unused),
-        .crc_busy_i(1'b0), .crc_data_done_i(1'b0), .crc_value_i(16'hFFFF)
-    );
-
-    uart_tx_byte #(.CLKS_PER_BIT(`P4_UART_CLKS_PER_BIT)) u_uart_tx (
-        .clk(sys_clk), .rst_n(sys_rst_n),
-        .byte_valid(frame_tx_byte_valid && frame_tx_byte_ready),
-        .byte_data(frame_tx_byte_data), .tx_o(host_uart_tx),
-        .busy(uart_tx_busy), .byte_done(uart_tx_byte_done)
-    );
-
-    wire unused_inputs = &{1'b0, uart_framing_error, frame_tx_busy, adapter_busy,
-        i2c_busy, temperature_busy, uart_tx_byte_done, tick_500us,
-        watchdog_timeout_event, calibrated_mask, fault_mask,
-        frame_rx_crc_start_unused, frame_rx_crc_data_valid_unused,
-        frame_rx_crc_data_unused, frame_tx_crc_start_unused,
-        frame_tx_crc_data_valid_unused, frame_tx_crc_data_unused};
-endmodule

+ 0 - 42
src/modules/prod2u_runtime_step_limit_gate.v

@@ -1,42 +0,0 @@
-`timescale 1ns/1ps
-
-// Production selected-limit hard gate: immediate truncate + hold until engine low.
-// Formal and sim must instantiate this module (not a hand-copied shell).
-module prod2u_runtime_step_limit_gate #(
-    parameter integer AXIS_COUNT = 3
-) (
-    input  wire                   clk,
-    input  wire                   rst_n,
-    input  wire [AXIS_COUNT-1:0] engine_step,
-    input  wire [AXIS_COUNT-1:0] engine_dir,
-    input  wire [AXIS_COUNT-1:0] close_limit,
-    input  wire [AXIS_COUNT-1:0] open_limit,
-    output wire [AXIS_COUNT-1:0] selected_limit,
-    output wire [AXIS_COUNT-1:0] gated_step
-);
-    reg [AXIS_COUNT-1:0] gate_hold;
-
-    genvar gi;
-    generate
-        for (gi = 0; gi < AXIS_COUNT; gi = gi + 1) begin : gen_gate
-            assign selected_limit[gi] =
-                engine_dir[gi] ? close_limit[gi] : open_limit[gi];
-            assign gated_step[gi] =
-                engine_step[gi] & ~selected_limit[gi] & ~gate_hold[gi];
-        end
-    endgenerate
-
-    integer ai;
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            gate_hold <= {AXIS_COUNT{1'b0}};
-        end else begin
-            for (ai = 0; ai < AXIS_COUNT; ai = ai + 1) begin
-                if (!engine_step[ai])
-                    gate_hold[ai] <= 1'b0;
-                else if (selected_limit[ai])
-                    gate_hold[ai] <= 1'b1;
-            end
-        end
-    end
-endmodule

+ 0 - 0
src/modules/shared_500us_tick.v


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików