-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_all.bat
More file actions
81 lines (70 loc) · 1.62 KB
/
run_all.bat
File metadata and controls
81 lines (70 loc) · 1.62 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
@echo off
echo ========================================
echo Morse Code Encoder/Decoder - Full Test
echo ========================================
echo.
REM Create directories
mkdir shared 2>nul
mkdir arm 2>nul
REM Check if main.c exists in arm folder
if not exist arm\main.c (
echo ERROR: main.c not found in arm folder!
echo Please make sure main.c is in the arm directory
pause
exit /b 1
)
REM Compile ARM code
echo Compiling ARM C code...
cd arm
gcc main.c -o morse_arm.exe
if errorlevel 1 (
echo Compilation failed!
cd ..
pause
exit /b 1
)
cd ..
echo Compilation successful!
echo.
REM Copy ARM binary to root and arm folder
copy arm\morse_arm.exe . >nul
copy arm\morse_arm.exe arm\ >nul
REM Create test input
echo SOS > shared\input.txt
echo Input text: SOS
echo.
REM Run ARM encoder
echo Running ARM Encoder...
morse_arm.exe --encode
echo.
REM Display timing output
echo Morse Timing Output:
type shared\morse_timing.txt
echo.
REM Run Verilog simulation
echo Running Verilog Simulation...
cd verilog
if exist testbench.v (
iverilog -o morse_sim testbench.v morse_core.v 2>nul
if exist morse_sim (
vvp morse_sim
) else (
echo Verilog compilation failed - skipping simulation
)
) else (
echo testbench.v not found in verilog folder
)
cd ..
echo.
REM Run ARM decoder on the timing file
echo Running ARM Decoder...
copy shared\morse_timing.txt shared\morse_wave_decoded.txt >nul
morse_arm.exe --decode
echo.
REM Display results
echo ========================================
echo FINAL RESULT:
type shared\decoded.txt
echo.
echo ========================================
pause