2
votes

When I'm trying to run riscv emulator asm tests I faced with below error:

./emulator-DefaultCPPConfig +dramsim +max-cycles=100000000 +verbose +loadmem=output/rv64ui-p-amoand_d.hex none 2> output/rv64ui-p-amoand_d.out && [ $PIPESTATUS -eq 0 ]
/bin/sh: 1: [: -eq: unexpected operator
make: *** [output/rv64ui-p-amoand_d.out] Error 2

I followed your instruction in your git. It can build emulator without any error, but problem happens when it's trying to run tests.

I added bash behind of the command in the makefile and the first error solved but when I did that I got a new error:

bash ./emulator-DefaultCPPConfig +dramsim +max-cycles=100000000 +verbose +loadmem=output/rv64ui-p-amoswap_d.hex none 2> output/rv64ui-p-amoswap_d.out && [ $PIPESTATUS -eq 0 ]
make: *** [output/rv64ui-p-amoswap_d.out] Error 126
1
What's in the output/rv64ui-p-amoswap_d.out file?Chris
I ran the test make run-asm-tests on another system, since I don't have access to that system but still I got the error but this time for: output/rv64ui-p-add.out . in this file there's just configuration of registers.Moriss
What is [ $PIPESTATUS -eq 0 ] command?Moriss
PIPESTATUS is a bash-ism that checks if the first command succeeded.Chris

1 Answers

1
votes

The problem is from Shell variable, I just needed to add following line to Makefile:

SHELL=/bin/bash

It would solve the problem.