tenstorrent / riscv_arch_tests

Self checking RISC-V directed tests
Apache License 2.0
85 stars 9 forks source link

Can't load elf file into spike #1

Closed msyksphinz-self closed 2 months ago

msyksphinz-self commented 1 year ago
spike --isa=rv64imc -l rv_i/rvi_compute_register_register/rvi_compute_register_register_1
Access exception occurred while loading payload rv_i/rvi_compute_register_register/rvi_compute_register_register_1:
Memory address 0x726000 is invalid

Following is the result of riscv64-unknown-elf-readelf -a

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0
  [ 1] .text             PROGBITS         0000000080000000  00001000
       00000000000002ec  0000000000000000  AX       0     0     64
  [ 2] .code             PROGBITS         0000000080002000  00002000
       0000000000000348  0000000000000000  WA       0     0     1
  [ 3] .os_data          PROGBITS         0000000000726f00  00000f00
       0000000000000030  0000000000000000  WA       0     0     1
  [ 4] .riscv.attributes RISCV_ATTRIBUTE  0000000000000000  00002348
       00000000000000b5  0000000000000000           0     0     1
  [ 5] .symtab           SYMTAB           0000000000000000  00002400
       00000000000010e0  0000000000000018           6   177     8
  [ 6] .strtab           STRTAB           0000000000000000  000034e0
       0000000000000c4b  0000000000000000           0     0     1
  [ 7] .shstrtab         STRTAB           0000000000000000  0000412b
       0000000000000042  0000000000000000           0     0     1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  D (mbind), p (processor specific)

There are no section groups in this file.

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  RISCV_ATTRIBUT 0x0000000000002348 0x0000000000000000 0x0000000000000000
                 0x00000000000000b5 0x0000000000000000  R      0x1
  LOAD           0x0000000000000000 0x0000000000726000 0x0000000000726000
                 0x0000000000000f30 0x0000000000000f30  RW     0x1000
  LOAD           0x0000000000001000 0x0000000080000000 0x0000000080000000
                 0x00000000000002ec 0x00000000000002ec  R E    0x1000
  LOAD           0x0000000000002000 0x0000000080002000 0x0000000080002000
                 0x0000000000000348 0x0000000000000348  RW     0x1000
darshakk commented 1 year ago

These tests access the addresses in the entire available virtual (up to 57-bits) and physical (52-bits) address space. We have tweaked memory ranges for Spike internally to allow these tests to run on modified Spike. We should open source the fork of Spike to provide you the changes.

darshakk commented 2 months ago

This has been fixed with the latest release and we have also switched to the public version of Spike. Please give it a try to the latest tests.

Please reopen if you see any fails.