RRZE-HPC / OSACA

Open Source Architecture Code Analyzer
GNU Affero General Public License v3.0
296 stars 18 forks source link

Benchmark fails on ICL #66

Closed andreas-abel closed 3 years ago

andreas-abel commented 3 years ago

On a number of benchmarks, OSACA fails on ICL with KeyError: 'imd'. With other target architectures, the error does not occur.

Example: echo 'cmpb $0x0,0x42(%rsi)' | osaca --arch ICL -

Output:

Traceback (most recent call last):
  File "/usr/local/bin/osaca", line 11, in <module>
    load_entry_point('osaca==0.3.14', 'console_scripts', 'osaca')()
  File "/usr/local/lib/python3.6/dist-packages/osaca/osaca.py", line 388, in main
    run(args, output_file=args.out)
  File "/usr/local/lib/python3.6/dist-packages/osaca/osaca.py", line 340, in run
    inspect(args, output_file=output_file)
  File "/usr/local/lib/python3.6/dist-packages/osaca/osaca.py", line 294, in inspect
    semantics.add_semantics(kernel)
  File "/usr/local/lib/python3.6/dist-packages/osaca/semantics/arch_semantics.py", line 31, in add_semantics
    self.assign_tp_lt(instruction_form)
  File "/usr/local/lib/python3.6/dist-packages/osaca/semantics/arch_semantics.py", line 176, in assign_tp_lt
    instruction_form['instruction'][:-1], instruction_form['operands']
  File "/usr/local/lib/python3.6/dist-packages/osaca/semantics/hw_model.py", line 113, in get_instruction
    for instruction_form in name_matched_iforms if self._match_operands(
  File "/usr/local/lib/python3.6/dist-packages/osaca/semantics/hw_model.py", line 115, in <genexpr>
    operands))
  File "/usr/local/lib/python3.6/dist-packages/osaca/semantics/hw_model.py", line 466, in _match_operands
    operands_ok = operands_ok and self._check_operands(i_operand, operand)
  File "/usr/local/lib/python3.6/dist-packages/osaca/semantics/hw_model.py", line 487, in _check_operands
    return self._check_x86_operands(i_operand, operand)
  File "/usr/local/lib/python3.6/dist-packages/osaca/semantics/hw_model.py", line 541, in _check_x86_operands
    return i_operand['class'] == 'immediate' and i_operand['imd'] == 'int'
  File "/home/andreas/.local/lib/python3.6/site-packages/ruamel/yaml/comments.py", line 753, in __getitem__
    return ordereddict.__getitem__(self, key)
KeyError: 'imd'
cod3monk commented 3 years ago

There was a typo in icl.yml. Should be working with the latest commit.

Thanks for reporting!