Project

General

Profile

Bug #9336

MicroTESK is not able to disassemble euclid binary (RISC-V)

Added by Alexander Kamkin about 2 months ago. Updated 22 days ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Start date:
10/18/2018
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:
2.4.44

Description

Analyzing file: ./euclid_0000.bin...
Error: Unrecognized instruction encoding: 32'b00000001100000000000000001101111
Error: Failed to disassemble ./euclid_0000.bin
Created file: ./euclid_0000.bin.smt2

History

#1 Updated by Alexander Protsenko about 2 months ago

00000001100000000000000001101111
is
imm[20|10:1|11|19:12] rd 1101111 JAL

(page 104 of https://forge.ispras.ru/projects/microtesk-riscv/repository/revisions/master/entry/microtesk-riscv/docs/riscv-spec-v2.2.pdf)

00000001100000000000 is a 20-bit immediate;
00000 is GPR [0];
1101111 is JAL opcode.

20-bit immediate (normal order of bits): 00000000000000001100 = 0x0000c = 12

#2 Updated by Alexander Protsenko about 2 months ago

+
j offset == jal x0, offset

#3 Updated by Alexander Kamkin about 2 months ago

Generation of the instruction decoder fails:

Warning: Failed to construct decoder for jal. Unrecognized field: jump_imm20<19..19>
Warning: Failed to construct decoder for jal. Unrecognized field: jump_imm20<9..0>
Warning: Failed to construct decoder for jal. Unrecognized field: jump_imm20<10..10>
Warning: Failed to construct decoder for jal. Unrecognized field: jump_imm20<18..11>
Warning: Failed to construct decoder for jal. Undecoded arguments: [imm]

#4 Updated by Alexander Kamkin about 2 months ago

StbDecoder (line 169):

      if (ExprUtils.isValue(field)) {
        // Constant (treated as an OPC).
        buildOpcCheck(stConstructor, group, field);
      } else if (isImmediateArgument(field)) {
        // Image of an immediate value.
        buildImmediateArgument(stConstructor, group, field);
      } else if (isImmediateArgumentField(field)) {
        // Image of an immediate value's part.
        buildImmediateArgumentField(stConstructor, group, field);
      } else if (isArgumentImage(field)) {
        // Image of an addressing mode / operation (argument).
        buildArgumentImage(stConstructor, group, field);
      } else if (isInstanceImage(field)) {
        // Image of an addressing mode / operation (instance).
        buildInstanceImage(st, stConstructor, group, field);
      } else {
        reportError("Unrecognized field: %s", field);
      }

#5 Updated by Alexander Kamkin 29 days ago

  • Status changed from New to Resolved

#6 Updated by Alexander Kamkin 22 days ago

  • Published in build set to 2.4.44
  • Status changed from Resolved to Closed

Also available in: Atom PDF