Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make instr_dict.yaml more detailed #231

Open
Vinayakamk opened this issue Feb 21, 2024 · 1 comment
Open

Make instr_dict.yaml more detailed #231

Vinayakamk opened this issue Feb 21, 2024 · 1 comment

Comments

@Vinayakamk
Copy link

consider this instr_dict.yaml snippet of making extention rv*_c
it has this
c_sw:
encoding: '----------------110-----------00'
extension:

  • rv_c
    mask: '0xe003'
    match: '0xc000'
    variable_fields:
  • rs1_p
  • rs2_p
  • c_uimm7lo
  • c_uimm7hi

i wish it would be more detailed and clear if the variable fields are bifurcated into immediate(or args ) and register fields like

args_field:

  • c_uimm7lo

  • c_uimm7hi
    register_field:

    • rs1_p
    • rs2_p

    this will be helpfull to analyse and know registers of the instructions of such type like
    "rv.zcmp":
    "cm.mva01s c_sreg1 c_sreg2 1..0=2 15..13=5 12..10=3 6..5=3",
    "cm.mvsa01 c_sreg1 c_sreg2 1..0=2 15..13=5 12..10=3 6..5=1",
    "cm.popret c_rlist c_spimm 1..0=2 15..13=5 12..8=0x1E",
    "cm.pop c_rlist c_spimm 1..0=2 15..13=5 12..8=0x1A",
    "cm.push c_rlist c_spimm 1..0=2 15..13=5 12..8=0x18",
    "cm.popretz c_rlist c_spimm 1..0=2 15..13=5 12..8=0x1C"

    since arg_lut.csv contains both register and imm fields,it is not clear to know what are registers and imm
    
    if there is the way to know it ,kindly let me know!
    thanks
    
@keys-i
Copy link

keys-i commented Aug 11, 2024

Thank you for your suggestion! Separating the variable fields into args_field (for immediates) and register_field is a great idea. It would make the instr_dict.yaml more readable and easier to analyze, especially for complex instructions like those in the "rv.zcmp" extension.

Currently, arg_lut.csv includes both registers and immediate fields, which can be confusing. Your proposed structure would clarify this by clearly distinguishing between the two. Here's an example:

c_sw:
  encoding: '----------------110-----------00'
  extension: rv_c
  mask: '0xe003'
  match: '0xc000'
  args_field:
    - c_uimm7lo
    - c_uimm7hi
  register_field:
    - rs1_p
    - rs2_p

This adjustment would improve clarity and usability. If there’s an existing method to differentiate these fields, please share, but I think this change would be a helpful improvement. Thanks again for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants