-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun_fitter.sh
executable file
·119 lines (99 loc) · 2.34 KB
/
run_fitter.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash -e
export ROOT=$(dirname $0)
export WINEPREFIX=$HOME/.wine_atf
export FITTERDIR=$(winepath -w ${ROOT}/vendor)
# Process command line args
DEVICE=ATF1508AS
PACKAGE=PLCC84
SPEED=15
usage() {
echo "Usage: $0 [-h] [-d <device>] [-p <package>] [-s <speed>] <name> [ fitter options ]" 1>&2
echo 1>&2
echo "Defaults:" 1>&2
echo " <device> = ${DEVICE}" 1>&2
echo " <package> = ${PACKAGE}" 1>&2
echo " <speed> = ${SPEED}" 1>&2
echo 1>&2
echo "additional options are passed through to the fitter"
exit 1;
}
while getopts ":hd:p:s:" o; do
case "${o}" in
h)
usage
;;
d)
DEVICE=${OPTARG}
;;
p)
PACKAGE=${OPTARG}
;;
s)
SPEED=${OPTARG}
;;
esac
done
shift $((OPTIND-1))
NAME=$1; shift
# Additional fitter options passed through
OPTS=$*
echo Name = ${NAME}
echo Device = ${DEVICE}
echo Package = ${PACKAGE}
echo Speed = ${SPEED}
echo Options = ${OPTS}
## Atmel foldback = Altera shareable expander
## Atmel cascade = Altera parallel expander
## Fitter Defaults
# Device_name = PQFP100
# Tech_name = ATF1508AS
# Package_type = PQFP
# Preassignment = try
# Security_mode = OFF
# Pin-Keeper = OFF
# supporter = ABEL
# optimize = ON
# Xor_synthesis = OFF
# Foldback_logic = OFF
# Cascade_logic = OFF
# Output_fast = ON
# SSTL_input = off
# Power down pin 1 = OFF
# Power down pin 2 = OFF
# power_reset = OFF
# JTAG = ON
# TDI pullup = OFF
# TMS pullup = OFF
# MC_power = OFF
# Open_collector = OFF
# ITD0 = ON
# ITD1 = ON
# ITD2 = ON
# Fast_inlatch = off
# Latch_synthesis = off
# Push_gate = on
# Verilog_sim = off
# VHDL_sim = off
# Out_Edif = off
# Logic Doubling = off
FITTER=fit${DEVICE//[!0-9]/}.exe
grep '//PIN:' ${NAME}.v | cut -d' ' -f2- > ${NAME}.pin
rm -f ${NAME}.fit
wine ${FITTERDIR}\\${FITTER} \
-i ${NAME}.edif \
-ifmt edif \
-o ${NAME}.jed \
-lib ${FITTERDIR}\\aprim.lib \
-tech ${DEVICE} \
-device ${PACKAGE} \
-tpd ${SPEED} \
${OPTS}
grep "^ " ${NAME}.fit
echo
echo "Logic Array Block Macro Cells I/O Pins Foldbacks TotalPT FanIN Cascades"
grep "^[A-H]:" ${NAME}.fit
echo
grep "^Total" ${NAME}.fit | sed "s/input pins \t/input pins/" | sed "s/Pts \t/Pts/"
echo
grep "^\$Device" ${NAME}.fit
echo