Project

General

Profile

Actions

Bug #9336

closed

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

Added by Alexander Kamkin about 6 years ago. Updated about 6 years 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
Actions #1

Updated by Alexander Protsenko about 6 years 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

Actions #2

Updated by Alexander Protsenko about 6 years ago

+
j offset == jal x0, offset

Actions #3

Updated by Alexander Kamkin about 6 years 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]
Actions #4

Updated by Alexander Kamkin about 6 years 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);
      }
Actions #5

Updated by Alexander Kamkin about 6 years ago

  • Status changed from New to Resolved
Actions #6

Updated by Alexander Kamkin about 6 years ago

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

Also available in: Atom PDF