name: "Hardmax One-Hot Classifier"
category: "AI/ML Accelerators"
complexity: "Medium"
description: >
  Implement a classification output layer for a neural network.
  
  The module receives 6 input logits (signed 8-bit integers) and must identify
  the class with the highest probability. The probability of class i is given by
  the Softmax function:
    P(y=i) = exp(x_i) / sum(exp(x_j) for all j)
  
  Your output should be a 6-bit one-hot vector where the bit corresponding to
  the class with the highest probability is set to 1, and all other bits are 0.
  
  If multiple inputs produce the same maximum probability, the class with the
  lowest index among them should be selected (e.g., if x0 and x2 are max, set bit 0).
  
  INPUT FORMAT: 6 x 8-bit signed integers (logits).
  OUTPUT FORMAT: 6-bit one-hot vector.
interface:
  module_name: "hardmax_onehot"
  clocked: false
  ports:
    - name: "x0"
      type: "input"
      width: "8"
      description: "Logit 0, signed 8-bit"
    - name: "x1"
      type: "input"
      width: "8"
      description: "Logit 1, signed 8-bit"
    - name: "x2"
      type: "input"
      width: "8"
      description: "Logit 2, signed 8-bit"
    - name: "x3"
      type: "input"
      width: "8"
      description: "Logit 3, signed 8-bit"
    - name: "x4"
      type: "input"
      width: "8"
      description: "Logit 4, signed 8-bit"
    - name: "x5"
      type: "input"
      width: "8"
      description: "Logit 5, signed 8-bit"
    - name: "y_onehot"
      type: "output"
      width: "6"
      description: "One-hot output vector (bit i set if x_i maximizes probability)"

target_platform:
  device_family: "AMD Xilinx Zynq-7000"

tasks:
  - name: "Efficient Softmax Inference"
    constraints:
      max_lut: 50
      max_ff: 0
      max_bram: 0
      max_dsp: 0
      min_frequency: 100
    objective:
      goal: "minimise"
      target: "LUT"
