2023-08-11 20:59:39 -05:00
|
|
|
#!/usr/bin/env bash
|
2020-02-01 14:41:10 -06:00
|
|
|
|
2020-02-06 07:45:40 -06:00
|
|
|
set -e
|
|
|
|
|
2020-02-01 14:41:10 -06:00
|
|
|
mkdir -p temp
|
2020-02-02 09:18:34 -06:00
|
|
|
cp content1.dat temp/content2.dat
|
2020-02-01 14:41:10 -06:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
2020-02-02 09:18:34 -06:00
|
|
|
echo "Running from the parent directory with content1.dat"
|
2020-02-02 09:33:34 -06:00
|
|
|
../yosys -qp "read_verilog -defer memfile/memory.v; chparam -set MEMFILE \"content1.dat\" memory"
|
2020-02-02 09:18:34 -06:00
|
|
|
echo "Running from the parent directory with temp/content2.dat"
|
2020-02-02 09:33:34 -06:00
|
|
|
../yosys -qp "read_verilog -defer memfile/memory.v; chparam -set MEMFILE \"temp/content2.dat\" memory"
|
2020-02-02 09:18:34 -06:00
|
|
|
echo "Running from the parent directory with memfile/temp/content2.dat"
|
2020-02-02 09:33:34 -06:00
|
|
|
../yosys -qp "read_verilog -defer memfile/memory.v; chparam -set MEMFILE \"memfile/temp/content2.dat\" memory"
|
2020-02-01 14:41:10 -06:00
|
|
|
|
|
|
|
cd memfile
|
|
|
|
|
2020-02-02 09:18:34 -06:00
|
|
|
echo "Running from the same directory with content1.dat"
|
2020-02-02 09:33:34 -06:00
|
|
|
../../yosys -qp "read_verilog -defer memory.v; chparam -set MEMFILE \"content1.dat\" memory"
|
2020-02-02 09:18:34 -06:00
|
|
|
echo "Running from the same directory with temp/content2.dat"
|
2020-02-02 09:33:34 -06:00
|
|
|
../../yosys -qp "read_verilog -defer memory.v; chparam -set MEMFILE \"temp/content2.dat\" memory"
|
2020-02-01 14:41:10 -06:00
|
|
|
|
|
|
|
cd temp
|
|
|
|
|
2020-02-02 09:18:34 -06:00
|
|
|
echo "Running from a child directory with content1.dat"
|
2020-02-02 09:33:34 -06:00
|
|
|
../../../yosys -qp "read_verilog -defer ../memory.v; chparam -set MEMFILE \"content1.dat\" memory"
|
2020-02-02 09:18:34 -06:00
|
|
|
echo "Running from a child directory with temp/content2.dat"
|
2020-02-02 09:33:34 -06:00
|
|
|
../../../yosys -qp "read_verilog -defer ../memory.v; chparam -set MEMFILE \"temp/content2.dat\" memory"
|
2020-02-02 09:18:34 -06:00
|
|
|
echo "Running from a child directory with content2.dat"
|
2020-02-02 09:33:34 -06:00
|
|
|
../../../yosys -qp "read_verilog -defer ../memory.v; chparam -set MEMFILE \"temp/content2.dat\" memory"
|
2020-02-06 07:45:40 -06:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo "Checking a failure when zero length filename is provided"
|
|
|
|
if ../../yosys -qp "read_verilog memory.v"; then
|
|
|
|
echo "The execution should fail but it didn't happen, which is WRONG."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Execution failed, which is OK."
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Checking a failure when not existing filename is provided"
|
|
|
|
if ../../yosys -qp "read_verilog -defer memory.v; chparam -set MEMFILE \"content3.dat\" memory"; then
|
|
|
|
echo "The execution should fail but it didn't happen, which is WRONG."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Execution failed, which is OK."
|
|
|
|
fi
|