physical-computation / sunflower-embedded-system-emulator

Sunflower Full-System Hardware Emulator and Physical System Simulator for Sensor-Driven Systems. Built-in architecture modeling of Hitachi SH (j-core), RISC-V, and more.
http://sflr.org
BSD 3-Clause "New" or "Revised" License
23 stars 215 forks source link

`dumppipe` segfaults for superH when SF_NUMA is 0 #187

Open btsouts opened 3 years ago

btsouts commented 3 years ago

Describe the bug dumppipe segfaults for superH when SF_NUMA is 0

To Reproduce Steps to reproduce the behavior:

  1. Set SF_NUMA to 0 in config.h.
  2. Re-compile sf.
  3. Run sf.
  4. Execute dumppipe command.

Expected behavior Initialized random number generator with seed 1012339143...

Sunflower 1.1 (build 08-19-2020-09:03:41-vt298@ip-172-31-19-5-Linux) Authored, 1999-2018: Phillip Stanley-Marbell phillip.stanleymarbell@gmail.com. 20018-onwards: See CONTRIBUTORS.TXT. This software is provided with ABSOLUTELY NO WARRANTY. Read LICENSE.txt

New node created with node ID 0

[ID=0 of 1][PC=0x8000000][3.3E+00V, 6.0E+01MHz] dumpregs R0 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R1 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R2 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R3 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R4 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R5 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R6 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R7 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R8 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R9 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R10 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R11 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R12 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R13 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R14 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] R15 0000 0000 0000 0000 0000 0000 0000 0000 [0x00000000] [ID=0 of 1][PC=0x8000000][3.3E+00V, 6.0E+01MHz] dumppipe

node ID=0, PC=0x8000000, ICLK=0, sleep?=0 Segmentation fault (core dumped)

Solution Guard
mprint(E, S, nodeinfo, "buslock=%d, buslocker=%d, EX touches mem = %d\n", S->superH->B->pbuslock, S->superH->B->pbuslocker, superHEXtouchesmem(S));

in sim/pipeline-hitachi-sh.c with if (SF_NUMA).