title: RISC-V 32b Simulation with Spike
body: <p>Has anyone used spike/pk in 32-bit mode?</p>
  
  <pre><code>$ riscv32-unknown-elf-gcc -g -m32 -march=RV32IM -DRISCV test.c test
  $ spike --isa=RV32 pk test
  assertion failed @ 0x000052bc: ntohl(hdr-&gt;magic) == FDT_MAGIC
  </code></pre>
  
  <p>The initial build.sh install didn't provide a 32b version of pk, so I used riscv32-unknown-</p>
  
  <p>elf-gcc to cross-compile pk for the 32b RISC-V target processor as follows:</p>
  
  <pre><code>$ ../configure --prefix=$RISCV/riscv32-unknown-elf --host=riscv32-unknown-elf
  $ make XLEN=32
  $ make install
  </code></pre>
  
  <p>Any thoughts?</p>