forked from lowRISC/ibex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·59 lines (41 loc) · 1.42 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Run make command to compile C code
cd examples/sw/simple_system/nnom
make clean
cd ../../../../
make -C examples/sw/simple_system/nnom
# Check if compilation was successful
if [ $? -eq 0 ]; then
echo "Compilation successful."
# Execute the compiled program
./build/lowrisc_ibex_ibex_simple_system_0/sim-verilator/Vibex_simple_system --meminit=ram,./examples/sw/simple_system/nnom/nnom_.elf
# Check if program execution was successful
if [ $? -eq 0 ]; then
echo "Program execution successful."
# Run Python script
cd examples/sw/simple_system/nnom
riscv32-unknown-elf-objdump -d nnom_.elf > nnom_dump.txt
riscv32-unknown-elf-objdump -Dhx nnom_.elf > nnom_dump.dis
if [ $? -eq 0 ]; then
echo "obj dump successful."
python3 prof_script.py
if [ $? -eq 0 ]; then
echo "Function_table: success."
python3 final_prof.py
if [ $? -eq 0 ]; then
echo "yay! All successfully done"
else
echo "Error in Final_prof"
fi
else
echo "Error: function table"
fi
else
echo "Error: obj dump"
fi
else
echo "Error: Program execution failed."
fi
else
echo "Error: Compilation failed."
fi