-
Notifications
You must be signed in to change notification settings - Fork 1
/
doc_begcd.sh
87 lines (73 loc) · 2.08 KB
/
doc_begcd.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
source ./doc_functions.sh
begcd_cond () {
local i=$1
if [[ "$i" == simu.v ]] ; then
return 1
else
return 0
fi
}
print_function_begcd () {
echo "<li>"$2
echo "<ul>"
echo "<li>"
echo "<ul class=\"simu\">"
for i in *.v; do
if [[ "$i" == *"$3"*simu* ]]; then
echo "<li>"
print_filename $dir $i
echo "</li>"
fi
done
echo "</ul>"
echo "</li>"
echo "<li>"
echo "<ul class=\"misc\">"
for i in *.v; do
if [[ "$i" == *"$3"*safe_termination* ]]; then
echo "<li>"
print_filename $dir $i
echo "</li>"
fi
done
echo "</ul>"
echo "</li>"
echo "</ul>"
echo "</li>"
}
echo "<title>TITLE</title>"
echo "</head>"
echo "<body>"
dir="begcd"
cd $dir
echo "<dt class=\"dt_main\"><span class=\"bfont\">"$dir/"</span>: "
cat README.doc
echo "</dt>"
echo "<p class=\"sublib\">Simulation between assembly programs and pseudo-code:</p>"
for i in *.v; do
begcd_cond $i
if [ $? -eq 1 ]; then
print_filename $dir $i
fi
done
echo "<p class=\"sublib\">Simulation for arithmetic functions: <span class=\"simu\">simulation</span> <span class=\"misc\">other properties</span></p>"
echo "<div id=\"functions\">"
echo "<ul class=\"crypto_list\">"
print_function_begcd $dir 'Initialization to 0 →' 'multi_zero_'
print_function_begcd $dir 'Initialization to 1 →' 'multi_one_'
print_function_begcd $dir 'Comparison (<, >, =) →' 'multi_lt'
print_function_begcd $dir 'Sign testing →' 'pick_sign'
print_function_begcd $dir 'Array copy →' 'copy_s_'
print_function_begcd $dir 'Signed addition →' 'multi_add_s_'
print_function_begcd $dir 'Signed subtractions →' 'multi_sub_s'
print_function_begcd $dir 'Doubling →' 'multi_double_u'
print_function_begcd $dir 'Halving →' 'multi_halve_'
print_function_begcd $dir 'Parity check →' 'multi_is_even_'
echo "</ul>"
echo "</div>"
echo "<p class=\"sublib\">Application to the binary extended gcd algorithm algorithm:</p>"
for i in *.v; do
if [[ "$i" == begcd*.v ]]; then
print_filename $dir $i
fi
done