prod2u_mrdimm_params.vh 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. `ifndef PROD2U_MRDIMM_PARAMS_VH
  2. `define PROD2U_MRDIMM_PARAMS_VH
  3. // Generated mrdimm-chamber contract SHA-256: 9d7db823005669797e4ed7efd0abf66ae6ad8e40c71f5f1c2fb5690e4f05ff17
  4. `define MR_CLOCK_HZ 25000000
  5. `define MR_HOST_BAUD 921600
  6. `define MR_HOST_CLKS_PER_BIT 27
  7. `define MR_BMC_BAUD 115200
  8. `define MR_BMC_CLKS_PER_BIT 217
  9. // Unified 16-bit-length protocol
  10. `define MR_FRAME_LENGTH_WIDTH 16
  11. `define MR_CMD_SET_ALL 8'h01
  12. `define MR_CMD_GET_ALL 8'h02
  13. `define MR_CMD_MOTOR_QUEUE_WRITE 8'h03
  14. `define MR_CMD_MOTOR_CONTROL 8'h04
  15. `define MR_CMD_OUTPUT_KEEPALIVE 8'h05
  16. `define MR_CMD_EVENT_READ 8'h08
  17. `define MR_CMD_EVENT_CLEAR 8'h09
  18. `define MR_RSP_ACK_NACK 8'h80
  19. `define MR_RSP_ALL_STATUS_DATA 8'h81
  20. `define MR_RSP_EVENT_DATA 8'h83
  21. `define MR_STATUS_OK 8'd0
  22. `define MR_STATUS_UNSUPPORTED 8'd1
  23. `define MR_STATUS_BAD_LENGTH 8'd2
  24. `define MR_STATUS_BAD_VALUE 8'd3
  25. `define MR_STATUS_BUSY 8'd4
  26. `define MR_STATUS_QUEUE_FULL 8'd5
  27. `define MR_STATUS_BAD_AXIS 8'd6
  28. `define MR_STATUS_BAD_MODE 8'd7
  29. `define MR_STATUS_BAD_REGISTER 8'd8
  30. `define MR_STATUS_NOT_READY 8'd9
  31. `define MR_MAX_REQUEST_PAYLOAD 256
  32. `define MR_MAX_RESPONSE_PAYLOAD 1024
  33. `define MR_SET_ALL_PAYLOAD_LENGTH 11
  34. `define MR_QW_MIN_LENGTH 17
  35. `define MR_QW_MAX_LENGTH 129
  36. `define MR_CTL_LENGTH 8
  37. `define MR_EVENT_RECORD_BYTES 16
  38. `define MR_EVENT_RING_DEPTH 64
  39. `define MR_EVENT_MAX_READ 8
  40. // motors: X/Y 1000 Hz, Z 25 Hz; frequency = 500000 / half_period_us
  41. `define MR_AXIS_COUNT 3
  42. `define MR_XY_MIN_HALF_US 500
  43. `define MR_Z_MIN_HALF_US 20000
  44. `define MR_XY_DEFAULT_HALF_US 500
  45. `define MR_Z_DEFAULT_HALF_US 20000
  46. `define MR_DIR_SETUP_TICKS 1000
  47. `define MR_LIMIT_COUNT 6
  48. `define MR_LIMIT_ACTIVE_HIGH 1
  49. // thermal outputs and lease
  50. `define MR_FAN_COUNT 4
  51. `define MR_PTC_COUNT 4
  52. `define MR_PTC_PHYSICAL 8
  53. `define MR_PWM_HZ 500
  54. `define MR_PWM_PERIOD_CLKS 50000
  55. `define MR_PWM_CLKS_PER_PERCENT 500
  56. `define MR_LEASE_SECONDS 30
  57. `define MR_BOOT_FAN_PERCENT 20
  58. `define MR_BOOT_PTC_PERCENT 0
  59. `define MR_EXPIRE_FAN_PERCENT 20
  60. `define MR_EXPIRE_PTC_PERCENT 0
  61. `define MR_HOST_I2C_ADDRESS 7'h2A
  62. // ALL_STATUS_DATA layout (contract section 10 telemetry)
  63. // [0..7] fan0..3/ptc0..3 applied percent
  64. // [8..19] [20..31] [32..43] axis X/Y/Z 96-bit packed telemetry
  65. // [44..47] time_us low 32 [48] event record count [49] event overflow lsb
  66. `define MR_SNAPSHOT_LENGTH 50
  67. `define MR_SNAPSHOT_THERMAL_OFFSET 0
  68. `define MR_SNAPSHOT_AXIS_OFFSET 8
  69. `define MR_SNAPSHOT_AXIS_STRIDE 12
  70. `define MR_SNAPSHOT_TIME_OFFSET 44
  71. `define MR_SNAPSHOT_EVCOUNT_OFFSET 48
  72. `define MR_SNAPSHOT_EVOVERFLOW_OFFSET 49
  73. `endif