ThinkOpenly / sail

Sail architecture definition language
Other
10 stars 11 forks source link

Fix order of operands. #34

Closed Linda-Njau closed 1 month ago

Linda-Njau commented 3 months ago

This PR addresses the issue described in issue #26 by correcting the order of operands in the JSON output. Previously, operands were extracted from the function clause, but this change extracts them from the right-hand side of the assembly clause. Additionally, non-operand inputs are now filtered out.

To properly match operands to their respective types, the structure of operands stored in the Hashtbl operands has been updated. The previous structure was a simple list of names:

WXTYPE: funct6, vm, vs2, rs1, vd

The new structure stores a list of tuples, each containing a name and its type value:

WXTYPE: (vd, regidx), (vs2, regidx), (rs1, regidx), (vm, bits(1))

From the example above note:

  1. funct6, which is not an operand, is now correctly filtered out with this update.
  2. The change of operand order.
  3. The change of operand structure.
Linda-Njau commented 3 months ago

I have also renamed the function for more clarity.

Linda-Njau commented 2 months ago

@ThinkOpenly, I made the changes to address your comments.