OpenCores
URL https://opencores.org/ocsvn/mips_enhanced/mips_enhanced/trunk

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [designs/] [leon3-digilent-xup/] [main.tk] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
set menus_per_column 4
2
set total_menus 19
3
 
4
proc toplevel_menu {num} {
5
        if {$num == 4} then {return 3}
6
        if {$num == 5} then {return 3}
7
        if {$num == 6} then {return 3}
8
        if {$num == 7} then {return 3}
9
        if {$num == 8} then {return 3}
10
        if {$num == 9} then {return 3}
11
        if {$num == 10} then {return 3}
12
        if {$num == 14} then {return 13}
13
        if {$num == 15} then {return 13}
14
        if {$num == 16} then {return 13}
15
        if {$num == 17} then {return 13}
16
        if {$num == 18} then {return 13}
17
        return $num
18
}
19
 
20
mainmenu_name "LEON3MP Design Configuration"
21
menu_option menu1 1 "Synthesis      "
22
proc menu1 {w title} {
23
        set oldFocus [focus]
24
        catch {destroy $w; unregister_active 1}
25
        toplevel $w -class Dialog
26
        wm withdraw $w
27
        global active_menus
28
        set active_menus [lsort -integer [linsert $active_menus end 1]]
29
        message $w.m -width 400 -aspect 300 -text \
30
                "Synthesis      "  -relief raised
31
        pack $w.m -pady 10 -side top -padx 10
32
        wm title $w "Synthesis      "
33
 
34
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 1; break"
35
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 1; menu2 .menu2 \"$title\""
36
        frame $w.f
37
        button $w.f.back -text "Main Menu" \
38
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 1"
39
        button $w.f.next -text "Next" -underline 0\
40
                -width 15 -command $nextscript
41
        bind all  $nextscript
42
        button $w.f.prev -text "Prev" -underline 0\
43
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 1; menu0 .menu0 \"$title\""
44
        $w.f.prev configure -state disabled
45
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
46
        pack $w.f -pady 10 -side bottom -anchor w -fill x
47
        frame $w.topline -relief ridge -borderwidth 2 -height 2
48
        pack $w.topline -side top -fill x
49
 
50
        frame $w.botline -relief ridge -borderwidth 2 -height 2
51
        pack $w.botline -side bottom -fill x
52
 
53
        frame $w.config
54
        pack $w.config -fill y -expand on
55
 
56
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
57
        pack $w.config.vscroll -side right -fill y
58
 
59
        canvas $w.config.canvas -height 1\
60
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
61
                -width [expr [winfo screenwidth .] * 1 / 2]
62
        frame $w.config.f
63
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
64
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
65
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
66
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
67
        bind $w  "$w.config.canvas yview moveto 0;break;"
68
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
69
        pack $w.config.canvas -side right -fill y
70
 
71
 
72
        global tmpvar_0
73
        minimenu $w.config.f 1 0 "Target technology                           " tmpvar_0 CONFIG_SYN_INFERRED
74
        menu $w.config.f.x0.x.menu -tearoffcommand "menutitle \"Target technology                           \""
75
        $w.config.f.x0.x.menu add radiobutton -label "Inferred" -variable tmpvar_0 -value "Inferred" -command "update_active"
76
        $w.config.f.x0.x.menu add radiobutton -label "Altera-Stratix" -variable tmpvar_0 -value "Altera-Stratix" -command "update_active"
77
        $w.config.f.x0.x.menu add radiobutton -label "Altera-StratixII" -variable tmpvar_0 -value "Altera-StratixII" -command "update_active"
78
        $w.config.f.x0.x.menu add radiobutton -label "Altera-StratixIII" -variable tmpvar_0 -value "Altera-StratixIII" -command "update_active"
79
        $w.config.f.x0.x.menu add radiobutton -label "Altera-CycloneIII" -variable tmpvar_0 -value "Altera-CycloneIII" -command "update_active"
80
        $w.config.f.x0.x.menu add radiobutton -label "Altera-Others" -variable tmpvar_0 -value "Altera-Others" -command "update_active"
81
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Axcelerator" -variable tmpvar_0 -value "Actel-Axcelerator" -command "update_active"
82
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Proasic" -variable tmpvar_0 -value "Actel-Proasic" -command "update_active"
83
        $w.config.f.x0.x.menu add radiobutton -label "Actel-ProasicPlus" -variable tmpvar_0 -value "Actel-ProasicPlus" -command "update_active"
84
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Proasic3" -variable tmpvar_0 -value "Actel-Proasic3" -command "update_active"
85
        $w.config.f.x0.x.menu add radiobutton -label "Aeroflex-UT025CRH" -variable tmpvar_0 -value "Aeroflex-UT025CRH" -command "update_active"
86
        $w.config.f.x0.x.menu add radiobutton -label "Atmel-ATC18" -variable tmpvar_0 -value "Atmel-ATC18" -command "update_active"
87
        $w.config.f.x0.x.menu add radiobutton -label "Atmel-ATC18RHA" -variable tmpvar_0 -value "Atmel-ATC18RHA" -command "update_active"
88
        $w.config.f.x0.x.menu add radiobutton -label "Custom1" -variable tmpvar_0 -value "Custom1" -command "update_active"
89
        $w.config.f.x0.x.menu add radiobutton -label "eASIC90" -variable tmpvar_0 -value "eASIC90" -command "update_active"
90
        $w.config.f.x0.x.menu add radiobutton -label "IHP25" -variable tmpvar_0 -value "IHP25" -command "update_active"
91
        $w.config.f.x0.x.menu add radiobutton -label "IHP25RH" -variable tmpvar_0 -value "IHP25RH" -command "update_active"
92
        $w.config.f.x0.x.menu add radiobutton -label "Lattice-EC/ECP/XP" -variable tmpvar_0 -value "Lattice-EC/ECP/XP" -command "update_active"
93
        $w.config.f.x0.x.menu add radiobutton -label "Quicklogic-Eclipse" -variable tmpvar_0 -value "Quicklogic-Eclipse" -command "update_active"
94
        $w.config.f.x0.x.menu add radiobutton -label "Peregrine" -variable tmpvar_0 -value "Peregrine" -command "update_active"
95
        $w.config.f.x0.x.menu add radiobutton -label "RH-LIB18T" -variable tmpvar_0 -value "RH-LIB18T" -command "update_active"
96
        $w.config.f.x0.x.menu add radiobutton -label "RH-UMC" -variable tmpvar_0 -value "RH-UMC" -command "update_active"
97
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan2" -variable tmpvar_0 -value "Xilinx-Spartan2" -command "update_active"
98
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan3" -variable tmpvar_0 -value "Xilinx-Spartan3" -command "update_active"
99
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan3E" -variable tmpvar_0 -value "Xilinx-Spartan3E" -command "update_active"
100
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex" -variable tmpvar_0 -value "Xilinx-Virtex" -command "update_active"
101
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-VirtexE" -variable tmpvar_0 -value "Xilinx-VirtexE" -command "update_active"
102
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex2" -variable tmpvar_0 -value "Xilinx-Virtex2" -command "update_active"
103
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex4" -variable tmpvar_0 -value "Xilinx-Virtex4" -command "update_active"
104
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex5" -variable tmpvar_0 -value "Xilinx-Virtex5" -command "update_active"
105
        $w.config.f.x0.x.menu add radiobutton -label "UMC18" -variable tmpvar_0 -value "UMC18" -command "update_active"
106
        $w.config.f.x0.x.menu add radiobutton -label "TSMC90" -variable tmpvar_0 -value "TSMC90" -command "update_active"
107
        menusplit $w $w.config.f.x0.x.menu 32
108
        global tmpvar_1
109
        minimenu $w.config.f 1 1 "Memory Library                           " tmpvar_1 CONFIG_MEM_INFERRED
110
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"Memory Library                           \""
111
        $w.config.f.x1.x.menu add radiobutton -label "Inferred" -variable tmpvar_1 -value "Inferred" -command "update_active"
112
        $w.config.f.x1.x.menu add radiobutton -label "UMC18" -variable tmpvar_1 -value "UMC18" -command "update_active"
113
        $w.config.f.x1.x.menu add radiobutton -label "RH-UMC" -variable tmpvar_1 -value "RH-UMC" -command "update_active"
114
        $w.config.f.x1.x.menu add radiobutton -label "Artisan" -variable tmpvar_1 -value "Artisan" -command "update_active"
115
        $w.config.f.x1.x.menu add radiobutton -label "Custom1" -variable tmpvar_1 -value "Custom1" -command "update_active"
116
        $w.config.f.x1.x.menu add radiobutton -label "Virage" -variable tmpvar_1 -value "Virage" -command "update_active"
117
        $w.config.f.x1.x.menu add radiobutton -label "Virage-TSMC90" -variable tmpvar_1 -value "Virage-TSMC90" -command "update_active"
118
        menusplit $w $w.config.f.x1.x.menu 7
119
        bool $w.config.f 1 2 "Infer RAM" CONFIG_SYN_INFER_RAM
120
        bool $w.config.f 1 3 "Infer pads" CONFIG_SYN_INFER_PADS
121
        bool $w.config.f 1 4 "Disable asynchronous reset" CONFIG_SYN_NO_ASYNC
122
        bool $w.config.f 1 5 "Enable scan support       " CONFIG_SYN_SCAN
123
 
124
 
125
 
126
        focus $w
127
        update_active
128
        global winx; global winy
129
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
130
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
131
        update idletasks
132
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
133
 
134
        $w.config.canvas configure \
135
                -width [expr [winfo reqwidth $w.config.f] + 1]\
136
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
137
                         [expr [winfo reqheight $w.config.f] + 1]"
138
 
139
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
140
        set scry [expr [winfo screenh $w] / 2]
141
        set maxy [expr [winfo screenh $w] * 3 / 4]
142
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
143
        if [expr $winy + $canvtotal < $maxy] {
144
                $w.config.canvas configure -height $canvtotal
145
        } else {
146
                $w.config.canvas configure -height [expr $scry - $winy]
147
                }
148
        }
149
        update idletasks
150
        if {[winfo exists $w]} then {
151
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
152
        wm minsize $w [winfo width $w] 100
153
 
154
        wm deiconify $w
155
}
156
}
157
 
158
proc update_menu1 {} {
159
        global CONFIG_SYN_INFERRED
160
        global CONFIG_SYN_CUSTOM1
161
        global CONFIG_SYN_ATC18
162
        global CONFIG_SYN_TSMC90
163
        global CONFIG_SYN_UMC
164
        global CONFIG_SYN_RHUMC
165
        global CONFIG_SYN_ARTISAN
166
        if {($CONFIG_SYN_INFERRED == 1 || $CONFIG_SYN_CUSTOM1 == 1 || $CONFIG_SYN_ATC18 == 1 || $CONFIG_SYN_TSMC90 == 1 || $CONFIG_SYN_UMC == 1 || $CONFIG_SYN_RHUMC == 1 || $CONFIG_SYN_ARTISAN == 1)} then {configure_entry .menu1.config.f.x1 normal {x l}} else {configure_entry .menu1.config.f.x1 disabled {x l}}
167
        global CONFIG_SYN_INFER_RAM
168
        if {($CONFIG_SYN_INFERRED != 1)} then {
169
        configure_entry .menu1.config.f.x2 normal {n l y}} else {configure_entry .menu1.config.f.x2 disabled {y n l}}
170
        global CONFIG_SYN_INFER_PADS
171
        if {($CONFIG_SYN_INFERRED != 1)} then {
172
        configure_entry .menu1.config.f.x3 normal {n l y}} else {configure_entry .menu1.config.f.x3 disabled {y n l}}
173
}
174
 
175
 
176
proc update_define_menu1 {} {
177
        update_define_mainmenu
178
        global CONFIG_MODULES
179
        global tmpvar_0
180
        global CONFIG_SYN_INFERRED
181
        if {$tmpvar_0 == "Inferred"} then {set CONFIG_SYN_INFERRED 1} else {set CONFIG_SYN_INFERRED 0}
182
        global CONFIG_SYN_STRATIX
183
        if {$tmpvar_0 == "Altera-Stratix"} then {set CONFIG_SYN_STRATIX 1} else {set CONFIG_SYN_STRATIX 0}
184
        global CONFIG_SYN_STRATIXII
185
        if {$tmpvar_0 == "Altera-StratixII"} then {set CONFIG_SYN_STRATIXII 1} else {set CONFIG_SYN_STRATIXII 0}
186
        global CONFIG_SYN_STRATIXIII
187
        if {$tmpvar_0 == "Altera-StratixIII"} then {set CONFIG_SYN_STRATIXIII 1} else {set CONFIG_SYN_STRATIXIII 0}
188
        global CONFIG_SYN_CYCLONEIII
189
        if {$tmpvar_0 == "Altera-CycloneIII"} then {set CONFIG_SYN_CYCLONEIII 1} else {set CONFIG_SYN_CYCLONEIII 0}
190
        global CONFIG_SYN_ALTERA
191
        if {$tmpvar_0 == "Altera-Others"} then {set CONFIG_SYN_ALTERA 1} else {set CONFIG_SYN_ALTERA 0}
192
        global CONFIG_SYN_AXCEL
193
        if {$tmpvar_0 == "Actel-Axcelerator"} then {set CONFIG_SYN_AXCEL 1} else {set CONFIG_SYN_AXCEL 0}
194
        global CONFIG_SYN_PROASIC
195
        if {$tmpvar_0 == "Actel-Proasic"} then {set CONFIG_SYN_PROASIC 1} else {set CONFIG_SYN_PROASIC 0}
196
        global CONFIG_SYN_PROASICPLUS
197
        if {$tmpvar_0 == "Actel-ProasicPlus"} then {set CONFIG_SYN_PROASICPLUS 1} else {set CONFIG_SYN_PROASICPLUS 0}
198
        global CONFIG_SYN_PROASIC3
199
        if {$tmpvar_0 == "Actel-Proasic3"} then {set CONFIG_SYN_PROASIC3 1} else {set CONFIG_SYN_PROASIC3 0}
200
        global CONFIG_SYN_UT025CRH
201
        if {$tmpvar_0 == "Aeroflex-UT025CRH"} then {set CONFIG_SYN_UT025CRH 1} else {set CONFIG_SYN_UT025CRH 0}
202
        global CONFIG_SYN_ATC18
203
        if {$tmpvar_0 == "Atmel-ATC18"} then {set CONFIG_SYN_ATC18 1} else {set CONFIG_SYN_ATC18 0}
204
        global CONFIG_SYN_ATC18RHA
205
        if {$tmpvar_0 == "Atmel-ATC18RHA"} then {set CONFIG_SYN_ATC18RHA 1} else {set CONFIG_SYN_ATC18RHA 0}
206
        global CONFIG_SYN_CUSTOM1
207
        if {$tmpvar_0 == "Custom1"} then {set CONFIG_SYN_CUSTOM1 1} else {set CONFIG_SYN_CUSTOM1 0}
208
        global CONFIG_SYN_EASIC90
209
        if {$tmpvar_0 == "eASIC90"} then {set CONFIG_SYN_EASIC90 1} else {set CONFIG_SYN_EASIC90 0}
210
        global CONFIG_SYN_IHP25
211
        if {$tmpvar_0 == "IHP25"} then {set CONFIG_SYN_IHP25 1} else {set CONFIG_SYN_IHP25 0}
212
        global CONFIG_SYN_IHP25RH
213
        if {$tmpvar_0 == "IHP25RH"} then {set CONFIG_SYN_IHP25RH 1} else {set CONFIG_SYN_IHP25RH 0}
214
        global CONFIG_SYN_LATTICE
215
        if {$tmpvar_0 == "Lattice-EC/ECP/XP"} then {set CONFIG_SYN_LATTICE 1} else {set CONFIG_SYN_LATTICE 0}
216
        global CONFIG_SYN_ECLIPSE
217
        if {$tmpvar_0 == "Quicklogic-Eclipse"} then {set CONFIG_SYN_ECLIPSE 1} else {set CONFIG_SYN_ECLIPSE 0}
218
        global CONFIG_SYN_PEREGRINE
219
        if {$tmpvar_0 == "Peregrine"} then {set CONFIG_SYN_PEREGRINE 1} else {set CONFIG_SYN_PEREGRINE 0}
220
        global CONFIG_SYN_RH_LIB18T
221
        if {$tmpvar_0 == "RH-LIB18T"} then {set CONFIG_SYN_RH_LIB18T 1} else {set CONFIG_SYN_RH_LIB18T 0}
222
        global CONFIG_SYN_RHUMC
223
        if {$tmpvar_0 == "RH-UMC"} then {set CONFIG_SYN_RHUMC 1} else {set CONFIG_SYN_RHUMC 0}
224
        global CONFIG_SYN_SPARTAN2
225
        if {$tmpvar_0 == "Xilinx-Spartan2"} then {set CONFIG_SYN_SPARTAN2 1} else {set CONFIG_SYN_SPARTAN2 0}
226
        global CONFIG_SYN_SPARTAN3
227
        if {$tmpvar_0 == "Xilinx-Spartan3"} then {set CONFIG_SYN_SPARTAN3 1} else {set CONFIG_SYN_SPARTAN3 0}
228
        global CONFIG_SYN_SPARTAN3E
229
        if {$tmpvar_0 == "Xilinx-Spartan3E"} then {set CONFIG_SYN_SPARTAN3E 1} else {set CONFIG_SYN_SPARTAN3E 0}
230
        global CONFIG_SYN_VIRTEX
231
        if {$tmpvar_0 == "Xilinx-Virtex"} then {set CONFIG_SYN_VIRTEX 1} else {set CONFIG_SYN_VIRTEX 0}
232
        global CONFIG_SYN_VIRTEXE
233
        if {$tmpvar_0 == "Xilinx-VirtexE"} then {set CONFIG_SYN_VIRTEXE 1} else {set CONFIG_SYN_VIRTEXE 0}
234
        global CONFIG_SYN_VIRTEX2
235
        if {$tmpvar_0 == "Xilinx-Virtex2"} then {set CONFIG_SYN_VIRTEX2 1} else {set CONFIG_SYN_VIRTEX2 0}
236
        global CONFIG_SYN_VIRTEX4
237
        if {$tmpvar_0 == "Xilinx-Virtex4"} then {set CONFIG_SYN_VIRTEX4 1} else {set CONFIG_SYN_VIRTEX4 0}
238
        global CONFIG_SYN_VIRTEX5
239
        if {$tmpvar_0 == "Xilinx-Virtex5"} then {set CONFIG_SYN_VIRTEX5 1} else {set CONFIG_SYN_VIRTEX5 0}
240
        global CONFIG_SYN_UMC
241
        if {$tmpvar_0 == "UMC18"} then {set CONFIG_SYN_UMC 1} else {set CONFIG_SYN_UMC 0}
242
        global CONFIG_SYN_TSMC90
243
        if {$tmpvar_0 == "TSMC90"} then {set CONFIG_SYN_TSMC90 1} else {set CONFIG_SYN_TSMC90 0}
244
        global tmpvar_1
245
        global CONFIG_MEM_INFERRED
246
        if {$tmpvar_1 == "Inferred"} then {set CONFIG_MEM_INFERRED 1} else {set CONFIG_MEM_INFERRED 0}
247
        global CONFIG_MEM_UMC
248
        if {$tmpvar_1 == "UMC18"} then {set CONFIG_MEM_UMC 1} else {set CONFIG_MEM_UMC 0}
249
        global CONFIG_MEM_RHUMC
250
        if {$tmpvar_1 == "RH-UMC"} then {set CONFIG_MEM_RHUMC 1} else {set CONFIG_MEM_RHUMC 0}
251
        global CONFIG_MEM_ARTISAN
252
        if {$tmpvar_1 == "Artisan"} then {set CONFIG_MEM_ARTISAN 1} else {set CONFIG_MEM_ARTISAN 0}
253
        global CONFIG_MEM_CUSTOM1
254
        if {$tmpvar_1 == "Custom1"} then {set CONFIG_MEM_CUSTOM1 1} else {set CONFIG_MEM_CUSTOM1 0}
255
        global CONFIG_MEM_VIRAGE
256
        if {$tmpvar_1 == "Virage"} then {set CONFIG_MEM_VIRAGE 1} else {set CONFIG_MEM_VIRAGE 0}
257
        global CONFIG_MEM_VIRAGE90
258
        if {$tmpvar_1 == "Virage-TSMC90"} then {set CONFIG_MEM_VIRAGE90 1} else {set CONFIG_MEM_VIRAGE90 0}
259
        global CONFIG_SYN_INFER_RAM
260
        if {($CONFIG_SYN_INFERRED != 1)} then {
261
        set CONFIG_SYN_INFER_RAM [expr $CONFIG_SYN_INFER_RAM&15]} else {set CONFIG_SYN_INFER_RAM [expr $CONFIG_SYN_INFER_RAM|16]}
262
        global CONFIG_SYN_INFER_PADS
263
        if {($CONFIG_SYN_INFERRED != 1)} then {
264
        set CONFIG_SYN_INFER_PADS [expr $CONFIG_SYN_INFER_PADS&15]} else {set CONFIG_SYN_INFER_PADS [expr $CONFIG_SYN_INFER_PADS|16]}
265
}
266
 
267
 
268
menu_option menu2 2 "Clock generation"
269
proc menu2 {w title} {
270
        set oldFocus [focus]
271
        catch {destroy $w; unregister_active 2}
272
        toplevel $w -class Dialog
273
        wm withdraw $w
274
        global active_menus
275
        set active_menus [lsort -integer [linsert $active_menus end 2]]
276
        message $w.m -width 400 -aspect 300 -text \
277
                "Clock generation"  -relief raised
278
        pack $w.m -pady 10 -side top -padx 10
279
        wm title $w "Clock generation"
280
 
281
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 2; break"
282
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu3 .menu3 \"$title\""
283
        frame $w.f
284
        button $w.f.back -text "Main Menu" \
285
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 2"
286
        button $w.f.next -text "Next" -underline 0\
287
                -width 15 -command $nextscript
288
        bind all  $nextscript
289
        button $w.f.prev -text "Prev" -underline 0\
290
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu1 .menu1 \"$title\""
291
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu1 .menu1 \"$title\";break"
292
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
293
        pack $w.f -pady 10 -side bottom -anchor w -fill x
294
        frame $w.topline -relief ridge -borderwidth 2 -height 2
295
        pack $w.topline -side top -fill x
296
 
297
        frame $w.botline -relief ridge -borderwidth 2 -height 2
298
        pack $w.botline -side bottom -fill x
299
 
300
        frame $w.config
301
        pack $w.config -fill y -expand on
302
 
303
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
304
        pack $w.config.vscroll -side right -fill y
305
 
306
        canvas $w.config.canvas -height 1\
307
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
308
                -width [expr [winfo screenwidth .] * 1 / 2]
309
        frame $w.config.f
310
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
311
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
312
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
313
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
314
        bind $w  "$w.config.canvas yview moveto 0;break;"
315
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
316
        pack $w.config.canvas -side right -fill y
317
 
318
 
319
        global tmpvar_2
320
        minimenu $w.config.f 2 0 "Clock generator                     " tmpvar_2 CONFIG_CLK_INFERRED
321
        menu $w.config.f.x0.x.menu -tearoffcommand "menutitle \"Clock generator                     \""
322
        $w.config.f.x0.x.menu add radiobutton -label "Inferred" -variable tmpvar_2 -value "Inferred" -command "update_active"
323
        $w.config.f.x0.x.menu add radiobutton -label "Actel-HCLKBUF" -variable tmpvar_2 -value "Actel-HCLKBUF" -command "update_active"
324
        $w.config.f.x0.x.menu add radiobutton -label "Altera-ALTPLL" -variable tmpvar_2 -value "Altera-ALTPLL" -command "update_active"
325
        $w.config.f.x0.x.menu add radiobutton -label "Lattice-EXPLL" -variable tmpvar_2 -value "Lattice-EXPLL" -command "update_active"
326
        $w.config.f.x0.x.menu add radiobutton -label "Proasic3-PLLL" -variable tmpvar_2 -value "Proasic3-PLLL" -command "update_active"
327
        $w.config.f.x0.x.menu add radiobutton -label "RH-LIB18T-PLL" -variable tmpvar_2 -value "RH-LIB18T-PLL" -command "update_active"
328
        $w.config.f.x0.x.menu add radiobutton -label "DARE-PLL" -variable tmpvar_2 -value "DARE-PLL" -command "update_active"
329
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-CLKDLL" -variable tmpvar_2 -value "Xilinx-CLKDLL" -command "update_active"
330
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-DCM" -variable tmpvar_2 -value "Xilinx-DCM" -command "update_active"
331
        menusplit $w $w.config.f.x0.x.menu 9
332
        int $w.config.f 2 1 "Clock multiplication factor (2 - 32)" CONFIG_CLK_MUL
333
        int $w.config.f 2 2 "Clock division factor (2 - 32)" CONFIG_CLK_DIV
334
        int $w.config.f 2 3 "Outout division factor (2 - 32)" CONFIG_OCLK_DIV
335
        bool $w.config.f 2 4 "Enable Xilinx CLKDLL for PCI clock" CONFIG_PCI_CLKDLL
336
        bool $w.config.f 2 5 "Disable external feedback for SDRAM clock" CONFIG_CLK_NOFB
337
        bool $w.config.f 2 6 "Use PCI clock as system clock" CONFIG_PCI_SYSCLK
338
 
339
 
340
 
341
        focus $w
342
        update_active
343
        global winx; global winy
344
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
345
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
346
        update idletasks
347
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
348
 
349
        $w.config.canvas configure \
350
                -width [expr [winfo reqwidth $w.config.f] + 1]\
351
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
352
                         [expr [winfo reqheight $w.config.f] + 1]"
353
 
354
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
355
        set scry [expr [winfo screenh $w] / 2]
356
        set maxy [expr [winfo screenh $w] * 3 / 4]
357
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
358
        if [expr $winy + $canvtotal < $maxy] {
359
                $w.config.canvas configure -height $canvtotal
360
        } else {
361
                $w.config.canvas configure -height [expr $scry - $winy]
362
                }
363
        }
364
        update idletasks
365
        if {[winfo exists $w]} then {
366
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
367
        wm minsize $w [winfo width $w] 100
368
 
369
        wm deiconify $w
370
}
371
}
372
 
373
proc update_menu2 {} {
374
        global CONFIG_CLK_DCM
375
        global CONFIG_CLK_ALTDLL
376
        global CONFIG_CLK_LATDLL
377
        global CONFIG_CLK_PRO3PLL
378
        global CONFIG_CLK_CLKDLL
379
        global CONFIG_CLK_LIB18T
380
        global CONFIG_CLK_MUL
381
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_PRO3PLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {.menu2.config.f.x1.x configure -state normal -foreground [ cget .ref -foreground ]; .menu2.config.f.x1.l configure -state normal; } else {.menu2.config.f.x1.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu2.config.f.x1.l configure -state disabled}
382
        global CONFIG_CLK_DIV
383
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_PRO3PLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {.menu2.config.f.x2.x configure -state normal -foreground [ cget .ref -foreground ]; .menu2.config.f.x2.l configure -state normal; } else {.menu2.config.f.x2.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu2.config.f.x2.l configure -state disabled}
384
        global CONFIG_OCLK_DIV
385
        if {($CONFIG_CLK_PRO3PLL == 1)} then {.menu2.config.f.x3.x configure -state normal -foreground [ cget .ref -foreground ]; .menu2.config.f.x3.l configure -state normal; } else {.menu2.config.f.x3.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu2.config.f.x3.l configure -state disabled}
386
        global CONFIG_PCI_CLKDLL
387
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {
388
        configure_entry .menu2.config.f.x4 normal {n l y}} else {configure_entry .menu2.config.f.x4 disabled {y n l}}
389
        global CONFIG_CLK_NOFB
390
        if {($CONFIG_CLK_DCM == 1)} then {
391
        configure_entry .menu2.config.f.x5 normal {n l y}} else {configure_entry .menu2.config.f.x5 disabled {y n l}}
392
        global CONFIG_PCI_ENABLE
393
        global CONFIG_PCI_SYSCLK
394
        if {($CONFIG_PCI_ENABLE != 1)} then {
395
        configure_entry .menu2.config.f.x6 normal {n l y}} else {configure_entry .menu2.config.f.x6 disabled {y n l}}
396
}
397
 
398
 
399
proc update_define_menu2 {} {
400
        update_define_mainmenu
401
        global CONFIG_MODULES
402
        global tmpvar_2
403
        global CONFIG_CLK_INFERRED
404
        if {$tmpvar_2 == "Inferred"} then {set CONFIG_CLK_INFERRED 1} else {set CONFIG_CLK_INFERRED 0}
405
        global CONFIG_CLK_HCLKBUF
406
        if {$tmpvar_2 == "Actel-HCLKBUF"} then {set CONFIG_CLK_HCLKBUF 1} else {set CONFIG_CLK_HCLKBUF 0}
407
        global CONFIG_CLK_ALTDLL
408
        if {$tmpvar_2 == "Altera-ALTPLL"} then {set CONFIG_CLK_ALTDLL 1} else {set CONFIG_CLK_ALTDLL 0}
409
        global CONFIG_CLK_LATDLL
410
        if {$tmpvar_2 == "Lattice-EXPLL"} then {set CONFIG_CLK_LATDLL 1} else {set CONFIG_CLK_LATDLL 0}
411
        global CONFIG_CLK_PRO3PLL
412
        if {$tmpvar_2 == "Proasic3-PLLL"} then {set CONFIG_CLK_PRO3PLL 1} else {set CONFIG_CLK_PRO3PLL 0}
413
        global CONFIG_CLK_LIB18T
414
        if {$tmpvar_2 == "RH-LIB18T-PLL"} then {set CONFIG_CLK_LIB18T 1} else {set CONFIG_CLK_LIB18T 0}
415
        global CONFIG_CLK_RHUMC
416
        if {$tmpvar_2 == "DARE-PLL"} then {set CONFIG_CLK_RHUMC 1} else {set CONFIG_CLK_RHUMC 0}
417
        global CONFIG_CLK_CLKDLL
418
        if {$tmpvar_2 == "Xilinx-CLKDLL"} then {set CONFIG_CLK_CLKDLL 1} else {set CONFIG_CLK_CLKDLL 0}
419
        global CONFIG_CLK_DCM
420
        if {$tmpvar_2 == "Xilinx-DCM"} then {set CONFIG_CLK_DCM 1} else {set CONFIG_CLK_DCM 0}
421
        global CONFIG_CLK_MUL
422
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_PRO3PLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {validate_int CONFIG_CLK_MUL "$CONFIG_CLK_MUL" 2}
423
        global CONFIG_CLK_DIV
424
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_PRO3PLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {validate_int CONFIG_CLK_DIV "$CONFIG_CLK_DIV" 2}
425
        global CONFIG_OCLK_DIV
426
        if {($CONFIG_CLK_PRO3PLL == 1)} then {validate_int CONFIG_OCLK_DIV "$CONFIG_OCLK_DIV" 2}
427
        global CONFIG_PCI_CLKDLL
428
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {
429
        set CONFIG_PCI_CLKDLL [expr $CONFIG_PCI_CLKDLL&15]} else {set CONFIG_PCI_CLKDLL [expr $CONFIG_PCI_CLKDLL|16]}
430
        global CONFIG_CLK_NOFB
431
        if {($CONFIG_CLK_DCM == 1)} then {
432
        set CONFIG_CLK_NOFB [expr $CONFIG_CLK_NOFB&15]} else {set CONFIG_CLK_NOFB [expr $CONFIG_CLK_NOFB|16]}
433
        global CONFIG_PCI_ENABLE
434
        global CONFIG_PCI_SYSCLK
435
        if {($CONFIG_PCI_ENABLE != 1)} then {
436
        set CONFIG_PCI_SYSCLK [expr $CONFIG_PCI_SYSCLK&15]} else {set CONFIG_PCI_SYSCLK [expr $CONFIG_PCI_SYSCLK|16]}
437
}
438
 
439
 
440
menu_option menu3 3 "Processor            "
441
proc menu3 {w title} {
442
        set oldFocus [focus]
443
        catch {destroy $w; unregister_active 3}
444
        toplevel $w -class Dialog
445
        wm withdraw $w
446
        global active_menus
447
        set active_menus [lsort -integer [linsert $active_menus end 3]]
448
        message $w.m -width 400 -aspect 300 -text \
449
                "Processor            "  -relief raised
450
        pack $w.m -pady 10 -side top -padx 10
451
        wm title $w "Processor            "
452
 
453
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 3; break"
454
        set nextscript "catch {focus $oldFocus}; menu4 .menu4 \"$title\""
455
        frame $w.f
456
        button $w.f.back -text "Main Menu" \
457
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 3"
458
        button $w.f.next -text "Next" -underline 0\
459
                -width 15 -command $nextscript
460
        bind all  $nextscript
461
        button $w.f.prev -text "Prev" -underline 0\
462
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu2 .menu2 \"$title\""
463
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu2 .menu2 \"$title\";break"
464
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
465
        pack $w.f -pady 10 -side bottom -anchor w -fill x
466
        frame $w.topline -relief ridge -borderwidth 2 -height 2
467
        pack $w.topline -side top -fill x
468
 
469
        frame $w.botline -relief ridge -borderwidth 2 -height 2
470
        pack $w.botline -side bottom -fill x
471
 
472
        frame $w.config
473
        pack $w.config -fill y -expand on
474
 
475
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
476
        pack $w.config.vscroll -side right -fill y
477
 
478
        canvas $w.config.canvas -height 1\
479
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
480
                -width [expr [winfo screenwidth .] * 1 / 2]
481
        frame $w.config.f
482
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
483
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
484
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
485
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
486
        bind $w  "$w.config.canvas yview moveto 0;break;"
487
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
488
        pack $w.config.canvas -side right -fill y
489
 
490
 
491
        bool $w.config.f 3 0 "Enable LEON3 SPARC V8 Processor" CONFIG_LEON3
492
        int $w.config.f 3 1 "Number of processors" CONFIG_PROC_NUM
493
        submenu $w.config.f 3 2 "Integer unit                                           " 4
494
        submenu $w.config.f 3 3 "Floating-point unit" 5
495
        submenu $w.config.f 3 4 "Cache system" 6
496
        submenu $w.config.f 3 5 "MMU" 7
497
        submenu $w.config.f 3 6 "Debug Support Unit        " 8
498
        submenu $w.config.f 3 7 "Fault-tolerance  " 9
499
        submenu $w.config.f 3 8 "VHDL debug settings       " 10
500
 
501
 
502
 
503
        focus $w
504
        update_active
505
        global winx; global winy
506
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
507
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
508
        update idletasks
509
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
510
 
511
        $w.config.canvas configure \
512
                -width [expr [winfo reqwidth $w.config.f] + 1]\
513
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
514
                         [expr [winfo reqheight $w.config.f] + 1]"
515
 
516
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
517
        set scry [expr [winfo screenh $w] / 2]
518
        set maxy [expr [winfo screenh $w] * 3 / 4]
519
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
520
        if [expr $winy + $canvtotal < $maxy] {
521
                $w.config.canvas configure -height $canvtotal
522
        } else {
523
                $w.config.canvas configure -height [expr $scry - $winy]
524
                }
525
        }
526
        update idletasks
527
        if {[winfo exists $w]} then {
528
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
529
        wm minsize $w [winfo width $w] 100
530
 
531
        wm deiconify $w
532
}
533
}
534
 
535
proc update_menu3 {} {
536
        global CONFIG_LEON3
537
        global CONFIG_PROC_NUM
538
        if {($CONFIG_LEON3 == 1)} then {.menu3.config.f.x1.x configure -state normal -foreground [ cget .ref -foreground ]; .menu3.config.f.x1.l configure -state normal; } else {.menu3.config.f.x1.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu3.config.f.x1.l configure -state disabled}
539
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x2 normal {m}} else {configure_entry .menu3.config.f.x2 disabled {m}}
540
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x3 normal {m}} else {configure_entry .menu3.config.f.x3 disabled {m}}
541
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x4 normal {m}} else {configure_entry .menu3.config.f.x4 disabled {m}}
542
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x5 normal {m}} else {configure_entry .menu3.config.f.x5 disabled {m}}
543
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x6 normal {m}} else {configure_entry .menu3.config.f.x6 disabled {m}}
544
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x7 normal {m}} else {configure_entry .menu3.config.f.x7 disabled {m}}
545
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x8 normal {m}} else {configure_entry .menu3.config.f.x8 disabled {m}}
546
}
547
 
548
 
549
proc update_define_menu3 {} {
550
        update_define_mainmenu
551
        global CONFIG_MODULES
552
        global CONFIG_LEON3
553
        global CONFIG_PROC_NUM
554
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_PROC_NUM "$CONFIG_PROC_NUM" 1}
555
}
556
 
557
 
558
proc menu4 {w title} {
559
        set oldFocus [focus]
560
        catch {focus .menu3}
561
        catch {destroy $w; unregister_active 4}
562
        toplevel $w -class Dialog
563
        wm withdraw $w
564
        global active_menus
565
        set active_menus [lsort -integer [linsert $active_menus end 4]]
566
        message $w.m -width 400 -aspect 300 -text \
567
                "Integer unit                                           "  -relief raised
568
        pack $w.m -pady 10 -side top -padx 10
569
        wm title $w "Integer unit                                           "
570
 
571
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 4; break"
572
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu5 .menu5 \"$title\""
573
        frame $w.f
574
        button $w.f.back -text "OK" \
575
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 4"
576
        button $w.f.next -text "Next" -underline 0\
577
                -width 15 -command $nextscript
578
        bind all  $nextscript
579
        button $w.f.prev -text "Prev" -underline 0\
580
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu3 .menu3 \"$title\""
581
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu3 .menu3 \"$title\";break"
582
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
583
        pack $w.f -pady 10 -side bottom -anchor w -fill x
584
        frame $w.topline -relief ridge -borderwidth 2 -height 2
585
        pack $w.topline -side top -fill x
586
 
587
        frame $w.botline -relief ridge -borderwidth 2 -height 2
588
        pack $w.botline -side bottom -fill x
589
 
590
        frame $w.config
591
        pack $w.config -fill y -expand on
592
 
593
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
594
        pack $w.config.vscroll -side right -fill y
595
 
596
        canvas $w.config.canvas -height 1\
597
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
598
                -width [expr [winfo screenwidth .] * 1 / 2]
599
        frame $w.config.f
600
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
601
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
602
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
603
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
604
        bind $w  "$w.config.canvas yview moveto 0;break;"
605
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
606
        pack $w.config.canvas -side right -fill y
607
 
608
 
609
        int $w.config.f 4 0 "SPARC register windows" CONFIG_IU_NWINDOWS
610
        bool $w.config.f 4 1 "SPARC V8 MUL/DIV instructions" CONFIG_IU_V8MULDIV
611
        global tmpvar_3
612
        minimenu $w.config.f 4 2 "Hardware multiplier latency" tmpvar_3 CONFIG_IU_MUL_LATENCY_2
613
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"Hardware multiplier latency\""
614
        $w.config.f.x2.x.menu add radiobutton -label "2-cycles" -variable tmpvar_3 -value "2-cycles" -command "update_active"
615
        $w.config.f.x2.x.menu add radiobutton -label "4-cycles" -variable tmpvar_3 -value "4-cycles" -command "update_active"
616
        $w.config.f.x2.x.menu add radiobutton -label "5-cycles" -variable tmpvar_3 -value "5-cycles" -command "update_active"
617
        menusplit $w $w.config.f.x2.x.menu 3
618
        bool $w.config.f 4 3 "SPARC V8e SMAC/UMAC instructions     " CONFIG_IU_MUL_MAC
619
        bool $w.config.f 4 4 "Single-vector trapping" CONFIG_IU_SVT
620
        int $w.config.f 4 5 "Load delay" CONFIG_IU_LDELAY
621
        int $w.config.f 4 6 "Hardware watchpoints" CONFIG_IU_WATCHPOINTS
622
        bool $w.config.f 4 7 "Enable power-down mode " CONFIG_PWD
623
        hex $w.config.f 4 8 " Reset start address (addr\[31:12\]) " CONFIG_IU_RSTADDR
624
 
625
 
626
 
627
        focus $w
628
        update_active
629
        global winx; global winy
630
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
631
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
632
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
633
        update idletasks
634
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
635
 
636
        $w.config.canvas configure \
637
                -width [expr [winfo reqwidth $w.config.f] + 1]\
638
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
639
                         [expr [winfo reqheight $w.config.f] + 1]"
640
 
641
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
642
        set scry [expr [winfo screenh $w] / 2]
643
        set maxy [expr [winfo screenh $w] * 3 / 4]
644
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
645
        if [expr $winy + $canvtotal < $maxy] {
646
                $w.config.canvas configure -height $canvtotal
647
        } else {
648
                $w.config.canvas configure -height [expr $scry - $winy]
649
                }
650
        }
651
        update idletasks
652
        if {[winfo exists $w]} then {
653
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
654
        wm minsize $w [winfo width $w] 100
655
 
656
        wm deiconify $w
657
}
658
}
659
 
660
proc update_menu4 {} {
661
        global CONFIG_LEON3
662
        global CONFIG_IU_NWINDOWS
663
        if {($CONFIG_LEON3 == 1)} then {.menu4.config.f.x0.x configure -state normal -foreground [ cget .ref -foreground ]; .menu4.config.f.x0.l configure -state normal; } else {.menu4.config.f.x0.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu4.config.f.x0.l configure -state disabled}
664
        global CONFIG_IU_V8MULDIV
665
        if {($CONFIG_LEON3 == 1)} then {
666
        configure_entry .menu4.config.f.x1 normal {n l y}} else {configure_entry .menu4.config.f.x1 disabled {y n l}}
667
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {configure_entry .menu4.config.f.x2 normal {x l}} else {configure_entry .menu4.config.f.x2 disabled {x l}}
668
        global CONFIG_IU_MUL_LATENCY_4
669
        global CONFIG_IU_MUL_LATENCY_5
670
        global CONFIG_IU_MUL_MAC
671
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1) && ($CONFIG_IU_MUL_LATENCY_4 == 1 || $CONFIG_IU_MUL_LATENCY_5 == 1)} then {
672
        configure_entry .menu4.config.f.x3 normal {n l y}} else {configure_entry .menu4.config.f.x3 disabled {y n l}}
673
        global CONFIG_IU_SVT
674
        if {($CONFIG_LEON3 == 1)} then {
675
        configure_entry .menu4.config.f.x4 normal {n l y}} else {configure_entry .menu4.config.f.x4 disabled {y n l}}
676
        global CONFIG_IU_LDELAY
677
        if {($CONFIG_LEON3 == 1)} then {.menu4.config.f.x5.x configure -state normal -foreground [ cget .ref -foreground ]; .menu4.config.f.x5.l configure -state normal; } else {.menu4.config.f.x5.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu4.config.f.x5.l configure -state disabled}
678
        global CONFIG_IU_WATCHPOINTS
679
        if {($CONFIG_LEON3 == 1)} then {.menu4.config.f.x6.x configure -state normal -foreground [ cget .ref -foreground ]; .menu4.config.f.x6.l configure -state normal; } else {.menu4.config.f.x6.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu4.config.f.x6.l configure -state disabled}
680
        global CONFIG_PWD
681
        if {($CONFIG_LEON3 == 1)} then {
682
        configure_entry .menu4.config.f.x7 normal {n l y}} else {configure_entry .menu4.config.f.x7 disabled {y n l}}
683
        global CONFIG_IU_RSTADDR
684
        if {($CONFIG_LEON3 == 1)} then {.menu4.config.f.x8.x configure -state normal -foreground [ cget .ref -foreground ]; .menu4.config.f.x8.l configure -state normal; } else {.menu4.config.f.x8.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu4.config.f.x8.l configure -state disabled}
685
}
686
 
687
 
688
proc update_define_menu4 {} {
689
        update_define_mainmenu
690
        global CONFIG_MODULES
691
        global CONFIG_LEON3
692
        global CONFIG_IU_NWINDOWS
693
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_NWINDOWS "$CONFIG_IU_NWINDOWS" 8}
694
        global CONFIG_IU_V8MULDIV
695
        if {($CONFIG_LEON3 == 1)} then {
696
        set CONFIG_IU_V8MULDIV [expr $CONFIG_IU_V8MULDIV&15]} else {set CONFIG_IU_V8MULDIV [expr $CONFIG_IU_V8MULDIV|16]}
697
        global tmpvar_3
698
        global CONFIG_IU_MUL_LATENCY_2
699
        if {$tmpvar_3 == "2-cycles"} then {set CONFIG_IU_MUL_LATENCY_2 1} else {set CONFIG_IU_MUL_LATENCY_2 0}
700
        global CONFIG_IU_MUL_LATENCY_4
701
        if {$tmpvar_3 == "4-cycles"} then {set CONFIG_IU_MUL_LATENCY_4 1} else {set CONFIG_IU_MUL_LATENCY_4 0}
702
        global CONFIG_IU_MUL_LATENCY_5
703
        if {$tmpvar_3 == "5-cycles"} then {set CONFIG_IU_MUL_LATENCY_5 1} else {set CONFIG_IU_MUL_LATENCY_5 0}
704
        global CONFIG_IU_MUL_MAC
705
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1) && ($CONFIG_IU_MUL_LATENCY_4 == 1 || $CONFIG_IU_MUL_LATENCY_5 == 1)} then {
706
        set CONFIG_IU_MUL_MAC [expr $CONFIG_IU_MUL_MAC&15]} else {set CONFIG_IU_MUL_MAC [expr $CONFIG_IU_MUL_MAC|16]}
707
        global CONFIG_IU_SVT
708
        if {($CONFIG_LEON3 == 1)} then {
709
        set CONFIG_IU_SVT [expr $CONFIG_IU_SVT&15]} else {set CONFIG_IU_SVT [expr $CONFIG_IU_SVT|16]}
710
        global CONFIG_IU_LDELAY
711
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_LDELAY "$CONFIG_IU_LDELAY" 1}
712
        global CONFIG_IU_WATCHPOINTS
713
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_WATCHPOINTS "$CONFIG_IU_WATCHPOINTS" 0}
714
        global CONFIG_PWD
715
        if {($CONFIG_LEON3 == 1)} then {
716
        set CONFIG_PWD [expr $CONFIG_PWD&15]} else {set CONFIG_PWD [expr $CONFIG_PWD|16]}
717
        global CONFIG_IU_RSTADDR
718
        if {($CONFIG_LEON3 == 1)} then {validate_hex CONFIG_IU_RSTADDR "$CONFIG_IU_RSTADDR" 00000}
719
}
720
 
721
 
722
proc menu5 {w title} {
723
        set oldFocus [focus]
724
        catch {focus .menu3}
725
        catch {destroy $w; unregister_active 5}
726
        toplevel $w -class Dialog
727
        wm withdraw $w
728
        global active_menus
729
        set active_menus [lsort -integer [linsert $active_menus end 5]]
730
        message $w.m -width 400 -aspect 300 -text \
731
                "Floating-point unit"  -relief raised
732
        pack $w.m -pady 10 -side top -padx 10
733
        wm title $w "Floating-point unit"
734
 
735
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 5; break"
736
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu6 .menu6 \"$title\""
737
        frame $w.f
738
        button $w.f.back -text "OK" \
739
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 5"
740
        button $w.f.next -text "Next" -underline 0\
741
                -width 15 -command $nextscript
742
        bind all  $nextscript
743
        button $w.f.prev -text "Prev" -underline 0\
744
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu4 .menu4 \"$title\""
745
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu4 .menu4 \"$title\";break"
746
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
747
        pack $w.f -pady 10 -side bottom -anchor w -fill x
748
        frame $w.topline -relief ridge -borderwidth 2 -height 2
749
        pack $w.topline -side top -fill x
750
 
751
        frame $w.botline -relief ridge -borderwidth 2 -height 2
752
        pack $w.botline -side bottom -fill x
753
 
754
        frame $w.config
755
        pack $w.config -fill y -expand on
756
 
757
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
758
        pack $w.config.vscroll -side right -fill y
759
 
760
        canvas $w.config.canvas -height 1\
761
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
762
                -width [expr [winfo screenwidth .] * 1 / 2]
763
        frame $w.config.f
764
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
765
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
766
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
767
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
768
        bind $w  "$w.config.canvas yview moveto 0;break;"
769
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
770
        pack $w.config.canvas -side right -fill y
771
 
772
 
773
        bool $w.config.f 5 0 "Enable FPU                             " CONFIG_FPU_ENABLE
774
        global tmpvar_4
775
        minimenu $w.config.f 5 1 "FPU core" tmpvar_4 CONFIG_FPU_GRFPU
776
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"FPU core\""
777
        $w.config.f.x1.x.menu add radiobutton -label "GRFPU" -variable tmpvar_4 -value "GRFPU" -command "update_active"
778
        $w.config.f.x1.x.menu add radiobutton -label "GRFPU-LITE" -variable tmpvar_4 -value "GRFPU-LITE" -command "update_active"
779
        $w.config.f.x1.x.menu add radiobutton -label "Meiko" -variable tmpvar_4 -value "Meiko" -command "update_active"
780
        menusplit $w $w.config.f.x1.x.menu 3
781
        global tmpvar_5
782
        minimenu $w.config.f 5 2 "GRFPU multiplier" tmpvar_5 CONFIG_FPU_GRFPU_INFMUL
783
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"GRFPU multiplier\""
784
        $w.config.f.x2.x.menu add radiobutton -label "Inferred" -variable tmpvar_5 -value "Inferred" -command "update_active"
785
        $w.config.f.x2.x.menu add radiobutton -label "DW" -variable tmpvar_5 -value "DW" -command "update_active"
786
        $w.config.f.x2.x.menu add radiobutton -label "ModGen" -variable tmpvar_5 -value "ModGen" -command "update_active"
787
        menusplit $w $w.config.f.x2.x.menu 3
788
        global tmpvar_6
789
        minimenu $w.config.f 5 3 "GRFPU-LITE controller" tmpvar_6 CONFIG_FPU_GRFPC0
790
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"GRFPU-LITE controller\""
791
        $w.config.f.x3.x.menu add radiobutton -label "Simple" -variable tmpvar_6 -value "Simple" -command "update_active"
792
        $w.config.f.x3.x.menu add radiobutton -label "Data-forwarding" -variable tmpvar_6 -value "Data-forwarding" -command "update_active"
793
        $w.config.f.x3.x.menu add radiobutton -label "Non-blocking" -variable tmpvar_6 -value "Non-blocking" -command "update_active"
794
        menusplit $w $w.config.f.x3.x.menu 3
795
        bool $w.config.f 5 4 "Use VHDL netlist          " CONFIG_FPU_NETLIST
796
 
797
 
798
 
799
        focus $w
800
        update_active
801
        global winx; global winy
802
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
803
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
804
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
805
        update idletasks
806
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
807
 
808
        $w.config.canvas configure \
809
                -width [expr [winfo reqwidth $w.config.f] + 1]\
810
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
811
                         [expr [winfo reqheight $w.config.f] + 1]"
812
 
813
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
814
        set scry [expr [winfo screenh $w] / 2]
815
        set maxy [expr [winfo screenh $w] * 3 / 4]
816
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
817
        if [expr $winy + $canvtotal < $maxy] {
818
                $w.config.canvas configure -height $canvtotal
819
        } else {
820
                $w.config.canvas configure -height [expr $scry - $winy]
821
                }
822
        }
823
        update idletasks
824
        if {[winfo exists $w]} then {
825
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
826
        wm minsize $w [winfo width $w] 100
827
 
828
        wm deiconify $w
829
}
830
}
831
 
832
proc update_menu5 {} {
833
        global CONFIG_LEON3
834
        global CONFIG_FPU_ENABLE
835
        if {($CONFIG_LEON3 == 1)} then {
836
        configure_entry .menu5.config.f.x0 normal {n l y}} else {configure_entry .menu5.config.f.x0 disabled {y n l}}
837
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {configure_entry .menu5.config.f.x1 normal {x l}} else {configure_entry .menu5.config.f.x1 disabled {x l}}
838
        global CONFIG_FPU_GRFPU
839
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPU == 1)} then {configure_entry .menu5.config.f.x2 normal {x l}} else {configure_entry .menu5.config.f.x2 disabled {x l}}
840
        global CONFIG_FPU_GRFPULITE
841
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPULITE == 1)} then {configure_entry .menu5.config.f.x3 normal {x l}} else {configure_entry .menu5.config.f.x3 disabled {x l}}
842
        global CONFIG_FPU_NETLIST
843
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
844
        configure_entry .menu5.config.f.x4 normal {n l y}} else {configure_entry .menu5.config.f.x4 disabled {y n l}}
845
}
846
 
847
 
848
proc update_define_menu5 {} {
849
        update_define_mainmenu
850
        global CONFIG_MODULES
851
        global CONFIG_LEON3
852
        global CONFIG_FPU_ENABLE
853
        if {($CONFIG_LEON3 == 1)} then {
854
        set CONFIG_FPU_ENABLE [expr $CONFIG_FPU_ENABLE&15]} else {set CONFIG_FPU_ENABLE [expr $CONFIG_FPU_ENABLE|16]}
855
        global tmpvar_4
856
        global CONFIG_FPU_GRFPU
857
        if {$tmpvar_4 == "GRFPU"} then {set CONFIG_FPU_GRFPU 1} else {set CONFIG_FPU_GRFPU 0}
858
        global CONFIG_FPU_GRFPULITE
859
        if {$tmpvar_4 == "GRFPU-LITE"} then {set CONFIG_FPU_GRFPULITE 1} else {set CONFIG_FPU_GRFPULITE 0}
860
        global CONFIG_FPU_MEIKO
861
        if {$tmpvar_4 == "Meiko"} then {set CONFIG_FPU_MEIKO 1} else {set CONFIG_FPU_MEIKO 0}
862
        global tmpvar_5
863
        global CONFIG_FPU_GRFPU_INFMUL
864
        if {$tmpvar_5 == "Inferred"} then {set CONFIG_FPU_GRFPU_INFMUL 1} else {set CONFIG_FPU_GRFPU_INFMUL 0}
865
        global CONFIG_FPU_GRFPU_DWMUL
866
        if {$tmpvar_5 == "DW"} then {set CONFIG_FPU_GRFPU_DWMUL 1} else {set CONFIG_FPU_GRFPU_DWMUL 0}
867
        global CONFIG_FPU_GRFPU_MODGEN
868
        if {$tmpvar_5 == "ModGen"} then {set CONFIG_FPU_GRFPU_MODGEN 1} else {set CONFIG_FPU_GRFPU_MODGEN 0}
869
        global tmpvar_6
870
        global CONFIG_FPU_GRFPC0
871
        if {$tmpvar_6 == "Simple"} then {set CONFIG_FPU_GRFPC0 1} else {set CONFIG_FPU_GRFPC0 0}
872
        global CONFIG_FPU_GRFPC1
873
        if {$tmpvar_6 == "Data-forwarding"} then {set CONFIG_FPU_GRFPC1 1} else {set CONFIG_FPU_GRFPC1 0}
874
        global CONFIG_FPU_GRFPC2
875
        if {$tmpvar_6 == "Non-blocking"} then {set CONFIG_FPU_GRFPC2 1} else {set CONFIG_FPU_GRFPC2 0}
876
        global CONFIG_FPU_NETLIST
877
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
878
        set CONFIG_FPU_NETLIST [expr $CONFIG_FPU_NETLIST&15]} else {set CONFIG_FPU_NETLIST [expr $CONFIG_FPU_NETLIST|16]}
879
}
880
 
881
 
882
proc menu6 {w title} {
883
        set oldFocus [focus]
884
        catch {focus .menu3}
885
        catch {destroy $w; unregister_active 6}
886
        toplevel $w -class Dialog
887
        wm withdraw $w
888
        global active_menus
889
        set active_menus [lsort -integer [linsert $active_menus end 6]]
890
        message $w.m -width 400 -aspect 300 -text \
891
                "Cache system"  -relief raised
892
        pack $w.m -pady 10 -side top -padx 10
893
        wm title $w "Cache system"
894
 
895
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 6; break"
896
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu7 .menu7 \"$title\""
897
        frame $w.f
898
        button $w.f.back -text "OK" \
899
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 6"
900
        button $w.f.next -text "Next" -underline 0\
901
                -width 15 -command $nextscript
902
        bind all  $nextscript
903
        button $w.f.prev -text "Prev" -underline 0\
904
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu5 .menu5 \"$title\""
905
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu5 .menu5 \"$title\";break"
906
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
907
        pack $w.f -pady 10 -side bottom -anchor w -fill x
908
        frame $w.topline -relief ridge -borderwidth 2 -height 2
909
        pack $w.topline -side top -fill x
910
 
911
        frame $w.botline -relief ridge -borderwidth 2 -height 2
912
        pack $w.botline -side bottom -fill x
913
 
914
        frame $w.config
915
        pack $w.config -fill y -expand on
916
 
917
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
918
        pack $w.config.vscroll -side right -fill y
919
 
920
        canvas $w.config.canvas -height 1\
921
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
922
                -width [expr [winfo screenwidth .] * 1 / 2]
923
        frame $w.config.f
924
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
925
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
926
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
927
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
928
        bind $w  "$w.config.canvas yview moveto 0;break;"
929
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
930
        pack $w.config.canvas -side right -fill y
931
 
932
 
933
        bool $w.config.f 6 0 "Enable instruction cache       " CONFIG_ICACHE_ENABLE
934
        global tmpvar_7
935
        minimenu $w.config.f 6 1 "Associativity (sets)            " tmpvar_7 CONFIG_ICACHE_ASSO1
936
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"Associativity (sets)            \""
937
        $w.config.f.x1.x.menu add radiobutton -label "1" -variable tmpvar_7 -value "1" -command "update_active"
938
        $w.config.f.x1.x.menu add radiobutton -label "2" -variable tmpvar_7 -value "2" -command "update_active"
939
        $w.config.f.x1.x.menu add radiobutton -label "3" -variable tmpvar_7 -value "3" -command "update_active"
940
        $w.config.f.x1.x.menu add radiobutton -label "4" -variable tmpvar_7 -value "4" -command "update_active"
941
        menusplit $w $w.config.f.x1.x.menu 4
942
        global tmpvar_8
943
        minimenu $w.config.f 6 2 "Set size (kbytes/set)" tmpvar_8 CONFIG_ICACHE_SZ1
944
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"Set size (kbytes/set)\""
945
        $w.config.f.x2.x.menu add radiobutton -label "1" -variable tmpvar_8 -value "1" -command "update_active"
946
        $w.config.f.x2.x.menu add radiobutton -label "2" -variable tmpvar_8 -value "2" -command "update_active"
947
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_8 -value "4" -command "update_active"
948
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_8 -value "8" -command "update_active"
949
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_8 -value "16" -command "update_active"
950
        $w.config.f.x2.x.menu add radiobutton -label "32" -variable tmpvar_8 -value "32" -command "update_active"
951
        $w.config.f.x2.x.menu add radiobutton -label "64" -variable tmpvar_8 -value "64" -command "update_active"
952
        $w.config.f.x2.x.menu add radiobutton -label "128" -variable tmpvar_8 -value "128" -command "update_active"
953
        $w.config.f.x2.x.menu add radiobutton -label "256" -variable tmpvar_8 -value "256" -command "update_active"
954
        menusplit $w $w.config.f.x2.x.menu 9
955
        global tmpvar_9
956
        minimenu $w.config.f 6 3 "Line size (bytes/line)" tmpvar_9 CONFIG_ICACHE_LZ16
957
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"Line size (bytes/line)\""
958
        $w.config.f.x3.x.menu add radiobutton -label "16" -variable tmpvar_9 -value "16" -command "update_active"
959
        $w.config.f.x3.x.menu add radiobutton -label "32" -variable tmpvar_9 -value "32" -command "update_active"
960
        menusplit $w $w.config.f.x3.x.menu 2
961
        global tmpvar_10
962
        minimenu $w.config.f 6 4 "Replacement alorithm" tmpvar_10 CONFIG_ICACHE_ALGORND
963
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"Replacement alorithm\""
964
        $w.config.f.x4.x.menu add radiobutton -label "Random" -variable tmpvar_10 -value "Random" -command "update_active"
965
        $w.config.f.x4.x.menu add radiobutton -label "LRR" -variable tmpvar_10 -value "LRR" -command "update_active"
966
        $w.config.f.x4.x.menu add radiobutton -label "LRU" -variable tmpvar_10 -value "LRU" -command "update_active"
967
        menusplit $w $w.config.f.x4.x.menu 3
968
        bool $w.config.f 6 5 "Cache locking      " CONFIG_ICACHE_LOCK
969
        bool $w.config.f 6 6 "Enable local instruction RAM            " CONFIG_ICACHE_LRAM
970
        global tmpvar_11
971
        minimenu $w.config.f 6 7 "Local data RAM size (kbytes)" tmpvar_11 CONFIG_ICACHE_LRAM_SZ1
972
        menu $w.config.f.x7.x.menu -tearoffcommand "menutitle \"Local data RAM size (kbytes)\""
973
        $w.config.f.x7.x.menu add radiobutton -label "1" -variable tmpvar_11 -value "1" -command "update_active"
974
        $w.config.f.x7.x.menu add radiobutton -label "2" -variable tmpvar_11 -value "2" -command "update_active"
975
        $w.config.f.x7.x.menu add radiobutton -label "4" -variable tmpvar_11 -value "4" -command "update_active"
976
        $w.config.f.x7.x.menu add radiobutton -label "8" -variable tmpvar_11 -value "8" -command "update_active"
977
        $w.config.f.x7.x.menu add radiobutton -label "16" -variable tmpvar_11 -value "16" -command "update_active"
978
        $w.config.f.x7.x.menu add radiobutton -label "32" -variable tmpvar_11 -value "32" -command "update_active"
979
        $w.config.f.x7.x.menu add radiobutton -label "64" -variable tmpvar_11 -value "64" -command "update_active"
980
        $w.config.f.x7.x.menu add radiobutton -label "128" -variable tmpvar_11 -value "128" -command "update_active"
981
        $w.config.f.x7.x.menu add radiobutton -label "256" -variable tmpvar_11 -value "256" -command "update_active"
982
        menusplit $w $w.config.f.x7.x.menu 9
983
        hex $w.config.f 6 8 " Local instruction RAM start address (8 MSB) " CONFIG_ICACHE_LRSTART
984
        bool $w.config.f 6 9 "Enable data cache       " CONFIG_DCACHE_ENABLE
985
        global tmpvar_12
986
        minimenu $w.config.f 6 10 "Associativity (sets)" tmpvar_12 CONFIG_DCACHE_ASSO1
987
        menu $w.config.f.x10.x.menu -tearoffcommand "menutitle \"Associativity (sets)\""
988
        $w.config.f.x10.x.menu add radiobutton -label "1" -variable tmpvar_12 -value "1" -command "update_active"
989
        $w.config.f.x10.x.menu add radiobutton -label "2" -variable tmpvar_12 -value "2" -command "update_active"
990
        $w.config.f.x10.x.menu add radiobutton -label "3" -variable tmpvar_12 -value "3" -command "update_active"
991
        $w.config.f.x10.x.menu add radiobutton -label "4" -variable tmpvar_12 -value "4" -command "update_active"
992
        menusplit $w $w.config.f.x10.x.menu 4
993
        global tmpvar_13
994
        minimenu $w.config.f 6 11 "Set size (kbytes/set)" tmpvar_13 CONFIG_DCACHE_SZ1
995
        menu $w.config.f.x11.x.menu -tearoffcommand "menutitle \"Set size (kbytes/set)\""
996
        $w.config.f.x11.x.menu add radiobutton -label "1" -variable tmpvar_13 -value "1" -command "update_active"
997
        $w.config.f.x11.x.menu add radiobutton -label "2" -variable tmpvar_13 -value "2" -command "update_active"
998
        $w.config.f.x11.x.menu add radiobutton -label "4" -variable tmpvar_13 -value "4" -command "update_active"
999
        $w.config.f.x11.x.menu add radiobutton -label "8" -variable tmpvar_13 -value "8" -command "update_active"
1000
        $w.config.f.x11.x.menu add radiobutton -label "16" -variable tmpvar_13 -value "16" -command "update_active"
1001
        $w.config.f.x11.x.menu add radiobutton -label "32" -variable tmpvar_13 -value "32" -command "update_active"
1002
        $w.config.f.x11.x.menu add radiobutton -label "64" -variable tmpvar_13 -value "64" -command "update_active"
1003
        $w.config.f.x11.x.menu add radiobutton -label "128" -variable tmpvar_13 -value "128" -command "update_active"
1004
        $w.config.f.x11.x.menu add radiobutton -label "256" -variable tmpvar_13 -value "256" -command "update_active"
1005
        menusplit $w $w.config.f.x11.x.menu 9
1006
        global tmpvar_14
1007
        minimenu $w.config.f 6 12 "Line size (bytes/line)" tmpvar_14 CONFIG_DCACHE_LZ16
1008
        menu $w.config.f.x12.x.menu -tearoffcommand "menutitle \"Line size (bytes/line)\""
1009
        $w.config.f.x12.x.menu add radiobutton -label "16" -variable tmpvar_14 -value "16" -command "update_active"
1010
        $w.config.f.x12.x.menu add radiobutton -label "32" -variable tmpvar_14 -value "32" -command "update_active"
1011
        menusplit $w $w.config.f.x12.x.menu 2
1012
        global tmpvar_15
1013
        minimenu $w.config.f 6 13 "Replacement alorithm" tmpvar_15 CONFIG_DCACHE_ALGORND
1014
        menu $w.config.f.x13.x.menu -tearoffcommand "menutitle \"Replacement alorithm\""
1015
        $w.config.f.x13.x.menu add radiobutton -label "Random" -variable tmpvar_15 -value "Random" -command "update_active"
1016
        $w.config.f.x13.x.menu add radiobutton -label "LRR" -variable tmpvar_15 -value "LRR" -command "update_active"
1017
        $w.config.f.x13.x.menu add radiobutton -label "LRU" -variable tmpvar_15 -value "LRU" -command "update_active"
1018
        menusplit $w $w.config.f.x13.x.menu 3
1019
        bool $w.config.f 6 14 "Cache locking      " CONFIG_DCACHE_LOCK
1020
        bool $w.config.f 6 15 "AHB snooping       " CONFIG_DCACHE_SNOOP
1021
        bool $w.config.f 6 16 "Fast snooping       " CONFIG_DCACHE_SNOOP_FAST
1022
        bool $w.config.f 6 17 "Separate snoop tags  " CONFIG_DCACHE_SNOOP_SEPTAG
1023
        hex $w.config.f 6 18 "Fixed cacheability map  " CONFIG_CACHE_FIXED
1024
        bool $w.config.f 6 19 "Enable local data RAM            " CONFIG_DCACHE_LRAM
1025
        global tmpvar_16
1026
        minimenu $w.config.f 6 20 "Local data RAM size (kbytes)" tmpvar_16 CONFIG_DCACHE_LRAM_SZ1
1027
        menu $w.config.f.x20.x.menu -tearoffcommand "menutitle \"Local data RAM size (kbytes)\""
1028
        $w.config.f.x20.x.menu add radiobutton -label "1" -variable tmpvar_16 -value "1" -command "update_active"
1029
        $w.config.f.x20.x.menu add radiobutton -label "2" -variable tmpvar_16 -value "2" -command "update_active"
1030
        $w.config.f.x20.x.menu add radiobutton -label "4" -variable tmpvar_16 -value "4" -command "update_active"
1031
        $w.config.f.x20.x.menu add radiobutton -label "8" -variable tmpvar_16 -value "8" -command "update_active"
1032
        $w.config.f.x20.x.menu add radiobutton -label "16" -variable tmpvar_16 -value "16" -command "update_active"
1033
        $w.config.f.x20.x.menu add radiobutton -label "32" -variable tmpvar_16 -value "32" -command "update_active"
1034
        $w.config.f.x20.x.menu add radiobutton -label "64" -variable tmpvar_16 -value "64" -command "update_active"
1035
        $w.config.f.x20.x.menu add radiobutton -label "128" -variable tmpvar_16 -value "128" -command "update_active"
1036
        $w.config.f.x20.x.menu add radiobutton -label "256" -variable tmpvar_16 -value "256" -command "update_active"
1037
        menusplit $w $w.config.f.x20.x.menu 9
1038
        hex $w.config.f 6 21 " Local data RAM start address (8 MSB) " CONFIG_DCACHE_LRSTART
1039
 
1040
 
1041
 
1042
        focus $w
1043
        update_active
1044
        global winx; global winy
1045
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
1046
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
1047
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1048
        update idletasks
1049
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1050
 
1051
        $w.config.canvas configure \
1052
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1053
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1054
                         [expr [winfo reqheight $w.config.f] + 1]"
1055
 
1056
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1057
        set scry [expr [winfo screenh $w] / 2]
1058
        set maxy [expr [winfo screenh $w] * 3 / 4]
1059
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1060
        if [expr $winy + $canvtotal < $maxy] {
1061
                $w.config.canvas configure -height $canvtotal
1062
        } else {
1063
                $w.config.canvas configure -height [expr $scry - $winy]
1064
                }
1065
        }
1066
        update idletasks
1067
        if {[winfo exists $w]} then {
1068
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1069
        wm minsize $w [winfo width $w] 100
1070
 
1071
        wm deiconify $w
1072
}
1073
}
1074
 
1075
proc update_menu6 {} {
1076
        global CONFIG_LEON3
1077
        global CONFIG_ICACHE_ENABLE
1078
        if {($CONFIG_LEON3 == 1)} then {
1079
        configure_entry .menu6.config.f.x0 normal {n l y}} else {configure_entry .menu6.config.f.x0 disabled {y n l}}
1080
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {configure_entry .menu6.config.f.x1 normal {x l}} else {configure_entry .menu6.config.f.x1 disabled {x l}}
1081
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {configure_entry .menu6.config.f.x2 normal {x l}} else {configure_entry .menu6.config.f.x2 disabled {x l}}
1082
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {configure_entry .menu6.config.f.x3 normal {x l}} else {configure_entry .menu6.config.f.x3 disabled {x l}}
1083
        global CONFIG_ICACHE_ASSO1
1084
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {configure_entry .menu6.config.f.x4 normal {x l}} else {configure_entry .menu6.config.f.x4 disabled {x l}}
1085
        global CONFIG_ICACHE_LOCK
1086
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {
1087
        configure_entry .menu6.config.f.x5 normal {n l y}} else {configure_entry .menu6.config.f.x5 disabled {y n l}}
1088
        global CONFIG_MMU_ENABLE
1089
        global CONFIG_ICACHE_LRAM
1090
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1091
        configure_entry .menu6.config.f.x6 normal {n l y}} else {configure_entry .menu6.config.f.x6 disabled {y n l}}
1092
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {configure_entry .menu6.config.f.x7 normal {x l}} else {configure_entry .menu6.config.f.x7 disabled {x l}}
1093
        global CONFIG_ICACHE_LRSTART
1094
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {.menu6.config.f.x8.x configure -state normal -foreground [ cget .ref -foreground ]; .menu6.config.f.x8.l configure -state normal; } else {.menu6.config.f.x8.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu6.config.f.x8.l configure -state disabled}
1095
        global CONFIG_DCACHE_ENABLE
1096
        if {($CONFIG_LEON3 == 1)} then {
1097
        configure_entry .menu6.config.f.x9 normal {n l y}} else {configure_entry .menu6.config.f.x9 disabled {y n l}}
1098
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {configure_entry .menu6.config.f.x10 normal {x l}} else {configure_entry .menu6.config.f.x10 disabled {x l}}
1099
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {configure_entry .menu6.config.f.x11 normal {x l}} else {configure_entry .menu6.config.f.x11 disabled {x l}}
1100
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {configure_entry .menu6.config.f.x12 normal {x l}} else {configure_entry .menu6.config.f.x12 disabled {x l}}
1101
        global CONFIG_DCACHE_ASSO1
1102
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {configure_entry .menu6.config.f.x13 normal {x l}} else {configure_entry .menu6.config.f.x13 disabled {x l}}
1103
        global CONFIG_DCACHE_LOCK
1104
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {
1105
        configure_entry .menu6.config.f.x14 normal {n l y}} else {configure_entry .menu6.config.f.x14 disabled {y n l}}
1106
        global CONFIG_DCACHE_SNOOP
1107
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
1108
        configure_entry .menu6.config.f.x15 normal {n l y}} else {configure_entry .menu6.config.f.x15 disabled {y n l}}
1109
        global CONFIG_DCACHE_SNOOP_FAST
1110
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1111
        configure_entry .menu6.config.f.x16 normal {n l y}} else {configure_entry .menu6.config.f.x16 disabled {y n l}}
1112
        global CONFIG_DCACHE_SNOOP_SEPTAG
1113
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1114
        configure_entry .menu6.config.f.x17 normal {n l y}} else {configure_entry .menu6.config.f.x17 disabled {y n l}}
1115
        global CONFIG_CACHE_FIXED
1116
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1 || $CONFIG_DCACHE_ENABLE == 1)} then {.menu6.config.f.x18.x configure -state normal -foreground [ cget .ref -foreground ]; .menu6.config.f.x18.l configure -state normal; } else {.menu6.config.f.x18.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu6.config.f.x18.l configure -state disabled}
1117
        global CONFIG_DCACHE_LRAM
1118
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1119
        configure_entry .menu6.config.f.x19 normal {n l y}} else {configure_entry .menu6.config.f.x19 disabled {y n l}}
1120
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {configure_entry .menu6.config.f.x20 normal {x l}} else {configure_entry .menu6.config.f.x20 disabled {x l}}
1121
        global CONFIG_DCACHE_LRSTART
1122
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {.menu6.config.f.x21.x configure -state normal -foreground [ cget .ref -foreground ]; .menu6.config.f.x21.l configure -state normal; } else {.menu6.config.f.x21.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu6.config.f.x21.l configure -state disabled}
1123
}
1124
 
1125
 
1126
proc update_define_menu6 {} {
1127
        update_define_mainmenu
1128
        global CONFIG_MODULES
1129
        global CONFIG_LEON3
1130
        global CONFIG_ICACHE_ENABLE
1131
        if {($CONFIG_LEON3 == 1)} then {
1132
        set CONFIG_ICACHE_ENABLE [expr $CONFIG_ICACHE_ENABLE&15]} else {set CONFIG_ICACHE_ENABLE [expr $CONFIG_ICACHE_ENABLE|16]}
1133
        global tmpvar_7
1134
        global CONFIG_ICACHE_ASSO1
1135
        if {$tmpvar_7 == "1"} then {set CONFIG_ICACHE_ASSO1 1} else {set CONFIG_ICACHE_ASSO1 0}
1136
        global CONFIG_ICACHE_ASSO2
1137
        if {$tmpvar_7 == "2"} then {set CONFIG_ICACHE_ASSO2 1} else {set CONFIG_ICACHE_ASSO2 0}
1138
        global CONFIG_ICACHE_ASSO3
1139
        if {$tmpvar_7 == "3"} then {set CONFIG_ICACHE_ASSO3 1} else {set CONFIG_ICACHE_ASSO3 0}
1140
        global CONFIG_ICACHE_ASSO4
1141
        if {$tmpvar_7 == "4"} then {set CONFIG_ICACHE_ASSO4 1} else {set CONFIG_ICACHE_ASSO4 0}
1142
        global tmpvar_8
1143
        global CONFIG_ICACHE_SZ1
1144
        if {$tmpvar_8 == "1"} then {set CONFIG_ICACHE_SZ1 1} else {set CONFIG_ICACHE_SZ1 0}
1145
        global CONFIG_ICACHE_SZ2
1146
        if {$tmpvar_8 == "2"} then {set CONFIG_ICACHE_SZ2 1} else {set CONFIG_ICACHE_SZ2 0}
1147
        global CONFIG_ICACHE_SZ4
1148
        if {$tmpvar_8 == "4"} then {set CONFIG_ICACHE_SZ4 1} else {set CONFIG_ICACHE_SZ4 0}
1149
        global CONFIG_ICACHE_SZ8
1150
        if {$tmpvar_8 == "8"} then {set CONFIG_ICACHE_SZ8 1} else {set CONFIG_ICACHE_SZ8 0}
1151
        global CONFIG_ICACHE_SZ16
1152
        if {$tmpvar_8 == "16"} then {set CONFIG_ICACHE_SZ16 1} else {set CONFIG_ICACHE_SZ16 0}
1153
        global CONFIG_ICACHE_SZ32
1154
        if {$tmpvar_8 == "32"} then {set CONFIG_ICACHE_SZ32 1} else {set CONFIG_ICACHE_SZ32 0}
1155
        global CONFIG_ICACHE_SZ64
1156
        if {$tmpvar_8 == "64"} then {set CONFIG_ICACHE_SZ64 1} else {set CONFIG_ICACHE_SZ64 0}
1157
        global CONFIG_ICACHE_SZ128
1158
        if {$tmpvar_8 == "128"} then {set CONFIG_ICACHE_SZ128 1} else {set CONFIG_ICACHE_SZ128 0}
1159
        global CONFIG_ICACHE_SZ256
1160
        if {$tmpvar_8 == "256"} then {set CONFIG_ICACHE_SZ256 1} else {set CONFIG_ICACHE_SZ256 0}
1161
        global tmpvar_9
1162
        global CONFIG_ICACHE_LZ16
1163
        if {$tmpvar_9 == "16"} then {set CONFIG_ICACHE_LZ16 1} else {set CONFIG_ICACHE_LZ16 0}
1164
        global CONFIG_ICACHE_LZ32
1165
        if {$tmpvar_9 == "32"} then {set CONFIG_ICACHE_LZ32 1} else {set CONFIG_ICACHE_LZ32 0}
1166
        global tmpvar_10
1167
        global CONFIG_ICACHE_ALGORND
1168
        if {$tmpvar_10 == "Random"} then {set CONFIG_ICACHE_ALGORND 1} else {set CONFIG_ICACHE_ALGORND 0}
1169
        global CONFIG_ICACHE_ALGOLRR
1170
        if {$tmpvar_10 == "LRR"} then {set CONFIG_ICACHE_ALGOLRR 1} else {set CONFIG_ICACHE_ALGOLRR 0}
1171
        global CONFIG_ICACHE_ALGOLRU
1172
        if {$tmpvar_10 == "LRU"} then {set CONFIG_ICACHE_ALGOLRU 1} else {set CONFIG_ICACHE_ALGOLRU 0}
1173
        global CONFIG_ICACHE_LOCK
1174
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {
1175
        set CONFIG_ICACHE_LOCK [expr $CONFIG_ICACHE_LOCK&15]} else {set CONFIG_ICACHE_LOCK [expr $CONFIG_ICACHE_LOCK|16]}
1176
        global CONFIG_MMU_ENABLE
1177
        global CONFIG_ICACHE_LRAM
1178
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1179
        set CONFIG_ICACHE_LRAM [expr $CONFIG_ICACHE_LRAM&15]} else {set CONFIG_ICACHE_LRAM [expr $CONFIG_ICACHE_LRAM|16]}
1180
        global tmpvar_11
1181
        global CONFIG_ICACHE_LRAM_SZ1
1182
        if {$tmpvar_11 == "1"} then {set CONFIG_ICACHE_LRAM_SZ1 1} else {set CONFIG_ICACHE_LRAM_SZ1 0}
1183
        global CONFIG_ICACHE_LRAM_SZ2
1184
        if {$tmpvar_11 == "2"} then {set CONFIG_ICACHE_LRAM_SZ2 1} else {set CONFIG_ICACHE_LRAM_SZ2 0}
1185
        global CONFIG_ICACHE_LRAM_SZ4
1186
        if {$tmpvar_11 == "4"} then {set CONFIG_ICACHE_LRAM_SZ4 1} else {set CONFIG_ICACHE_LRAM_SZ4 0}
1187
        global CONFIG_ICACHE_LRAM_SZ8
1188
        if {$tmpvar_11 == "8"} then {set CONFIG_ICACHE_LRAM_SZ8 1} else {set CONFIG_ICACHE_LRAM_SZ8 0}
1189
        global CONFIG_ICACHE_LRAM_SZ16
1190
        if {$tmpvar_11 == "16"} then {set CONFIG_ICACHE_LRAM_SZ16 1} else {set CONFIG_ICACHE_LRAM_SZ16 0}
1191
        global CONFIG_ICACHE_LRAM_SZ32
1192
        if {$tmpvar_11 == "32"} then {set CONFIG_ICACHE_LRAM_SZ32 1} else {set CONFIG_ICACHE_LRAM_SZ32 0}
1193
        global CONFIG_ICACHE_LRAM_SZ64
1194
        if {$tmpvar_11 == "64"} then {set CONFIG_ICACHE_LRAM_SZ64 1} else {set CONFIG_ICACHE_LRAM_SZ64 0}
1195
        global CONFIG_ICACHE_LRAM_SZ128
1196
        if {$tmpvar_11 == "128"} then {set CONFIG_ICACHE_LRAM_SZ128 1} else {set CONFIG_ICACHE_LRAM_SZ128 0}
1197
        global CONFIG_ICACHE_LRAM_SZ256
1198
        if {$tmpvar_11 == "256"} then {set CONFIG_ICACHE_LRAM_SZ256 1} else {set CONFIG_ICACHE_LRAM_SZ256 0}
1199
        global CONFIG_ICACHE_LRSTART
1200
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {validate_hex CONFIG_ICACHE_LRSTART "$CONFIG_ICACHE_LRSTART" 8e}
1201
        global CONFIG_DCACHE_ENABLE
1202
        if {($CONFIG_LEON3 == 1)} then {
1203
        set CONFIG_DCACHE_ENABLE [expr $CONFIG_DCACHE_ENABLE&15]} else {set CONFIG_DCACHE_ENABLE [expr $CONFIG_DCACHE_ENABLE|16]}
1204
        global tmpvar_12
1205
        global CONFIG_DCACHE_ASSO1
1206
        if {$tmpvar_12 == "1"} then {set CONFIG_DCACHE_ASSO1 1} else {set CONFIG_DCACHE_ASSO1 0}
1207
        global CONFIG_DCACHE_ASSO2
1208
        if {$tmpvar_12 == "2"} then {set CONFIG_DCACHE_ASSO2 1} else {set CONFIG_DCACHE_ASSO2 0}
1209
        global CONFIG_DCACHE_ASSO3
1210
        if {$tmpvar_12 == "3"} then {set CONFIG_DCACHE_ASSO3 1} else {set CONFIG_DCACHE_ASSO3 0}
1211
        global CONFIG_DCACHE_ASSO4
1212
        if {$tmpvar_12 == "4"} then {set CONFIG_DCACHE_ASSO4 1} else {set CONFIG_DCACHE_ASSO4 0}
1213
        global tmpvar_13
1214
        global CONFIG_DCACHE_SZ1
1215
        if {$tmpvar_13 == "1"} then {set CONFIG_DCACHE_SZ1 1} else {set CONFIG_DCACHE_SZ1 0}
1216
        global CONFIG_DCACHE_SZ2
1217
        if {$tmpvar_13 == "2"} then {set CONFIG_DCACHE_SZ2 1} else {set CONFIG_DCACHE_SZ2 0}
1218
        global CONFIG_DCACHE_SZ4
1219
        if {$tmpvar_13 == "4"} then {set CONFIG_DCACHE_SZ4 1} else {set CONFIG_DCACHE_SZ4 0}
1220
        global CONFIG_DCACHE_SZ8
1221
        if {$tmpvar_13 == "8"} then {set CONFIG_DCACHE_SZ8 1} else {set CONFIG_DCACHE_SZ8 0}
1222
        global CONFIG_DCACHE_SZ16
1223
        if {$tmpvar_13 == "16"} then {set CONFIG_DCACHE_SZ16 1} else {set CONFIG_DCACHE_SZ16 0}
1224
        global CONFIG_DCACHE_SZ32
1225
        if {$tmpvar_13 == "32"} then {set CONFIG_DCACHE_SZ32 1} else {set CONFIG_DCACHE_SZ32 0}
1226
        global CONFIG_DCACHE_SZ64
1227
        if {$tmpvar_13 == "64"} then {set CONFIG_DCACHE_SZ64 1} else {set CONFIG_DCACHE_SZ64 0}
1228
        global CONFIG_DCACHE_SZ128
1229
        if {$tmpvar_13 == "128"} then {set CONFIG_DCACHE_SZ128 1} else {set CONFIG_DCACHE_SZ128 0}
1230
        global CONFIG_DCACHE_SZ256
1231
        if {$tmpvar_13 == "256"} then {set CONFIG_DCACHE_SZ256 1} else {set CONFIG_DCACHE_SZ256 0}
1232
        global tmpvar_14
1233
        global CONFIG_DCACHE_LZ16
1234
        if {$tmpvar_14 == "16"} then {set CONFIG_DCACHE_LZ16 1} else {set CONFIG_DCACHE_LZ16 0}
1235
        global CONFIG_DCACHE_LZ32
1236
        if {$tmpvar_14 == "32"} then {set CONFIG_DCACHE_LZ32 1} else {set CONFIG_DCACHE_LZ32 0}
1237
        global tmpvar_15
1238
        global CONFIG_DCACHE_ALGORND
1239
        if {$tmpvar_15 == "Random"} then {set CONFIG_DCACHE_ALGORND 1} else {set CONFIG_DCACHE_ALGORND 0}
1240
        global CONFIG_DCACHE_ALGOLRR
1241
        if {$tmpvar_15 == "LRR"} then {set CONFIG_DCACHE_ALGOLRR 1} else {set CONFIG_DCACHE_ALGOLRR 0}
1242
        global CONFIG_DCACHE_ALGOLRU
1243
        if {$tmpvar_15 == "LRU"} then {set CONFIG_DCACHE_ALGOLRU 1} else {set CONFIG_DCACHE_ALGOLRU 0}
1244
        global CONFIG_DCACHE_LOCK
1245
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {
1246
        set CONFIG_DCACHE_LOCK [expr $CONFIG_DCACHE_LOCK&15]} else {set CONFIG_DCACHE_LOCK [expr $CONFIG_DCACHE_LOCK|16]}
1247
        global CONFIG_DCACHE_SNOOP
1248
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
1249
        set CONFIG_DCACHE_SNOOP [expr $CONFIG_DCACHE_SNOOP&15]} else {set CONFIG_DCACHE_SNOOP [expr $CONFIG_DCACHE_SNOOP|16]}
1250
        global CONFIG_DCACHE_SNOOP_FAST
1251
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1252
        set CONFIG_DCACHE_SNOOP_FAST [expr $CONFIG_DCACHE_SNOOP_FAST&15]} else {set CONFIG_DCACHE_SNOOP_FAST [expr $CONFIG_DCACHE_SNOOP_FAST|16]}
1253
        global CONFIG_DCACHE_SNOOP_SEPTAG
1254
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1255
        set CONFIG_DCACHE_SNOOP_SEPTAG [expr $CONFIG_DCACHE_SNOOP_SEPTAG&15]} else {set CONFIG_DCACHE_SNOOP_SEPTAG [expr $CONFIG_DCACHE_SNOOP_SEPTAG|16]}
1256
        global CONFIG_CACHE_FIXED
1257
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1 || $CONFIG_DCACHE_ENABLE == 1)} then {validate_hex CONFIG_CACHE_FIXED "$CONFIG_CACHE_FIXED" 0}
1258
        global CONFIG_DCACHE_LRAM
1259
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1260
        set CONFIG_DCACHE_LRAM [expr $CONFIG_DCACHE_LRAM&15]} else {set CONFIG_DCACHE_LRAM [expr $CONFIG_DCACHE_LRAM|16]}
1261
        global tmpvar_16
1262
        global CONFIG_DCACHE_LRAM_SZ1
1263
        if {$tmpvar_16 == "1"} then {set CONFIG_DCACHE_LRAM_SZ1 1} else {set CONFIG_DCACHE_LRAM_SZ1 0}
1264
        global CONFIG_DCACHE_LRAM_SZ2
1265
        if {$tmpvar_16 == "2"} then {set CONFIG_DCACHE_LRAM_SZ2 1} else {set CONFIG_DCACHE_LRAM_SZ2 0}
1266
        global CONFIG_DCACHE_LRAM_SZ4
1267
        if {$tmpvar_16 == "4"} then {set CONFIG_DCACHE_LRAM_SZ4 1} else {set CONFIG_DCACHE_LRAM_SZ4 0}
1268
        global CONFIG_DCACHE_LRAM_SZ8
1269
        if {$tmpvar_16 == "8"} then {set CONFIG_DCACHE_LRAM_SZ8 1} else {set CONFIG_DCACHE_LRAM_SZ8 0}
1270
        global CONFIG_DCACHE_LRAM_SZ16
1271
        if {$tmpvar_16 == "16"} then {set CONFIG_DCACHE_LRAM_SZ16 1} else {set CONFIG_DCACHE_LRAM_SZ16 0}
1272
        global CONFIG_DCACHE_LRAM_SZ32
1273
        if {$tmpvar_16 == "32"} then {set CONFIG_DCACHE_LRAM_SZ32 1} else {set CONFIG_DCACHE_LRAM_SZ32 0}
1274
        global CONFIG_DCACHE_LRAM_SZ64
1275
        if {$tmpvar_16 == "64"} then {set CONFIG_DCACHE_LRAM_SZ64 1} else {set CONFIG_DCACHE_LRAM_SZ64 0}
1276
        global CONFIG_DCACHE_LRAM_SZ128
1277
        if {$tmpvar_16 == "128"} then {set CONFIG_DCACHE_LRAM_SZ128 1} else {set CONFIG_DCACHE_LRAM_SZ128 0}
1278
        global CONFIG_DCACHE_LRAM_SZ256
1279
        if {$tmpvar_16 == "256"} then {set CONFIG_DCACHE_LRAM_SZ256 1} else {set CONFIG_DCACHE_LRAM_SZ256 0}
1280
        global CONFIG_DCACHE_LRSTART
1281
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {validate_hex CONFIG_DCACHE_LRSTART "$CONFIG_DCACHE_LRSTART" 8f}
1282
}
1283
 
1284
 
1285
proc menu7 {w title} {
1286
        set oldFocus [focus]
1287
        catch {focus .menu3}
1288
        catch {destroy $w; unregister_active 7}
1289
        toplevel $w -class Dialog
1290
        wm withdraw $w
1291
        global active_menus
1292
        set active_menus [lsort -integer [linsert $active_menus end 7]]
1293
        message $w.m -width 400 -aspect 300 -text \
1294
                "MMU"  -relief raised
1295
        pack $w.m -pady 10 -side top -padx 10
1296
        wm title $w "MMU"
1297
 
1298
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 7; break"
1299
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu8 .menu8 \"$title\""
1300
        frame $w.f
1301
        button $w.f.back -text "OK" \
1302
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 7"
1303
        button $w.f.next -text "Next" -underline 0\
1304
                -width 15 -command $nextscript
1305
        bind all  $nextscript
1306
        button $w.f.prev -text "Prev" -underline 0\
1307
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu6 .menu6 \"$title\""
1308
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu6 .menu6 \"$title\";break"
1309
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1310
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1311
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1312
        pack $w.topline -side top -fill x
1313
 
1314
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1315
        pack $w.botline -side bottom -fill x
1316
 
1317
        frame $w.config
1318
        pack $w.config -fill y -expand on
1319
 
1320
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1321
        pack $w.config.vscroll -side right -fill y
1322
 
1323
        canvas $w.config.canvas -height 1\
1324
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1325
                -width [expr [winfo screenwidth .] * 1 / 2]
1326
        frame $w.config.f
1327
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1328
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1329
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1330
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1331
        bind $w  "$w.config.canvas yview moveto 0;break;"
1332
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1333
        pack $w.config.canvas -side right -fill y
1334
 
1335
 
1336
        bool $w.config.f 7 0 "Enable MMU       " CONFIG_MMU_ENABLE
1337
        global tmpvar_17
1338
        minimenu $w.config.f 7 1 "MMU type              " tmpvar_17 CONFIG_MMU_COMBINED
1339
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"MMU type              \""
1340
        $w.config.f.x1.x.menu add radiobutton -label "combined" -variable tmpvar_17 -value "combined" -command "update_active"
1341
        $w.config.f.x1.x.menu add radiobutton -label "split" -variable tmpvar_17 -value "split" -command "update_active"
1342
        menusplit $w $w.config.f.x1.x.menu 2
1343
        global tmpvar_18
1344
        minimenu $w.config.f 7 2 "TLB replacement sheme              " tmpvar_18 CONFIG_MMU_REPARRAY
1345
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"TLB replacement sheme              \""
1346
        $w.config.f.x2.x.menu add radiobutton -label "LRU" -variable tmpvar_18 -value "LRU" -command "update_active"
1347
        $w.config.f.x2.x.menu add radiobutton -label "Increment" -variable tmpvar_18 -value "Increment" -command "update_active"
1348
        menusplit $w $w.config.f.x2.x.menu 2
1349
        global tmpvar_19
1350
        minimenu $w.config.f 7 3 "Instruction (or combined) TLB entries" tmpvar_19 CONFIG_MMU_I2
1351
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"Instruction (or combined) TLB entries\""
1352
        $w.config.f.x3.x.menu add radiobutton -label "2" -variable tmpvar_19 -value "2" -command "update_active"
1353
        $w.config.f.x3.x.menu add radiobutton -label "4" -variable tmpvar_19 -value "4" -command "update_active"
1354
        $w.config.f.x3.x.menu add radiobutton -label "8" -variable tmpvar_19 -value "8" -command "update_active"
1355
        $w.config.f.x3.x.menu add radiobutton -label "16" -variable tmpvar_19 -value "16" -command "update_active"
1356
        $w.config.f.x3.x.menu add radiobutton -label "32" -variable tmpvar_19 -value "32" -command "update_active"
1357
        menusplit $w $w.config.f.x3.x.menu 5
1358
        global tmpvar_20
1359
        minimenu $w.config.f 7 4 "Data TLB entries" tmpvar_20 CONFIG_MMU_D2
1360
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"Data TLB entries\""
1361
        $w.config.f.x4.x.menu add radiobutton -label "2" -variable tmpvar_20 -value "2" -command "update_active"
1362
        $w.config.f.x4.x.menu add radiobutton -label "4" -variable tmpvar_20 -value "4" -command "update_active"
1363
        $w.config.f.x4.x.menu add radiobutton -label "8" -variable tmpvar_20 -value "8" -command "update_active"
1364
        $w.config.f.x4.x.menu add radiobutton -label "16" -variable tmpvar_20 -value "16" -command "update_active"
1365
        $w.config.f.x4.x.menu add radiobutton -label "32" -variable tmpvar_20 -value "32" -command "update_active"
1366
        menusplit $w $w.config.f.x4.x.menu 5
1367
        bool $w.config.f 7 5 "Fast writebuffer       " CONFIG_MMU_FASTWB
1368
 
1369
 
1370
 
1371
        focus $w
1372
        update_active
1373
        global winx; global winy
1374
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
1375
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
1376
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1377
        update idletasks
1378
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1379
 
1380
        $w.config.canvas configure \
1381
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1382
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1383
                         [expr [winfo reqheight $w.config.f] + 1]"
1384
 
1385
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1386
        set scry [expr [winfo screenh $w] / 2]
1387
        set maxy [expr [winfo screenh $w] * 3 / 4]
1388
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1389
        if [expr $winy + $canvtotal < $maxy] {
1390
                $w.config.canvas configure -height $canvtotal
1391
        } else {
1392
                $w.config.canvas configure -height [expr $scry - $winy]
1393
                }
1394
        }
1395
        update idletasks
1396
        if {[winfo exists $w]} then {
1397
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1398
        wm minsize $w [winfo width $w] 100
1399
 
1400
        wm deiconify $w
1401
}
1402
}
1403
 
1404
proc update_menu7 {} {
1405
        global CONFIG_LEON3
1406
        global CONFIG_MMU_ENABLE
1407
        if {($CONFIG_LEON3 == 1)} then {
1408
        configure_entry .menu7.config.f.x0 normal {n l y}} else {configure_entry .menu7.config.f.x0 disabled {y n l}}
1409
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {configure_entry .menu7.config.f.x1 normal {x l}} else {configure_entry .menu7.config.f.x1 disabled {x l}}
1410
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {configure_entry .menu7.config.f.x2 normal {x l}} else {configure_entry .menu7.config.f.x2 disabled {x l}}
1411
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {configure_entry .menu7.config.f.x3 normal {x l}} else {configure_entry .menu7.config.f.x3 disabled {x l}}
1412
        global CONFIG_MMU_SPLIT
1413
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {configure_entry .menu7.config.f.x4 normal {x l}} else {configure_entry .menu7.config.f.x4 disabled {x l}}
1414
        global CONFIG_MMU_FASTWB
1415
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {
1416
        configure_entry .menu7.config.f.x5 normal {n l y}} else {configure_entry .menu7.config.f.x5 disabled {y n l}}
1417
}
1418
 
1419
 
1420
proc update_define_menu7 {} {
1421
        update_define_mainmenu
1422
        global CONFIG_MODULES
1423
        global CONFIG_LEON3
1424
        global CONFIG_MMU_ENABLE
1425
        if {($CONFIG_LEON3 == 1)} then {
1426
        set CONFIG_MMU_ENABLE [expr $CONFIG_MMU_ENABLE&15]} else {set CONFIG_MMU_ENABLE [expr $CONFIG_MMU_ENABLE|16]}
1427
        global tmpvar_17
1428
        global CONFIG_MMU_COMBINED
1429
        if {$tmpvar_17 == "combined"} then {set CONFIG_MMU_COMBINED 1} else {set CONFIG_MMU_COMBINED 0}
1430
        global CONFIG_MMU_SPLIT
1431
        if {$tmpvar_17 == "split"} then {set CONFIG_MMU_SPLIT 1} else {set CONFIG_MMU_SPLIT 0}
1432
        global tmpvar_18
1433
        global CONFIG_MMU_REPARRAY
1434
        if {$tmpvar_18 == "LRU"} then {set CONFIG_MMU_REPARRAY 1} else {set CONFIG_MMU_REPARRAY 0}
1435
        global CONFIG_MMU_REPINCREMENT
1436
        if {$tmpvar_18 == "Increment"} then {set CONFIG_MMU_REPINCREMENT 1} else {set CONFIG_MMU_REPINCREMENT 0}
1437
        global tmpvar_19
1438
        global CONFIG_MMU_I2
1439
        if {$tmpvar_19 == "2"} then {set CONFIG_MMU_I2 1} else {set CONFIG_MMU_I2 0}
1440
        global CONFIG_MMU_I4
1441
        if {$tmpvar_19 == "4"} then {set CONFIG_MMU_I4 1} else {set CONFIG_MMU_I4 0}
1442
        global CONFIG_MMU_I8
1443
        if {$tmpvar_19 == "8"} then {set CONFIG_MMU_I8 1} else {set CONFIG_MMU_I8 0}
1444
        global CONFIG_MMU_I16
1445
        if {$tmpvar_19 == "16"} then {set CONFIG_MMU_I16 1} else {set CONFIG_MMU_I16 0}
1446
        global CONFIG_MMU_I32
1447
        if {$tmpvar_19 == "32"} then {set CONFIG_MMU_I32 1} else {set CONFIG_MMU_I32 0}
1448
        global tmpvar_20
1449
        global CONFIG_MMU_D2
1450
        if {$tmpvar_20 == "2"} then {set CONFIG_MMU_D2 1} else {set CONFIG_MMU_D2 0}
1451
        global CONFIG_MMU_D4
1452
        if {$tmpvar_20 == "4"} then {set CONFIG_MMU_D4 1} else {set CONFIG_MMU_D4 0}
1453
        global CONFIG_MMU_D8
1454
        if {$tmpvar_20 == "8"} then {set CONFIG_MMU_D8 1} else {set CONFIG_MMU_D8 0}
1455
        global CONFIG_MMU_D16
1456
        if {$tmpvar_20 == "16"} then {set CONFIG_MMU_D16 1} else {set CONFIG_MMU_D16 0}
1457
        global CONFIG_MMU_D32
1458
        if {$tmpvar_20 == "32"} then {set CONFIG_MMU_D32 1} else {set CONFIG_MMU_D32 0}
1459
        global CONFIG_MMU_FASTWB
1460
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {
1461
        set CONFIG_MMU_FASTWB [expr $CONFIG_MMU_FASTWB&15]} else {set CONFIG_MMU_FASTWB [expr $CONFIG_MMU_FASTWB|16]}
1462
}
1463
 
1464
 
1465
proc menu8 {w title} {
1466
        set oldFocus [focus]
1467
        catch {focus .menu3}
1468
        catch {destroy $w; unregister_active 8}
1469
        toplevel $w -class Dialog
1470
        wm withdraw $w
1471
        global active_menus
1472
        set active_menus [lsort -integer [linsert $active_menus end 8]]
1473
        message $w.m -width 400 -aspect 300 -text \
1474
                "Debug Support Unit        "  -relief raised
1475
        pack $w.m -pady 10 -side top -padx 10
1476
        wm title $w "Debug Support Unit        "
1477
 
1478
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 8; break"
1479
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 8; menu9 .menu9 \"$title\""
1480
        frame $w.f
1481
        button $w.f.back -text "OK" \
1482
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 8"
1483
        button $w.f.next -text "Next" -underline 0\
1484
                -width 15 -command $nextscript
1485
        bind all  $nextscript
1486
        button $w.f.prev -text "Prev" -underline 0\
1487
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 8; menu7 .menu7 \"$title\""
1488
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 8; menu7 .menu7 \"$title\";break"
1489
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1490
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1491
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1492
        pack $w.topline -side top -fill x
1493
 
1494
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1495
        pack $w.botline -side bottom -fill x
1496
 
1497
        frame $w.config
1498
        pack $w.config -fill y -expand on
1499
 
1500
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1501
        pack $w.config.vscroll -side right -fill y
1502
 
1503
        canvas $w.config.canvas -height 1\
1504
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1505
                -width [expr [winfo screenwidth .] * 1 / 2]
1506
        frame $w.config.f
1507
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1508
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1509
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1510
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1511
        bind $w  "$w.config.canvas yview moveto 0;break;"
1512
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1513
        pack $w.config.canvas -side right -fill y
1514
 
1515
 
1516
        bool $w.config.f 8 0 "Enable LEON3 Debug support unit    " CONFIG_DSU_ENABLE
1517
        bool $w.config.f 8 1 "Instruction trace buffer" CONFIG_DSU_ITRACE
1518
        global tmpvar_21
1519
        minimenu $w.config.f 8 2 "Instruction trace buffer size (kbytes)" tmpvar_21 CONFIG_DSU_ITRACESZ1
1520
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"Instruction trace buffer size (kbytes)\""
1521
        $w.config.f.x2.x.menu add radiobutton -label "1" -variable tmpvar_21 -value "1" -command "update_active"
1522
        $w.config.f.x2.x.menu add radiobutton -label "2" -variable tmpvar_21 -value "2" -command "update_active"
1523
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_21 -value "4" -command "update_active"
1524
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_21 -value "8" -command "update_active"
1525
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_21 -value "16" -command "update_active"
1526
        menusplit $w $w.config.f.x2.x.menu 5
1527
        bool $w.config.f 8 3 "AHB trace buffer" CONFIG_DSU_ATRACE
1528
        global tmpvar_22
1529
        minimenu $w.config.f 8 4 "AHB trace buffer size (kbytes)" tmpvar_22 CONFIG_DSU_ATRACESZ1
1530
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"AHB trace buffer size (kbytes)\""
1531
        $w.config.f.x4.x.menu add radiobutton -label "1" -variable tmpvar_22 -value "1" -command "update_active"
1532
        $w.config.f.x4.x.menu add radiobutton -label "2" -variable tmpvar_22 -value "2" -command "update_active"
1533
        $w.config.f.x4.x.menu add radiobutton -label "4" -variable tmpvar_22 -value "4" -command "update_active"
1534
        $w.config.f.x4.x.menu add radiobutton -label "8" -variable tmpvar_22 -value "8" -command "update_active"
1535
        $w.config.f.x4.x.menu add radiobutton -label "16" -variable tmpvar_22 -value "16" -command "update_active"
1536
        menusplit $w $w.config.f.x4.x.menu 5
1537
 
1538
 
1539
 
1540
        focus $w
1541
        update_active
1542
        global winx; global winy
1543
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
1544
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
1545
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1546
        update idletasks
1547
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1548
 
1549
        $w.config.canvas configure \
1550
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1551
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1552
                         [expr [winfo reqheight $w.config.f] + 1]"
1553
 
1554
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1555
        set scry [expr [winfo screenh $w] / 2]
1556
        set maxy [expr [winfo screenh $w] * 3 / 4]
1557
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1558
        if [expr $winy + $canvtotal < $maxy] {
1559
                $w.config.canvas configure -height $canvtotal
1560
        } else {
1561
                $w.config.canvas configure -height [expr $scry - $winy]
1562
                }
1563
        }
1564
        update idletasks
1565
        if {[winfo exists $w]} then {
1566
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1567
        wm minsize $w [winfo width $w] 100
1568
 
1569
        wm deiconify $w
1570
}
1571
}
1572
 
1573
proc update_menu8 {} {
1574
        global CONFIG_LEON3
1575
        global CONFIG_DSU_ENABLE
1576
        if {($CONFIG_LEON3 == 1)} then {
1577
        configure_entry .menu8.config.f.x0 normal {n l y}} else {configure_entry .menu8.config.f.x0 disabled {y n l}}
1578
        global CONFIG_DSU_ITRACE
1579
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
1580
        configure_entry .menu8.config.f.x1 normal {n l y}} else {configure_entry .menu8.config.f.x1 disabled {y n l}}
1581
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ITRACE == 1)} then {configure_entry .menu8.config.f.x2 normal {x l}} else {configure_entry .menu8.config.f.x2 disabled {x l}}
1582
        global CONFIG_DSU_ATRACE
1583
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
1584
        configure_entry .menu8.config.f.x3 normal {n l y}} else {configure_entry .menu8.config.f.x3 disabled {y n l}}
1585
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ATRACE == 1)} then {configure_entry .menu8.config.f.x4 normal {x l}} else {configure_entry .menu8.config.f.x4 disabled {x l}}
1586
}
1587
 
1588
 
1589
proc update_define_menu8 {} {
1590
        update_define_mainmenu
1591
        global CONFIG_MODULES
1592
        global CONFIG_LEON3
1593
        global CONFIG_DSU_ENABLE
1594
        if {($CONFIG_LEON3 == 1)} then {
1595
        set CONFIG_DSU_ENABLE [expr $CONFIG_DSU_ENABLE&15]} else {set CONFIG_DSU_ENABLE [expr $CONFIG_DSU_ENABLE|16]}
1596
        global CONFIG_DSU_ITRACE
1597
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
1598
        set CONFIG_DSU_ITRACE [expr $CONFIG_DSU_ITRACE&15]} else {set CONFIG_DSU_ITRACE [expr $CONFIG_DSU_ITRACE|16]}
1599
        global tmpvar_21
1600
        global CONFIG_DSU_ITRACESZ1
1601
        if {$tmpvar_21 == "1"} then {set CONFIG_DSU_ITRACESZ1 1} else {set CONFIG_DSU_ITRACESZ1 0}
1602
        global CONFIG_DSU_ITRACESZ2
1603
        if {$tmpvar_21 == "2"} then {set CONFIG_DSU_ITRACESZ2 1} else {set CONFIG_DSU_ITRACESZ2 0}
1604
        global CONFIG_DSU_ITRACESZ4
1605
        if {$tmpvar_21 == "4"} then {set CONFIG_DSU_ITRACESZ4 1} else {set CONFIG_DSU_ITRACESZ4 0}
1606
        global CONFIG_DSU_ITRACESZ8
1607
        if {$tmpvar_21 == "8"} then {set CONFIG_DSU_ITRACESZ8 1} else {set CONFIG_DSU_ITRACESZ8 0}
1608
        global CONFIG_DSU_ITRACESZ16
1609
        if {$tmpvar_21 == "16"} then {set CONFIG_DSU_ITRACESZ16 1} else {set CONFIG_DSU_ITRACESZ16 0}
1610
        global CONFIG_DSU_ATRACE
1611
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
1612
        set CONFIG_DSU_ATRACE [expr $CONFIG_DSU_ATRACE&15]} else {set CONFIG_DSU_ATRACE [expr $CONFIG_DSU_ATRACE|16]}
1613
        global tmpvar_22
1614
        global CONFIG_DSU_ATRACESZ1
1615
        if {$tmpvar_22 == "1"} then {set CONFIG_DSU_ATRACESZ1 1} else {set CONFIG_DSU_ATRACESZ1 0}
1616
        global CONFIG_DSU_ATRACESZ2
1617
        if {$tmpvar_22 == "2"} then {set CONFIG_DSU_ATRACESZ2 1} else {set CONFIG_DSU_ATRACESZ2 0}
1618
        global CONFIG_DSU_ATRACESZ4
1619
        if {$tmpvar_22 == "4"} then {set CONFIG_DSU_ATRACESZ4 1} else {set CONFIG_DSU_ATRACESZ4 0}
1620
        global CONFIG_DSU_ATRACESZ8
1621
        if {$tmpvar_22 == "8"} then {set CONFIG_DSU_ATRACESZ8 1} else {set CONFIG_DSU_ATRACESZ8 0}
1622
        global CONFIG_DSU_ATRACESZ16
1623
        if {$tmpvar_22 == "16"} then {set CONFIG_DSU_ATRACESZ16 1} else {set CONFIG_DSU_ATRACESZ16 0}
1624
}
1625
 
1626
 
1627
proc menu9 {w title} {
1628
        set oldFocus [focus]
1629
        catch {focus .menu3}
1630
        catch {destroy $w; unregister_active 9}
1631
        toplevel $w -class Dialog
1632
        wm withdraw $w
1633
        global active_menus
1634
        set active_menus [lsort -integer [linsert $active_menus end 9]]
1635
        message $w.m -width 400 -aspect 300 -text \
1636
                "Fault-tolerance  "  -relief raised
1637
        pack $w.m -pady 10 -side top -padx 10
1638
        wm title $w "Fault-tolerance  "
1639
 
1640
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 9; break"
1641
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 9; menu10 .menu10 \"$title\""
1642
        frame $w.f
1643
        button $w.f.back -text "OK" \
1644
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 9"
1645
        button $w.f.next -text "Next" -underline 0\
1646
                -width 15 -command $nextscript
1647
        bind all  $nextscript
1648
        button $w.f.prev -text "Prev" -underline 0\
1649
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 9; menu8 .menu8 \"$title\""
1650
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 9; menu8 .menu8 \"$title\";break"
1651
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1652
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1653
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1654
        pack $w.topline -side top -fill x
1655
 
1656
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1657
        pack $w.botline -side bottom -fill x
1658
 
1659
        frame $w.config
1660
        pack $w.config -fill y -expand on
1661
 
1662
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1663
        pack $w.config.vscroll -side right -fill y
1664
 
1665
        canvas $w.config.canvas -height 1\
1666
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1667
                -width [expr [winfo screenwidth .] * 1 / 2]
1668
        frame $w.config.f
1669
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1670
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1671
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1672
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1673
        bind $w  "$w.config.canvas yview moveto 0;break;"
1674
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1675
        pack $w.config.canvas -side right -fill y
1676
 
1677
 
1678
 
1679
 
1680
 
1681
        focus $w
1682
        update_active
1683
        global winx; global winy
1684
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
1685
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
1686
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1687
        update idletasks
1688
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1689
 
1690
        $w.config.canvas configure \
1691
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1692
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1693
                         [expr [winfo reqheight $w.config.f] + 1]"
1694
 
1695
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1696
        set scry [expr [winfo screenh $w] / 2]
1697
        set maxy [expr [winfo screenh $w] * 3 / 4]
1698
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1699
        if [expr $winy + $canvtotal < $maxy] {
1700
                $w.config.canvas configure -height $canvtotal
1701
        } else {
1702
                $w.config.canvas configure -height [expr $scry - $winy]
1703
                }
1704
        }
1705
        update idletasks
1706
        if {[winfo exists $w]} then {
1707
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1708
        wm minsize $w [winfo width $w] 100
1709
 
1710
        wm deiconify $w
1711
}
1712
}
1713
 
1714
proc update_menu9 {} {
1715
}
1716
 
1717
 
1718
proc update_define_menu9 {} {
1719
        update_define_mainmenu
1720
        global CONFIG_MODULES
1721
}
1722
 
1723
 
1724
proc menu10 {w title} {
1725
        set oldFocus [focus]
1726
        catch {focus .menu3}
1727
        catch {destroy $w; unregister_active 10}
1728
        toplevel $w -class Dialog
1729
        wm withdraw $w
1730
        global active_menus
1731
        set active_menus [lsort -integer [linsert $active_menus end 10]]
1732
        message $w.m -width 400 -aspect 300 -text \
1733
                "VHDL debug settings       "  -relief raised
1734
        pack $w.m -pady 10 -side top -padx 10
1735
        wm title $w "VHDL debug settings       "
1736
 
1737
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 10; break"
1738
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 10; catch {destroy .menu3}; unregister_active 3; menu11 .menu11 \"$title\""
1739
        frame $w.f
1740
        button $w.f.back -text "OK" \
1741
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 10"
1742
        button $w.f.next -text "Next" -underline 0\
1743
                -width 15 -command $nextscript
1744
        bind all  $nextscript
1745
        button $w.f.prev -text "Prev" -underline 0\
1746
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 10; menu9 .menu9 \"$title\""
1747
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 10; menu9 .menu9 \"$title\";break"
1748
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1749
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1750
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1751
        pack $w.topline -side top -fill x
1752
 
1753
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1754
        pack $w.botline -side bottom -fill x
1755
 
1756
        frame $w.config
1757
        pack $w.config -fill y -expand on
1758
 
1759
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1760
        pack $w.config.vscroll -side right -fill y
1761
 
1762
        canvas $w.config.canvas -height 1\
1763
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1764
                -width [expr [winfo screenwidth .] * 1 / 2]
1765
        frame $w.config.f
1766
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1767
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1768
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1769
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1770
        bind $w  "$w.config.canvas yview moveto 0;break;"
1771
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1772
        pack $w.config.canvas -side right -fill y
1773
 
1774
 
1775
        bool $w.config.f 10 0 "Processor disassembly to console         " CONFIG_IU_DISAS
1776
        bool $w.config.f 10 1 "Processor disassembly in netlist         " CONFIG_IU_DISAS_NET
1777
        bool $w.config.f 10 2 "32-bit program counters       " CONFIG_DEBUG_PC32
1778
 
1779
 
1780
 
1781
        focus $w
1782
        update_active
1783
        global winx; global winy
1784
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
1785
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
1786
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1787
        update idletasks
1788
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1789
 
1790
        $w.config.canvas configure \
1791
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1792
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1793
                         [expr [winfo reqheight $w.config.f] + 1]"
1794
 
1795
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1796
        set scry [expr [winfo screenh $w] / 2]
1797
        set maxy [expr [winfo screenh $w] * 3 / 4]
1798
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1799
        if [expr $winy + $canvtotal < $maxy] {
1800
                $w.config.canvas configure -height $canvtotal
1801
        } else {
1802
                $w.config.canvas configure -height [expr $scry - $winy]
1803
                }
1804
        }
1805
        update idletasks
1806
        if {[winfo exists $w]} then {
1807
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1808
        wm minsize $w [winfo width $w] 100
1809
 
1810
        wm deiconify $w
1811
}
1812
}
1813
 
1814
proc update_menu10 {} {
1815
        global CONFIG_LEON3
1816
        global CONFIG_IU_DISAS
1817
        if {($CONFIG_LEON3 == 1)} then {
1818
        configure_entry .menu10.config.f.x0 normal {n l y}} else {configure_entry .menu10.config.f.x0 disabled {y n l}}
1819
        global CONFIG_IU_DISAS_NET
1820
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_DISAS == 1)} then {
1821
        configure_entry .menu10.config.f.x1 normal {n l y}} else {configure_entry .menu10.config.f.x1 disabled {y n l}}
1822
        global CONFIG_DEBUG_PC32
1823
        if {($CONFIG_LEON3 == 1)} then {
1824
        configure_entry .menu10.config.f.x2 normal {n l y}} else {configure_entry .menu10.config.f.x2 disabled {y n l}}
1825
}
1826
 
1827
 
1828
proc update_define_menu10 {} {
1829
        update_define_mainmenu
1830
        global CONFIG_MODULES
1831
        global CONFIG_LEON3
1832
        global CONFIG_IU_DISAS
1833
        if {($CONFIG_LEON3 == 1)} then {
1834
        set CONFIG_IU_DISAS [expr $CONFIG_IU_DISAS&15]} else {set CONFIG_IU_DISAS [expr $CONFIG_IU_DISAS|16]}
1835
        global CONFIG_IU_DISAS_NET
1836
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_DISAS == 1)} then {
1837
        set CONFIG_IU_DISAS_NET [expr $CONFIG_IU_DISAS_NET&15]} else {set CONFIG_IU_DISAS_NET [expr $CONFIG_IU_DISAS_NET|16]}
1838
        global CONFIG_DEBUG_PC32
1839
        if {($CONFIG_LEON3 == 1)} then {
1840
        set CONFIG_DEBUG_PC32 [expr $CONFIG_DEBUG_PC32&15]} else {set CONFIG_DEBUG_PC32 [expr $CONFIG_DEBUG_PC32|16]}
1841
}
1842
 
1843
 
1844
menu_option menu11 11 "AMBA configuration"
1845
proc menu11 {w title} {
1846
        set oldFocus [focus]
1847
        catch {destroy $w; unregister_active 11}
1848
        toplevel $w -class Dialog
1849
        wm withdraw $w
1850
        global active_menus
1851
        set active_menus [lsort -integer [linsert $active_menus end 11]]
1852
        message $w.m -width 400 -aspect 300 -text \
1853
                "AMBA configuration"  -relief raised
1854
        pack $w.m -pady 10 -side top -padx 10
1855
        wm title $w "AMBA configuration"
1856
 
1857
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 11; break"
1858
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 11; menu12 .menu12 \"$title\""
1859
        frame $w.f
1860
        button $w.f.back -text "Main Menu" \
1861
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 11"
1862
        button $w.f.next -text "Next" -underline 0\
1863
                -width 15 -command $nextscript
1864
        bind all  $nextscript
1865
        button $w.f.prev -text "Prev" -underline 0\
1866
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 11; menu10 .menu10 \"$title\""
1867
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 11; menu10 .menu10 \"$title\";break"
1868
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1869
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1870
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1871
        pack $w.topline -side top -fill x
1872
 
1873
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1874
        pack $w.botline -side bottom -fill x
1875
 
1876
        frame $w.config
1877
        pack $w.config -fill y -expand on
1878
 
1879
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1880
        pack $w.config.vscroll -side right -fill y
1881
 
1882
        canvas $w.config.canvas -height 1\
1883
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1884
                -width [expr [winfo screenwidth .] * 1 / 2]
1885
        frame $w.config.f
1886
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1887
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1888
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1889
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1890
        bind $w  "$w.config.canvas yview moveto 0;break;"
1891
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1892
        pack $w.config.canvas -side right -fill y
1893
 
1894
 
1895
        int $w.config.f 11 0 "Default AHB master" CONFIG_AHB_DEFMST
1896
        bool $w.config.f 11 1 "Round-robin arbiter                       " CONFIG_AHB_RROBIN
1897
        bool $w.config.f 11 2 "AHB split-transaction support             " CONFIG_AHB_SPLIT
1898
        hex $w.config.f 11 3 "I/O area start address (haddr\[31:20\]) " CONFIG_AHB_IOADDR
1899
        hex $w.config.f 11 4 "AHB/APB bridge address (haddr\[31:20\]) " CONFIG_APB_HADDR
1900
        bool $w.config.f 11 5 "Enable AMBA AHB monitor              " CONFIG_AHB_MON
1901
        bool $w.config.f 11 6 "Report AHB errors                  " CONFIG_AHB_MONERR
1902
        bool $w.config.f 11 7 "Report AHB warings                 " CONFIG_AHB_MONWAR
1903
 
1904
 
1905
 
1906
        focus $w
1907
        update_active
1908
        global winx; global winy
1909
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
1910
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1911
        update idletasks
1912
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1913
 
1914
        $w.config.canvas configure \
1915
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1916
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1917
                         [expr [winfo reqheight $w.config.f] + 1]"
1918
 
1919
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1920
        set scry [expr [winfo screenh $w] / 2]
1921
        set maxy [expr [winfo screenh $w] * 3 / 4]
1922
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1923
        if [expr $winy + $canvtotal < $maxy] {
1924
                $w.config.canvas configure -height $canvtotal
1925
        } else {
1926
                $w.config.canvas configure -height [expr $scry - $winy]
1927
                }
1928
        }
1929
        update idletasks
1930
        if {[winfo exists $w]} then {
1931
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1932
        wm minsize $w [winfo width $w] 100
1933
 
1934
        wm deiconify $w
1935
}
1936
}
1937
 
1938
proc update_menu11 {} {
1939
        global CONFIG_AHB_MON
1940
        global CONFIG_AHB_MONERR
1941
        if {($CONFIG_AHB_MON == 1)} then {
1942
        configure_entry .menu11.config.f.x6 normal {n l y}} else {configure_entry .menu11.config.f.x6 disabled {y n l}}
1943
        global CONFIG_AHB_MONWAR
1944
        if {($CONFIG_AHB_MON == 1)} then {
1945
        configure_entry .menu11.config.f.x7 normal {n l y}} else {configure_entry .menu11.config.f.x7 disabled {y n l}}
1946
}
1947
 
1948
 
1949
proc update_define_menu11 {} {
1950
        update_define_mainmenu
1951
        global CONFIG_MODULES
1952
        global CONFIG_AHB_MON
1953
        global CONFIG_AHB_MONERR
1954
        if {($CONFIG_AHB_MON == 1)} then {
1955
        set CONFIG_AHB_MONERR [expr $CONFIG_AHB_MONERR&15]} else {set CONFIG_AHB_MONERR [expr $CONFIG_AHB_MONERR|16]}
1956
        global CONFIG_AHB_MONWAR
1957
        if {($CONFIG_AHB_MON == 1)} then {
1958
        set CONFIG_AHB_MONWAR [expr $CONFIG_AHB_MONWAR&15]} else {set CONFIG_AHB_MONWAR [expr $CONFIG_AHB_MONWAR|16]}
1959
}
1960
 
1961
 
1962
menu_option menu12 12 "Debug Link           "
1963
proc menu12 {w title} {
1964
        set oldFocus [focus]
1965
        catch {destroy $w; unregister_active 12}
1966
        toplevel $w -class Dialog
1967
        wm withdraw $w
1968
        global active_menus
1969
        set active_menus [lsort -integer [linsert $active_menus end 12]]
1970
        message $w.m -width 400 -aspect 300 -text \
1971
                "Debug Link           "  -relief raised
1972
        pack $w.m -pady 10 -side top -padx 10
1973
        wm title $w "Debug Link           "
1974
 
1975
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 12; break"
1976
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 12; menu13 .menu13 \"$title\""
1977
        frame $w.f
1978
        button $w.f.back -text "Main Menu" \
1979
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 12"
1980
        button $w.f.next -text "Next" -underline 0\
1981
                -width 15 -command $nextscript
1982
        bind all  $nextscript
1983
        button $w.f.prev -text "Prev" -underline 0\
1984
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 12; menu11 .menu11 \"$title\""
1985
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 12; menu11 .menu11 \"$title\";break"
1986
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1987
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1988
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1989
        pack $w.topline -side top -fill x
1990
 
1991
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1992
        pack $w.botline -side bottom -fill x
1993
 
1994
        frame $w.config
1995
        pack $w.config -fill y -expand on
1996
 
1997
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1998
        pack $w.config.vscroll -side right -fill y
1999
 
2000
        canvas $w.config.canvas -height 1\
2001
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2002
                -width [expr [winfo screenwidth .] * 1 / 2]
2003
        frame $w.config.f
2004
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2005
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2006
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2007
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2008
        bind $w  "$w.config.canvas yview moveto 0;break;"
2009
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2010
        pack $w.config.canvas -side right -fill y
2011
 
2012
 
2013
        bool $w.config.f 12 0 "Serial Debug Link (RS232)                " CONFIG_DSU_UART
2014
        bool $w.config.f 12 1 "JTAG Debug Link" CONFIG_DSU_JTAG
2015
        bool $w.config.f 12 2 "Ethernet Debug Communication Link (EDCL)" CONFIG_DSU_ETH
2016
        global tmpvar_24
2017
        minimenu $w.config.f 12 3 "Ethernet/AHB bridge buffer size (kbytes)" tmpvar_24 CONFIG_DSU_ETHSZ1
2018
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"Ethernet/AHB bridge buffer size (kbytes)\""
2019
        $w.config.f.x3.x.menu add radiobutton -label "1" -variable tmpvar_24 -value "1" -command "update_active"
2020
        $w.config.f.x3.x.menu add radiobutton -label "2" -variable tmpvar_24 -value "2" -command "update_active"
2021
        $w.config.f.x3.x.menu add radiobutton -label "4" -variable tmpvar_24 -value "4" -command "update_active"
2022
        $w.config.f.x3.x.menu add radiobutton -label "8" -variable tmpvar_24 -value "8" -command "update_active"
2023
        $w.config.f.x3.x.menu add radiobutton -label "16" -variable tmpvar_24 -value "16" -command "update_active"
2024
        menusplit $w $w.config.f.x3.x.menu 5
2025
        hex $w.config.f 12 4 "MSB 16 bits of IP address (hex)       " CONFIG_DSU_IPMSB
2026
        hex $w.config.f 12 5 "LSB 16 bits of IP address (hex)       " CONFIG_DSU_IPLSB
2027
        hex $w.config.f 12 6 "MSB 24 bits of ethern number (hex)    " CONFIG_DSU_ETHMSB
2028
        hex $w.config.f 12 7 "LSB 24 bits of ethern number (hex)    " CONFIG_DSU_ETHLSB
2029
        bool $w.config.f 12 8 "Programmable 4-bit LSB of MAC/IP address" CONFIG_DSU_ETH_PROG
2030
 
2031
 
2032
 
2033
        focus $w
2034
        update_active
2035
        global winx; global winy
2036
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
2037
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2038
        update idletasks
2039
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2040
 
2041
        $w.config.canvas configure \
2042
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2043
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2044
                         [expr [winfo reqheight $w.config.f] + 1]"
2045
 
2046
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2047
        set scry [expr [winfo screenh $w] / 2]
2048
        set maxy [expr [winfo screenh $w] * 3 / 4]
2049
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2050
        if [expr $winy + $canvtotal < $maxy] {
2051
                $w.config.canvas configure -height $canvtotal
2052
        } else {
2053
                $w.config.canvas configure -height [expr $scry - $winy]
2054
                }
2055
        }
2056
        update idletasks
2057
        if {[winfo exists $w]} then {
2058
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2059
        wm minsize $w [winfo width $w] 100
2060
 
2061
        wm deiconify $w
2062
}
2063
}
2064
 
2065
proc update_menu12 {} {
2066
        global CONFIG_GRETH_ENABLE
2067
        global CONFIG_DSU_ETH
2068
        if {($CONFIG_GRETH_ENABLE == 1)} then {
2069
        configure_entry .menu12.config.f.x2 normal {n l y}} else {configure_entry .menu12.config.f.x2 disabled {y n l}}
2070
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {configure_entry .menu12.config.f.x3 normal {x l}} else {configure_entry .menu12.config.f.x3 disabled {x l}}
2071
        global CONFIG_DSU_IPMSB
2072
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {.menu12.config.f.x4.x configure -state normal -foreground [ cget .ref -foreground ]; .menu12.config.f.x4.l configure -state normal; } else {.menu12.config.f.x4.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu12.config.f.x4.l configure -state disabled}
2073
        global CONFIG_DSU_IPLSB
2074
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {.menu12.config.f.x5.x configure -state normal -foreground [ cget .ref -foreground ]; .menu12.config.f.x5.l configure -state normal; } else {.menu12.config.f.x5.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu12.config.f.x5.l configure -state disabled}
2075
        global CONFIG_DSU_ETHMSB
2076
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {.menu12.config.f.x6.x configure -state normal -foreground [ cget .ref -foreground ]; .menu12.config.f.x6.l configure -state normal; } else {.menu12.config.f.x6.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu12.config.f.x6.l configure -state disabled}
2077
        global CONFIG_DSU_ETHLSB
2078
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {.menu12.config.f.x7.x configure -state normal -foreground [ cget .ref -foreground ]; .menu12.config.f.x7.l configure -state normal; } else {.menu12.config.f.x7.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu12.config.f.x7.l configure -state disabled}
2079
        global CONFIG_GRETH_GIGA
2080
        global CONFIG_DSU_ETH_PROG
2081
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1) && ($CONFIG_GRETH_GIGA == 0)} then {
2082
        configure_entry .menu12.config.f.x8 normal {n l y}} else {configure_entry .menu12.config.f.x8 disabled {y n l}}
2083
}
2084
 
2085
 
2086
proc update_define_menu12 {} {
2087
        update_define_mainmenu
2088
        global CONFIG_MODULES
2089
        global CONFIG_GRETH_ENABLE
2090
        global CONFIG_DSU_ETH
2091
        if {($CONFIG_GRETH_ENABLE == 1)} then {
2092
        set CONFIG_DSU_ETH [expr $CONFIG_DSU_ETH&15]} else {set CONFIG_DSU_ETH [expr $CONFIG_DSU_ETH|16]}
2093
        global tmpvar_24
2094
        global CONFIG_DSU_ETHSZ1
2095
        if {$tmpvar_24 == "1"} then {set CONFIG_DSU_ETHSZ1 1} else {set CONFIG_DSU_ETHSZ1 0}
2096
        global CONFIG_DSU_ETHSZ2
2097
        if {$tmpvar_24 == "2"} then {set CONFIG_DSU_ETHSZ2 1} else {set CONFIG_DSU_ETHSZ2 0}
2098
        global CONFIG_DSU_ETHSZ4
2099
        if {$tmpvar_24 == "4"} then {set CONFIG_DSU_ETHSZ4 1} else {set CONFIG_DSU_ETHSZ4 0}
2100
        global CONFIG_DSU_ETHSZ8
2101
        if {$tmpvar_24 == "8"} then {set CONFIG_DSU_ETHSZ8 1} else {set CONFIG_DSU_ETHSZ8 0}
2102
        global CONFIG_DSU_ETHSZ16
2103
        if {$tmpvar_24 == "16"} then {set CONFIG_DSU_ETHSZ16 1} else {set CONFIG_DSU_ETHSZ16 0}
2104
        global CONFIG_DSU_IPMSB
2105
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {validate_hex CONFIG_DSU_IPMSB "$CONFIG_DSU_IPMSB" C0A8}
2106
        global CONFIG_DSU_IPLSB
2107
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {validate_hex CONFIG_DSU_IPLSB "$CONFIG_DSU_IPLSB" 0033}
2108
        global CONFIG_DSU_ETHMSB
2109
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {validate_hex CONFIG_DSU_ETHMSB "$CONFIG_DSU_ETHMSB" 00007A}
2110
        global CONFIG_DSU_ETHLSB
2111
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {validate_hex CONFIG_DSU_ETHLSB "$CONFIG_DSU_ETHLSB" CC0001}
2112
        global CONFIG_GRETH_GIGA
2113
        global CONFIG_DSU_ETH_PROG
2114
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1) && ($CONFIG_GRETH_GIGA == 0)} then {
2115
        set CONFIG_DSU_ETH_PROG [expr $CONFIG_DSU_ETH_PROG&15]} else {set CONFIG_DSU_ETH_PROG [expr $CONFIG_DSU_ETH_PROG|16]}
2116
}
2117
 
2118
 
2119
menu_option menu13 13 "Peripherals             "
2120
proc menu13 {w title} {
2121
        set oldFocus [focus]
2122
        catch {destroy $w; unregister_active 13}
2123
        toplevel $w -class Dialog
2124
        wm withdraw $w
2125
        global active_menus
2126
        set active_menus [lsort -integer [linsert $active_menus end 13]]
2127
        message $w.m -width 400 -aspect 300 -text \
2128
                "Peripherals             "  -relief raised
2129
        pack $w.m -pady 10 -side top -padx 10
2130
        wm title $w "Peripherals             "
2131
 
2132
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 13; break"
2133
        set nextscript "catch {focus $oldFocus}; menu14 .menu14 \"$title\""
2134
        frame $w.f
2135
        button $w.f.back -text "Main Menu" \
2136
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 13"
2137
        button $w.f.next -text "Next" -underline 0\
2138
                -width 15 -command $nextscript
2139
        bind all  $nextscript
2140
        button $w.f.prev -text "Prev" -underline 0\
2141
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 13; menu12 .menu12 \"$title\""
2142
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 13; menu12 .menu12 \"$title\";break"
2143
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2144
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2145
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2146
        pack $w.topline -side top -fill x
2147
 
2148
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2149
        pack $w.botline -side bottom -fill x
2150
 
2151
        frame $w.config
2152
        pack $w.config -fill y -expand on
2153
 
2154
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2155
        pack $w.config.vscroll -side right -fill y
2156
 
2157
        canvas $w.config.canvas -height 1\
2158
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2159
                -width [expr [winfo screenwidth .] * 1 / 2]
2160
        frame $w.config.f
2161
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2162
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2163
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2164
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2165
        bind $w  "$w.config.canvas yview moveto 0;break;"
2166
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2167
        pack $w.config.canvas -side right -fill y
2168
 
2169
 
2170
        submenu $w.config.f 13 0 "DDR266 SDRAM controller             " 14
2171
        submenu $w.config.f 13 1 "On-chip RAM/ROM                 " 15
2172
        submenu $w.config.f 13 2 "Ethernet             " 16
2173
        submenu $w.config.f 13 3 "UART, timer, I/O port and interrupt controller" 17
2174
        submenu $w.config.f 13 4 "Keybord and VGA interface" 18
2175
 
2176
 
2177
 
2178
        focus $w
2179
        update_active
2180
        global winx; global winy
2181
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
2182
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2183
        update idletasks
2184
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2185
 
2186
        $w.config.canvas configure \
2187
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2188
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2189
                         [expr [winfo reqheight $w.config.f] + 1]"
2190
 
2191
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2192
        set scry [expr [winfo screenh $w] / 2]
2193
        set maxy [expr [winfo screenh $w] * 3 / 4]
2194
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2195
        if [expr $winy + $canvtotal < $maxy] {
2196
                $w.config.canvas configure -height $canvtotal
2197
        } else {
2198
                $w.config.canvas configure -height [expr $scry - $winy]
2199
                }
2200
        }
2201
        update idletasks
2202
        if {[winfo exists $w]} then {
2203
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2204
        wm minsize $w [winfo width $w] 100
2205
 
2206
        wm deiconify $w
2207
}
2208
}
2209
 
2210
proc update_menu13 {} {
2211
}
2212
 
2213
 
2214
proc update_define_menu13 {} {
2215
        update_define_mainmenu
2216
        global CONFIG_MODULES
2217
}
2218
 
2219
 
2220
proc menu14 {w title} {
2221
        set oldFocus [focus]
2222
        catch {focus .menu13}
2223
        catch {destroy $w; unregister_active 14}
2224
        toplevel $w -class Dialog
2225
        wm withdraw $w
2226
        global active_menus
2227
        set active_menus [lsort -integer [linsert $active_menus end 14]]
2228
        message $w.m -width 400 -aspect 300 -text \
2229
                "DDR266 SDRAM controller             "  -relief raised
2230
        pack $w.m -pady 10 -side top -padx 10
2231
        wm title $w "DDR266 SDRAM controller             "
2232
 
2233
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 14; break"
2234
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 14; menu15 .menu15 \"$title\""
2235
        frame $w.f
2236
        button $w.f.back -text "OK" \
2237
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 14"
2238
        button $w.f.next -text "Next" -underline 0\
2239
                -width 15 -command $nextscript
2240
        bind all  $nextscript
2241
        button $w.f.prev -text "Prev" -underline 0\
2242
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 14; menu13 .menu13 \"$title\""
2243
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 14; menu13 .menu13 \"$title\";break"
2244
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2245
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2246
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2247
        pack $w.topline -side top -fill x
2248
 
2249
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2250
        pack $w.botline -side bottom -fill x
2251
 
2252
        frame $w.config
2253
        pack $w.config -fill y -expand on
2254
 
2255
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2256
        pack $w.config.vscroll -side right -fill y
2257
 
2258
        canvas $w.config.canvas -height 1\
2259
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2260
                -width [expr [winfo screenwidth .] * 1 / 2]
2261
        frame $w.config.f
2262
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2263
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2264
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2265
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2266
        bind $w  "$w.config.canvas yview moveto 0;break;"
2267
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2268
        pack $w.config.canvas -side right -fill y
2269
 
2270
 
2271
        bool $w.config.f 14 0 "Enable DDR266 SDRAM controller       " CONFIG_DDRSP
2272
        bool $w.config.f 14 1 "Enable power-on initialization       " CONFIG_DDRSP_INIT
2273
        int $w.config.f 14 2 "Memory frequency (MHz)  " CONFIG_DDRSP_FREQ
2274
        int $w.config.f 14 3 "Column address bits (9 - 12)  " CONFIG_DDRSP_COL
2275
        int $w.config.f 14 4 "Chip select bank size (Mbyte) " CONFIG_DDRSP_MBYTE
2276
        int $w.config.f 14 5 "Read clock phase shift        " CONFIG_DDRSP_RSKEW
2277
 
2278
 
2279
 
2280
        focus $w
2281
        update_active
2282
        global winx; global winy
2283
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
2284
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
2285
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2286
        update idletasks
2287
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2288
 
2289
        $w.config.canvas configure \
2290
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2291
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2292
                         [expr [winfo reqheight $w.config.f] + 1]"
2293
 
2294
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2295
        set scry [expr [winfo screenh $w] / 2]
2296
        set maxy [expr [winfo screenh $w] * 3 / 4]
2297
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2298
        if [expr $winy + $canvtotal < $maxy] {
2299
                $w.config.canvas configure -height $canvtotal
2300
        } else {
2301
                $w.config.canvas configure -height [expr $scry - $winy]
2302
                }
2303
        }
2304
        update idletasks
2305
        if {[winfo exists $w]} then {
2306
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2307
        wm minsize $w [winfo width $w] 100
2308
 
2309
        wm deiconify $w
2310
}
2311
}
2312
 
2313
proc update_menu14 {} {
2314
        global CONFIG_DDRSP
2315
        global CONFIG_DDRSP_INIT
2316
        if {($CONFIG_DDRSP == 1)} then {
2317
        configure_entry .menu14.config.f.x1 normal {n l y}} else {configure_entry .menu14.config.f.x1 disabled {y n l}}
2318
        global CONFIG_DDRSP_FREQ
2319
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {.menu14.config.f.x2.x configure -state normal -foreground [ cget .ref -foreground ]; .menu14.config.f.x2.l configure -state normal; } else {.menu14.config.f.x2.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu14.config.f.x2.l configure -state disabled}
2320
        global CONFIG_DDRSP_COL
2321
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {.menu14.config.f.x3.x configure -state normal -foreground [ cget .ref -foreground ]; .menu14.config.f.x3.l configure -state normal; } else {.menu14.config.f.x3.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu14.config.f.x3.l configure -state disabled}
2322
        global CONFIG_DDRSP_MBYTE
2323
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {.menu14.config.f.x4.x configure -state normal -foreground [ cget .ref -foreground ]; .menu14.config.f.x4.l configure -state normal; } else {.menu14.config.f.x4.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu14.config.f.x4.l configure -state disabled}
2324
        global CONFIG_SYN_VIRTEX2
2325
        global CONFIG_SYN_VIRTEX4
2326
        global CONFIG_SYN_SPARTAN3
2327
        global CONFIG_SYN_VIRTEX5
2328
        global CONFIG_SYN_SPARTAN3E
2329
        global CONFIG_SYN_CYCLONEIII
2330
        global CONFIG_DDRSP_RSKEW
2331
        if {($CONFIG_DDRSP == 1) && ($CONFIG_SYN_VIRTEX2 == 1 || $CONFIG_SYN_VIRTEX4 == 1 || $CONFIG_SYN_SPARTAN3 == 1 || $CONFIG_SYN_VIRTEX5 == 1 || $CONFIG_SYN_SPARTAN3E == 1 || $CONFIG_SYN_CYCLONEIII == 1)} then {.menu14.config.f.x5.x configure -state normal -foreground [ cget .ref -foreground ]; .menu14.config.f.x5.l configure -state normal; } else {.menu14.config.f.x5.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu14.config.f.x5.l configure -state disabled}
2332
}
2333
 
2334
 
2335
proc update_define_menu14 {} {
2336
        update_define_mainmenu
2337
        global CONFIG_MODULES
2338
        global CONFIG_DDRSP
2339
        global CONFIG_DDRSP_INIT
2340
        if {($CONFIG_DDRSP == 1)} then {
2341
        set CONFIG_DDRSP_INIT [expr $CONFIG_DDRSP_INIT&15]} else {set CONFIG_DDRSP_INIT [expr $CONFIG_DDRSP_INIT|16]}
2342
        global CONFIG_DDRSP_FREQ
2343
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {validate_int CONFIG_DDRSP_FREQ "$CONFIG_DDRSP_FREQ" 100}
2344
        global CONFIG_DDRSP_COL
2345
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {validate_int CONFIG_DDRSP_COL "$CONFIG_DDRSP_COL" 9}
2346
        global CONFIG_DDRSP_MBYTE
2347
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {validate_int CONFIG_DDRSP_MBYTE "$CONFIG_DDRSP_MBYTE" 16}
2348
        global CONFIG_SYN_VIRTEX2
2349
        global CONFIG_SYN_VIRTEX4
2350
        global CONFIG_SYN_SPARTAN3
2351
        global CONFIG_SYN_VIRTEX5
2352
        global CONFIG_SYN_SPARTAN3E
2353
        global CONFIG_SYN_CYCLONEIII
2354
        global CONFIG_DDRSP_RSKEW
2355
        if {($CONFIG_DDRSP == 1) && ($CONFIG_SYN_VIRTEX2 == 1 || $CONFIG_SYN_VIRTEX4 == 1 || $CONFIG_SYN_SPARTAN3 == 1 || $CONFIG_SYN_VIRTEX5 == 1 || $CONFIG_SYN_SPARTAN3E == 1 || $CONFIG_SYN_CYCLONEIII == 1)} then {validate_int CONFIG_DDRSP_RSKEW "$CONFIG_DDRSP_RSKEW" 0}
2356
}
2357
 
2358
 
2359
proc menu15 {w title} {
2360
        set oldFocus [focus]
2361
        catch {focus .menu13}
2362
        catch {destroy $w; unregister_active 15}
2363
        toplevel $w -class Dialog
2364
        wm withdraw $w
2365
        global active_menus
2366
        set active_menus [lsort -integer [linsert $active_menus end 15]]
2367
        message $w.m -width 400 -aspect 300 -text \
2368
                "On-chip RAM/ROM                 "  -relief raised
2369
        pack $w.m -pady 10 -side top -padx 10
2370
        wm title $w "On-chip RAM/ROM                 "
2371
 
2372
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 15; break"
2373
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 15; menu16 .menu16 \"$title\""
2374
        frame $w.f
2375
        button $w.f.back -text "OK" \
2376
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 15"
2377
        button $w.f.next -text "Next" -underline 0\
2378
                -width 15 -command $nextscript
2379
        bind all  $nextscript
2380
        button $w.f.prev -text "Prev" -underline 0\
2381
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 15; menu14 .menu14 \"$title\""
2382
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 15; menu14 .menu14 \"$title\";break"
2383
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2384
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2385
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2386
        pack $w.topline -side top -fill x
2387
 
2388
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2389
        pack $w.botline -side bottom -fill x
2390
 
2391
        frame $w.config
2392
        pack $w.config -fill y -expand on
2393
 
2394
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2395
        pack $w.config.vscroll -side right -fill y
2396
 
2397
        canvas $w.config.canvas -height 1\
2398
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2399
                -width [expr [winfo screenwidth .] * 1 / 2]
2400
        frame $w.config.f
2401
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2402
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2403
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2404
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2405
        bind $w  "$w.config.canvas yview moveto 0;break;"
2406
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2407
        pack $w.config.canvas -side right -fill y
2408
 
2409
 
2410
        bool $w.config.f 15 0 "On-chip AHB ROM                   " CONFIG_AHBROM_ENABLE
2411
        hex $w.config.f 15 1 "ROM start address (haddr\[31:20\]) " CONFIG_AHBROM_START
2412
        bool $w.config.f 15 2 "Pipelined ROM access              " CONFIG_AHBROM_PIPE
2413
        bool $w.config.f 15 3 "On-chip AHB RAM                   " CONFIG_AHBRAM_ENABLE
2414
        global tmpvar_25
2415
        minimenu $w.config.f 15 4 "AHB RAM size (Kbyte)" tmpvar_25 CONFIG_AHBRAM_SZ1
2416
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"AHB RAM size (Kbyte)\""
2417
        $w.config.f.x4.x.menu add radiobutton -label "1" -variable tmpvar_25 -value "1" -command "update_active"
2418
        $w.config.f.x4.x.menu add radiobutton -label "2" -variable tmpvar_25 -value "2" -command "update_active"
2419
        $w.config.f.x4.x.menu add radiobutton -label "4" -variable tmpvar_25 -value "4" -command "update_active"
2420
        $w.config.f.x4.x.menu add radiobutton -label "8" -variable tmpvar_25 -value "8" -command "update_active"
2421
        $w.config.f.x4.x.menu add radiobutton -label "16" -variable tmpvar_25 -value "16" -command "update_active"
2422
        $w.config.f.x4.x.menu add radiobutton -label "32" -variable tmpvar_25 -value "32" -command "update_active"
2423
        $w.config.f.x4.x.menu add radiobutton -label "64" -variable tmpvar_25 -value "64" -command "update_active"
2424
        menusplit $w $w.config.f.x4.x.menu 7
2425
        hex $w.config.f 15 5 "RAM start address (haddr\[31:20\]) " CONFIG_AHBRAM_START
2426
 
2427
 
2428
 
2429
        focus $w
2430
        update_active
2431
        global winx; global winy
2432
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
2433
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
2434
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2435
        update idletasks
2436
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2437
 
2438
        $w.config.canvas configure \
2439
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2440
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2441
                         [expr [winfo reqheight $w.config.f] + 1]"
2442
 
2443
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2444
        set scry [expr [winfo screenh $w] / 2]
2445
        set maxy [expr [winfo screenh $w] * 3 / 4]
2446
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2447
        if [expr $winy + $canvtotal < $maxy] {
2448
                $w.config.canvas configure -height $canvtotal
2449
        } else {
2450
                $w.config.canvas configure -height [expr $scry - $winy]
2451
                }
2452
        }
2453
        update idletasks
2454
        if {[winfo exists $w]} then {
2455
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2456
        wm minsize $w [winfo width $w] 100
2457
 
2458
        wm deiconify $w
2459
}
2460
}
2461
 
2462
proc update_menu15 {} {
2463
        global CONFIG_AHBROM_ENABLE
2464
        global CONFIG_AHBROM_START
2465
        if {($CONFIG_AHBROM_ENABLE == 1)} then {.menu15.config.f.x1.x configure -state normal -foreground [ cget .ref -foreground ]; .menu15.config.f.x1.l configure -state normal; } else {.menu15.config.f.x1.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu15.config.f.x1.l configure -state disabled}
2466
        global CONFIG_AHBROM_PIPE
2467
        if {($CONFIG_AHBROM_ENABLE == 1)} then {
2468
        configure_entry .menu15.config.f.x2 normal {n l y}} else {configure_entry .menu15.config.f.x2 disabled {y n l}}
2469
        global CONFIG_AHBRAM_ENABLE
2470
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {configure_entry .menu15.config.f.x4 normal {x l}} else {configure_entry .menu15.config.f.x4 disabled {x l}}
2471
        global CONFIG_AHBRAM_START
2472
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {.menu15.config.f.x5.x configure -state normal -foreground [ cget .ref -foreground ]; .menu15.config.f.x5.l configure -state normal; } else {.menu15.config.f.x5.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu15.config.f.x5.l configure -state disabled}
2473
}
2474
 
2475
 
2476
proc update_define_menu15 {} {
2477
        update_define_mainmenu
2478
        global CONFIG_MODULES
2479
        global CONFIG_AHBROM_ENABLE
2480
        global CONFIG_AHBROM_START
2481
        if {($CONFIG_AHBROM_ENABLE == 1)} then {validate_hex CONFIG_AHBROM_START "$CONFIG_AHBROM_START" 000}
2482
        global CONFIG_AHBROM_PIPE
2483
        if {($CONFIG_AHBROM_ENABLE == 1)} then {
2484
        set CONFIG_AHBROM_PIPE [expr $CONFIG_AHBROM_PIPE&15]} else {set CONFIG_AHBROM_PIPE [expr $CONFIG_AHBROM_PIPE|16]}
2485
        global tmpvar_25
2486
        global CONFIG_AHBRAM_SZ1
2487
        if {$tmpvar_25 == "1"} then {set CONFIG_AHBRAM_SZ1 1} else {set CONFIG_AHBRAM_SZ1 0}
2488
        global CONFIG_AHBRAM_SZ2
2489
        if {$tmpvar_25 == "2"} then {set CONFIG_AHBRAM_SZ2 1} else {set CONFIG_AHBRAM_SZ2 0}
2490
        global CONFIG_AHBRAM_SZ4
2491
        if {$tmpvar_25 == "4"} then {set CONFIG_AHBRAM_SZ4 1} else {set CONFIG_AHBRAM_SZ4 0}
2492
        global CONFIG_AHBRAM_SZ8
2493
        if {$tmpvar_25 == "8"} then {set CONFIG_AHBRAM_SZ8 1} else {set CONFIG_AHBRAM_SZ8 0}
2494
        global CONFIG_AHBRAM_SZ16
2495
        if {$tmpvar_25 == "16"} then {set CONFIG_AHBRAM_SZ16 1} else {set CONFIG_AHBRAM_SZ16 0}
2496
        global CONFIG_AHBRAM_SZ32
2497
        if {$tmpvar_25 == "32"} then {set CONFIG_AHBRAM_SZ32 1} else {set CONFIG_AHBRAM_SZ32 0}
2498
        global CONFIG_AHBRAM_SZ64
2499
        if {$tmpvar_25 == "64"} then {set CONFIG_AHBRAM_SZ64 1} else {set CONFIG_AHBRAM_SZ64 0}
2500
        global CONFIG_AHBRAM_ENABLE
2501
        global CONFIG_AHBRAM_START
2502
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {validate_hex CONFIG_AHBRAM_START "$CONFIG_AHBRAM_START" A00}
2503
}
2504
 
2505
 
2506
proc menu16 {w title} {
2507
        set oldFocus [focus]
2508
        catch {focus .menu13}
2509
        catch {destroy $w; unregister_active 16}
2510
        toplevel $w -class Dialog
2511
        wm withdraw $w
2512
        global active_menus
2513
        set active_menus [lsort -integer [linsert $active_menus end 16]]
2514
        message $w.m -width 400 -aspect 300 -text \
2515
                "Ethernet             "  -relief raised
2516
        pack $w.m -pady 10 -side top -padx 10
2517
        wm title $w "Ethernet             "
2518
 
2519
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 16; break"
2520
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 16; menu17 .menu17 \"$title\""
2521
        frame $w.f
2522
        button $w.f.back -text "OK" \
2523
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 16"
2524
        button $w.f.next -text "Next" -underline 0\
2525
                -width 15 -command $nextscript
2526
        bind all  $nextscript
2527
        button $w.f.prev -text "Prev" -underline 0\
2528
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 16; menu15 .menu15 \"$title\""
2529
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 16; menu15 .menu15 \"$title\";break"
2530
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2531
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2532
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2533
        pack $w.topline -side top -fill x
2534
 
2535
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2536
        pack $w.botline -side bottom -fill x
2537
 
2538
        frame $w.config
2539
        pack $w.config -fill y -expand on
2540
 
2541
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2542
        pack $w.config.vscroll -side right -fill y
2543
 
2544
        canvas $w.config.canvas -height 1\
2545
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2546
                -width [expr [winfo screenwidth .] * 1 / 2]
2547
        frame $w.config.f
2548
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2549
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2550
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2551
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2552
        bind $w  "$w.config.canvas yview moveto 0;break;"
2553
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2554
        pack $w.config.canvas -side right -fill y
2555
 
2556
 
2557
        bool $w.config.f 16 0 "Gaisler Research 10/100/1000 Mbit Ethernet MAC " CONFIG_GRETH_ENABLE
2558
        bool $w.config.f 16 1 "Enable 1000 Mbit support    " CONFIG_GRETH_GIGA
2559
        global tmpvar_26
2560
        minimenu $w.config.f 16 2 "AHB FIFO size (words)            " tmpvar_26 CONFIG_GRETH_FIFO4
2561
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"AHB FIFO size (words)            \""
2562
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_26 -value "4" -command "update_active"
2563
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_26 -value "8" -command "update_active"
2564
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_26 -value "16" -command "update_active"
2565
        $w.config.f.x2.x.menu add radiobutton -label "32" -variable tmpvar_26 -value "32" -command "update_active"
2566
        $w.config.f.x2.x.menu add radiobutton -label "64" -variable tmpvar_26 -value "64" -command "update_active"
2567
        menusplit $w $w.config.f.x2.x.menu 5
2568
 
2569
 
2570
 
2571
        focus $w
2572
        update_active
2573
        global winx; global winy
2574
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
2575
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
2576
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2577
        update idletasks
2578
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2579
 
2580
        $w.config.canvas configure \
2581
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2582
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2583
                         [expr [winfo reqheight $w.config.f] + 1]"
2584
 
2585
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2586
        set scry [expr [winfo screenh $w] / 2]
2587
        set maxy [expr [winfo screenh $w] * 3 / 4]
2588
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2589
        if [expr $winy + $canvtotal < $maxy] {
2590
                $w.config.canvas configure -height $canvtotal
2591
        } else {
2592
                $w.config.canvas configure -height [expr $scry - $winy]
2593
                }
2594
        }
2595
        update idletasks
2596
        if {[winfo exists $w]} then {
2597
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2598
        wm minsize $w [winfo width $w] 100
2599
 
2600
        wm deiconify $w
2601
}
2602
}
2603
 
2604
proc update_menu16 {} {
2605
        global CONFIG_GRETH_ENABLE
2606
        global CONFIG_GRETH_GIGA
2607
        if {($CONFIG_GRETH_ENABLE == 1)} then {
2608
        configure_entry .menu16.config.f.x1 normal {n l y}} else {configure_entry .menu16.config.f.x1 disabled {y n l}}
2609
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_GRETH_GIGA == 0)} then {configure_entry .menu16.config.f.x2 normal {x l}} else {configure_entry .menu16.config.f.x2 disabled {x l}}
2610
}
2611
 
2612
 
2613
proc update_define_menu16 {} {
2614
        update_define_mainmenu
2615
        global CONFIG_MODULES
2616
        global CONFIG_GRETH_ENABLE
2617
        global CONFIG_GRETH_GIGA
2618
        if {($CONFIG_GRETH_ENABLE == 1)} then {
2619
        set CONFIG_GRETH_GIGA [expr $CONFIG_GRETH_GIGA&15]} else {set CONFIG_GRETH_GIGA [expr $CONFIG_GRETH_GIGA|16]}
2620
        global tmpvar_26
2621
        global CONFIG_GRETH_FIFO4
2622
        if {$tmpvar_26 == "4"} then {set CONFIG_GRETH_FIFO4 1} else {set CONFIG_GRETH_FIFO4 0}
2623
        global CONFIG_GRETH_FIFO8
2624
        if {$tmpvar_26 == "8"} then {set CONFIG_GRETH_FIFO8 1} else {set CONFIG_GRETH_FIFO8 0}
2625
        global CONFIG_GRETH_FIFO16
2626
        if {$tmpvar_26 == "16"} then {set CONFIG_GRETH_FIFO16 1} else {set CONFIG_GRETH_FIFO16 0}
2627
        global CONFIG_GRETH_FIFO32
2628
        if {$tmpvar_26 == "32"} then {set CONFIG_GRETH_FIFO32 1} else {set CONFIG_GRETH_FIFO32 0}
2629
        global CONFIG_GRETH_FIFO64
2630
        if {$tmpvar_26 == "64"} then {set CONFIG_GRETH_FIFO64 1} else {set CONFIG_GRETH_FIFO64 0}
2631
}
2632
 
2633
 
2634
proc menu17 {w title} {
2635
        set oldFocus [focus]
2636
        catch {focus .menu13}
2637
        catch {destroy $w; unregister_active 17}
2638
        toplevel $w -class Dialog
2639
        wm withdraw $w
2640
        global active_menus
2641
        set active_menus [lsort -integer [linsert $active_menus end 17]]
2642
        message $w.m -width 400 -aspect 300 -text \
2643
                "UART, timer, I/O port and interrupt controller"  -relief raised
2644
        pack $w.m -pady 10 -side top -padx 10
2645
        wm title $w "UART, timer, I/O port and interrupt controller"
2646
 
2647
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 17; break"
2648
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 17; menu18 .menu18 \"$title\""
2649
        frame $w.f
2650
        button $w.f.back -text "OK" \
2651
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 17"
2652
        button $w.f.next -text "Next" -underline 0\
2653
                -width 15 -command $nextscript
2654
        bind all  $nextscript
2655
        button $w.f.prev -text "Prev" -underline 0\
2656
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 17; menu16 .menu16 \"$title\""
2657
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 17; menu16 .menu16 \"$title\";break"
2658
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2659
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2660
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2661
        pack $w.topline -side top -fill x
2662
 
2663
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2664
        pack $w.botline -side bottom -fill x
2665
 
2666
        frame $w.config
2667
        pack $w.config -fill y -expand on
2668
 
2669
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2670
        pack $w.config.vscroll -side right -fill y
2671
 
2672
        canvas $w.config.canvas -height 1\
2673
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2674
                -width [expr [winfo screenwidth .] * 1 / 2]
2675
        frame $w.config.f
2676
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2677
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2678
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2679
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2680
        bind $w  "$w.config.canvas yview moveto 0;break;"
2681
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2682
        pack $w.config.canvas -side right -fill y
2683
 
2684
 
2685
        bool $w.config.f 17 0 "Enable console UART                  " CONFIG_UART1_ENABLE
2686
        global tmpvar_27
2687
        minimenu $w.config.f 17 1 "UART1 FIFO depth" tmpvar_27 CONFIG_UA1_FIFO1
2688
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"UART1 FIFO depth\""
2689
        $w.config.f.x1.x.menu add radiobutton -label "1" -variable tmpvar_27 -value "1" -command "update_active"
2690
        $w.config.f.x1.x.menu add radiobutton -label "2" -variable tmpvar_27 -value "2" -command "update_active"
2691
        $w.config.f.x1.x.menu add radiobutton -label "4" -variable tmpvar_27 -value "4" -command "update_active"
2692
        $w.config.f.x1.x.menu add radiobutton -label "8" -variable tmpvar_27 -value "8" -command "update_active"
2693
        $w.config.f.x1.x.menu add radiobutton -label "16" -variable tmpvar_27 -value "16" -command "update_active"
2694
        $w.config.f.x1.x.menu add radiobutton -label "32" -variable tmpvar_27 -value "32" -command "update_active"
2695
        menusplit $w $w.config.f.x1.x.menu 6
2696
        bool $w.config.f 17 2 "Enable LEON3 interrupt controller    " CONFIG_IRQ3_ENABLE
2697
        bool $w.config.f 17 3 "Enable secondary interrupts           " CONFIG_IRQ3_SEC
2698
        int $w.config.f 17 4 "Secondary interrupt number (1 - 15)    " CONFIG_IRQ3_NSEC
2699
        bool $w.config.f 17 5 "Enable Timer Unit                    " CONFIG_GPT_ENABLE
2700
        int $w.config.f 17 6 "Number of timers (1 - 7)              " CONFIG_GPT_NTIM
2701
        int $w.config.f 17 7 "Scaler width (2 - 16)                 " CONFIG_GPT_SW
2702
        int $w.config.f 17 8 "Timer width (2 - 32)                  " CONFIG_GPT_TW
2703
        int $w.config.f 17 9 "Timer unit interrupt                  " CONFIG_GPT_IRQ
2704
        bool $w.config.f 17 10 "Separate interrupts                  " CONFIG_GPT_SEPIRQ
2705
        bool $w.config.f 17 11 "Watchdog enable                      " CONFIG_GPT_WDOGEN
2706
        hex $w.config.f 17 12 "Initial watchdog time-out value       " CONFIG_GPT_WDOG
2707
 
2708
 
2709
 
2710
        focus $w
2711
        update_active
2712
        global winx; global winy
2713
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
2714
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
2715
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2716
        update idletasks
2717
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2718
 
2719
        $w.config.canvas configure \
2720
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2721
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2722
                         [expr [winfo reqheight $w.config.f] + 1]"
2723
 
2724
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2725
        set scry [expr [winfo screenh $w] / 2]
2726
        set maxy [expr [winfo screenh $w] * 3 / 4]
2727
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2728
        if [expr $winy + $canvtotal < $maxy] {
2729
                $w.config.canvas configure -height $canvtotal
2730
        } else {
2731
                $w.config.canvas configure -height [expr $scry - $winy]
2732
                }
2733
        }
2734
        update idletasks
2735
        if {[winfo exists $w]} then {
2736
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2737
        wm minsize $w [winfo width $w] 100
2738
 
2739
        wm deiconify $w
2740
}
2741
}
2742
 
2743
proc update_menu17 {} {
2744
        global CONFIG_UART1_ENABLE
2745
        if {($CONFIG_UART1_ENABLE == 1)} then {configure_entry .menu17.config.f.x1 normal {x l}} else {configure_entry .menu17.config.f.x1 disabled {x l}}
2746
        global CONFIG_IRQ3_ENABLE
2747
        global CONFIG_IRQ3_SEC
2748
        if {($CONFIG_IRQ3_ENABLE == 1)} then {
2749
        configure_entry .menu17.config.f.x3 normal {n l y}} else {configure_entry .menu17.config.f.x3 disabled {y n l}}
2750
        global CONFIG_IRQ3_NSEC
2751
        if {($CONFIG_IRQ3_ENABLE == 1) && ($CONFIG_IRQ3_SEC == 1)} then {.menu17.config.f.x4.x configure -state normal -foreground [ cget .ref -foreground ]; .menu17.config.f.x4.l configure -state normal; } else {.menu17.config.f.x4.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu17.config.f.x4.l configure -state disabled}
2752
        global CONFIG_GPT_ENABLE
2753
        global CONFIG_GPT_NTIM
2754
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu17.config.f.x6.x configure -state normal -foreground [ cget .ref -foreground ]; .menu17.config.f.x6.l configure -state normal; } else {.menu17.config.f.x6.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu17.config.f.x6.l configure -state disabled}
2755
        global CONFIG_GPT_SW
2756
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu17.config.f.x7.x configure -state normal -foreground [ cget .ref -foreground ]; .menu17.config.f.x7.l configure -state normal; } else {.menu17.config.f.x7.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu17.config.f.x7.l configure -state disabled}
2757
        global CONFIG_GPT_TW
2758
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu17.config.f.x8.x configure -state normal -foreground [ cget .ref -foreground ]; .menu17.config.f.x8.l configure -state normal; } else {.menu17.config.f.x8.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu17.config.f.x8.l configure -state disabled}
2759
        global CONFIG_GPT_IRQ
2760
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu17.config.f.x9.x configure -state normal -foreground [ cget .ref -foreground ]; .menu17.config.f.x9.l configure -state normal; } else {.menu17.config.f.x9.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu17.config.f.x9.l configure -state disabled}
2761
        global CONFIG_GPT_SEPIRQ
2762
        if {($CONFIG_GPT_ENABLE == 1)} then {
2763
        configure_entry .menu17.config.f.x10 normal {n l y}} else {configure_entry .menu17.config.f.x10 disabled {y n l}}
2764
        global CONFIG_GPT_WDOGEN
2765
        if {($CONFIG_GPT_ENABLE == 1)} then {
2766
        configure_entry .menu17.config.f.x11 normal {n l y}} else {configure_entry .menu17.config.f.x11 disabled {y n l}}
2767
        global CONFIG_GPT_WDOG
2768
        if {($CONFIG_GPT_ENABLE == 1) && ($CONFIG_GPT_WDOGEN == 1)} then {.menu17.config.f.x12.x configure -state normal -foreground [ cget .ref -foreground ]; .menu17.config.f.x12.l configure -state normal; } else {.menu17.config.f.x12.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu17.config.f.x12.l configure -state disabled}
2769
}
2770
 
2771
 
2772
proc update_define_menu17 {} {
2773
        update_define_mainmenu
2774
        global CONFIG_MODULES
2775
        global tmpvar_27
2776
        global CONFIG_UA1_FIFO1
2777
        if {$tmpvar_27 == "1"} then {set CONFIG_UA1_FIFO1 1} else {set CONFIG_UA1_FIFO1 0}
2778
        global CONFIG_UA1_FIFO2
2779
        if {$tmpvar_27 == "2"} then {set CONFIG_UA1_FIFO2 1} else {set CONFIG_UA1_FIFO2 0}
2780
        global CONFIG_UA1_FIFO4
2781
        if {$tmpvar_27 == "4"} then {set CONFIG_UA1_FIFO4 1} else {set CONFIG_UA1_FIFO4 0}
2782
        global CONFIG_UA1_FIFO8
2783
        if {$tmpvar_27 == "8"} then {set CONFIG_UA1_FIFO8 1} else {set CONFIG_UA1_FIFO8 0}
2784
        global CONFIG_UA1_FIFO16
2785
        if {$tmpvar_27 == "16"} then {set CONFIG_UA1_FIFO16 1} else {set CONFIG_UA1_FIFO16 0}
2786
        global CONFIG_UA1_FIFO32
2787
        if {$tmpvar_27 == "32"} then {set CONFIG_UA1_FIFO32 1} else {set CONFIG_UA1_FIFO32 0}
2788
        global CONFIG_IRQ3_ENABLE
2789
        global CONFIG_IRQ3_SEC
2790
        if {($CONFIG_IRQ3_ENABLE == 1)} then {
2791
        set CONFIG_IRQ3_SEC [expr $CONFIG_IRQ3_SEC&15]} else {set CONFIG_IRQ3_SEC [expr $CONFIG_IRQ3_SEC|16]}
2792
        global CONFIG_IRQ3_NSEC
2793
        if {($CONFIG_IRQ3_ENABLE == 1) && ($CONFIG_IRQ3_SEC == 1)} then {validate_int CONFIG_IRQ3_NSEC "$CONFIG_IRQ3_NSEC" 12}
2794
        global CONFIG_GPT_ENABLE
2795
        global CONFIG_GPT_NTIM
2796
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_NTIM "$CONFIG_GPT_NTIM" 2}
2797
        global CONFIG_GPT_SW
2798
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_SW "$CONFIG_GPT_SW" 8}
2799
        global CONFIG_GPT_TW
2800
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_TW "$CONFIG_GPT_TW" 32}
2801
        global CONFIG_GPT_IRQ
2802
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_IRQ "$CONFIG_GPT_IRQ" 8}
2803
        global CONFIG_GPT_SEPIRQ
2804
        if {($CONFIG_GPT_ENABLE == 1)} then {
2805
        set CONFIG_GPT_SEPIRQ [expr $CONFIG_GPT_SEPIRQ&15]} else {set CONFIG_GPT_SEPIRQ [expr $CONFIG_GPT_SEPIRQ|16]}
2806
        global CONFIG_GPT_WDOGEN
2807
        if {($CONFIG_GPT_ENABLE == 1)} then {
2808
        set CONFIG_GPT_WDOGEN [expr $CONFIG_GPT_WDOGEN&15]} else {set CONFIG_GPT_WDOGEN [expr $CONFIG_GPT_WDOGEN|16]}
2809
        global CONFIG_GPT_WDOG
2810
        if {($CONFIG_GPT_ENABLE == 1) && ($CONFIG_GPT_WDOGEN == 1)} then {validate_hex CONFIG_GPT_WDOG "$CONFIG_GPT_WDOG" FFFF}
2811
}
2812
 
2813
 
2814
proc menu18 {w title} {
2815
        set oldFocus [focus]
2816
        catch {focus .menu13}
2817
        catch {destroy $w; unregister_active 18}
2818
        toplevel $w -class Dialog
2819
        wm withdraw $w
2820
        global active_menus
2821
        set active_menus [lsort -integer [linsert $active_menus end 18]]
2822
        message $w.m -width 400 -aspect 300 -text \
2823
                "Keybord and VGA interface"  -relief raised
2824
        pack $w.m -pady 10 -side top -padx 10
2825
        wm title $w "Keybord and VGA interface"
2826
 
2827
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 18; break"
2828
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 18; catch {destroy .menu13}; unregister_active 13; menu19 .menu19 \"$title\""
2829
        frame $w.f
2830
        button $w.f.back -text "OK" \
2831
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 18"
2832
        button $w.f.next -text "Next" -underline 0\
2833
                -width 15 -command $nextscript
2834
        bind all  $nextscript
2835
        button $w.f.prev -text "Prev" -underline 0\
2836
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 18; menu17 .menu17 \"$title\""
2837
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 18; menu17 .menu17 \"$title\";break"
2838
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2839
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2840
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2841
        pack $w.topline -side top -fill x
2842
 
2843
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2844
        pack $w.botline -side bottom -fill x
2845
 
2846
        frame $w.config
2847
        pack $w.config -fill y -expand on
2848
 
2849
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2850
        pack $w.config.vscroll -side right -fill y
2851
 
2852
        canvas $w.config.canvas -height 1\
2853
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2854
                -width [expr [winfo screenwidth .] * 1 / 2]
2855
        frame $w.config.f
2856
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2857
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2858
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2859
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2860
        bind $w  "$w.config.canvas yview moveto 0;break;"
2861
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2862
        pack $w.config.canvas -side right -fill y
2863
 
2864
 
2865
        bool $w.config.f 18 0 "Keyboard/mouse (PS2) interface  " CONFIG_KBD_ENABLE
2866
        bool $w.config.f 18 1 "Text-based VGA interface  " CONFIG_VGA_ENABLE
2867
        bool $w.config.f 18 2 "SVGA graphical frame buffer  " CONFIG_SVGA_ENABLE
2868
 
2869
 
2870
 
2871
        focus $w
2872
        update_active
2873
        global winx; global winy
2874
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
2875
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
2876
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2877
        update idletasks
2878
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2879
 
2880
        $w.config.canvas configure \
2881
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2882
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2883
                         [expr [winfo reqheight $w.config.f] + 1]"
2884
 
2885
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2886
        set scry [expr [winfo screenh $w] / 2]
2887
        set maxy [expr [winfo screenh $w] * 3 / 4]
2888
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2889
        if [expr $winy + $canvtotal < $maxy] {
2890
                $w.config.canvas configure -height $canvtotal
2891
        } else {
2892
                $w.config.canvas configure -height [expr $scry - $winy]
2893
                }
2894
        }
2895
        update idletasks
2896
        if {[winfo exists $w]} then {
2897
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2898
        wm minsize $w [winfo width $w] 100
2899
 
2900
        wm deiconify $w
2901
}
2902
}
2903
 
2904
proc update_menu18 {} {
2905
        global CONFIG_VGA_ENABLE
2906
        global CONFIG_SVGA_ENABLE
2907
        if {($CONFIG_VGA_ENABLE == 0)} then {
2908
        configure_entry .menu18.config.f.x2 normal {n l y}} else {configure_entry .menu18.config.f.x2 disabled {y n l}}
2909
}
2910
 
2911
 
2912
proc update_define_menu18 {} {
2913
        update_define_mainmenu
2914
        global CONFIG_MODULES
2915
        global CONFIG_VGA_ENABLE
2916
        global CONFIG_SVGA_ENABLE
2917
        if {($CONFIG_VGA_ENABLE == 0)} then {
2918
        set CONFIG_SVGA_ENABLE [expr $CONFIG_SVGA_ENABLE&15]} else {set CONFIG_SVGA_ENABLE [expr $CONFIG_SVGA_ENABLE|16]}
2919
}
2920
 
2921
 
2922
menu_option menu19 19 "VHDL Debugging        "
2923
proc menu19 {w title} {
2924
        set oldFocus [focus]
2925
        catch {destroy $w; unregister_active 19}
2926
        toplevel $w -class Dialog
2927
        wm withdraw $w
2928
        global active_menus
2929
        set active_menus [lsort -integer [linsert $active_menus end 19]]
2930
        message $w.m -width 400 -aspect 300 -text \
2931
                "VHDL Debugging        "  -relief raised
2932
        pack $w.m -pady 10 -side top -padx 10
2933
        wm title $w "VHDL Debugging        "
2934
 
2935
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 19; break"
2936
        set nextscript "catch {focus $oldFocus}; menu20 .menu20 \"$title\""
2937
        frame $w.f
2938
        button $w.f.back -text "Main Menu" \
2939
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 19"
2940
        button $w.f.next -text "Next" -underline 0\
2941
                -width 15 -command $nextscript
2942
        $w.f.next configure -state disabled
2943
        bind all  "puts \"no more menus\" "
2944
        button $w.f.prev -text "Prev" -underline 0\
2945
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 19; menu18 .menu18 \"$title\""
2946
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 19; menu18 .menu18 \"$title\";break"
2947
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2948
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2949
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2950
        pack $w.topline -side top -fill x
2951
 
2952
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2953
        pack $w.botline -side bottom -fill x
2954
 
2955
        frame $w.config
2956
        pack $w.config -fill y -expand on
2957
 
2958
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2959
        pack $w.config.vscroll -side right -fill y
2960
 
2961
        canvas $w.config.canvas -height 1\
2962
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2963
                -width [expr [winfo screenwidth .] * 1 / 2]
2964
        frame $w.config.f
2965
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2966
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2967
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2968
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2969
        bind $w  "$w.config.canvas yview moveto 0;break;"
2970
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2971
        pack $w.config.canvas -side right -fill y
2972
 
2973
 
2974
        bool $w.config.f 19 0 "Accelerated UART tracing       " CONFIG_DEBUG_UART
2975
 
2976
 
2977
 
2978
        focus $w
2979
        update_active
2980
        global winx; global winy
2981
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
2982
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2983
        update idletasks
2984
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2985
 
2986
        $w.config.canvas configure \
2987
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2988
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2989
                         [expr [winfo reqheight $w.config.f] + 1]"
2990
 
2991
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2992
        set scry [expr [winfo screenh $w] / 2]
2993
        set maxy [expr [winfo screenh $w] * 3 / 4]
2994
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2995
        if [expr $winy + $canvtotal < $maxy] {
2996
                $w.config.canvas configure -height $canvtotal
2997
        } else {
2998
                $w.config.canvas configure -height [expr $scry - $winy]
2999
                }
3000
        }
3001
        update idletasks
3002
        if {[winfo exists $w]} then {
3003
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3004
        wm minsize $w [winfo width $w] 100
3005
 
3006
        wm deiconify $w
3007
}
3008
}
3009
 
3010
proc update_menu19 {} {
3011
}
3012
 
3013
 
3014
proc update_define_menu19 {} {
3015
        update_define_mainmenu
3016
        global CONFIG_MODULES
3017
}
3018
 
3019
 
3020
proc update_mainmenu {}  {
3021
}
3022
 
3023
 
3024
set tmpvar_0 "(not set)"
3025
set CONFIG_SYN_INFERRED 0
3026
set CONFIG_SYN_STRATIX 0
3027
set CONFIG_SYN_STRATIXII 0
3028
set CONFIG_SYN_STRATIXIII 0
3029
set CONFIG_SYN_CYCLONEIII 0
3030
set CONFIG_SYN_ALTERA 0
3031
set CONFIG_SYN_AXCEL 0
3032
set CONFIG_SYN_PROASIC 0
3033
set CONFIG_SYN_PROASICPLUS 0
3034
set CONFIG_SYN_PROASIC3 0
3035
set CONFIG_SYN_UT025CRH 0
3036
set CONFIG_SYN_ATC18 0
3037
set CONFIG_SYN_ATC18RHA 0
3038
set CONFIG_SYN_CUSTOM1 0
3039
set CONFIG_SYN_EASIC90 0
3040
set CONFIG_SYN_IHP25 0
3041
set CONFIG_SYN_IHP25RH 0
3042
set CONFIG_SYN_LATTICE 0
3043
set CONFIG_SYN_ECLIPSE 0
3044
set CONFIG_SYN_PEREGRINE 0
3045
set CONFIG_SYN_RH_LIB18T 0
3046
set CONFIG_SYN_RHUMC 0
3047
set CONFIG_SYN_SPARTAN2 0
3048
set CONFIG_SYN_SPARTAN3 0
3049
set CONFIG_SYN_SPARTAN3E 0
3050
set CONFIG_SYN_VIRTEX 0
3051
set CONFIG_SYN_VIRTEXE 0
3052
set CONFIG_SYN_VIRTEX2 0
3053
set CONFIG_SYN_VIRTEX4 0
3054
set CONFIG_SYN_VIRTEX5 0
3055
set CONFIG_SYN_UMC 0
3056
set CONFIG_SYN_TSMC90 0
3057
set tmpvar_1 "(not set)"
3058
set CONFIG_MEM_INFERRED 0
3059
set CONFIG_MEM_UMC 0
3060
set CONFIG_MEM_RHUMC 0
3061
set CONFIG_MEM_ARTISAN 0
3062
set CONFIG_MEM_CUSTOM1 0
3063
set CONFIG_MEM_VIRAGE 0
3064
set CONFIG_MEM_VIRAGE90 0
3065
set CONFIG_SYN_INFER_RAM 0
3066
set CONFIG_SYN_INFER_PADS 0
3067
set CONFIG_SYN_NO_ASYNC 0
3068
set CONFIG_SYN_SCAN 0
3069
set tmpvar_2 "(not set)"
3070
set CONFIG_CLK_INFERRED 0
3071
set CONFIG_CLK_HCLKBUF 0
3072
set CONFIG_CLK_ALTDLL 0
3073
set CONFIG_CLK_LATDLL 0
3074
set CONFIG_CLK_PRO3PLL 0
3075
set CONFIG_CLK_LIB18T 0
3076
set CONFIG_CLK_RHUMC 0
3077
set CONFIG_CLK_CLKDLL 0
3078
set CONFIG_CLK_DCM 0
3079
set CONFIG_CLK_MUL 2
3080
set CONFIG_CLK_DIV 2
3081
set CONFIG_OCLK_DIV 2
3082
set CONFIG_PCI_CLKDLL 0
3083
set CONFIG_CLK_NOFB 0
3084
set CONFIG_PCI_SYSCLK 0
3085
set CONFIG_LEON3 0
3086
set CONFIG_PROC_NUM 1
3087
set CONFIG_IU_NWINDOWS 8
3088
set CONFIG_IU_V8MULDIV 0
3089
set tmpvar_3 "(not set)"
3090
set CONFIG_IU_MUL_LATENCY_2 0
3091
set CONFIG_IU_MUL_LATENCY_4 0
3092
set CONFIG_IU_MUL_LATENCY_5 0
3093
set CONFIG_IU_MUL_MAC 0
3094
set CONFIG_IU_SVT 0
3095
set CONFIG_IU_LDELAY 1
3096
set CONFIG_IU_WATCHPOINTS 0
3097
set CONFIG_PWD 0
3098
set CONFIG_IU_RSTADDR 00000
3099
set CONFIG_FPU_ENABLE 0
3100
set tmpvar_4 "(not set)"
3101
set CONFIG_FPU_GRFPU 0
3102
set CONFIG_FPU_GRFPULITE 0
3103
set CONFIG_FPU_MEIKO 0
3104
set tmpvar_5 "(not set)"
3105
set CONFIG_FPU_GRFPU_INFMUL 0
3106
set CONFIG_FPU_GRFPU_DWMUL 0
3107
set CONFIG_FPU_GRFPU_MODGEN 0
3108
set tmpvar_6 "(not set)"
3109
set CONFIG_FPU_GRFPC0 0
3110
set CONFIG_FPU_GRFPC1 0
3111
set CONFIG_FPU_GRFPC2 0
3112
set CONFIG_FPU_NETLIST 0
3113
set CONFIG_ICACHE_ENABLE 0
3114
set tmpvar_7 "(not set)"
3115
set CONFIG_ICACHE_ASSO1 0
3116
set CONFIG_ICACHE_ASSO2 0
3117
set CONFIG_ICACHE_ASSO3 0
3118
set CONFIG_ICACHE_ASSO4 0
3119
set tmpvar_8 "(not set)"
3120
set CONFIG_ICACHE_SZ1 0
3121
set CONFIG_ICACHE_SZ2 0
3122
set CONFIG_ICACHE_SZ4 0
3123
set CONFIG_ICACHE_SZ8 0
3124
set CONFIG_ICACHE_SZ16 0
3125
set CONFIG_ICACHE_SZ32 0
3126
set CONFIG_ICACHE_SZ64 0
3127
set CONFIG_ICACHE_SZ128 0
3128
set CONFIG_ICACHE_SZ256 0
3129
set tmpvar_9 "(not set)"
3130
set CONFIG_ICACHE_LZ16 0
3131
set CONFIG_ICACHE_LZ32 0
3132
set tmpvar_10 "(not set)"
3133
set CONFIG_ICACHE_ALGORND 0
3134
set CONFIG_ICACHE_ALGOLRR 0
3135
set CONFIG_ICACHE_ALGOLRU 0
3136
set CONFIG_ICACHE_LOCK 0
3137
set CONFIG_ICACHE_LRAM 0
3138
set tmpvar_11 "(not set)"
3139
set CONFIG_ICACHE_LRAM_SZ1 0
3140
set CONFIG_ICACHE_LRAM_SZ2 0
3141
set CONFIG_ICACHE_LRAM_SZ4 0
3142
set CONFIG_ICACHE_LRAM_SZ8 0
3143
set CONFIG_ICACHE_LRAM_SZ16 0
3144
set CONFIG_ICACHE_LRAM_SZ32 0
3145
set CONFIG_ICACHE_LRAM_SZ64 0
3146
set CONFIG_ICACHE_LRAM_SZ128 0
3147
set CONFIG_ICACHE_LRAM_SZ256 0
3148
set CONFIG_ICACHE_LRSTART 8e
3149
set CONFIG_DCACHE_ENABLE 0
3150
set tmpvar_12 "(not set)"
3151
set CONFIG_DCACHE_ASSO1 0
3152
set CONFIG_DCACHE_ASSO2 0
3153
set CONFIG_DCACHE_ASSO3 0
3154
set CONFIG_DCACHE_ASSO4 0
3155
set tmpvar_13 "(not set)"
3156
set CONFIG_DCACHE_SZ1 0
3157
set CONFIG_DCACHE_SZ2 0
3158
set CONFIG_DCACHE_SZ4 0
3159
set CONFIG_DCACHE_SZ8 0
3160
set CONFIG_DCACHE_SZ16 0
3161
set CONFIG_DCACHE_SZ32 0
3162
set CONFIG_DCACHE_SZ64 0
3163
set CONFIG_DCACHE_SZ128 0
3164
set CONFIG_DCACHE_SZ256 0
3165
set tmpvar_14 "(not set)"
3166
set CONFIG_DCACHE_LZ16 0
3167
set CONFIG_DCACHE_LZ32 0
3168
set tmpvar_15 "(not set)"
3169
set CONFIG_DCACHE_ALGORND 0
3170
set CONFIG_DCACHE_ALGOLRR 0
3171
set CONFIG_DCACHE_ALGOLRU 0
3172
set CONFIG_DCACHE_LOCK 0
3173
set CONFIG_DCACHE_SNOOP 0
3174
set CONFIG_DCACHE_SNOOP_FAST 0
3175
set CONFIG_DCACHE_SNOOP_SEPTAG 0
3176
set CONFIG_CACHE_FIXED 0
3177
set CONFIG_DCACHE_LRAM 0
3178
set tmpvar_16 "(not set)"
3179
set CONFIG_DCACHE_LRAM_SZ1 0
3180
set CONFIG_DCACHE_LRAM_SZ2 0
3181
set CONFIG_DCACHE_LRAM_SZ4 0
3182
set CONFIG_DCACHE_LRAM_SZ8 0
3183
set CONFIG_DCACHE_LRAM_SZ16 0
3184
set CONFIG_DCACHE_LRAM_SZ32 0
3185
set CONFIG_DCACHE_LRAM_SZ64 0
3186
set CONFIG_DCACHE_LRAM_SZ128 0
3187
set CONFIG_DCACHE_LRAM_SZ256 0
3188
set CONFIG_DCACHE_LRSTART 8f
3189
set CONFIG_MMU_ENABLE 0
3190
set tmpvar_17 "(not set)"
3191
set CONFIG_MMU_COMBINED 0
3192
set CONFIG_MMU_SPLIT 0
3193
set tmpvar_18 "(not set)"
3194
set CONFIG_MMU_REPARRAY 0
3195
set CONFIG_MMU_REPINCREMENT 0
3196
set tmpvar_19 "(not set)"
3197
set CONFIG_MMU_I2 0
3198
set CONFIG_MMU_I4 0
3199
set CONFIG_MMU_I8 0
3200
set CONFIG_MMU_I16 0
3201
set CONFIG_MMU_I32 0
3202
set tmpvar_20 "(not set)"
3203
set CONFIG_MMU_D2 0
3204
set CONFIG_MMU_D4 0
3205
set CONFIG_MMU_D8 0
3206
set CONFIG_MMU_D16 0
3207
set CONFIG_MMU_D32 0
3208
set CONFIG_MMU_FASTWB 0
3209
set CONFIG_DSU_ENABLE 0
3210
set CONFIG_DSU_ITRACE 0
3211
set tmpvar_21 "(not set)"
3212
set CONFIG_DSU_ITRACESZ1 0
3213
set CONFIG_DSU_ITRACESZ2 0
3214
set CONFIG_DSU_ITRACESZ4 0
3215
set CONFIG_DSU_ITRACESZ8 0
3216
set CONFIG_DSU_ITRACESZ16 0
3217
set CONFIG_DSU_ATRACE 0
3218
set tmpvar_22 "(not set)"
3219
set CONFIG_DSU_ATRACESZ1 0
3220
set CONFIG_DSU_ATRACESZ2 0
3221
set CONFIG_DSU_ATRACESZ4 0
3222
set CONFIG_DSU_ATRACESZ8 0
3223
set CONFIG_DSU_ATRACESZ16 0
3224
set CONFIG_IU_DISAS 0
3225
set CONFIG_IU_DISAS_NET 0
3226
set CONFIG_DEBUG_PC32 0
3227
set CONFIG_AHB_DEFMST 0
3228
set CONFIG_AHB_RROBIN 0
3229
set CONFIG_AHB_SPLIT 0
3230
set CONFIG_AHB_IOADDR FFF
3231
set CONFIG_APB_HADDR 800
3232
set CONFIG_AHB_MON 0
3233
set CONFIG_AHB_MONERR 0
3234
set CONFIG_AHB_MONWAR 0
3235
set CONFIG_DSU_UART 0
3236
set CONFIG_DSU_JTAG 0
3237
set CONFIG_DSU_ETH 0
3238
set tmpvar_24 "(not set)"
3239
set CONFIG_DSU_ETHSZ1 0
3240
set CONFIG_DSU_ETHSZ2 0
3241
set CONFIG_DSU_ETHSZ4 0
3242
set CONFIG_DSU_ETHSZ8 0
3243
set CONFIG_DSU_ETHSZ16 0
3244
set CONFIG_DSU_IPMSB C0A8
3245
set CONFIG_DSU_IPLSB 0033
3246
set CONFIG_DSU_ETHMSB 00007A
3247
set CONFIG_DSU_ETHLSB CC0001
3248
set CONFIG_DSU_ETH_PROG 0
3249
set CONFIG_DDRSP 0
3250
set CONFIG_DDRSP_INIT 0
3251
set CONFIG_DDRSP_FREQ 100
3252
set CONFIG_DDRSP_COL 9
3253
set CONFIG_DDRSP_MBYTE 16
3254
set CONFIG_DDRSP_RSKEW 0
3255
set CONFIG_AHBROM_ENABLE 0
3256
set CONFIG_AHBROM_START 000
3257
set CONFIG_AHBROM_PIPE 0
3258
set CONFIG_AHBRAM_ENABLE 0
3259
set tmpvar_25 "(not set)"
3260
set CONFIG_AHBRAM_SZ1 0
3261
set CONFIG_AHBRAM_SZ2 0
3262
set CONFIG_AHBRAM_SZ4 0
3263
set CONFIG_AHBRAM_SZ8 0
3264
set CONFIG_AHBRAM_SZ16 0
3265
set CONFIG_AHBRAM_SZ32 0
3266
set CONFIG_AHBRAM_SZ64 0
3267
set CONFIG_AHBRAM_START A00
3268
set CONFIG_GRETH_ENABLE 0
3269
set CONFIG_GRETH_GIGA 0
3270
set tmpvar_26 "(not set)"
3271
set CONFIG_GRETH_FIFO4 0
3272
set CONFIG_GRETH_FIFO8 0
3273
set CONFIG_GRETH_FIFO16 0
3274
set CONFIG_GRETH_FIFO32 0
3275
set CONFIG_GRETH_FIFO64 0
3276
set CONFIG_UART1_ENABLE 0
3277
set tmpvar_27 "(not set)"
3278
set CONFIG_UA1_FIFO1 0
3279
set CONFIG_UA1_FIFO2 0
3280
set CONFIG_UA1_FIFO4 0
3281
set CONFIG_UA1_FIFO8 0
3282
set CONFIG_UA1_FIFO16 0
3283
set CONFIG_UA1_FIFO32 0
3284
set CONFIG_IRQ3_ENABLE 0
3285
set CONFIG_IRQ3_SEC 0
3286
set CONFIG_IRQ3_NSEC 12
3287
set CONFIG_GPT_ENABLE 0
3288
set CONFIG_GPT_NTIM 2
3289
set CONFIG_GPT_SW 8
3290
set CONFIG_GPT_TW 32
3291
set CONFIG_GPT_IRQ 8
3292
set CONFIG_GPT_SEPIRQ 0
3293
set CONFIG_GPT_WDOGEN 0
3294
set CONFIG_GPT_WDOG FFFF
3295
set CONFIG_KBD_ENABLE 0
3296
set CONFIG_VGA_ENABLE 0
3297
set CONFIG_SVGA_ENABLE 0
3298
set CONFIG_DEBUG_UART 0
3299
set CONFIG_SYN_ARTISAN 4
3300
set CONFIG_PCI_ENABLE 4
3301
set CONFIG_HAS_SHARED_GRFPU 4
3302
set CONFIG_FPU_GRFPU_SH 4
3303
set CONFIG_LEON3FT_PRESENT 4
3304
set CONFIG_LEON3FT_EN 4
3305
set CONFIG_IUFT_NONE 4
3306
set CONFIG_IUFT_PAR 4
3307
set CONFIG_IUFT_DMR 4
3308
set CONFIG_IUFT_BCH 4
3309
set CONFIG_IUFT_TMR 4
3310
set CONFIG_FPUFT_EN 4
3311
set CONFIG_RF_ERRINJ 4
3312
set CONFIG_CACHE_FT_EN 4
3313
set CONFIG_CACHE_ERRINJ 4
3314
set CONFIG_LEON3_NETLIST 4
3315
set CONFIG_MODULES 4
3316
proc writeconfig {file1 file2} {
3317
        set cfg [open $file1 w]
3318
        set autocfg [open $file2 w]
3319
        set notmod 1
3320
        set notset 0
3321
        puts $cfg "#"
3322
        puts $cfg "# Automatically generated make config: don't edit"
3323
        puts $cfg "#"
3324
        puts $autocfg "/*"
3325
        puts $autocfg " * Automatically generated C config: don't edit"
3326
        puts $autocfg " */"
3327
        puts $autocfg "#define AUTOCONF_INCLUDED"
3328
        write_comment $cfg $autocfg "Synthesis      "
3329
        global tmpvar_0
3330
 
3331
        if { $tmpvar_0 == "Inferred" } then { write_tristate $cfg $autocfg CONFIG_SYN_INFERRED 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_INFERRED 0 [list $notmod] 2 }
3332
        if { $tmpvar_0 == "Altera-Stratix" } then { write_tristate $cfg $autocfg CONFIG_SYN_STRATIX 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_STRATIX 0 [list $notmod] 2 }
3333
        if { $tmpvar_0 == "Altera-StratixII" } then { write_tristate $cfg $autocfg CONFIG_SYN_STRATIXII 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_STRATIXII 0 [list $notmod] 2 }
3334
        if { $tmpvar_0 == "Altera-StratixIII" } then { write_tristate $cfg $autocfg CONFIG_SYN_STRATIXIII 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_STRATIXIII 0 [list $notmod] 2 }
3335
        if { $tmpvar_0 == "Altera-CycloneIII" } then { write_tristate $cfg $autocfg CONFIG_SYN_CYCLONEIII 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_CYCLONEIII 0 [list $notmod] 2 }
3336
        if { $tmpvar_0 == "Altera-Others" } then { write_tristate $cfg $autocfg CONFIG_SYN_ALTERA 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_ALTERA 0 [list $notmod] 2 }
3337
        if { $tmpvar_0 == "Actel-Axcelerator" } then { write_tristate $cfg $autocfg CONFIG_SYN_AXCEL 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_AXCEL 0 [list $notmod] 2 }
3338
        if { $tmpvar_0 == "Actel-Proasic" } then { write_tristate $cfg $autocfg CONFIG_SYN_PROASIC 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_PROASIC 0 [list $notmod] 2 }
3339
        if { $tmpvar_0 == "Actel-ProasicPlus" } then { write_tristate $cfg $autocfg CONFIG_SYN_PROASICPLUS 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_PROASICPLUS 0 [list $notmod] 2 }
3340
        if { $tmpvar_0 == "Actel-Proasic3" } then { write_tristate $cfg $autocfg CONFIG_SYN_PROASIC3 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_PROASIC3 0 [list $notmod] 2 }
3341
        if { $tmpvar_0 == "Aeroflex-UT025CRH" } then { write_tristate $cfg $autocfg CONFIG_SYN_UT025CRH 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_UT025CRH 0 [list $notmod] 2 }
3342
        if { $tmpvar_0 == "Atmel-ATC18" } then { write_tristate $cfg $autocfg CONFIG_SYN_ATC18 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_ATC18 0 [list $notmod] 2 }
3343
        if { $tmpvar_0 == "Atmel-ATC18RHA" } then { write_tristate $cfg $autocfg CONFIG_SYN_ATC18RHA 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_ATC18RHA 0 [list $notmod] 2 }
3344
        if { $tmpvar_0 == "Custom1" } then { write_tristate $cfg $autocfg CONFIG_SYN_CUSTOM1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_CUSTOM1 0 [list $notmod] 2 }
3345
        if { $tmpvar_0 == "eASIC90" } then { write_tristate $cfg $autocfg CONFIG_SYN_EASIC90 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_EASIC90 0 [list $notmod] 2 }
3346
        if { $tmpvar_0 == "IHP25" } then { write_tristate $cfg $autocfg CONFIG_SYN_IHP25 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_IHP25 0 [list $notmod] 2 }
3347
        if { $tmpvar_0 == "IHP25RH" } then { write_tristate $cfg $autocfg CONFIG_SYN_IHP25RH 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_IHP25RH 0 [list $notmod] 2 }
3348
        if { $tmpvar_0 == "Lattice-EC/ECP/XP" } then { write_tristate $cfg $autocfg CONFIG_SYN_LATTICE 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_LATTICE 0 [list $notmod] 2 }
3349
        if { $tmpvar_0 == "Quicklogic-Eclipse" } then { write_tristate $cfg $autocfg CONFIG_SYN_ECLIPSE 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_ECLIPSE 0 [list $notmod] 2 }
3350
        if { $tmpvar_0 == "Peregrine" } then { write_tristate $cfg $autocfg CONFIG_SYN_PEREGRINE 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_PEREGRINE 0 [list $notmod] 2 }
3351
        if { $tmpvar_0 == "RH-LIB18T" } then { write_tristate $cfg $autocfg CONFIG_SYN_RH_LIB18T 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_RH_LIB18T 0 [list $notmod] 2 }
3352
        if { $tmpvar_0 == "RH-UMC" } then { write_tristate $cfg $autocfg CONFIG_SYN_RHUMC 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_RHUMC 0 [list $notmod] 2 }
3353
        if { $tmpvar_0 == "Xilinx-Spartan2" } then { write_tristate $cfg $autocfg CONFIG_SYN_SPARTAN2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_SPARTAN2 0 [list $notmod] 2 }
3354
        if { $tmpvar_0 == "Xilinx-Spartan3" } then { write_tristate $cfg $autocfg CONFIG_SYN_SPARTAN3 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_SPARTAN3 0 [list $notmod] 2 }
3355
        if { $tmpvar_0 == "Xilinx-Spartan3E" } then { write_tristate $cfg $autocfg CONFIG_SYN_SPARTAN3E 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_SPARTAN3E 0 [list $notmod] 2 }
3356
        if { $tmpvar_0 == "Xilinx-Virtex" } then { write_tristate $cfg $autocfg CONFIG_SYN_VIRTEX 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_VIRTEX 0 [list $notmod] 2 }
3357
        if { $tmpvar_0 == "Xilinx-VirtexE" } then { write_tristate $cfg $autocfg CONFIG_SYN_VIRTEXE 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_VIRTEXE 0 [list $notmod] 2 }
3358
        if { $tmpvar_0 == "Xilinx-Virtex2" } then { write_tristate $cfg $autocfg CONFIG_SYN_VIRTEX2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_VIRTEX2 0 [list $notmod] 2 }
3359
        if { $tmpvar_0 == "Xilinx-Virtex4" } then { write_tristate $cfg $autocfg CONFIG_SYN_VIRTEX4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_VIRTEX4 0 [list $notmod] 2 }
3360
        if { $tmpvar_0 == "Xilinx-Virtex5" } then { write_tristate $cfg $autocfg CONFIG_SYN_VIRTEX5 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_VIRTEX5 0 [list $notmod] 2 }
3361
        if { $tmpvar_0 == "UMC18" } then { write_tristate $cfg $autocfg CONFIG_SYN_UMC 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_UMC 0 [list $notmod] 2 }
3362
        if { $tmpvar_0 == "TSMC90" } then { write_tristate $cfg $autocfg CONFIG_SYN_TSMC90 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_TSMC90 0 [list $notmod] 2 }
3363
        global tmpvar_1
3364
        global CONFIG_SYN_INFERRED
3365
        global CONFIG_SYN_CUSTOM1
3366
        global CONFIG_SYN_ATC18
3367
        global CONFIG_SYN_TSMC90
3368
        global CONFIG_SYN_UMC
3369
        global CONFIG_SYN_RHUMC
3370
        global CONFIG_SYN_ARTISAN
3371
        if {($CONFIG_SYN_INFERRED == 1 || $CONFIG_SYN_CUSTOM1 == 1 || $CONFIG_SYN_ATC18 == 1 || $CONFIG_SYN_TSMC90 == 1 || $CONFIG_SYN_UMC == 1 || $CONFIG_SYN_RHUMC == 1 || $CONFIG_SYN_ARTISAN == 1)} then {
3372
        if { $tmpvar_1 == "Inferred" } then { write_tristate $cfg $autocfg CONFIG_MEM_INFERRED 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MEM_INFERRED 0 [list $notmod] 2 }
3373
        if { $tmpvar_1 == "UMC18" } then { write_tristate $cfg $autocfg CONFIG_MEM_UMC 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MEM_UMC 0 [list $notmod] 2 }
3374
        if { $tmpvar_1 == "RH-UMC" } then { write_tristate $cfg $autocfg CONFIG_MEM_RHUMC 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MEM_RHUMC 0 [list $notmod] 2 }
3375
        if { $tmpvar_1 == "Artisan" } then { write_tristate $cfg $autocfg CONFIG_MEM_ARTISAN 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MEM_ARTISAN 0 [list $notmod] 2 }
3376
        if { $tmpvar_1 == "Custom1" } then { write_tristate $cfg $autocfg CONFIG_MEM_CUSTOM1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MEM_CUSTOM1 0 [list $notmod] 2 }
3377
        if { $tmpvar_1 == "Virage" } then { write_tristate $cfg $autocfg CONFIG_MEM_VIRAGE 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MEM_VIRAGE 0 [list $notmod] 2 }
3378
        if { $tmpvar_1 == "Virage-TSMC90" } then { write_tristate $cfg $autocfg CONFIG_MEM_VIRAGE90 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MEM_VIRAGE90 0 [list $notmod] 2 }}
3379
        global CONFIG_SYN_INFER_RAM
3380
        if {($CONFIG_SYN_INFERRED != 1)} then {write_tristate $cfg $autocfg CONFIG_SYN_INFER_RAM $CONFIG_SYN_INFER_RAM [list $notmod] 2 }
3381
        global CONFIG_SYN_INFER_PADS
3382
        if {($CONFIG_SYN_INFERRED != 1)} then {write_tristate $cfg $autocfg CONFIG_SYN_INFER_PADS $CONFIG_SYN_INFER_PADS [list $notmod] 2 }
3383
        global CONFIG_SYN_NO_ASYNC
3384
        write_tristate $cfg $autocfg CONFIG_SYN_NO_ASYNC $CONFIG_SYN_NO_ASYNC [list $notmod] 2
3385
        global CONFIG_SYN_SCAN
3386
        write_tristate $cfg $autocfg CONFIG_SYN_SCAN $CONFIG_SYN_SCAN [list $notmod] 2
3387
        write_comment $cfg $autocfg "Clock generation"
3388
        global tmpvar_2
3389
 
3390
        if { $tmpvar_2 == "Inferred" } then { write_tristate $cfg $autocfg CONFIG_CLK_INFERRED 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_CLK_INFERRED 0 [list $notmod] 2 }
3391
        if { $tmpvar_2 == "Actel-HCLKBUF" } then { write_tristate $cfg $autocfg CONFIG_CLK_HCLKBUF 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_CLK_HCLKBUF 0 [list $notmod] 2 }
3392
        if { $tmpvar_2 == "Altera-ALTPLL" } then { write_tristate $cfg $autocfg CONFIG_CLK_ALTDLL 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_CLK_ALTDLL 0 [list $notmod] 2 }
3393
        if { $tmpvar_2 == "Lattice-EXPLL" } then { write_tristate $cfg $autocfg CONFIG_CLK_LATDLL 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_CLK_LATDLL 0 [list $notmod] 2 }
3394
        if { $tmpvar_2 == "Proasic3-PLLL" } then { write_tristate $cfg $autocfg CONFIG_CLK_PRO3PLL 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_CLK_PRO3PLL 0 [list $notmod] 2 }
3395
        if { $tmpvar_2 == "RH-LIB18T-PLL" } then { write_tristate $cfg $autocfg CONFIG_CLK_LIB18T 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_CLK_LIB18T 0 [list $notmod] 2 }
3396
        if { $tmpvar_2 == "DARE-PLL" } then { write_tristate $cfg $autocfg CONFIG_CLK_RHUMC 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_CLK_RHUMC 0 [list $notmod] 2 }
3397
        if { $tmpvar_2 == "Xilinx-CLKDLL" } then { write_tristate $cfg $autocfg CONFIG_CLK_CLKDLL 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_CLK_CLKDLL 0 [list $notmod] 2 }
3398
        if { $tmpvar_2 == "Xilinx-DCM" } then { write_tristate $cfg $autocfg CONFIG_CLK_DCM 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_CLK_DCM 0 [list $notmod] 2 }
3399
        global CONFIG_CLK_MUL
3400
        global CONFIG_CLK_DCM
3401
        global CONFIG_CLK_ALTDLL
3402
        global CONFIG_CLK_LATDLL
3403
        global CONFIG_CLK_PRO3PLL
3404
        global CONFIG_CLK_CLKDLL
3405
        global CONFIG_CLK_LIB18T
3406
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_PRO3PLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {write_int $cfg $autocfg CONFIG_CLK_MUL $CONFIG_CLK_MUL $notmod }
3407
        global CONFIG_CLK_DIV
3408
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_PRO3PLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {write_int $cfg $autocfg CONFIG_CLK_DIV $CONFIG_CLK_DIV $notmod }
3409
        global CONFIG_OCLK_DIV
3410
        if {($CONFIG_CLK_PRO3PLL == 1)} then {write_int $cfg $autocfg CONFIG_OCLK_DIV $CONFIG_OCLK_DIV $notmod }
3411
        global CONFIG_PCI_CLKDLL
3412
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_CLKDLL $CONFIG_PCI_CLKDLL [list $notmod] 2 }
3413
        global CONFIG_CLK_NOFB
3414
        if {($CONFIG_CLK_DCM == 1)} then {write_tristate $cfg $autocfg CONFIG_CLK_NOFB $CONFIG_CLK_NOFB [list $notmod] 2 }
3415
        global CONFIG_PCI_SYSCLK
3416
        global CONFIG_PCI_ENABLE
3417
        if {($CONFIG_PCI_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_SYSCLK $CONFIG_PCI_SYSCLK [list $notmod] 2 }
3418
        global CONFIG_LEON3
3419
        write_tristate $cfg $autocfg CONFIG_LEON3 $CONFIG_LEON3 [list $notmod] 2
3420
        global CONFIG_PROC_NUM
3421
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_PROC_NUM $CONFIG_PROC_NUM $notmod }
3422
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Processor            "}
3423
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Integer unit                                           "}
3424
        global CONFIG_IU_NWINDOWS
3425
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_NWINDOWS $CONFIG_IU_NWINDOWS $notmod }
3426
        global CONFIG_IU_V8MULDIV
3427
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_V8MULDIV $CONFIG_IU_V8MULDIV [list $notmod] 2 }
3428
        global tmpvar_3
3429
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {
3430
        if { $tmpvar_3 == "2-cycles" } then { write_tristate $cfg $autocfg CONFIG_IU_MUL_LATENCY_2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_IU_MUL_LATENCY_2 0 [list $notmod] 2 }
3431
        if { $tmpvar_3 == "4-cycles" } then { write_tristate $cfg $autocfg CONFIG_IU_MUL_LATENCY_4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_IU_MUL_LATENCY_4 0 [list $notmod] 2 }
3432
        if { $tmpvar_3 == "5-cycles" } then { write_tristate $cfg $autocfg CONFIG_IU_MUL_LATENCY_5 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_IU_MUL_LATENCY_5 0 [list $notmod] 2 }}
3433
        global CONFIG_IU_MUL_MAC
3434
        global CONFIG_IU_MUL_LATENCY_4
3435
        global CONFIG_IU_MUL_LATENCY_5
3436
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1) && ($CONFIG_IU_MUL_LATENCY_4 == 1 || $CONFIG_IU_MUL_LATENCY_5 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_MUL_MAC $CONFIG_IU_MUL_MAC [list $notmod] 2 }
3437
        global CONFIG_IU_SVT
3438
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_SVT $CONFIG_IU_SVT [list $notmod] 2 }
3439
        global CONFIG_IU_LDELAY
3440
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_LDELAY $CONFIG_IU_LDELAY $notmod }
3441
        global CONFIG_IU_WATCHPOINTS
3442
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_WATCHPOINTS $CONFIG_IU_WATCHPOINTS $notmod }
3443
        global CONFIG_PWD
3444
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_PWD $CONFIG_PWD [list $notmod] 2 }
3445
        global CONFIG_IU_RSTADDR
3446
        if {($CONFIG_LEON3 == 1)} then {write_hex $cfg $autocfg CONFIG_IU_RSTADDR $CONFIG_IU_RSTADDR $notmod }
3447
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Floating-point unit"}
3448
        global CONFIG_FPU_ENABLE
3449
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_FPU_ENABLE $CONFIG_FPU_ENABLE [list $notmod] 2 }
3450
        global tmpvar_4
3451
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
3452
        if { $tmpvar_4 == "GRFPU" } then { write_tristate $cfg $autocfg CONFIG_FPU_GRFPU 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPU_GRFPU 0 [list $notmod] 2 }
3453
        if { $tmpvar_4 == "GRFPU-LITE" } then { write_tristate $cfg $autocfg CONFIG_FPU_GRFPULITE 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPU_GRFPULITE 0 [list $notmod] 2 }
3454
        if { $tmpvar_4 == "Meiko" } then { write_tristate $cfg $autocfg CONFIG_FPU_MEIKO 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPU_MEIKO 0 [list $notmod] 2 }}
3455
        global tmpvar_5
3456
        global CONFIG_FPU_GRFPU
3457
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPU == 1)} then {
3458
        if { $tmpvar_5 == "Inferred" } then { write_tristate $cfg $autocfg CONFIG_FPU_GRFPU_INFMUL 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPU_GRFPU_INFMUL 0 [list $notmod] 2 }
3459
        if { $tmpvar_5 == "DW" } then { write_tristate $cfg $autocfg CONFIG_FPU_GRFPU_DWMUL 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPU_GRFPU_DWMUL 0 [list $notmod] 2 }
3460
        if { $tmpvar_5 == "ModGen" } then { write_tristate $cfg $autocfg CONFIG_FPU_GRFPU_MODGEN 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPU_GRFPU_MODGEN 0 [list $notmod] 2 }}
3461
        global tmpvar_6
3462
        global CONFIG_FPU_GRFPULITE
3463
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPULITE == 1)} then {
3464
        if { $tmpvar_6 == "Simple" } then { write_tristate $cfg $autocfg CONFIG_FPU_GRFPC0 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPU_GRFPC0 0 [list $notmod] 2 }
3465
        if { $tmpvar_6 == "Data-forwarding" } then { write_tristate $cfg $autocfg CONFIG_FPU_GRFPC1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPU_GRFPC1 0 [list $notmod] 2 }
3466
        if { $tmpvar_6 == "Non-blocking" } then { write_tristate $cfg $autocfg CONFIG_FPU_GRFPC2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPU_GRFPC2 0 [list $notmod] 2 }}
3467
        global CONFIG_FPU_NETLIST
3468
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_FPU_NETLIST $CONFIG_FPU_NETLIST [list $notmod] 2 }
3469
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Cache system"}
3470
        global CONFIG_ICACHE_ENABLE
3471
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_ICACHE_ENABLE $CONFIG_ICACHE_ENABLE [list $notmod] 2 }
3472
        global tmpvar_7
3473
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
3474
        if { $tmpvar_7 == "1" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_ASSO1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_ASSO1 0 [list $notmod] 2 }
3475
        if { $tmpvar_7 == "2" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_ASSO2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_ASSO2 0 [list $notmod] 2 }
3476
        if { $tmpvar_7 == "3" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_ASSO3 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_ASSO3 0 [list $notmod] 2 }
3477
        if { $tmpvar_7 == "4" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_ASSO4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_ASSO4 0 [list $notmod] 2 }}
3478
        global tmpvar_8
3479
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
3480
        if { $tmpvar_8 == "1" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ1 0 [list $notmod] 2 }
3481
        if { $tmpvar_8 == "2" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ2 0 [list $notmod] 2 }
3482
        if { $tmpvar_8 == "4" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ4 0 [list $notmod] 2 }
3483
        if { $tmpvar_8 == "8" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ8 0 [list $notmod] 2 }
3484
        if { $tmpvar_8 == "16" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ16 0 [list $notmod] 2 }
3485
        if { $tmpvar_8 == "32" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ32 0 [list $notmod] 2 }
3486
        if { $tmpvar_8 == "64" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ64 0 [list $notmod] 2 }
3487
        if { $tmpvar_8 == "128" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ128 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ128 0 [list $notmod] 2 }
3488
        if { $tmpvar_8 == "256" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ256 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_SZ256 0 [list $notmod] 2 }}
3489
        global tmpvar_9
3490
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
3491
        if { $tmpvar_9 == "16" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LZ16 0 [list $notmod] 2 }
3492
        if { $tmpvar_9 == "32" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LZ32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LZ32 0 [list $notmod] 2 }}
3493
        global tmpvar_10
3494
        global CONFIG_ICACHE_ASSO1
3495
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {
3496
        if { $tmpvar_10 == "Random" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_ALGORND 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_ALGORND 0 [list $notmod] 2 }
3497
        if { $tmpvar_10 == "LRR" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_ALGOLRR 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_ALGOLRR 0 [list $notmod] 2 }
3498
        if { $tmpvar_10 == "LRU" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_ALGOLRU 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_ALGOLRU 0 [list $notmod] 2 }}
3499
        global CONFIG_ICACHE_LOCK
3500
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {write_tristate $cfg $autocfg CONFIG_ICACHE_LOCK $CONFIG_ICACHE_LOCK [list $notmod] 2 }
3501
        global CONFIG_ICACHE_LRAM
3502
        global CONFIG_MMU_ENABLE
3503
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM $CONFIG_ICACHE_LRAM [list $notmod] 2 }
3504
        global tmpvar_11
3505
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {
3506
        if { $tmpvar_11 == "1" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ1 0 [list $notmod] 2 }
3507
        if { $tmpvar_11 == "2" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ2 0 [list $notmod] 2 }
3508
        if { $tmpvar_11 == "4" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ4 0 [list $notmod] 2 }
3509
        if { $tmpvar_11 == "8" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ8 0 [list $notmod] 2 }
3510
        if { $tmpvar_11 == "16" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ16 0 [list $notmod] 2 }
3511
        if { $tmpvar_11 == "32" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ32 0 [list $notmod] 2 }
3512
        if { $tmpvar_11 == "64" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ64 0 [list $notmod] 2 }
3513
        if { $tmpvar_11 == "128" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ128 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ128 0 [list $notmod] 2 }
3514
        if { $tmpvar_11 == "256" } then { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ256 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM_SZ256 0 [list $notmod] 2 }}
3515
        global CONFIG_ICACHE_LRSTART
3516
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {write_hex $cfg $autocfg CONFIG_ICACHE_LRSTART $CONFIG_ICACHE_LRSTART $notmod }
3517
        global CONFIG_DCACHE_ENABLE
3518
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_ENABLE $CONFIG_DCACHE_ENABLE [list $notmod] 2 }
3519
        global tmpvar_12
3520
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
3521
        if { $tmpvar_12 == "1" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_ASSO1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_ASSO1 0 [list $notmod] 2 }
3522
        if { $tmpvar_12 == "2" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_ASSO2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_ASSO2 0 [list $notmod] 2 }
3523
        if { $tmpvar_12 == "3" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_ASSO3 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_ASSO3 0 [list $notmod] 2 }
3524
        if { $tmpvar_12 == "4" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_ASSO4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_ASSO4 0 [list $notmod] 2 }}
3525
        global tmpvar_13
3526
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
3527
        if { $tmpvar_13 == "1" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ1 0 [list $notmod] 2 }
3528
        if { $tmpvar_13 == "2" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ2 0 [list $notmod] 2 }
3529
        if { $tmpvar_13 == "4" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ4 0 [list $notmod] 2 }
3530
        if { $tmpvar_13 == "8" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ8 0 [list $notmod] 2 }
3531
        if { $tmpvar_13 == "16" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ16 0 [list $notmod] 2 }
3532
        if { $tmpvar_13 == "32" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ32 0 [list $notmod] 2 }
3533
        if { $tmpvar_13 == "64" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ64 0 [list $notmod] 2 }
3534
        if { $tmpvar_13 == "128" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ128 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ128 0 [list $notmod] 2 }
3535
        if { $tmpvar_13 == "256" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ256 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_SZ256 0 [list $notmod] 2 }}
3536
        global tmpvar_14
3537
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
3538
        if { $tmpvar_14 == "16" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LZ16 0 [list $notmod] 2 }
3539
        if { $tmpvar_14 == "32" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LZ32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LZ32 0 [list $notmod] 2 }}
3540
        global tmpvar_15
3541
        global CONFIG_DCACHE_ASSO1
3542
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {
3543
        if { $tmpvar_15 == "Random" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_ALGORND 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_ALGORND 0 [list $notmod] 2 }
3544
        if { $tmpvar_15 == "LRR" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_ALGOLRR 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_ALGOLRR 0 [list $notmod] 2 }
3545
        if { $tmpvar_15 == "LRU" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_ALGOLRU 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_ALGOLRU 0 [list $notmod] 2 }}
3546
        global CONFIG_DCACHE_LOCK
3547
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_LOCK $CONFIG_DCACHE_LOCK [list $notmod] 2 }
3548
        global CONFIG_DCACHE_SNOOP
3549
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_SNOOP $CONFIG_DCACHE_SNOOP [list $notmod] 2 }
3550
        global CONFIG_DCACHE_SNOOP_FAST
3551
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_SNOOP_FAST $CONFIG_DCACHE_SNOOP_FAST [list $notmod] 2 }
3552
        global CONFIG_DCACHE_SNOOP_SEPTAG
3553
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_SNOOP_SEPTAG $CONFIG_DCACHE_SNOOP_SEPTAG [list $notmod] 2 }
3554
        global CONFIG_CACHE_FIXED
3555
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1 || $CONFIG_DCACHE_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_CACHE_FIXED $CONFIG_CACHE_FIXED $notmod }
3556
        global CONFIG_DCACHE_LRAM
3557
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM $CONFIG_DCACHE_LRAM [list $notmod] 2 }
3558
        global tmpvar_16
3559
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {
3560
        if { $tmpvar_16 == "1" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ1 0 [list $notmod] 2 }
3561
        if { $tmpvar_16 == "2" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ2 0 [list $notmod] 2 }
3562
        if { $tmpvar_16 == "4" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ4 0 [list $notmod] 2 }
3563
        if { $tmpvar_16 == "8" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ8 0 [list $notmod] 2 }
3564
        if { $tmpvar_16 == "16" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ16 0 [list $notmod] 2 }
3565
        if { $tmpvar_16 == "32" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ32 0 [list $notmod] 2 }
3566
        if { $tmpvar_16 == "64" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ64 0 [list $notmod] 2 }
3567
        if { $tmpvar_16 == "128" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ128 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ128 0 [list $notmod] 2 }
3568
        if { $tmpvar_16 == "256" } then { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ256 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM_SZ256 0 [list $notmod] 2 }}
3569
        global CONFIG_DCACHE_LRSTART
3570
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {write_hex $cfg $autocfg CONFIG_DCACHE_LRSTART $CONFIG_DCACHE_LRSTART $notmod }
3571
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "MMU"}
3572
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_MMU_ENABLE $CONFIG_MMU_ENABLE [list $notmod] 2 }
3573
        global tmpvar_17
3574
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
3575
        if { $tmpvar_17 == "combined" } then { write_tristate $cfg $autocfg CONFIG_MMU_COMBINED 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_COMBINED 0 [list $notmod] 2 }
3576
        if { $tmpvar_17 == "split" } then { write_tristate $cfg $autocfg CONFIG_MMU_SPLIT 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_SPLIT 0 [list $notmod] 2 }}
3577
        global tmpvar_18
3578
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
3579
        if { $tmpvar_18 == "LRU" } then { write_tristate $cfg $autocfg CONFIG_MMU_REPARRAY 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_REPARRAY 0 [list $notmod] 2 }
3580
        if { $tmpvar_18 == "Increment" } then { write_tristate $cfg $autocfg CONFIG_MMU_REPINCREMENT 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_REPINCREMENT 0 [list $notmod] 2 }}
3581
        global tmpvar_19
3582
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
3583
        if { $tmpvar_19 == "2" } then { write_tristate $cfg $autocfg CONFIG_MMU_I2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_I2 0 [list $notmod] 2 }
3584
        if { $tmpvar_19 == "4" } then { write_tristate $cfg $autocfg CONFIG_MMU_I4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_I4 0 [list $notmod] 2 }
3585
        if { $tmpvar_19 == "8" } then { write_tristate $cfg $autocfg CONFIG_MMU_I8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_I8 0 [list $notmod] 2 }
3586
        if { $tmpvar_19 == "16" } then { write_tristate $cfg $autocfg CONFIG_MMU_I16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_I16 0 [list $notmod] 2 }
3587
        if { $tmpvar_19 == "32" } then { write_tristate $cfg $autocfg CONFIG_MMU_I32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_I32 0 [list $notmod] 2 }}
3588
        global tmpvar_20
3589
        global CONFIG_MMU_SPLIT
3590
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {
3591
        if { $tmpvar_20 == "2" } then { write_tristate $cfg $autocfg CONFIG_MMU_D2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_D2 0 [list $notmod] 2 }
3592
        if { $tmpvar_20 == "4" } then { write_tristate $cfg $autocfg CONFIG_MMU_D4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_D4 0 [list $notmod] 2 }
3593
        if { $tmpvar_20 == "8" } then { write_tristate $cfg $autocfg CONFIG_MMU_D8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_D8 0 [list $notmod] 2 }
3594
        if { $tmpvar_20 == "16" } then { write_tristate $cfg $autocfg CONFIG_MMU_D16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_D16 0 [list $notmod] 2 }
3595
        if { $tmpvar_20 == "32" } then { write_tristate $cfg $autocfg CONFIG_MMU_D32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MMU_D32 0 [list $notmod] 2 }}
3596
        global CONFIG_MMU_FASTWB
3597
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {write_tristate $cfg $autocfg CONFIG_MMU_FASTWB $CONFIG_MMU_FASTWB [list $notmod] 2 }
3598
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Debug Support Unit        "}
3599
        global CONFIG_DSU_ENABLE
3600
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ENABLE $CONFIG_DSU_ENABLE [list $notmod] 2 }
3601
        global CONFIG_DSU_ITRACE
3602
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ITRACE $CONFIG_DSU_ITRACE [list $notmod] 2 }
3603
        global tmpvar_21
3604
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ITRACE == 1)} then {
3605
        if { $tmpvar_21 == "1" } then { write_tristate $cfg $autocfg CONFIG_DSU_ITRACESZ1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ITRACESZ1 0 [list $notmod] 2 }
3606
        if { $tmpvar_21 == "2" } then { write_tristate $cfg $autocfg CONFIG_DSU_ITRACESZ2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ITRACESZ2 0 [list $notmod] 2 }
3607
        if { $tmpvar_21 == "4" } then { write_tristate $cfg $autocfg CONFIG_DSU_ITRACESZ4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ITRACESZ4 0 [list $notmod] 2 }
3608
        if { $tmpvar_21 == "8" } then { write_tristate $cfg $autocfg CONFIG_DSU_ITRACESZ8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ITRACESZ8 0 [list $notmod] 2 }
3609
        if { $tmpvar_21 == "16" } then { write_tristate $cfg $autocfg CONFIG_DSU_ITRACESZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ITRACESZ16 0 [list $notmod] 2 }}
3610
        global CONFIG_DSU_ATRACE
3611
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ATRACE $CONFIG_DSU_ATRACE [list $notmod] 2 }
3612
        global tmpvar_22
3613
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ATRACE == 1)} then {
3614
        if { $tmpvar_22 == "1" } then { write_tristate $cfg $autocfg CONFIG_DSU_ATRACESZ1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ATRACESZ1 0 [list $notmod] 2 }
3615
        if { $tmpvar_22 == "2" } then { write_tristate $cfg $autocfg CONFIG_DSU_ATRACESZ2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ATRACESZ2 0 [list $notmod] 2 }
3616
        if { $tmpvar_22 == "4" } then { write_tristate $cfg $autocfg CONFIG_DSU_ATRACESZ4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ATRACESZ4 0 [list $notmod] 2 }
3617
        if { $tmpvar_22 == "8" } then { write_tristate $cfg $autocfg CONFIG_DSU_ATRACESZ8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ATRACESZ8 0 [list $notmod] 2 }
3618
        if { $tmpvar_22 == "16" } then { write_tristate $cfg $autocfg CONFIG_DSU_ATRACESZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ATRACESZ16 0 [list $notmod] 2 }}
3619
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Fault-tolerance  "}
3620
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "VHDL debug settings       "}
3621
        global CONFIG_IU_DISAS
3622
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_DISAS $CONFIG_IU_DISAS [list $notmod] 2 }
3623
        global CONFIG_IU_DISAS_NET
3624
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_DISAS == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_DISAS_NET $CONFIG_IU_DISAS_NET [list $notmod] 2 }
3625
        global CONFIG_DEBUG_PC32
3626
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DEBUG_PC32 $CONFIG_DEBUG_PC32 [list $notmod] 2 }
3627
        write_comment $cfg $autocfg "AMBA configuration"
3628
        global CONFIG_AHB_DEFMST
3629
        write_int $cfg $autocfg CONFIG_AHB_DEFMST $CONFIG_AHB_DEFMST $notmod
3630
        global CONFIG_AHB_RROBIN
3631
        write_tristate $cfg $autocfg CONFIG_AHB_RROBIN $CONFIG_AHB_RROBIN [list $notmod] 2
3632
        global CONFIG_AHB_SPLIT
3633
        write_tristate $cfg $autocfg CONFIG_AHB_SPLIT $CONFIG_AHB_SPLIT [list $notmod] 2
3634
        global CONFIG_AHB_IOADDR
3635
        write_hex $cfg $autocfg CONFIG_AHB_IOADDR $CONFIG_AHB_IOADDR $notmod
3636
        global CONFIG_APB_HADDR
3637
        write_hex $cfg $autocfg CONFIG_APB_HADDR $CONFIG_APB_HADDR $notmod
3638
        global CONFIG_AHB_MON
3639
        write_tristate $cfg $autocfg CONFIG_AHB_MON $CONFIG_AHB_MON [list $notmod] 2
3640
        global CONFIG_AHB_MONERR
3641
        if {($CONFIG_AHB_MON == 1)} then {write_tristate $cfg $autocfg CONFIG_AHB_MONERR $CONFIG_AHB_MONERR [list $notmod] 2 }
3642
        global CONFIG_AHB_MONWAR
3643
        if {($CONFIG_AHB_MON == 1)} then {write_tristate $cfg $autocfg CONFIG_AHB_MONWAR $CONFIG_AHB_MONWAR [list $notmod] 2 }
3644
        write_comment $cfg $autocfg "Debug Link           "
3645
        global CONFIG_DSU_UART
3646
        write_tristate $cfg $autocfg CONFIG_DSU_UART $CONFIG_DSU_UART [list $notmod] 2
3647
        global CONFIG_DSU_JTAG
3648
        write_tristate $cfg $autocfg CONFIG_DSU_JTAG $CONFIG_DSU_JTAG [list $notmod] 2
3649
        global CONFIG_DSU_ETH
3650
        global CONFIG_GRETH_ENABLE
3651
        if {($CONFIG_GRETH_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ETH $CONFIG_DSU_ETH [list $notmod] 2 }
3652
        global tmpvar_24
3653
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {
3654
        if { $tmpvar_24 == "1" } then { write_tristate $cfg $autocfg CONFIG_DSU_ETHSZ1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ETHSZ1 0 [list $notmod] 2 }
3655
        if { $tmpvar_24 == "2" } then { write_tristate $cfg $autocfg CONFIG_DSU_ETHSZ2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ETHSZ2 0 [list $notmod] 2 }
3656
        if { $tmpvar_24 == "4" } then { write_tristate $cfg $autocfg CONFIG_DSU_ETHSZ4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ETHSZ4 0 [list $notmod] 2 }
3657
        if { $tmpvar_24 == "8" } then { write_tristate $cfg $autocfg CONFIG_DSU_ETHSZ8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ETHSZ8 0 [list $notmod] 2 }
3658
        if { $tmpvar_24 == "16" } then { write_tristate $cfg $autocfg CONFIG_DSU_ETHSZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_DSU_ETHSZ16 0 [list $notmod] 2 }}
3659
        global CONFIG_DSU_IPMSB
3660
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_IPMSB $CONFIG_DSU_IPMSB $notmod }
3661
        global CONFIG_DSU_IPLSB
3662
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_IPLSB $CONFIG_DSU_IPLSB $notmod }
3663
        global CONFIG_DSU_ETHMSB
3664
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_ETHMSB $CONFIG_DSU_ETHMSB $notmod }
3665
        global CONFIG_DSU_ETHLSB
3666
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_ETHLSB $CONFIG_DSU_ETHLSB $notmod }
3667
        global CONFIG_DSU_ETH_PROG
3668
        global CONFIG_GRETH_GIGA
3669
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1) && ($CONFIG_GRETH_GIGA == 0)} then {write_tristate $cfg $autocfg CONFIG_DSU_ETH_PROG $CONFIG_DSU_ETH_PROG [list $notmod] 2 }
3670
        write_comment $cfg $autocfg "Peripherals             "
3671
        write_comment $cfg $autocfg "DDR266 SDRAM controller             "
3672
        global CONFIG_DDRSP
3673
        write_tristate $cfg $autocfg CONFIG_DDRSP $CONFIG_DDRSP [list $notmod] 2
3674
        global CONFIG_DDRSP_INIT
3675
        if {($CONFIG_DDRSP == 1)} then {write_tristate $cfg $autocfg CONFIG_DDRSP_INIT $CONFIG_DDRSP_INIT [list $notmod] 2 }
3676
        global CONFIG_DDRSP_FREQ
3677
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {write_int $cfg $autocfg CONFIG_DDRSP_FREQ $CONFIG_DDRSP_FREQ $notmod }
3678
        global CONFIG_DDRSP_COL
3679
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {write_int $cfg $autocfg CONFIG_DDRSP_COL $CONFIG_DDRSP_COL $notmod }
3680
        global CONFIG_DDRSP_MBYTE
3681
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {write_int $cfg $autocfg CONFIG_DDRSP_MBYTE $CONFIG_DDRSP_MBYTE $notmod }
3682
        global CONFIG_DDRSP_RSKEW
3683
        global CONFIG_SYN_VIRTEX2
3684
        global CONFIG_SYN_VIRTEX4
3685
        global CONFIG_SYN_SPARTAN3
3686
        global CONFIG_SYN_VIRTEX5
3687
        global CONFIG_SYN_SPARTAN3E
3688
        global CONFIG_SYN_CYCLONEIII
3689
        if {($CONFIG_DDRSP == 1) && ($CONFIG_SYN_VIRTEX2 == 1 || $CONFIG_SYN_VIRTEX4 == 1 || $CONFIG_SYN_SPARTAN3 == 1 || $CONFIG_SYN_VIRTEX5 == 1 || $CONFIG_SYN_SPARTAN3E == 1 || $CONFIG_SYN_CYCLONEIII == 1)} then {write_int $cfg $autocfg CONFIG_DDRSP_RSKEW $CONFIG_DDRSP_RSKEW $notmod }
3690
        write_comment $cfg $autocfg "On-chip RAM/ROM                 "
3691
        global CONFIG_AHBROM_ENABLE
3692
        write_tristate $cfg $autocfg CONFIG_AHBROM_ENABLE $CONFIG_AHBROM_ENABLE [list $notmod] 2
3693
        global CONFIG_AHBROM_START
3694
        if {($CONFIG_AHBROM_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_AHBROM_START $CONFIG_AHBROM_START $notmod }
3695
        global CONFIG_AHBROM_PIPE
3696
        if {($CONFIG_AHBROM_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_AHBROM_PIPE $CONFIG_AHBROM_PIPE [list $notmod] 2 }
3697
        global CONFIG_AHBRAM_ENABLE
3698
        write_tristate $cfg $autocfg CONFIG_AHBRAM_ENABLE $CONFIG_AHBRAM_ENABLE [list $notmod] 2
3699
        global tmpvar_25
3700
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {
3701
        if { $tmpvar_25 == "1" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ1 0 [list $notmod] 2 }
3702
        if { $tmpvar_25 == "2" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ2 0 [list $notmod] 2 }
3703
        if { $tmpvar_25 == "4" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ4 0 [list $notmod] 2 }
3704
        if { $tmpvar_25 == "8" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ8 0 [list $notmod] 2 }
3705
        if { $tmpvar_25 == "16" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ16 0 [list $notmod] 2 }
3706
        if { $tmpvar_25 == "32" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ32 0 [list $notmod] 2 }
3707
        if { $tmpvar_25 == "64" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ64 0 [list $notmod] 2 }}
3708
        global CONFIG_AHBRAM_START
3709
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_AHBRAM_START $CONFIG_AHBRAM_START $notmod }
3710
        write_comment $cfg $autocfg "Ethernet             "
3711
        write_tristate $cfg $autocfg CONFIG_GRETH_ENABLE $CONFIG_GRETH_ENABLE [list $notmod] 2
3712
        if {($CONFIG_GRETH_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_GRETH_GIGA $CONFIG_GRETH_GIGA [list $notmod] 2 }
3713
        global tmpvar_26
3714
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_GRETH_GIGA == 0)} then {
3715
        if { $tmpvar_26 == "4" } then { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO4 0 [list $notmod] 2 }
3716
        if { $tmpvar_26 == "8" } then { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO8 0 [list $notmod] 2 }
3717
        if { $tmpvar_26 == "16" } then { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO16 0 [list $notmod] 2 }
3718
        if { $tmpvar_26 == "32" } then { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO32 0 [list $notmod] 2 }
3719
        if { $tmpvar_26 == "64" } then { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO64 0 [list $notmod] 2 }}
3720
        write_comment $cfg $autocfg "UART, timer, I/O port and interrupt controller"
3721
        global CONFIG_UART1_ENABLE
3722
        write_tristate $cfg $autocfg CONFIG_UART1_ENABLE $CONFIG_UART1_ENABLE [list $notmod] 2
3723
        global tmpvar_27
3724
        if {($CONFIG_UART1_ENABLE == 1)} then {
3725
        if { $tmpvar_27 == "1" } then { write_tristate $cfg $autocfg CONFIG_UA1_FIFO1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA1_FIFO1 0 [list $notmod] 2 }
3726
        if { $tmpvar_27 == "2" } then { write_tristate $cfg $autocfg CONFIG_UA1_FIFO2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA1_FIFO2 0 [list $notmod] 2 }
3727
        if { $tmpvar_27 == "4" } then { write_tristate $cfg $autocfg CONFIG_UA1_FIFO4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA1_FIFO4 0 [list $notmod] 2 }
3728
        if { $tmpvar_27 == "8" } then { write_tristate $cfg $autocfg CONFIG_UA1_FIFO8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA1_FIFO8 0 [list $notmod] 2 }
3729
        if { $tmpvar_27 == "16" } then { write_tristate $cfg $autocfg CONFIG_UA1_FIFO16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA1_FIFO16 0 [list $notmod] 2 }
3730
        if { $tmpvar_27 == "32" } then { write_tristate $cfg $autocfg CONFIG_UA1_FIFO32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA1_FIFO32 0 [list $notmod] 2 }}
3731
        global CONFIG_IRQ3_ENABLE
3732
        write_tristate $cfg $autocfg CONFIG_IRQ3_ENABLE $CONFIG_IRQ3_ENABLE [list $notmod] 2
3733
        global CONFIG_IRQ3_SEC
3734
        if {($CONFIG_IRQ3_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_IRQ3_SEC $CONFIG_IRQ3_SEC [list $notmod] 2 }
3735
        global CONFIG_IRQ3_NSEC
3736
        if {($CONFIG_IRQ3_ENABLE == 1) && ($CONFIG_IRQ3_SEC == 1)} then {write_int $cfg $autocfg CONFIG_IRQ3_NSEC $CONFIG_IRQ3_NSEC $notmod }
3737
        global CONFIG_GPT_ENABLE
3738
        write_tristate $cfg $autocfg CONFIG_GPT_ENABLE $CONFIG_GPT_ENABLE [list $notmod] 2
3739
        global CONFIG_GPT_NTIM
3740
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_NTIM $CONFIG_GPT_NTIM $notmod }
3741
        global CONFIG_GPT_SW
3742
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_SW $CONFIG_GPT_SW $notmod }
3743
        global CONFIG_GPT_TW
3744
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_TW $CONFIG_GPT_TW $notmod }
3745
        global CONFIG_GPT_IRQ
3746
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_IRQ $CONFIG_GPT_IRQ $notmod }
3747
        global CONFIG_GPT_SEPIRQ
3748
        if {($CONFIG_GPT_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_GPT_SEPIRQ $CONFIG_GPT_SEPIRQ [list $notmod] 2 }
3749
        global CONFIG_GPT_WDOGEN
3750
        if {($CONFIG_GPT_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_GPT_WDOGEN $CONFIG_GPT_WDOGEN [list $notmod] 2 }
3751
        global CONFIG_GPT_WDOG
3752
        if {($CONFIG_GPT_ENABLE == 1) && ($CONFIG_GPT_WDOGEN == 1)} then {write_hex $cfg $autocfg CONFIG_GPT_WDOG $CONFIG_GPT_WDOG $notmod }
3753
        write_comment $cfg $autocfg "Keybord and VGA interface"
3754
        global CONFIG_KBD_ENABLE
3755
        write_tristate $cfg $autocfg CONFIG_KBD_ENABLE $CONFIG_KBD_ENABLE [list $notmod] 2
3756
        global CONFIG_VGA_ENABLE
3757
        write_tristate $cfg $autocfg CONFIG_VGA_ENABLE $CONFIG_VGA_ENABLE [list $notmod] 2
3758
        global CONFIG_SVGA_ENABLE
3759
        if {($CONFIG_VGA_ENABLE == 0)} then {write_tristate $cfg $autocfg CONFIG_SVGA_ENABLE $CONFIG_SVGA_ENABLE [list $notmod] 2 }
3760
        write_comment $cfg $autocfg "VHDL Debugging        "
3761
        global CONFIG_DEBUG_UART
3762
        write_tristate $cfg $autocfg CONFIG_DEBUG_UART $CONFIG_DEBUG_UART [list $notmod] 2
3763
        close $cfg
3764
        close $autocfg
3765
}
3766
 
3767
 
3768
proc clear_choices { } {
3769
        global CONFIG_SYN_INFERRED; set CONFIG_SYN_INFERRED 0
3770
        global CONFIG_SYN_STRATIX; set CONFIG_SYN_STRATIX 0
3771
        global CONFIG_SYN_STRATIXII; set CONFIG_SYN_STRATIXII 0
3772
        global CONFIG_SYN_STRATIXIII; set CONFIG_SYN_STRATIXIII 0
3773
        global CONFIG_SYN_CYCLONEIII; set CONFIG_SYN_CYCLONEIII 0
3774
        global CONFIG_SYN_ALTERA; set CONFIG_SYN_ALTERA 0
3775
        global CONFIG_SYN_AXCEL; set CONFIG_SYN_AXCEL 0
3776
        global CONFIG_SYN_PROASIC; set CONFIG_SYN_PROASIC 0
3777
        global CONFIG_SYN_PROASICPLUS; set CONFIG_SYN_PROASICPLUS 0
3778
        global CONFIG_SYN_PROASIC3; set CONFIG_SYN_PROASIC3 0
3779
        global CONFIG_SYN_UT025CRH; set CONFIG_SYN_UT025CRH 0
3780
        global CONFIG_SYN_ATC18; set CONFIG_SYN_ATC18 0
3781
        global CONFIG_SYN_ATC18RHA; set CONFIG_SYN_ATC18RHA 0
3782
        global CONFIG_SYN_CUSTOM1; set CONFIG_SYN_CUSTOM1 0
3783
        global CONFIG_SYN_EASIC90; set CONFIG_SYN_EASIC90 0
3784
        global CONFIG_SYN_IHP25; set CONFIG_SYN_IHP25 0
3785
        global CONFIG_SYN_IHP25RH; set CONFIG_SYN_IHP25RH 0
3786
        global CONFIG_SYN_LATTICE; set CONFIG_SYN_LATTICE 0
3787
        global CONFIG_SYN_ECLIPSE; set CONFIG_SYN_ECLIPSE 0
3788
        global CONFIG_SYN_PEREGRINE; set CONFIG_SYN_PEREGRINE 0
3789
        global CONFIG_SYN_RH_LIB18T; set CONFIG_SYN_RH_LIB18T 0
3790
        global CONFIG_SYN_RHUMC; set CONFIG_SYN_RHUMC 0
3791
        global CONFIG_SYN_SPARTAN2; set CONFIG_SYN_SPARTAN2 0
3792
        global CONFIG_SYN_SPARTAN3; set CONFIG_SYN_SPARTAN3 0
3793
        global CONFIG_SYN_SPARTAN3E; set CONFIG_SYN_SPARTAN3E 0
3794
        global CONFIG_SYN_VIRTEX; set CONFIG_SYN_VIRTEX 0
3795
        global CONFIG_SYN_VIRTEXE; set CONFIG_SYN_VIRTEXE 0
3796
        global CONFIG_SYN_VIRTEX2; set CONFIG_SYN_VIRTEX2 0
3797
        global CONFIG_SYN_VIRTEX4; set CONFIG_SYN_VIRTEX4 0
3798
        global CONFIG_SYN_VIRTEX5; set CONFIG_SYN_VIRTEX5 0
3799
        global CONFIG_SYN_UMC; set CONFIG_SYN_UMC 0
3800
        global CONFIG_SYN_TSMC90; set CONFIG_SYN_TSMC90 0
3801
        global CONFIG_MEM_INFERRED; set CONFIG_MEM_INFERRED 0
3802
        global CONFIG_MEM_UMC; set CONFIG_MEM_UMC 0
3803
        global CONFIG_MEM_RHUMC; set CONFIG_MEM_RHUMC 0
3804
        global CONFIG_MEM_ARTISAN; set CONFIG_MEM_ARTISAN 0
3805
        global CONFIG_MEM_CUSTOM1; set CONFIG_MEM_CUSTOM1 0
3806
        global CONFIG_MEM_VIRAGE; set CONFIG_MEM_VIRAGE 0
3807
        global CONFIG_MEM_VIRAGE90; set CONFIG_MEM_VIRAGE90 0
3808
        global CONFIG_CLK_INFERRED; set CONFIG_CLK_INFERRED 0
3809
        global CONFIG_CLK_HCLKBUF; set CONFIG_CLK_HCLKBUF 0
3810
        global CONFIG_CLK_ALTDLL; set CONFIG_CLK_ALTDLL 0
3811
        global CONFIG_CLK_LATDLL; set CONFIG_CLK_LATDLL 0
3812
        global CONFIG_CLK_PRO3PLL; set CONFIG_CLK_PRO3PLL 0
3813
        global CONFIG_CLK_LIB18T; set CONFIG_CLK_LIB18T 0
3814
        global CONFIG_CLK_RHUMC; set CONFIG_CLK_RHUMC 0
3815
        global CONFIG_CLK_CLKDLL; set CONFIG_CLK_CLKDLL 0
3816
        global CONFIG_CLK_DCM; set CONFIG_CLK_DCM 0
3817
        global CONFIG_IU_MUL_LATENCY_2; set CONFIG_IU_MUL_LATENCY_2 0
3818
        global CONFIG_IU_MUL_LATENCY_4; set CONFIG_IU_MUL_LATENCY_4 0
3819
        global CONFIG_IU_MUL_LATENCY_5; set CONFIG_IU_MUL_LATENCY_5 0
3820
        global CONFIG_FPU_GRFPU; set CONFIG_FPU_GRFPU 0
3821
        global CONFIG_FPU_GRFPULITE; set CONFIG_FPU_GRFPULITE 0
3822
        global CONFIG_FPU_MEIKO; set CONFIG_FPU_MEIKO 0
3823
        global CONFIG_FPU_GRFPU_INFMUL; set CONFIG_FPU_GRFPU_INFMUL 0
3824
        global CONFIG_FPU_GRFPU_DWMUL; set CONFIG_FPU_GRFPU_DWMUL 0
3825
        global CONFIG_FPU_GRFPU_MODGEN; set CONFIG_FPU_GRFPU_MODGEN 0
3826
        global CONFIG_FPU_GRFPC0; set CONFIG_FPU_GRFPC0 0
3827
        global CONFIG_FPU_GRFPC1; set CONFIG_FPU_GRFPC1 0
3828
        global CONFIG_FPU_GRFPC2; set CONFIG_FPU_GRFPC2 0
3829
        global CONFIG_ICACHE_ASSO1; set CONFIG_ICACHE_ASSO1 0
3830
        global CONFIG_ICACHE_ASSO2; set CONFIG_ICACHE_ASSO2 0
3831
        global CONFIG_ICACHE_ASSO3; set CONFIG_ICACHE_ASSO3 0
3832
        global CONFIG_ICACHE_ASSO4; set CONFIG_ICACHE_ASSO4 0
3833
        global CONFIG_ICACHE_SZ1; set CONFIG_ICACHE_SZ1 0
3834
        global CONFIG_ICACHE_SZ2; set CONFIG_ICACHE_SZ2 0
3835
        global CONFIG_ICACHE_SZ4; set CONFIG_ICACHE_SZ4 0
3836
        global CONFIG_ICACHE_SZ8; set CONFIG_ICACHE_SZ8 0
3837
        global CONFIG_ICACHE_SZ16; set CONFIG_ICACHE_SZ16 0
3838
        global CONFIG_ICACHE_SZ32; set CONFIG_ICACHE_SZ32 0
3839
        global CONFIG_ICACHE_SZ64; set CONFIG_ICACHE_SZ64 0
3840
        global CONFIG_ICACHE_SZ128; set CONFIG_ICACHE_SZ128 0
3841
        global CONFIG_ICACHE_SZ256; set CONFIG_ICACHE_SZ256 0
3842
        global CONFIG_ICACHE_LZ16; set CONFIG_ICACHE_LZ16 0
3843
        global CONFIG_ICACHE_LZ32; set CONFIG_ICACHE_LZ32 0
3844
        global CONFIG_ICACHE_ALGORND; set CONFIG_ICACHE_ALGORND 0
3845
        global CONFIG_ICACHE_ALGOLRR; set CONFIG_ICACHE_ALGOLRR 0
3846
        global CONFIG_ICACHE_ALGOLRU; set CONFIG_ICACHE_ALGOLRU 0
3847
        global CONFIG_ICACHE_LRAM_SZ1; set CONFIG_ICACHE_LRAM_SZ1 0
3848
        global CONFIG_ICACHE_LRAM_SZ2; set CONFIG_ICACHE_LRAM_SZ2 0
3849
        global CONFIG_ICACHE_LRAM_SZ4; set CONFIG_ICACHE_LRAM_SZ4 0
3850
        global CONFIG_ICACHE_LRAM_SZ8; set CONFIG_ICACHE_LRAM_SZ8 0
3851
        global CONFIG_ICACHE_LRAM_SZ16; set CONFIG_ICACHE_LRAM_SZ16 0
3852
        global CONFIG_ICACHE_LRAM_SZ32; set CONFIG_ICACHE_LRAM_SZ32 0
3853
        global CONFIG_ICACHE_LRAM_SZ64; set CONFIG_ICACHE_LRAM_SZ64 0
3854
        global CONFIG_ICACHE_LRAM_SZ128; set CONFIG_ICACHE_LRAM_SZ128 0
3855
        global CONFIG_ICACHE_LRAM_SZ256; set CONFIG_ICACHE_LRAM_SZ256 0
3856
        global CONFIG_DCACHE_ASSO1; set CONFIG_DCACHE_ASSO1 0
3857
        global CONFIG_DCACHE_ASSO2; set CONFIG_DCACHE_ASSO2 0
3858
        global CONFIG_DCACHE_ASSO3; set CONFIG_DCACHE_ASSO3 0
3859
        global CONFIG_DCACHE_ASSO4; set CONFIG_DCACHE_ASSO4 0
3860
        global CONFIG_DCACHE_SZ1; set CONFIG_DCACHE_SZ1 0
3861
        global CONFIG_DCACHE_SZ2; set CONFIG_DCACHE_SZ2 0
3862
        global CONFIG_DCACHE_SZ4; set CONFIG_DCACHE_SZ4 0
3863
        global CONFIG_DCACHE_SZ8; set CONFIG_DCACHE_SZ8 0
3864
        global CONFIG_DCACHE_SZ16; set CONFIG_DCACHE_SZ16 0
3865
        global CONFIG_DCACHE_SZ32; set CONFIG_DCACHE_SZ32 0
3866
        global CONFIG_DCACHE_SZ64; set CONFIG_DCACHE_SZ64 0
3867
        global CONFIG_DCACHE_SZ128; set CONFIG_DCACHE_SZ128 0
3868
        global CONFIG_DCACHE_SZ256; set CONFIG_DCACHE_SZ256 0
3869
        global CONFIG_DCACHE_LZ16; set CONFIG_DCACHE_LZ16 0
3870
        global CONFIG_DCACHE_LZ32; set CONFIG_DCACHE_LZ32 0
3871
        global CONFIG_DCACHE_ALGORND; set CONFIG_DCACHE_ALGORND 0
3872
        global CONFIG_DCACHE_ALGOLRR; set CONFIG_DCACHE_ALGOLRR 0
3873
        global CONFIG_DCACHE_ALGOLRU; set CONFIG_DCACHE_ALGOLRU 0
3874
        global CONFIG_DCACHE_LRAM_SZ1; set CONFIG_DCACHE_LRAM_SZ1 0
3875
        global CONFIG_DCACHE_LRAM_SZ2; set CONFIG_DCACHE_LRAM_SZ2 0
3876
        global CONFIG_DCACHE_LRAM_SZ4; set CONFIG_DCACHE_LRAM_SZ4 0
3877
        global CONFIG_DCACHE_LRAM_SZ8; set CONFIG_DCACHE_LRAM_SZ8 0
3878
        global CONFIG_DCACHE_LRAM_SZ16; set CONFIG_DCACHE_LRAM_SZ16 0
3879
        global CONFIG_DCACHE_LRAM_SZ32; set CONFIG_DCACHE_LRAM_SZ32 0
3880
        global CONFIG_DCACHE_LRAM_SZ64; set CONFIG_DCACHE_LRAM_SZ64 0
3881
        global CONFIG_DCACHE_LRAM_SZ128; set CONFIG_DCACHE_LRAM_SZ128 0
3882
        global CONFIG_DCACHE_LRAM_SZ256; set CONFIG_DCACHE_LRAM_SZ256 0
3883
        global CONFIG_MMU_COMBINED; set CONFIG_MMU_COMBINED 0
3884
        global CONFIG_MMU_SPLIT; set CONFIG_MMU_SPLIT 0
3885
        global CONFIG_MMU_REPARRAY; set CONFIG_MMU_REPARRAY 0
3886
        global CONFIG_MMU_REPINCREMENT; set CONFIG_MMU_REPINCREMENT 0
3887
        global CONFIG_MMU_I2; set CONFIG_MMU_I2 0
3888
        global CONFIG_MMU_I4; set CONFIG_MMU_I4 0
3889
        global CONFIG_MMU_I8; set CONFIG_MMU_I8 0
3890
        global CONFIG_MMU_I16; set CONFIG_MMU_I16 0
3891
        global CONFIG_MMU_I32; set CONFIG_MMU_I32 0
3892
        global CONFIG_MMU_D2; set CONFIG_MMU_D2 0
3893
        global CONFIG_MMU_D4; set CONFIG_MMU_D4 0
3894
        global CONFIG_MMU_D8; set CONFIG_MMU_D8 0
3895
        global CONFIG_MMU_D16; set CONFIG_MMU_D16 0
3896
        global CONFIG_MMU_D32; set CONFIG_MMU_D32 0
3897
        global CONFIG_DSU_ITRACESZ1; set CONFIG_DSU_ITRACESZ1 0
3898
        global CONFIG_DSU_ITRACESZ2; set CONFIG_DSU_ITRACESZ2 0
3899
        global CONFIG_DSU_ITRACESZ4; set CONFIG_DSU_ITRACESZ4 0
3900
        global CONFIG_DSU_ITRACESZ8; set CONFIG_DSU_ITRACESZ8 0
3901
        global CONFIG_DSU_ITRACESZ16; set CONFIG_DSU_ITRACESZ16 0
3902
        global CONFIG_DSU_ATRACESZ1; set CONFIG_DSU_ATRACESZ1 0
3903
        global CONFIG_DSU_ATRACESZ2; set CONFIG_DSU_ATRACESZ2 0
3904
        global CONFIG_DSU_ATRACESZ4; set CONFIG_DSU_ATRACESZ4 0
3905
        global CONFIG_DSU_ATRACESZ8; set CONFIG_DSU_ATRACESZ8 0
3906
        global CONFIG_DSU_ATRACESZ16; set CONFIG_DSU_ATRACESZ16 0
3907
        global CONFIG_DSU_ETHSZ1; set CONFIG_DSU_ETHSZ1 0
3908
        global CONFIG_DSU_ETHSZ2; set CONFIG_DSU_ETHSZ2 0
3909
        global CONFIG_DSU_ETHSZ4; set CONFIG_DSU_ETHSZ4 0
3910
        global CONFIG_DSU_ETHSZ8; set CONFIG_DSU_ETHSZ8 0
3911
        global CONFIG_DSU_ETHSZ16; set CONFIG_DSU_ETHSZ16 0
3912
        global CONFIG_AHBRAM_SZ1; set CONFIG_AHBRAM_SZ1 0
3913
        global CONFIG_AHBRAM_SZ2; set CONFIG_AHBRAM_SZ2 0
3914
        global CONFIG_AHBRAM_SZ4; set CONFIG_AHBRAM_SZ4 0
3915
        global CONFIG_AHBRAM_SZ8; set CONFIG_AHBRAM_SZ8 0
3916
        global CONFIG_AHBRAM_SZ16; set CONFIG_AHBRAM_SZ16 0
3917
        global CONFIG_AHBRAM_SZ32; set CONFIG_AHBRAM_SZ32 0
3918
        global CONFIG_AHBRAM_SZ64; set CONFIG_AHBRAM_SZ64 0
3919
        global CONFIG_GRETH_FIFO4; set CONFIG_GRETH_FIFO4 0
3920
        global CONFIG_GRETH_FIFO8; set CONFIG_GRETH_FIFO8 0
3921
        global CONFIG_GRETH_FIFO16; set CONFIG_GRETH_FIFO16 0
3922
        global CONFIG_GRETH_FIFO32; set CONFIG_GRETH_FIFO32 0
3923
        global CONFIG_GRETH_FIFO64; set CONFIG_GRETH_FIFO64 0
3924
        global CONFIG_UA1_FIFO1; set CONFIG_UA1_FIFO1 0
3925
        global CONFIG_UA1_FIFO2; set CONFIG_UA1_FIFO2 0
3926
        global CONFIG_UA1_FIFO4; set CONFIG_UA1_FIFO4 0
3927
        global CONFIG_UA1_FIFO8; set CONFIG_UA1_FIFO8 0
3928
        global CONFIG_UA1_FIFO16; set CONFIG_UA1_FIFO16 0
3929
        global CONFIG_UA1_FIFO32; set CONFIG_UA1_FIFO32 0
3930
}
3931
 
3932
 
3933
proc update_choices { } {
3934
        global tmpvar_0
3935
        set tmpvar_0 "Inferred"
3936
        global CONFIG_SYN_INFERRED
3937
        if { $CONFIG_SYN_INFERRED == 1 } then { set tmpvar_0 "Inferred" }
3938
        global CONFIG_SYN_STRATIX
3939
        if { $CONFIG_SYN_STRATIX == 1 } then { set tmpvar_0 "Altera-Stratix" }
3940
        global CONFIG_SYN_STRATIXII
3941
        if { $CONFIG_SYN_STRATIXII == 1 } then { set tmpvar_0 "Altera-StratixII" }
3942
        global CONFIG_SYN_STRATIXIII
3943
        if { $CONFIG_SYN_STRATIXIII == 1 } then { set tmpvar_0 "Altera-StratixIII" }
3944
        global CONFIG_SYN_CYCLONEIII
3945
        if { $CONFIG_SYN_CYCLONEIII == 1 } then { set tmpvar_0 "Altera-CycloneIII" }
3946
        global CONFIG_SYN_ALTERA
3947
        if { $CONFIG_SYN_ALTERA == 1 } then { set tmpvar_0 "Altera-Others" }
3948
        global CONFIG_SYN_AXCEL
3949
        if { $CONFIG_SYN_AXCEL == 1 } then { set tmpvar_0 "Actel-Axcelerator" }
3950
        global CONFIG_SYN_PROASIC
3951
        if { $CONFIG_SYN_PROASIC == 1 } then { set tmpvar_0 "Actel-Proasic" }
3952
        global CONFIG_SYN_PROASICPLUS
3953
        if { $CONFIG_SYN_PROASICPLUS == 1 } then { set tmpvar_0 "Actel-ProasicPlus" }
3954
        global CONFIG_SYN_PROASIC3
3955
        if { $CONFIG_SYN_PROASIC3 == 1 } then { set tmpvar_0 "Actel-Proasic3" }
3956
        global CONFIG_SYN_UT025CRH
3957
        if { $CONFIG_SYN_UT025CRH == 1 } then { set tmpvar_0 "Aeroflex-UT025CRH" }
3958
        global CONFIG_SYN_ATC18
3959
        if { $CONFIG_SYN_ATC18 == 1 } then { set tmpvar_0 "Atmel-ATC18" }
3960
        global CONFIG_SYN_ATC18RHA
3961
        if { $CONFIG_SYN_ATC18RHA == 1 } then { set tmpvar_0 "Atmel-ATC18RHA" }
3962
        global CONFIG_SYN_CUSTOM1
3963
        if { $CONFIG_SYN_CUSTOM1 == 1 } then { set tmpvar_0 "Custom1" }
3964
        global CONFIG_SYN_EASIC90
3965
        if { $CONFIG_SYN_EASIC90 == 1 } then { set tmpvar_0 "eASIC90" }
3966
        global CONFIG_SYN_IHP25
3967
        if { $CONFIG_SYN_IHP25 == 1 } then { set tmpvar_0 "IHP25" }
3968
        global CONFIG_SYN_IHP25RH
3969
        if { $CONFIG_SYN_IHP25RH == 1 } then { set tmpvar_0 "IHP25RH" }
3970
        global CONFIG_SYN_LATTICE
3971
        if { $CONFIG_SYN_LATTICE == 1 } then { set tmpvar_0 "Lattice-EC/ECP/XP" }
3972
        global CONFIG_SYN_ECLIPSE
3973
        if { $CONFIG_SYN_ECLIPSE == 1 } then { set tmpvar_0 "Quicklogic-Eclipse" }
3974
        global CONFIG_SYN_PEREGRINE
3975
        if { $CONFIG_SYN_PEREGRINE == 1 } then { set tmpvar_0 "Peregrine" }
3976
        global CONFIG_SYN_RH_LIB18T
3977
        if { $CONFIG_SYN_RH_LIB18T == 1 } then { set tmpvar_0 "RH-LIB18T" }
3978
        global CONFIG_SYN_RHUMC
3979
        if { $CONFIG_SYN_RHUMC == 1 } then { set tmpvar_0 "RH-UMC" }
3980
        global CONFIG_SYN_SPARTAN2
3981
        if { $CONFIG_SYN_SPARTAN2 == 1 } then { set tmpvar_0 "Xilinx-Spartan2" }
3982
        global CONFIG_SYN_SPARTAN3
3983
        if { $CONFIG_SYN_SPARTAN3 == 1 } then { set tmpvar_0 "Xilinx-Spartan3" }
3984
        global CONFIG_SYN_SPARTAN3E
3985
        if { $CONFIG_SYN_SPARTAN3E == 1 } then { set tmpvar_0 "Xilinx-Spartan3E" }
3986
        global CONFIG_SYN_VIRTEX
3987
        if { $CONFIG_SYN_VIRTEX == 1 } then { set tmpvar_0 "Xilinx-Virtex" }
3988
        global CONFIG_SYN_VIRTEXE
3989
        if { $CONFIG_SYN_VIRTEXE == 1 } then { set tmpvar_0 "Xilinx-VirtexE" }
3990
        global CONFIG_SYN_VIRTEX2
3991
        if { $CONFIG_SYN_VIRTEX2 == 1 } then { set tmpvar_0 "Xilinx-Virtex2" }
3992
        global CONFIG_SYN_VIRTEX4
3993
        if { $CONFIG_SYN_VIRTEX4 == 1 } then { set tmpvar_0 "Xilinx-Virtex4" }
3994
        global CONFIG_SYN_VIRTEX5
3995
        if { $CONFIG_SYN_VIRTEX5 == 1 } then { set tmpvar_0 "Xilinx-Virtex5" }
3996
        global CONFIG_SYN_UMC
3997
        if { $CONFIG_SYN_UMC == 1 } then { set tmpvar_0 "UMC18" }
3998
        global CONFIG_SYN_TSMC90
3999
        if { $CONFIG_SYN_TSMC90 == 1 } then { set tmpvar_0 "TSMC90" }
4000
        global tmpvar_1
4001
        set tmpvar_1 "Inferred"
4002
        global CONFIG_MEM_INFERRED
4003
        if { $CONFIG_MEM_INFERRED == 1 } then { set tmpvar_1 "Inferred" }
4004
        global CONFIG_MEM_UMC
4005
        if { $CONFIG_MEM_UMC == 1 } then { set tmpvar_1 "UMC18" }
4006
        global CONFIG_MEM_RHUMC
4007
        if { $CONFIG_MEM_RHUMC == 1 } then { set tmpvar_1 "RH-UMC" }
4008
        global CONFIG_MEM_ARTISAN
4009
        if { $CONFIG_MEM_ARTISAN == 1 } then { set tmpvar_1 "Artisan" }
4010
        global CONFIG_MEM_CUSTOM1
4011
        if { $CONFIG_MEM_CUSTOM1 == 1 } then { set tmpvar_1 "Custom1" }
4012
        global CONFIG_MEM_VIRAGE
4013
        if { $CONFIG_MEM_VIRAGE == 1 } then { set tmpvar_1 "Virage" }
4014
        global CONFIG_MEM_VIRAGE90
4015
        if { $CONFIG_MEM_VIRAGE90 == 1 } then { set tmpvar_1 "Virage-TSMC90" }
4016
        global tmpvar_2
4017
        set tmpvar_2 "Inferred"
4018
        global CONFIG_CLK_INFERRED
4019
        if { $CONFIG_CLK_INFERRED == 1 } then { set tmpvar_2 "Inferred" }
4020
        global CONFIG_CLK_HCLKBUF
4021
        if { $CONFIG_CLK_HCLKBUF == 1 } then { set tmpvar_2 "Actel-HCLKBUF" }
4022
        global CONFIG_CLK_ALTDLL
4023
        if { $CONFIG_CLK_ALTDLL == 1 } then { set tmpvar_2 "Altera-ALTPLL" }
4024
        global CONFIG_CLK_LATDLL
4025
        if { $CONFIG_CLK_LATDLL == 1 } then { set tmpvar_2 "Lattice-EXPLL" }
4026
        global CONFIG_CLK_PRO3PLL
4027
        if { $CONFIG_CLK_PRO3PLL == 1 } then { set tmpvar_2 "Proasic3-PLLL" }
4028
        global CONFIG_CLK_LIB18T
4029
        if { $CONFIG_CLK_LIB18T == 1 } then { set tmpvar_2 "RH-LIB18T-PLL" }
4030
        global CONFIG_CLK_RHUMC
4031
        if { $CONFIG_CLK_RHUMC == 1 } then { set tmpvar_2 "DARE-PLL" }
4032
        global CONFIG_CLK_CLKDLL
4033
        if { $CONFIG_CLK_CLKDLL == 1 } then { set tmpvar_2 "Xilinx-CLKDLL" }
4034
        global CONFIG_CLK_DCM
4035
        if { $CONFIG_CLK_DCM == 1 } then { set tmpvar_2 "Xilinx-DCM" }
4036
        global tmpvar_3
4037
        set tmpvar_3 "5-cycles"
4038
        global CONFIG_IU_MUL_LATENCY_2
4039
        if { $CONFIG_IU_MUL_LATENCY_2 == 1 } then { set tmpvar_3 "2-cycles" }
4040
        global CONFIG_IU_MUL_LATENCY_4
4041
        if { $CONFIG_IU_MUL_LATENCY_4 == 1 } then { set tmpvar_3 "4-cycles" }
4042
        global CONFIG_IU_MUL_LATENCY_5
4043
        if { $CONFIG_IU_MUL_LATENCY_5 == 1 } then { set tmpvar_3 "5-cycles" }
4044
        global tmpvar_4
4045
        set tmpvar_4 "GRFPU"
4046
        global CONFIG_FPU_GRFPU
4047
        if { $CONFIG_FPU_GRFPU == 1 } then { set tmpvar_4 "GRFPU" }
4048
        global CONFIG_FPU_GRFPULITE
4049
        if { $CONFIG_FPU_GRFPULITE == 1 } then { set tmpvar_4 "GRFPU-LITE" }
4050
        global CONFIG_FPU_MEIKO
4051
        if { $CONFIG_FPU_MEIKO == 1 } then { set tmpvar_4 "Meiko" }
4052
        global tmpvar_5
4053
        set tmpvar_5 "Inferred"
4054
        global CONFIG_FPU_GRFPU_INFMUL
4055
        if { $CONFIG_FPU_GRFPU_INFMUL == 1 } then { set tmpvar_5 "Inferred" }
4056
        global CONFIG_FPU_GRFPU_DWMUL
4057
        if { $CONFIG_FPU_GRFPU_DWMUL == 1 } then { set tmpvar_5 "DW" }
4058
        global CONFIG_FPU_GRFPU_MODGEN
4059
        if { $CONFIG_FPU_GRFPU_MODGEN == 1 } then { set tmpvar_5 "ModGen" }
4060
        global tmpvar_6
4061
        set tmpvar_6 "Simple"
4062
        global CONFIG_FPU_GRFPC0
4063
        if { $CONFIG_FPU_GRFPC0 == 1 } then { set tmpvar_6 "Simple" }
4064
        global CONFIG_FPU_GRFPC1
4065
        if { $CONFIG_FPU_GRFPC1 == 1 } then { set tmpvar_6 "Data-forwarding" }
4066
        global CONFIG_FPU_GRFPC2
4067
        if { $CONFIG_FPU_GRFPC2 == 1 } then { set tmpvar_6 "Non-blocking" }
4068
        global tmpvar_7
4069
        set tmpvar_7 "1"
4070
        global CONFIG_ICACHE_ASSO1
4071
        if { $CONFIG_ICACHE_ASSO1 == 1 } then { set tmpvar_7 "1" }
4072
        global CONFIG_ICACHE_ASSO2
4073
        if { $CONFIG_ICACHE_ASSO2 == 1 } then { set tmpvar_7 "2" }
4074
        global CONFIG_ICACHE_ASSO3
4075
        if { $CONFIG_ICACHE_ASSO3 == 1 } then { set tmpvar_7 "3" }
4076
        global CONFIG_ICACHE_ASSO4
4077
        if { $CONFIG_ICACHE_ASSO4 == 1 } then { set tmpvar_7 "4" }
4078
        global tmpvar_8
4079
        set tmpvar_8 "4"
4080
        global CONFIG_ICACHE_SZ1
4081
        if { $CONFIG_ICACHE_SZ1 == 1 } then { set tmpvar_8 "1" }
4082
        global CONFIG_ICACHE_SZ2
4083
        if { $CONFIG_ICACHE_SZ2 == 1 } then { set tmpvar_8 "2" }
4084
        global CONFIG_ICACHE_SZ4
4085
        if { $CONFIG_ICACHE_SZ4 == 1 } then { set tmpvar_8 "4" }
4086
        global CONFIG_ICACHE_SZ8
4087
        if { $CONFIG_ICACHE_SZ8 == 1 } then { set tmpvar_8 "8" }
4088
        global CONFIG_ICACHE_SZ16
4089
        if { $CONFIG_ICACHE_SZ16 == 1 } then { set tmpvar_8 "16" }
4090
        global CONFIG_ICACHE_SZ32
4091
        if { $CONFIG_ICACHE_SZ32 == 1 } then { set tmpvar_8 "32" }
4092
        global CONFIG_ICACHE_SZ64
4093
        if { $CONFIG_ICACHE_SZ64 == 1 } then { set tmpvar_8 "64" }
4094
        global CONFIG_ICACHE_SZ128
4095
        if { $CONFIG_ICACHE_SZ128 == 1 } then { set tmpvar_8 "128" }
4096
        global CONFIG_ICACHE_SZ256
4097
        if { $CONFIG_ICACHE_SZ256 == 1 } then { set tmpvar_8 "256" }
4098
        global tmpvar_9
4099
        set tmpvar_9 "32"
4100
        global CONFIG_ICACHE_LZ16
4101
        if { $CONFIG_ICACHE_LZ16 == 1 } then { set tmpvar_9 "16" }
4102
        global CONFIG_ICACHE_LZ32
4103
        if { $CONFIG_ICACHE_LZ32 == 1 } then { set tmpvar_9 "32" }
4104
        global tmpvar_10
4105
        set tmpvar_10 "Random"
4106
        global CONFIG_ICACHE_ALGORND
4107
        if { $CONFIG_ICACHE_ALGORND == 1 } then { set tmpvar_10 "Random" }
4108
        global CONFIG_ICACHE_ALGOLRR
4109
        if { $CONFIG_ICACHE_ALGOLRR == 1 } then { set tmpvar_10 "LRR" }
4110
        global CONFIG_ICACHE_ALGOLRU
4111
        if { $CONFIG_ICACHE_ALGOLRU == 1 } then { set tmpvar_10 "LRU" }
4112
        global tmpvar_11
4113
        set tmpvar_11 "4"
4114
        global CONFIG_ICACHE_LRAM_SZ1
4115
        if { $CONFIG_ICACHE_LRAM_SZ1 == 1 } then { set tmpvar_11 "1" }
4116
        global CONFIG_ICACHE_LRAM_SZ2
4117
        if { $CONFIG_ICACHE_LRAM_SZ2 == 1 } then { set tmpvar_11 "2" }
4118
        global CONFIG_ICACHE_LRAM_SZ4
4119
        if { $CONFIG_ICACHE_LRAM_SZ4 == 1 } then { set tmpvar_11 "4" }
4120
        global CONFIG_ICACHE_LRAM_SZ8
4121
        if { $CONFIG_ICACHE_LRAM_SZ8 == 1 } then { set tmpvar_11 "8" }
4122
        global CONFIG_ICACHE_LRAM_SZ16
4123
        if { $CONFIG_ICACHE_LRAM_SZ16 == 1 } then { set tmpvar_11 "16" }
4124
        global CONFIG_ICACHE_LRAM_SZ32
4125
        if { $CONFIG_ICACHE_LRAM_SZ32 == 1 } then { set tmpvar_11 "32" }
4126
        global CONFIG_ICACHE_LRAM_SZ64
4127
        if { $CONFIG_ICACHE_LRAM_SZ64 == 1 } then { set tmpvar_11 "64" }
4128
        global CONFIG_ICACHE_LRAM_SZ128
4129
        if { $CONFIG_ICACHE_LRAM_SZ128 == 1 } then { set tmpvar_11 "128" }
4130
        global CONFIG_ICACHE_LRAM_SZ256
4131
        if { $CONFIG_ICACHE_LRAM_SZ256 == 1 } then { set tmpvar_11 "256" }
4132
        global tmpvar_12
4133
        set tmpvar_12 "1"
4134
        global CONFIG_DCACHE_ASSO1
4135
        if { $CONFIG_DCACHE_ASSO1 == 1 } then { set tmpvar_12 "1" }
4136
        global CONFIG_DCACHE_ASSO2
4137
        if { $CONFIG_DCACHE_ASSO2 == 1 } then { set tmpvar_12 "2" }
4138
        global CONFIG_DCACHE_ASSO3
4139
        if { $CONFIG_DCACHE_ASSO3 == 1 } then { set tmpvar_12 "3" }
4140
        global CONFIG_DCACHE_ASSO4
4141
        if { $CONFIG_DCACHE_ASSO4 == 1 } then { set tmpvar_12 "4" }
4142
        global tmpvar_13
4143
        set tmpvar_13 "4"
4144
        global CONFIG_DCACHE_SZ1
4145
        if { $CONFIG_DCACHE_SZ1 == 1 } then { set tmpvar_13 "1" }
4146
        global CONFIG_DCACHE_SZ2
4147
        if { $CONFIG_DCACHE_SZ2 == 1 } then { set tmpvar_13 "2" }
4148
        global CONFIG_DCACHE_SZ4
4149
        if { $CONFIG_DCACHE_SZ4 == 1 } then { set tmpvar_13 "4" }
4150
        global CONFIG_DCACHE_SZ8
4151
        if { $CONFIG_DCACHE_SZ8 == 1 } then { set tmpvar_13 "8" }
4152
        global CONFIG_DCACHE_SZ16
4153
        if { $CONFIG_DCACHE_SZ16 == 1 } then { set tmpvar_13 "16" }
4154
        global CONFIG_DCACHE_SZ32
4155
        if { $CONFIG_DCACHE_SZ32 == 1 } then { set tmpvar_13 "32" }
4156
        global CONFIG_DCACHE_SZ64
4157
        if { $CONFIG_DCACHE_SZ64 == 1 } then { set tmpvar_13 "64" }
4158
        global CONFIG_DCACHE_SZ128
4159
        if { $CONFIG_DCACHE_SZ128 == 1 } then { set tmpvar_13 "128" }
4160
        global CONFIG_DCACHE_SZ256
4161
        if { $CONFIG_DCACHE_SZ256 == 1 } then { set tmpvar_13 "256" }
4162
        global tmpvar_14
4163
        set tmpvar_14 "32"
4164
        global CONFIG_DCACHE_LZ16
4165
        if { $CONFIG_DCACHE_LZ16 == 1 } then { set tmpvar_14 "16" }
4166
        global CONFIG_DCACHE_LZ32
4167
        if { $CONFIG_DCACHE_LZ32 == 1 } then { set tmpvar_14 "32" }
4168
        global tmpvar_15
4169
        set tmpvar_15 "Random"
4170
        global CONFIG_DCACHE_ALGORND
4171
        if { $CONFIG_DCACHE_ALGORND == 1 } then { set tmpvar_15 "Random" }
4172
        global CONFIG_DCACHE_ALGOLRR
4173
        if { $CONFIG_DCACHE_ALGOLRR == 1 } then { set tmpvar_15 "LRR" }
4174
        global CONFIG_DCACHE_ALGOLRU
4175
        if { $CONFIG_DCACHE_ALGOLRU == 1 } then { set tmpvar_15 "LRU" }
4176
        global tmpvar_16
4177
        set tmpvar_16 "4"
4178
        global CONFIG_DCACHE_LRAM_SZ1
4179
        if { $CONFIG_DCACHE_LRAM_SZ1 == 1 } then { set tmpvar_16 "1" }
4180
        global CONFIG_DCACHE_LRAM_SZ2
4181
        if { $CONFIG_DCACHE_LRAM_SZ2 == 1 } then { set tmpvar_16 "2" }
4182
        global CONFIG_DCACHE_LRAM_SZ4
4183
        if { $CONFIG_DCACHE_LRAM_SZ4 == 1 } then { set tmpvar_16 "4" }
4184
        global CONFIG_DCACHE_LRAM_SZ8
4185
        if { $CONFIG_DCACHE_LRAM_SZ8 == 1 } then { set tmpvar_16 "8" }
4186
        global CONFIG_DCACHE_LRAM_SZ16
4187
        if { $CONFIG_DCACHE_LRAM_SZ16 == 1 } then { set tmpvar_16 "16" }
4188
        global CONFIG_DCACHE_LRAM_SZ32
4189
        if { $CONFIG_DCACHE_LRAM_SZ32 == 1 } then { set tmpvar_16 "32" }
4190
        global CONFIG_DCACHE_LRAM_SZ64
4191
        if { $CONFIG_DCACHE_LRAM_SZ64 == 1 } then { set tmpvar_16 "64" }
4192
        global CONFIG_DCACHE_LRAM_SZ128
4193
        if { $CONFIG_DCACHE_LRAM_SZ128 == 1 } then { set tmpvar_16 "128" }
4194
        global CONFIG_DCACHE_LRAM_SZ256
4195
        if { $CONFIG_DCACHE_LRAM_SZ256 == 1 } then { set tmpvar_16 "256" }
4196
        global tmpvar_17
4197
        set tmpvar_17 "combined"
4198
        global CONFIG_MMU_COMBINED
4199
        if { $CONFIG_MMU_COMBINED == 1 } then { set tmpvar_17 "combined" }
4200
        global CONFIG_MMU_SPLIT
4201
        if { $CONFIG_MMU_SPLIT == 1 } then { set tmpvar_17 "split" }
4202
        global tmpvar_18
4203
        set tmpvar_18 "Increment"
4204
        global CONFIG_MMU_REPARRAY
4205
        if { $CONFIG_MMU_REPARRAY == 1 } then { set tmpvar_18 "LRU" }
4206
        global CONFIG_MMU_REPINCREMENT
4207
        if { $CONFIG_MMU_REPINCREMENT == 1 } then { set tmpvar_18 "Increment" }
4208
        global tmpvar_19
4209
        set tmpvar_19 "8"
4210
        global CONFIG_MMU_I2
4211
        if { $CONFIG_MMU_I2 == 1 } then { set tmpvar_19 "2" }
4212
        global CONFIG_MMU_I4
4213
        if { $CONFIG_MMU_I4 == 1 } then { set tmpvar_19 "4" }
4214
        global CONFIG_MMU_I8
4215
        if { $CONFIG_MMU_I8 == 1 } then { set tmpvar_19 "8" }
4216
        global CONFIG_MMU_I16
4217
        if { $CONFIG_MMU_I16 == 1 } then { set tmpvar_19 "16" }
4218
        global CONFIG_MMU_I32
4219
        if { $CONFIG_MMU_I32 == 1 } then { set tmpvar_19 "32" }
4220
        global tmpvar_20
4221
        set tmpvar_20 "8"
4222
        global CONFIG_MMU_D2
4223
        if { $CONFIG_MMU_D2 == 1 } then { set tmpvar_20 "2" }
4224
        global CONFIG_MMU_D4
4225
        if { $CONFIG_MMU_D4 == 1 } then { set tmpvar_20 "4" }
4226
        global CONFIG_MMU_D8
4227
        if { $CONFIG_MMU_D8 == 1 } then { set tmpvar_20 "8" }
4228
        global CONFIG_MMU_D16
4229
        if { $CONFIG_MMU_D16 == 1 } then { set tmpvar_20 "16" }
4230
        global CONFIG_MMU_D32
4231
        if { $CONFIG_MMU_D32 == 1 } then { set tmpvar_20 "32" }
4232
        global tmpvar_21
4233
        set tmpvar_21 "1"
4234
        global CONFIG_DSU_ITRACESZ1
4235
        if { $CONFIG_DSU_ITRACESZ1 == 1 } then { set tmpvar_21 "1" }
4236
        global CONFIG_DSU_ITRACESZ2
4237
        if { $CONFIG_DSU_ITRACESZ2 == 1 } then { set tmpvar_21 "2" }
4238
        global CONFIG_DSU_ITRACESZ4
4239
        if { $CONFIG_DSU_ITRACESZ4 == 1 } then { set tmpvar_21 "4" }
4240
        global CONFIG_DSU_ITRACESZ8
4241
        if { $CONFIG_DSU_ITRACESZ8 == 1 } then { set tmpvar_21 "8" }
4242
        global CONFIG_DSU_ITRACESZ16
4243
        if { $CONFIG_DSU_ITRACESZ16 == 1 } then { set tmpvar_21 "16" }
4244
        global tmpvar_22
4245
        set tmpvar_22 "1"
4246
        global CONFIG_DSU_ATRACESZ1
4247
        if { $CONFIG_DSU_ATRACESZ1 == 1 } then { set tmpvar_22 "1" }
4248
        global CONFIG_DSU_ATRACESZ2
4249
        if { $CONFIG_DSU_ATRACESZ2 == 1 } then { set tmpvar_22 "2" }
4250
        global CONFIG_DSU_ATRACESZ4
4251
        if { $CONFIG_DSU_ATRACESZ4 == 1 } then { set tmpvar_22 "4" }
4252
        global CONFIG_DSU_ATRACESZ8
4253
        if { $CONFIG_DSU_ATRACESZ8 == 1 } then { set tmpvar_22 "8" }
4254
        global CONFIG_DSU_ATRACESZ16
4255
        if { $CONFIG_DSU_ATRACESZ16 == 1 } then { set tmpvar_22 "16" }
4256
        global tmpvar_24
4257
        set tmpvar_24 "2"
4258
        global CONFIG_DSU_ETHSZ1
4259
        if { $CONFIG_DSU_ETHSZ1 == 1 } then { set tmpvar_24 "1" }
4260
        global CONFIG_DSU_ETHSZ2
4261
        if { $CONFIG_DSU_ETHSZ2 == 1 } then { set tmpvar_24 "2" }
4262
        global CONFIG_DSU_ETHSZ4
4263
        if { $CONFIG_DSU_ETHSZ4 == 1 } then { set tmpvar_24 "4" }
4264
        global CONFIG_DSU_ETHSZ8
4265
        if { $CONFIG_DSU_ETHSZ8 == 1 } then { set tmpvar_24 "8" }
4266
        global CONFIG_DSU_ETHSZ16
4267
        if { $CONFIG_DSU_ETHSZ16 == 1 } then { set tmpvar_24 "16" }
4268
        global tmpvar_25
4269
        set tmpvar_25 "4"
4270
        global CONFIG_AHBRAM_SZ1
4271
        if { $CONFIG_AHBRAM_SZ1 == 1 } then { set tmpvar_25 "1" }
4272
        global CONFIG_AHBRAM_SZ2
4273
        if { $CONFIG_AHBRAM_SZ2 == 1 } then { set tmpvar_25 "2" }
4274
        global CONFIG_AHBRAM_SZ4
4275
        if { $CONFIG_AHBRAM_SZ4 == 1 } then { set tmpvar_25 "4" }
4276
        global CONFIG_AHBRAM_SZ8
4277
        if { $CONFIG_AHBRAM_SZ8 == 1 } then { set tmpvar_25 "8" }
4278
        global CONFIG_AHBRAM_SZ16
4279
        if { $CONFIG_AHBRAM_SZ16 == 1 } then { set tmpvar_25 "16" }
4280
        global CONFIG_AHBRAM_SZ32
4281
        if { $CONFIG_AHBRAM_SZ32 == 1 } then { set tmpvar_25 "32" }
4282
        global CONFIG_AHBRAM_SZ64
4283
        if { $CONFIG_AHBRAM_SZ64 == 1 } then { set tmpvar_25 "64" }
4284
        global tmpvar_26
4285
        set tmpvar_26 "8"
4286
        global CONFIG_GRETH_FIFO4
4287
        if { $CONFIG_GRETH_FIFO4 == 1 } then { set tmpvar_26 "4" }
4288
        global CONFIG_GRETH_FIFO8
4289
        if { $CONFIG_GRETH_FIFO8 == 1 } then { set tmpvar_26 "8" }
4290
        global CONFIG_GRETH_FIFO16
4291
        if { $CONFIG_GRETH_FIFO16 == 1 } then { set tmpvar_26 "16" }
4292
        global CONFIG_GRETH_FIFO32
4293
        if { $CONFIG_GRETH_FIFO32 == 1 } then { set tmpvar_26 "32" }
4294
        global CONFIG_GRETH_FIFO64
4295
        if { $CONFIG_GRETH_FIFO64 == 1 } then { set tmpvar_26 "64" }
4296
        global tmpvar_27
4297
        set tmpvar_27 "1"
4298
        global CONFIG_UA1_FIFO1
4299
        if { $CONFIG_UA1_FIFO1 == 1 } then { set tmpvar_27 "1" }
4300
        global CONFIG_UA1_FIFO2
4301
        if { $CONFIG_UA1_FIFO2 == 1 } then { set tmpvar_27 "2" }
4302
        global CONFIG_UA1_FIFO4
4303
        if { $CONFIG_UA1_FIFO4 == 1 } then { set tmpvar_27 "4" }
4304
        global CONFIG_UA1_FIFO8
4305
        if { $CONFIG_UA1_FIFO8 == 1 } then { set tmpvar_27 "8" }
4306
        global CONFIG_UA1_FIFO16
4307
        if { $CONFIG_UA1_FIFO16 == 1 } then { set tmpvar_27 "16" }
4308
        global CONFIG_UA1_FIFO32
4309
        if { $CONFIG_UA1_FIFO32 == 1 } then { set tmpvar_27 "32" }
4310
}
4311
 
4312
 
4313
proc update_define_mainmenu {} {
4314
        global CONFIG_MODULES
4315
}
4316
 
4317
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.