-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrun_25_Synthesis_Wokwi.sh
63 lines (50 loc) · 1.68 KB
/
run_25_Synthesis_Wokwi.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
60
61
#!/bin/bash
# Run Synthesis from VHDL to Discrete Logic
# Invokes GHDL, Yosys and ABC (via Yosys)
#
# --->>>> Requires name of HDL source file as argument <<<<---
# set HDLCODE = "counter.vhd" # Name of source file from "10_HDL"
if [ "$1" == "" ]; then
echo "Usage: run_20_Synthesis.sh design [technology] "
echo " 'design' is the ID of your Wokwi project."
echo " 'technology' selects technology (optional)"
echo ""
echo "Technologies:"
echo " RT Bipolar Resistor Transistor Logic (default)"
echo " RTPG Bipolar Resistor Transistor Logic with pass gates"
echo " nmos nmos transistor logic"
echo " amux analog multiplexer logic"
echo " 74LVC 74LVC single gate logic"
echo " YG YG strip logic"
echo " LTL LED Transistor Logic"
exit 1
else
FILE="$1"
fi
if [ "$2" == "" ]; then
APP="RT"
else
APP="$2"
fi
if [ "$APP" == "RT" ]; then
echo "Synthesizing to bipolar resistor transistor logic"
elif [ "$APP" == "RTPG" ]; then
echo "Synthesizing to bipolar resistor transistor/pass gate logic"
elif [ "$APP" == "nmos" ]; then
echo "Synthesizing to nmos transistor logic"
elif [ "$APP" == "amux" ]; then
echo "Synthesizing to analog multiplexer logic"
elif [ "$APP" == "74LVC" ]; then
echo "Synthesizing to single gate TTL logic (74LVC)"
elif [ "$APP" == "LTL" ]; then
echo "Synthesizing to LED²-Transistor-Logic"
else
echo "Unknown logic style :$APP"
exit 1
fi
cd Work
echo "Fetching verilog from Wokwi"
curl https://wokwi.com/api/projects/$FILE/verilog >design.v
yosys ../20_SYNTH/flow_v_discrete_$APP.ys >208_log_yosys.txt
grep -i 'Chip area' -A 4 -B 16 208_log_yosys.txt
cd ..