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/] [ut699rh-evab/] [lconfig.tk] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
# FILE: header.tk
2
# This file is boilerplate TCL/TK function definitions for 'make xconfig'.
3
#
4
# CHANGES
5
# =======
6
#
7
# 8 January 1999, Michael Elizabeth Chastain, 
8
# - Remove unused do_cmd function (part of the 2.0 sound support).
9
# - Arrange buttons in three columns for better screen fitting.
10
# - Add CONSTANT_Y, CONSTANT_M, CONSTANT_N for commands like:
11
#     dep_tristate 'foo' CONFIG_FOO m
12
#
13
# 23 January 1999, Michael Elizabeth Chastain, 
14
# - Shut vfix the hell up.
15
#
16
# 24 January 1999, Michael Elizabeth Chastain, 
17
# - Improve the exit message (Jeff Ronne).
18
 
19
#
20
# This is a handy replacement for ".widget cget" that requires neither tk4
21
# nor additional source code uglification.
22
#
23
proc cget { w option } {
24
        return "[lindex [$w configure $option] 4]"
25
}
26
 
27
#
28
# Function to compensate for broken config.in scripts like the sound driver,
29
# which make dependencies on variables that are never even conditionally
30
# defined.
31
#
32
proc vfix { var } {
33
        global $var
34
        if [ catch {eval concat $$var} ] {
35
                set $var 4
36
        }
37
}
38
 
39
#
40
# Constant values used by certain dep_tristate commands.
41
#
42
set CONSTANT_Y 1
43
set CONSTANT_M 2
44
set CONSTANT_N 0
45
set CONSTANT_E 4
46
 
47
#
48
# Create a "reference" object to steal colors from.
49
#
50
button .ref
51
 
52
#
53
# On monochrome displays, -disabledforeground is blank by default; that's
54
# bad.  Fill it with -foreground instead.
55
#
56
if { [cget .ref -disabledforeground] == "" } {
57
        .ref configure -disabledforeground [cget .ref -foreground]
58
}
59
 
60
 
61
#
62
# Define some macros we will need to parse the config.in file.
63
#
64
 
65
proc mainmenu_name { text } {
66
        wm title . "$text"
67
}
68
 
69
proc menu_option { w menu_num text } {
70
        global menus_per_column
71
        global processed_top_level
72
        set processed_top_level [expr $processed_top_level + 1]
73
        if { $processed_top_level <= $menus_per_column } then {
74
            set myframe left
75
        } elseif { $processed_top_level <= [expr 2 * $menus_per_column] } then {
76
            set myframe middle
77
        } else {
78
            set myframe right
79
        }
80
        button .f0.x$menu_num -anchor w -text "$text" \
81
            -command "$w .$w \"$text\""
82
        pack .f0.x$menu_num -pady 0 -side top -fill x -in .f0.$myframe
83
}
84
 
85
proc load_configfile { w title func } {
86
        catch {destroy $w}
87
        toplevel $w -class Dialog
88
        global loadfile
89
        frame $w.x
90
        label $w.bm -bitmap questhead
91
        pack  $w.bm -pady 10 -side top -padx 10
92
        label $w.x.l -text "Enter filename:" -relief raised
93
        entry $w.x.x -width 35 -relief sunken -borderwidth 2 \
94
                -textvariable loadfile
95
        pack $w.x.l $w.x.x -anchor w -side left
96
        pack $w.x -side top -pady 10
97
        wm title $w "$title"
98
 
99
        set oldFocus [focus]
100
        frame $w.f
101
        button $w.f.back -text "OK" -width 20 \
102
                -command "destroy $w; focus $oldFocus;$func .fileio"
103
        button $w.f.canc -text "Cancel" \
104
                -width 20 -command "destroy $w; focus $oldFocus"
105
        pack $w.f.back $w.f.canc -side left -pady 10 -padx 45
106
        pack $w.f -pady 10 -side bottom -padx 10 -anchor w
107
        focus $w
108
        global winx; global winy
109
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
110
        wm geometry $w +$winx+$winy
111
}
112
 
113
bind all  {maybe_exit .maybe}
114
 
115
proc maybe_exit { w } {
116
        catch {destroy $w}
117
        toplevel $w -class Dialog
118
        label $w.bm -bitmap questhead
119
        pack  $w.bm -pady 10 -side top -padx 10
120
        message $w.m -width 400 -aspect 300 \
121
                -text "Changes will be lost.  Are you sure?" -relief flat
122
        pack  $w.m -pady 10 -side top -padx 10
123
        wm title $w "Are you sure?"
124
 
125
        set oldFocus [focus]
126
        frame $w.f
127
        button $w.f.back -text "OK" -width 20 \
128
                -command "exit 1"
129
        button $w.f.canc -text "Cancel" \
130
                -width 20 -command "destroy $w; focus $oldFocus"
131
        pack $w.f.back $w.f.canc -side left -pady 10 -padx 45
132
        pack $w.f -pady 10 -side bottom -padx 10 -anchor w
133
        bind $w  "exit 1"
134
        bind $w  "destroy $w; focus $oldFocus"
135
        focus $w
136
        global winx; global winy
137
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
138
        wm geometry $w +$winx+$winy
139
}
140
 
141
proc read_config_file { w } {
142
        global loadfile
143
        if { [string length $loadfile] != 0 && [file readable $loadfile] == 1 } then {
144
                read_config $loadfile
145
        } else {
146
                catch {destroy $w}
147
                toplevel $w -class Dialog
148
                message $w.m -width 400 -aspect 300 -text \
149
                        "Unable to read file $loadfile" \
150
                         -relief raised
151
                label $w.bm -bitmap error
152
                pack $w.bm $w.m -pady 10 -side top -padx 10
153
                wm title $w "Xconfig Internal Error"
154
 
155
                set oldFocus [focus]
156
                frame $w.f
157
                button $w.f.back -text "Bummer" \
158
                        -width 10 -command "destroy $w; focus $oldFocus"
159
                pack $w.f.back -side bottom -pady 10 -anchor s
160
                pack $w.f -pady 10 -side top -padx 10 -anchor s
161
                focus $w
162
                global winx; global winy
163
                set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
164
                wm geometry $w +$winx+$winy
165
        }
166
}
167
 
168
proc write_config_file  { w } {
169
        global loadfile
170
        if { [string length $loadfile] != 0
171
                && ([file writable $loadfile] == 1 || ([file exists $loadfile] == 0 && [file writable [file dirname $loadfile]] == 1)) } then {
172
                writeconfig $loadfile .null
173
        } else {
174
                catch {destroy $w}
175
                toplevel $w -class Dialog
176
                message $w.m -width 400 -aspect 300 -text \
177
                        "Unable to write file $loadfile" \
178
                         -relief raised
179
                label $w.bm -bitmap error
180
                pack $w.bm $w.m -pady 10 -side top -padx 10
181
                wm title $w "Xconfig Internal Error"
182
 
183
                set oldFocus [focus]
184
                frame $w.f
185
                button $w.f.back -text "OK" \
186
                        -width 10 -command "destroy $w; focus $oldFocus"
187
                pack $w.f.back -side bottom -pady 10 -anchor s
188
                pack $w.f -pady 10 -side top -padx 10 -anchor s
189
                focus $w
190
                global winx; global winy
191
                set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
192
                wm geometry $w +$winx+$winy
193
        }
194
}
195
 
196
proc read_config { filename } {
197
        set file1 [open $filename r]
198
        clear_choices
199
        while { [gets $file1 line] >= 0} {
200
                if [regexp {([0-9A-Za-z_]+)=([ynm])} $line foo var value] {
201
                        if { $value == "y" } then { set cmd "global $var; set $var 1" }
202
                        if { $value == "n" } then { set cmd "global $var; set $var 0" }
203
                        if { $value == "m" } then { set cmd "global $var; set $var 2" }
204
                        eval $cmd
205
                }
206
                if [regexp {# ([0-9A-Za-z_]+) is not set} $line foo var] {
207
                        set cmd "global $var; set $var 0"
208
                        eval $cmd
209
                }
210
                if [regexp {([0-9A-Za-z_]+)=([0-9A-Fa-f]+)} $line foo var value] {
211
                        set cmd "global $var; set $var $value"
212
                        eval $cmd
213
                }
214
                if [regexp {([0-9A-Za-z_]+)="([^"]*)"} $line foo var value] {
215
                        set cmd "global $var; set $var \"$value\""
216
                        eval $cmd
217
                }
218
        }
219
        close $file1
220
        update_choices
221
        update_mainmenu
222
}
223
proc write_comment { file1 file2 text } {
224
        puts $file1 ""
225
        puts $file1 "#"
226
        puts $file1 "# $text"
227
        puts $file1 "#"
228
        puts $file2 "/*"
229
        puts $file2 " * $text"
230
        puts $file2 " */"
231
}
232
 
233
proc effective_dep { deplist } {
234
        global CONFIG_MODULES
235
        set depend 1
236
        foreach i $deplist {
237
                if {$i == 0} then {set depend 0}
238
                if {$i == 2 && $depend == 1} then {set depend 2}
239
        }
240
        if {$depend == 2 && $CONFIG_MODULES == 0} then {set depend 0}
241
        return $depend
242
}
243
 
244
proc sync_tristate { var dep } {
245
        global CONFIG_MODULES
246
        if {$dep == 0 && ($var == 1 || $var == 2)} then {
247
                set var 0
248
        } elseif {$dep == 2 && $var == 1} then {
249
                set var 2
250
        } elseif {$var == 2 && $CONFIG_MODULES == 0} then {
251
                if {$dep == 1} then {set var 1} else {set var 0}
252
        }
253
        return $var
254
}
255
 
256
proc sync_bool { var dep modset } {
257
        set var [sync_tristate $var $dep]
258
        if {$dep == 2 && $var == 2} then {
259
                set var $modset
260
        }
261
        return $var
262
}
263
 
264
proc write_tristate { file1 file2 varname variable deplist modset } {
265
        set variable [sync_tristate $variable [effective_dep $deplist]]
266
        if { $variable == 2 } \
267
                then { set variable $modset }
268
        if { $variable == 1 } \
269
                then { puts $file1 "$varname=y"; \
270
                       puts $file2 "#define $varname 1" } \
271
        elseif { $variable == 2 } \
272
                then { puts $file1 "$varname=m"; \
273
                       puts $file2 "#undef  $varname"; \
274
                       puts $file2 "#define ${varname}_MODULE 1" } \
275
        elseif { $variable == 0 } \
276
                then { puts $file1 "# $varname is not set"; \
277
                       puts $file2 "#undef  $varname"} \
278
        else { \
279
            puts stdout "ERROR - Attempting to write value for unconfigured variable ($varname)." \
280
        }
281
}
282
 
283
proc write_int { file1 file2 varname variable dep } {
284
        if { $dep == 0 } \
285
                then { puts $file1 "# $varname is not set"; \
286
                       puts $file2 "#undef  $varname"} \
287
        else {
288
                puts $file1 "$varname=$variable"; \
289
                puts $file2 "#define $varname ($variable)"; \
290
        }
291
}
292
 
293
proc write_hex { file1 file2 varname variable dep } {
294
        if { $dep == 0 } \
295
                then { puts $file1 "# $varname is not set"; \
296
                       puts $file2 "#undef  $varname"} \
297
        else {
298
                puts $file1 "$varname=$variable"; \
299
                puts -nonewline $file2 "#define $varname "; \
300
                puts $file2 [exec echo $variable | sed s/^0\[xX\]//]; \
301
        }
302
}
303
 
304
proc write_string { file1 file2 varname variable dep } {
305
        if { $dep == 0 } \
306
                then { puts $file1 "# $varname is not set"; \
307
                       puts $file2 "#undef  $varname"} \
308
        else {
309
                puts $file1 "$varname=\"$variable\""; \
310
                puts $file2 "#define $varname \"$variable\""; \
311
        }
312
}
313
 
314
proc option_name {w mnum line text helpidx} {
315
        button $w.x$line.l -text "$text" -relief groove -anchor w
316
        $w.x$line.l configure -activefore [cget $w.x$line.l -fg] \
317
                                -activeback [cget $w.x$line.l -bg]
318
        button $w.x$line.help -text "Help" -relief raised \
319
                -command "dohelp .dohelp $helpidx .menu$mnum"
320
        pack $w.x$line.help -side right -fill y
321
        pack $w.x$line.l -side right -fill both -expand on
322
}
323
 
324
proc toggle_switch2 {w mnum line text variable} {
325
        frame $w.x$line -relief sunken
326
        radiobutton $w.x$line.y -text "y" -variable $variable -value 1 \
327
                -relief groove -width 2 -command "update_active"
328
#       radiobutton $w.x$line.m -text "-"  -variable $variable -value 2 \
329
#               -relief groove -width 2 -command "update_active"
330
        radiobutton $w.x$line.n -text "n"  -variable $variable -value 0 \
331
                -relief groove -width 2 -command "update_active"
332
 
333
        option_name $w $mnum $line $text $variable
334
 
335
        pack $w.x$line.n $w.x$line.y -side right -fill y
336
}
337
 
338
proc toggle_switch3 {w mnum line text variable} {
339
        frame $w.x$line -relief sunken
340
        radiobutton $w.x$line.y -text "y" -variable $variable -value 1 \
341
                -relief groove -width 2 -command "update_active"
342
        radiobutton $w.x$line.m -text "m"  -variable $variable -value 2 \
343
                -relief groove -width 2 -command "update_active"
344
        radiobutton $w.x$line.n -text "n"  -variable $variable -value 0 \
345
                -relief groove -width 2 -command "update_active"
346
 
347
        option_name $w $mnum $line $text $variable
348
 
349
        global CONFIG_MODULES
350
        if {($CONFIG_MODULES == 0)} then {
351
                $w.x$line.m configure -state disabled
352
        }
353
        pack $w.x$line.n $w.x$line.m $w.x$line.y -side right -fill y
354
}
355
 
356
proc bool {w mnum line text variable} {
357
        toggle_switch2 $w $mnum $line $text $variable
358
#       $w.x$line.m configure -state disabled
359
        pack $w.x$line -anchor w -fill both -expand on
360
}
361
 
362
proc tristate {w mnum line text variable } {
363
        toggle_switch3 $w $mnum $line $text $variable
364
        pack $w.x$line -anchor w -fill both -expand on
365
}
366
 
367
proc dep_tristate {w mnum line text variable } {
368
        tristate $w $mnum $line $text $variable
369
}
370
 
371
proc dep_bool {w mnum line text variable } {
372
        bool $w $mnum $line $text $variable
373
}
374
 
375
proc int { w mnum line text variable } {
376
        frame $w.x$line
377
        entry $w.x$line.x -width 11 -relief sunken -borderwidth 2 \
378
                -textvariable $variable
379
        option_name $w $mnum $line $text $variable
380
        pack $w.x$line.x -anchor w -side right -fill y
381
        pack $w.x$line -anchor w -fill both -expand on
382
}
383
 
384
proc hex { w mnum line text variable } {
385
        int $w $mnum $line $text $variable
386
}
387
 
388
proc istring { w mnum line text variable } {
389
        frame $w.x$line
390
        entry $w.x$line.x -width 18 -relief sunken -borderwidth 2 \
391
                -textvariable $variable
392
        option_name $w $mnum $line $text $variable
393
        pack $w.x$line.x -anchor w -side right -fill y
394
        pack $w.x$line -anchor w -fill both -expand on
395
}
396
 
397
proc minimenu { w mnum line text variable helpidx } {
398
        frame $w.x$line
399
        menubutton $w.x$line.x -textvariable $variable -menu \
400
                $w.x$line.x.menu -relief raised \
401
                -anchor w
402
        option_name $w $mnum $line $text $helpidx
403
        pack $w.x$line.x -anchor w -side right -fill y
404
        pack $w.x$line -anchor w -fill both -expand on
405
}
406
 
407
proc menusplit {w m n} {
408
        if { $n > 2 } then {
409
                update idletasks
410
                set menuoptsize [expr [$m yposition 2] - [$m yposition 1]]
411
                set maxsize [winfo screenheight $w]
412
                set splitpoint [expr $maxsize * 4 / 5 / $menuoptsize - 1]
413
                for {set i [expr $splitpoint + 1]} {$i <= $n} {incr i $splitpoint} {
414
                        $m entryconfigure $i -columnbreak 1
415
                }
416
        }
417
}
418
 
419
proc menutitle {text menu w} {
420
        wm title $w "$text"
421
}
422
 
423
proc submenu { w mnum line text subnum } {
424
        frame $w.x$line
425
        button $w.x$line.l -text "" -width 9 -relief groove
426
        $w.x$line.l configure -activefore [cget $w.x$line.l -fg] \
427
                -activeback [cget $w.x$line.l -bg] -state disabled
428
        button $w.x$line.m -text "$text" -relief raised -anchor w \
429
                -command "catch {destroy .menu$subnum}; menu$subnum .menu$subnum \"$text\""
430
        pack $w.x$line.l -side left -fill both
431
        pack $w.x$line.m -anchor w -side right -fill both -expand on
432
        pack $w.x$line -anchor w -fill both -expand on
433
}
434
 
435
proc comment {w mnum line text } {
436
        frame $w.x$line
437
        button $w.x$line.l -text "" -width 15 -relief groove
438
        $w.x$line.l configure -activefore [cget $w.x$line.l -fg] \
439
                -activeback [cget $w.x$line.l -bg] -state disabled
440
        button $w.x$line.m -text "$text" -relief groove -anchor w
441
        $w.x$line.m configure -activefore [cget $w.x$line.m -fg] \
442
                -activeback [cget $w.x$line.m -bg]
443
        pack $w.x$line.l -side left -fill both
444
        pack $w.x$line.m -anchor w -side right -fill both -expand on
445
        pack $w.x$line -anchor w -fill both -expand on
446
}
447
 
448
proc readhelp {tag fn}  {
449
        set message ""
450
        set b 0
451
        if { [file readable $fn] == 1} then {
452
                set fhandle [open $fn r]
453
                while {[gets $fhandle inline] >= 0} {
454
                        if { $b == 0 } {
455
                                if { [regexp $tag $inline ] } {
456
                                        set b 1
457
                                        set message "$inline:\n"
458
                                }
459
                        } else {
460
                                if { [regexp {^[^ \t]} $inline]} {
461
                                        break
462
                                }
463
                                set message "$message\n$inline"
464
                        }
465
                }
466
                close $fhandle
467
        }
468
        return $message
469
}
470
 
471
proc dohelp {w var parent}  {
472
        catch {destroy $w}
473
        toplevel $w -class Dialog
474
 
475
        set filefound 0
476
        set found 0
477
        set lineno 0
478
 
479
        if { [file readable config.help] == 1} then {
480
                set filefound 1
481
                # First escape sed regexp special characters in var:
482
                set var [exec echo "$var" | sed s/\[\]\[\/.^$*\]/\\\\&/g]
483
                # Now pick out right help text:
484
                set message [readhelp $var config.help]
485
                set found [expr [string length "$message"] > 0]
486
        }
487
 
488
        frame $w.f1
489
        pack $w.f1 -fill both -expand on
490
 
491
        # Do the OK button
492
        #
493
        set oldFocus [focus]
494
        frame $w.f2
495
        button $w.f2.ok -text "OK" \
496
                -width 10 -command "destroy $w; catch {focus $oldFocus}"
497
        pack $w.f2.ok -side bottom -pady 6 -anchor n
498
        pack $w.f2 -side bottom -padx 10 -anchor s
499
 
500
        scrollbar $w.f1.vscroll -command "$w.f1.canvas yview"
501
        pack $w.f1.vscroll -side right -fill y
502
 
503
        canvas $w.f1.canvas -relief flat -borderwidth 0 \
504
                -yscrollcommand "$w.f1.vscroll set"
505
        frame $w.f1.f
506
        pack $w.f1.canvas -side right -fill y -expand on
507
 
508
        if { $found == 0 } then {
509
                if { $filefound == 0 } then {
510
                message $w.f1.f.m -width 750 -aspect 300 -relief flat -text \
511
                        "No help available - unable to open file config.help."
512
                } else {
513
                message $w.f1.f.m -width 400 -aspect 300 -relief flat -text \
514
                        "No help available for $var"
515
                }
516
                label $w.f1.bm -bitmap error
517
                wm title $w "RTFM"
518
        } else {
519
                text $w.f1.f.m -width 73 -relief flat -wrap word
520
                $w.f1.f.m insert 0.0 $message
521
                $w.f1.f.m conf -state disabled -height [$w.f1.f.m index end]
522
 
523
                label $w.f1.bm -bitmap info
524
                wm title $w "Configuration help"
525
        }
526
        pack $w.f1.f.m -side left
527
        pack $w.f1.bm $w.f1.f -side left -padx 10
528
 
529
        focus $w
530
        set winx [expr [winfo x $parent]+20]
531
        set winy [expr [winfo y $parent]+20]
532
        wm geometry $w +$winx+$winy
533
        set sizok [expr [winfo reqheight $w.f2.ok] + 12]
534
        set maxy [expr [winfo screenheight .] * 3 / 4]
535
        set canvtotal [winfo reqheight $w.f1.f.m]
536
        if [expr $sizok + $canvtotal < $maxy] {
537
                set sizy $canvtotal
538
        } else {
539
                set sizy [expr $maxy - $sizok]
540
        }
541
        $w.f1.canvas configure -height $sizy -width [winfo reqwidth $w.f1.f.m] \
542
                -scrollregion "0 0 [winfo reqwidth $w.f1.f.m] \
543
                        [winfo reqheight $w.f1.f.m]"
544
        $w.f1.canvas create window 0 0 -anchor nw -window $w.f1.f
545
        update idletasks
546
 
547
        set maxy [winfo screenheight .]
548
        if [expr $sizok + $canvtotal < $maxy] {
549
                set sizy [expr $sizok + $canvtotal]
550
        } else {
551
                set sizy $maxy
552
        }
553
        wm maxsize $w [winfo width $w] $sizy
554
}
555
 
556
bind all  { catch {exec cp -f .config .config.old}; \
557
                writeconfig .config config.h; wrapup .wrap }
558
 
559
proc wrapup {w }  {
560
        catch {destroy $w}
561
        toplevel $w -class Dialog
562
 
563
        global CONFIG_MODVERSIONS; vfix CONFIG_MODVERSIONS
564
        message $w.m -width 460 -aspect 300 -relief raised -text \
565
                "End of design configuration. "
566
        label $w.bm -bitmap info
567
        pack $w.bm $w.m -pady 10 -side top -padx 10
568
        wm title $w "LEON build instructions"
569
 
570
        set oldFocus [focus]
571
        frame $w.f
572
        button $w.f.back -text "OK" \
573
                -width 10 -command "exit 2"
574
        pack $w.f.back -side bottom -pady 10 -anchor s
575
        pack $w.f -pady 10 -side top -padx 10 -anchor s
576
        focus $w
577
        bind $w  "exit 2"
578
        global winx; global winy
579
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
580
        wm geometry $w +$winx+$winy
581
 
582
}
583
 
584
proc unregister_active {num} {
585
        global active_menus
586
        set index [lsearch -exact $active_menus $num]
587
        if {$index != -1} then {set active_menus [lreplace $active_menus $index $index]}
588
}
589
 
590
proc update_active {} {
591
        global active_menus total_menus
592
        set max 0
593
        if {[llength $active_menus] > 0} then {
594
                set max [lindex $active_menus end]
595
                update_define [toplevel_menu [lindex $active_menus 0]] $max 0
596
        }
597
        foreach i $active_menus {
598
                if {[winfo exists .menu$i] == 0} then {
599
                        unregister_active $i
600
                } else {
601
                        update_menu$i
602
                }
603
        }
604
        update_define [expr $max + 1] $total_menus 1
605
        update_mainmenu
606
}
607
 
608
proc configure_entry {w option items} {
609
        foreach i $items {
610
                $w.$i configure -state $option
611
        }
612
}
613
 
614
proc validate_int {name val default} {
615
        if {([exec echo $val | sed s/^-//g | tr -d \[:digit:\] ] != "")} then {
616
                global $name; set $name $default
617
        }
618
}
619
 
620
proc validate_hex {name val default} {
621
        if {([exec echo $val | tr -d \[:xdigit:\] ] != "")} then {
622
                global $name; set $name $default
623
        }
624
}
625
 
626
proc update_define {first last allow_update} {
627
        for {set i $first} {$i <= $last} {incr i} {
628
                update_define_menu$i
629
                if {$allow_update == 1} then update
630
        }
631
}
632
 
633
#
634
# Next set up the particulars for the top level menu, and define a few
635
# buttons which we will stick down at the bottom.
636
#
637
 
638
frame .f0
639
frame .f0.left
640
frame .f0.middle
641
frame .f0.right
642
 
643
set active_menus [list]
644
set processed_top_level 0
645
set ARCH sparc
646
set menus_per_column 4
647
set total_menus 22
648
 
649
proc toplevel_menu {num} {
650
        if {$num == 4} then {return 3}
651
        if {$num == 5} then {return 3}
652
        if {$num == 6} then {return 3}
653
        if {$num == 7} then {return 3}
654
        if {$num == 8} then {return 3}
655
        if {$num == 9} then {return 3}
656
        if {$num == 10} then {return 3}
657
        if {$num == 14} then {return 13}
658
        if {$num == 15} then {return 13}
659
        if {$num == 17} then {return 16}
660
        if {$num == 18} then {return 16}
661
        if {$num == 19} then {return 16}
662
        if {$num == 20} then {return 16}
663
        if {$num == 21} then {return 16}
664
        return $num
665
}
666
 
667
mainmenu_name "LEON3MP GR-CPCI-XC4V Design Configuration"
668
menu_option menu1 1 "Synthesis      "
669
proc menu1 {w title} {
670
        set oldFocus [focus]
671
        catch {destroy $w; unregister_active 1}
672
        toplevel $w -class Dialog
673
        wm withdraw $w
674
        global active_menus
675
        set active_menus [lsort -integer [linsert $active_menus end 1]]
676
        message $w.m -width 400 -aspect 300 -text \
677
                "Synthesis      "  -relief raised
678
        pack $w.m -pady 10 -side top -padx 10
679
        wm title $w "Synthesis      "
680
 
681
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 1; break"
682
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 1; menu2 .menu2 \"$title\""
683
        frame $w.f
684
        button $w.f.back -text "Main Menu" \
685
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 1"
686
        button $w.f.next -text "Next" -underline 0\
687
                -width 15 -command $nextscript
688
        bind all  $nextscript
689
        button $w.f.prev -text "Prev" -underline 0\
690
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 1; menu0 .menu0 \"$title\""
691
        $w.f.prev configure -state disabled
692
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
693
        pack $w.f -pady 10 -side bottom -anchor w -fill x
694
        frame $w.topline -relief ridge -borderwidth 2 -height 2
695
        pack $w.topline -side top -fill x
696
 
697
        frame $w.botline -relief ridge -borderwidth 2 -height 2
698
        pack $w.botline -side bottom -fill x
699
 
700
        frame $w.config
701
        pack $w.config -fill y -expand on
702
 
703
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
704
        pack $w.config.vscroll -side right -fill y
705
 
706
        canvas $w.config.canvas -height 1\
707
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
708
                -width [expr [winfo screenwidth .] * 1 / 2]
709
        frame $w.config.f
710
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
711
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
712
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
713
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
714
        bind $w  "$w.config.canvas yview moveto 0;break;"
715
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
716
        pack $w.config.canvas -side right -fill y
717
 
718
 
719
        global tmpvar_0
720
        minimenu $w.config.f 1 0 "Target technology                           " tmpvar_0 CONFIG_SYN_INFERRED
721
        menu $w.config.f.x0.x.menu -tearoffcommand "menutitle \"Target technology                           \""
722
        $w.config.f.x0.x.menu add radiobutton -label "Inferred" -variable tmpvar_0 -value "Inferred" -command "update_active"
723
        $w.config.f.x0.x.menu add radiobutton -label "Altera-Stratix" -variable tmpvar_0 -value "Altera-Stratix" -command "update_active"
724
        $w.config.f.x0.x.menu add radiobutton -label "Altera-StratixII" -variable tmpvar_0 -value "Altera-StratixII" -command "update_active"
725
        $w.config.f.x0.x.menu add radiobutton -label "Altera-StratixIII" -variable tmpvar_0 -value "Altera-StratixIII" -command "update_active"
726
        $w.config.f.x0.x.menu add radiobutton -label "Altera-CycloneIII" -variable tmpvar_0 -value "Altera-CycloneIII" -command "update_active"
727
        $w.config.f.x0.x.menu add radiobutton -label "Altera-Others" -variable tmpvar_0 -value "Altera-Others" -command "update_active"
728
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Axcelerator" -variable tmpvar_0 -value "Actel-Axcelerator" -command "update_active"
729
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Proasic" -variable tmpvar_0 -value "Actel-Proasic" -command "update_active"
730
        $w.config.f.x0.x.menu add radiobutton -label "Actel-ProasicPlus" -variable tmpvar_0 -value "Actel-ProasicPlus" -command "update_active"
731
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Proasic3" -variable tmpvar_0 -value "Actel-Proasic3" -command "update_active"
732
        $w.config.f.x0.x.menu add radiobutton -label "Aeroflex-UT025CRH" -variable tmpvar_0 -value "Aeroflex-UT025CRH" -command "update_active"
733
        $w.config.f.x0.x.menu add radiobutton -label "Atmel-ATC18" -variable tmpvar_0 -value "Atmel-ATC18" -command "update_active"
734
        $w.config.f.x0.x.menu add radiobutton -label "Custom1" -variable tmpvar_0 -value "Custom1" -command "update_active"
735
        $w.config.f.x0.x.menu add radiobutton -label "IHP25" -variable tmpvar_0 -value "IHP25" -command "update_active"
736
        $w.config.f.x0.x.menu add radiobutton -label "IHP25RH" -variable tmpvar_0 -value "IHP25RH" -command "update_active"
737
        $w.config.f.x0.x.menu add radiobutton -label "Lattice-EC/ECP/XP" -variable tmpvar_0 -value "Lattice-EC/ECP/XP" -command "update_active"
738
        $w.config.f.x0.x.menu add radiobutton -label "Quicklogic-Eclipse" -variable tmpvar_0 -value "Quicklogic-Eclipse" -command "update_active"
739
        $w.config.f.x0.x.menu add radiobutton -label "Peregrine" -variable tmpvar_0 -value "Peregrine" -command "update_active"
740
        $w.config.f.x0.x.menu add radiobutton -label "RH-LIB18T" -variable tmpvar_0 -value "RH-LIB18T" -command "update_active"
741
        $w.config.f.x0.x.menu add radiobutton -label "RH-UMC" -variable tmpvar_0 -value "RH-UMC" -command "update_active"
742
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan2" -variable tmpvar_0 -value "Xilinx-Spartan2" -command "update_active"
743
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan3" -variable tmpvar_0 -value "Xilinx-Spartan3" -command "update_active"
744
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan3E" -variable tmpvar_0 -value "Xilinx-Spartan3E" -command "update_active"
745
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex" -variable tmpvar_0 -value "Xilinx-Virtex" -command "update_active"
746
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-VirtexE" -variable tmpvar_0 -value "Xilinx-VirtexE" -command "update_active"
747
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex2" -variable tmpvar_0 -value "Xilinx-Virtex2" -command "update_active"
748
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex4" -variable tmpvar_0 -value "Xilinx-Virtex4" -command "update_active"
749
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex5" -variable tmpvar_0 -value "Xilinx-Virtex5" -command "update_active"
750
        $w.config.f.x0.x.menu add radiobutton -label "UMC18" -variable tmpvar_0 -value "UMC18" -command "update_active"
751
        $w.config.f.x0.x.menu add radiobutton -label "TSMC90" -variable tmpvar_0 -value "TSMC90" -command "update_active"
752
        menusplit $w $w.config.f.x0.x.menu 30
753
        global tmpvar_1
754
        minimenu $w.config.f 1 1 "Memory Library                           " tmpvar_1 CONFIG_MEM_INFERRED
755
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"Memory Library                           \""
756
        $w.config.f.x1.x.menu add radiobutton -label "Inferred" -variable tmpvar_1 -value "Inferred" -command "update_active"
757
        $w.config.f.x1.x.menu add radiobutton -label "UMC18" -variable tmpvar_1 -value "UMC18" -command "update_active"
758
        $w.config.f.x1.x.menu add radiobutton -label "RH-UMC" -variable tmpvar_1 -value "RH-UMC" -command "update_active"
759
        $w.config.f.x1.x.menu add radiobutton -label "Artisan" -variable tmpvar_1 -value "Artisan" -command "update_active"
760
        $w.config.f.x1.x.menu add radiobutton -label "Custom1" -variable tmpvar_1 -value "Custom1" -command "update_active"
761
        $w.config.f.x1.x.menu add radiobutton -label "Virage" -variable tmpvar_1 -value "Virage" -command "update_active"
762
        $w.config.f.x1.x.menu add radiobutton -label "Virage-TSMC90" -variable tmpvar_1 -value "Virage-TSMC90" -command "update_active"
763
        menusplit $w $w.config.f.x1.x.menu 7
764
        bool $w.config.f 1 2 "Infer RAM" CONFIG_SYN_INFER_RAM
765
        bool $w.config.f 1 3 "Infer pads" CONFIG_SYN_INFER_PADS
766
        bool $w.config.f 1 4 "Disable asynchronous reset" CONFIG_SYN_NO_ASYNC
767
        bool $w.config.f 1 5 "Enable scan support       " CONFIG_SYN_SCAN
768
        global tmpvar_2
769
        minimenu $w.config.f 1 6 "FPGA type                                      " tmpvar_2 CONFIG_FPGA_LX100
770
        menu $w.config.f.x6.x.menu -tearoffcommand "menutitle \"FPGA type                                      \""
771
        $w.config.f.x6.x.menu add radiobutton -label "XC4V-LX100" -variable tmpvar_2 -value "XC4V-LX100" -command "update_active"
772
        $w.config.f.x6.x.menu add radiobutton -label "XC4V-LX160" -variable tmpvar_2 -value "XC4V-LX160" -command "update_active"
773
        $w.config.f.x6.x.menu add radiobutton -label "XC4V-LX200" -variable tmpvar_2 -value "XC4V-LX200" -command "update_active"
774
        menusplit $w $w.config.f.x6.x.menu 3
775
 
776
 
777
 
778
        focus $w
779
        update_active
780
        global winx; global winy
781
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
782
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
783
        update idletasks
784
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
785
 
786
        $w.config.canvas configure \
787
                -width [expr [winfo reqwidth $w.config.f] + 1]\
788
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
789
                         [expr [winfo reqheight $w.config.f] + 1]"
790
 
791
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
792
        set scry [expr [winfo screenh $w] / 2]
793
        set maxy [expr [winfo screenh $w] * 3 / 4]
794
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
795
        if [expr $winy + $canvtotal < $maxy] {
796
                $w.config.canvas configure -height $canvtotal
797
        } else {
798
                $w.config.canvas configure -height [expr $scry - $winy]
799
                }
800
        }
801
        update idletasks
802
        if {[winfo exists $w]} then {
803
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
804
        wm minsize $w [winfo width $w] 100
805
 
806
        wm deiconify $w
807
}
808
}
809
 
810
proc update_menu1 {} {
811
        global CONFIG_SYN_INFERRED
812
        global CONFIG_SYN_CUSTOM1
813
        global CONFIG_SYN_ATC18
814
        global CONFIG_SYN_TSMC90
815
        global CONFIG_SYN_RHUMC
816
        global CONFIG_SYN_ARTISAN
817
        if {($CONFIG_SYN_INFERRED == 1 || $CONFIG_SYN_CUSTOM1 == 1 || $CONFIG_SYN_ATC18 == 1 || $CONFIG_SYN_TSMC90 == 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}}
818
        global CONFIG_SYN_INFER_RAM
819
        if {($CONFIG_SYN_INFERRED != 1)} then {
820
        configure_entry .menu1.config.f.x2 normal {n l y}} else {configure_entry .menu1.config.f.x2 disabled {y n l}}
821
        global CONFIG_SYN_INFER_PADS
822
        if {($CONFIG_SYN_INFERRED != 1)} then {
823
        configure_entry .menu1.config.f.x3 normal {n l y}} else {configure_entry .menu1.config.f.x3 disabled {y n l}}
824
}
825
 
826
 
827
proc update_define_menu1 {} {
828
        update_define_mainmenu
829
        global CONFIG_MODULES
830
        global tmpvar_0
831
        global CONFIG_SYN_INFERRED
832
        if {$tmpvar_0 == "Inferred"} then {set CONFIG_SYN_INFERRED 1} else {set CONFIG_SYN_INFERRED 0}
833
        global CONFIG_SYN_STRATIX
834
        if {$tmpvar_0 == "Altera-Stratix"} then {set CONFIG_SYN_STRATIX 1} else {set CONFIG_SYN_STRATIX 0}
835
        global CONFIG_SYN_STRATIXII
836
        if {$tmpvar_0 == "Altera-StratixII"} then {set CONFIG_SYN_STRATIXII 1} else {set CONFIG_SYN_STRATIXII 0}
837
        global CONFIG_SYN_STRATIXIII
838
        if {$tmpvar_0 == "Altera-StratixIII"} then {set CONFIG_SYN_STRATIXIII 1} else {set CONFIG_SYN_STRATIXIII 0}
839
        global CONFIG_SYN_CYCLONEIII
840
        if {$tmpvar_0 == "Altera-CycloneIII"} then {set CONFIG_SYN_CYCLONEIII 1} else {set CONFIG_SYN_CYCLONEIII 0}
841
        global CONFIG_SYN_ALTERA
842
        if {$tmpvar_0 == "Altera-Others"} then {set CONFIG_SYN_ALTERA 1} else {set CONFIG_SYN_ALTERA 0}
843
        global CONFIG_SYN_AXCEL
844
        if {$tmpvar_0 == "Actel-Axcelerator"} then {set CONFIG_SYN_AXCEL 1} else {set CONFIG_SYN_AXCEL 0}
845
        global CONFIG_SYN_PROASIC
846
        if {$tmpvar_0 == "Actel-Proasic"} then {set CONFIG_SYN_PROASIC 1} else {set CONFIG_SYN_PROASIC 0}
847
        global CONFIG_SYN_PROASICPLUS
848
        if {$tmpvar_0 == "Actel-ProasicPlus"} then {set CONFIG_SYN_PROASICPLUS 1} else {set CONFIG_SYN_PROASICPLUS 0}
849
        global CONFIG_SYN_PROASIC3
850
        if {$tmpvar_0 == "Actel-Proasic3"} then {set CONFIG_SYN_PROASIC3 1} else {set CONFIG_SYN_PROASIC3 0}
851
        global CONFIG_SYN_UT025CRH
852
        if {$tmpvar_0 == "Aeroflex-UT025CRH"} then {set CONFIG_SYN_UT025CRH 1} else {set CONFIG_SYN_UT025CRH 0}
853
        global CONFIG_SYN_ATC18
854
        if {$tmpvar_0 == "Atmel-ATC18"} then {set CONFIG_SYN_ATC18 1} else {set CONFIG_SYN_ATC18 0}
855
        global CONFIG_SYN_CUSTOM1
856
        if {$tmpvar_0 == "Custom1"} then {set CONFIG_SYN_CUSTOM1 1} else {set CONFIG_SYN_CUSTOM1 0}
857
        global CONFIG_SYN_IHP25
858
        if {$tmpvar_0 == "IHP25"} then {set CONFIG_SYN_IHP25 1} else {set CONFIG_SYN_IHP25 0}
859
        global CONFIG_SYN_IHP25RH
860
        if {$tmpvar_0 == "IHP25RH"} then {set CONFIG_SYN_IHP25RH 1} else {set CONFIG_SYN_IHP25RH 0}
861
        global CONFIG_SYN_LATTICE
862
        if {$tmpvar_0 == "Lattice-EC/ECP/XP"} then {set CONFIG_SYN_LATTICE 1} else {set CONFIG_SYN_LATTICE 0}
863
        global CONFIG_SYN_ECLIPSE
864
        if {$tmpvar_0 == "Quicklogic-Eclipse"} then {set CONFIG_SYN_ECLIPSE 1} else {set CONFIG_SYN_ECLIPSE 0}
865
        global CONFIG_SYN_PEREGRINE
866
        if {$tmpvar_0 == "Peregrine"} then {set CONFIG_SYN_PEREGRINE 1} else {set CONFIG_SYN_PEREGRINE 0}
867
        global CONFIG_SYN_RH_LIB18T
868
        if {$tmpvar_0 == "RH-LIB18T"} then {set CONFIG_SYN_RH_LIB18T 1} else {set CONFIG_SYN_RH_LIB18T 0}
869
        global CONFIG_SYN_RHUMC
870
        if {$tmpvar_0 == "RH-UMC"} then {set CONFIG_SYN_RHUMC 1} else {set CONFIG_SYN_RHUMC 0}
871
        global CONFIG_SYN_SPARTAN2
872
        if {$tmpvar_0 == "Xilinx-Spartan2"} then {set CONFIG_SYN_SPARTAN2 1} else {set CONFIG_SYN_SPARTAN2 0}
873
        global CONFIG_SYN_SPARTAN3
874
        if {$tmpvar_0 == "Xilinx-Spartan3"} then {set CONFIG_SYN_SPARTAN3 1} else {set CONFIG_SYN_SPARTAN3 0}
875
        global CONFIG_SYN_SPARTAN3E
876
        if {$tmpvar_0 == "Xilinx-Spartan3E"} then {set CONFIG_SYN_SPARTAN3E 1} else {set CONFIG_SYN_SPARTAN3E 0}
877
        global CONFIG_SYN_VIRTEX
878
        if {$tmpvar_0 == "Xilinx-Virtex"} then {set CONFIG_SYN_VIRTEX 1} else {set CONFIG_SYN_VIRTEX 0}
879
        global CONFIG_SYN_VIRTEXE
880
        if {$tmpvar_0 == "Xilinx-VirtexE"} then {set CONFIG_SYN_VIRTEXE 1} else {set CONFIG_SYN_VIRTEXE 0}
881
        global CONFIG_SYN_VIRTEX2
882
        if {$tmpvar_0 == "Xilinx-Virtex2"} then {set CONFIG_SYN_VIRTEX2 1} else {set CONFIG_SYN_VIRTEX2 0}
883
        global CONFIG_SYN_VIRTEX4
884
        if {$tmpvar_0 == "Xilinx-Virtex4"} then {set CONFIG_SYN_VIRTEX4 1} else {set CONFIG_SYN_VIRTEX4 0}
885
        global CONFIG_SYN_VIRTEX5
886
        if {$tmpvar_0 == "Xilinx-Virtex5"} then {set CONFIG_SYN_VIRTEX5 1} else {set CONFIG_SYN_VIRTEX5 0}
887
        global CONFIG_SYN_UMC
888
        if {$tmpvar_0 == "UMC18"} then {set CONFIG_SYN_UMC 1} else {set CONFIG_SYN_UMC 0}
889
        global CONFIG_SYN_TSMC90
890
        if {$tmpvar_0 == "TSMC90"} then {set CONFIG_SYN_TSMC90 1} else {set CONFIG_SYN_TSMC90 0}
891
        global tmpvar_1
892
        global CONFIG_MEM_INFERRED
893
        if {$tmpvar_1 == "Inferred"} then {set CONFIG_MEM_INFERRED 1} else {set CONFIG_MEM_INFERRED 0}
894
        global CONFIG_MEM_UMC
895
        if {$tmpvar_1 == "UMC18"} then {set CONFIG_MEM_UMC 1} else {set CONFIG_MEM_UMC 0}
896
        global CONFIG_MEM_RHUMC
897
        if {$tmpvar_1 == "RH-UMC"} then {set CONFIG_MEM_RHUMC 1} else {set CONFIG_MEM_RHUMC 0}
898
        global CONFIG_MEM_ARTISAN
899
        if {$tmpvar_1 == "Artisan"} then {set CONFIG_MEM_ARTISAN 1} else {set CONFIG_MEM_ARTISAN 0}
900
        global CONFIG_MEM_CUSTOM1
901
        if {$tmpvar_1 == "Custom1"} then {set CONFIG_MEM_CUSTOM1 1} else {set CONFIG_MEM_CUSTOM1 0}
902
        global CONFIG_MEM_VIRAGE
903
        if {$tmpvar_1 == "Virage"} then {set CONFIG_MEM_VIRAGE 1} else {set CONFIG_MEM_VIRAGE 0}
904
        global CONFIG_MEM_VIRAGE90
905
        if {$tmpvar_1 == "Virage-TSMC90"} then {set CONFIG_MEM_VIRAGE90 1} else {set CONFIG_MEM_VIRAGE90 0}
906
        global CONFIG_SYN_INFER_RAM
907
        if {($CONFIG_SYN_INFERRED != 1)} then {
908
        set CONFIG_SYN_INFER_RAM [expr $CONFIG_SYN_INFER_RAM&15]} else {set CONFIG_SYN_INFER_RAM [expr $CONFIG_SYN_INFER_RAM|16]}
909
        global CONFIG_SYN_INFER_PADS
910
        if {($CONFIG_SYN_INFERRED != 1)} then {
911
        set CONFIG_SYN_INFER_PADS [expr $CONFIG_SYN_INFER_PADS&15]} else {set CONFIG_SYN_INFER_PADS [expr $CONFIG_SYN_INFER_PADS|16]}
912
        global tmpvar_2
913
        global CONFIG_FPGA_LX100
914
        if {$tmpvar_2 == "XC4V-LX100"} then {set CONFIG_FPGA_LX100 1} else {set CONFIG_FPGA_LX100 0}
915
        global CONFIG_FPGA_LX160
916
        if {$tmpvar_2 == "XC4V-LX160"} then {set CONFIG_FPGA_LX160 1} else {set CONFIG_FPGA_LX160 0}
917
        global CONFIG_FPGA_LX200
918
        if {$tmpvar_2 == "XC4V-LX200"} then {set CONFIG_FPGA_LX200 1} else {set CONFIG_FPGA_LX200 0}
919
}
920
 
921
 
922
menu_option menu2 2 "Clock generation"
923
proc menu2 {w title} {
924
        set oldFocus [focus]
925
        catch {destroy $w; unregister_active 2}
926
        toplevel $w -class Dialog
927
        wm withdraw $w
928
        global active_menus
929
        set active_menus [lsort -integer [linsert $active_menus end 2]]
930
        message $w.m -width 400 -aspect 300 -text \
931
                "Clock generation"  -relief raised
932
        pack $w.m -pady 10 -side top -padx 10
933
        wm title $w "Clock generation"
934
 
935
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 2; break"
936
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu3 .menu3 \"$title\""
937
        frame $w.f
938
        button $w.f.back -text "Main Menu" \
939
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 2"
940
        button $w.f.next -text "Next" -underline 0\
941
                -width 15 -command $nextscript
942
        bind all  $nextscript
943
        button $w.f.prev -text "Prev" -underline 0\
944
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu1 .menu1 \"$title\""
945
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu1 .menu1 \"$title\";break"
946
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
947
        pack $w.f -pady 10 -side bottom -anchor w -fill x
948
        frame $w.topline -relief ridge -borderwidth 2 -height 2
949
        pack $w.topline -side top -fill x
950
 
951
        frame $w.botline -relief ridge -borderwidth 2 -height 2
952
        pack $w.botline -side bottom -fill x
953
 
954
        frame $w.config
955
        pack $w.config -fill y -expand on
956
 
957
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
958
        pack $w.config.vscroll -side right -fill y
959
 
960
        canvas $w.config.canvas -height 1\
961
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
962
                -width [expr [winfo screenwidth .] * 1 / 2]
963
        frame $w.config.f
964
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
965
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
966
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
967
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
968
        bind $w  "$w.config.canvas yview moveto 0;break;"
969
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
970
        pack $w.config.canvas -side right -fill y
971
 
972
 
973
        global tmpvar_3
974
        minimenu $w.config.f 2 0 "Clock generator                     " tmpvar_3 CONFIG_CLK_INFERRED
975
        menu $w.config.f.x0.x.menu -tearoffcommand "menutitle \"Clock generator                     \""
976
        $w.config.f.x0.x.menu add radiobutton -label "Inferred" -variable tmpvar_3 -value "Inferred" -command "update_active"
977
        $w.config.f.x0.x.menu add radiobutton -label "Actel-HCLKBUF" -variable tmpvar_3 -value "Actel-HCLKBUF" -command "update_active"
978
        $w.config.f.x0.x.menu add radiobutton -label "Altera-ALTPLL" -variable tmpvar_3 -value "Altera-ALTPLL" -command "update_active"
979
        $w.config.f.x0.x.menu add radiobutton -label "Lattice-EXPLL" -variable tmpvar_3 -value "Lattice-EXPLL" -command "update_active"
980
        $w.config.f.x0.x.menu add radiobutton -label "Proasic3-PLLL" -variable tmpvar_3 -value "Proasic3-PLLL" -command "update_active"
981
        $w.config.f.x0.x.menu add radiobutton -label "RH-LIB18T-PLL" -variable tmpvar_3 -value "RH-LIB18T-PLL" -command "update_active"
982
        $w.config.f.x0.x.menu add radiobutton -label "DARE-PLL" -variable tmpvar_3 -value "DARE-PLL" -command "update_active"
983
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-CLKDLL" -variable tmpvar_3 -value "Xilinx-CLKDLL" -command "update_active"
984
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-DCM" -variable tmpvar_3 -value "Xilinx-DCM" -command "update_active"
985
        menusplit $w $w.config.f.x0.x.menu 9
986
        int $w.config.f 2 1 "Clock multiplication factor (2 - 32)" CONFIG_CLK_MUL
987
        int $w.config.f 2 2 "Clock division factor (2 - 32)" CONFIG_CLK_DIV
988
        int $w.config.f 2 3 "Outout division factor (2 - 32)" CONFIG_OCLK_DIV
989
        bool $w.config.f 2 4 "Enable Xilinx CLKDLL for PCI clock" CONFIG_PCI_CLKDLL
990
        bool $w.config.f 2 5 "Disable external feedback for SDRAM clock" CONFIG_CLK_NOFB
991
        bool $w.config.f 2 6 "Use PCI clock as system clock" CONFIG_PCI_SYSCLK
992
 
993
 
994
 
995
        focus $w
996
        update_active
997
        global winx; global winy
998
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
999
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1000
        update idletasks
1001
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1002
 
1003
        $w.config.canvas configure \
1004
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1005
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1006
                         [expr [winfo reqheight $w.config.f] + 1]"
1007
 
1008
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1009
        set scry [expr [winfo screenh $w] / 2]
1010
        set maxy [expr [winfo screenh $w] * 3 / 4]
1011
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1012
        if [expr $winy + $canvtotal < $maxy] {
1013
                $w.config.canvas configure -height $canvtotal
1014
        } else {
1015
                $w.config.canvas configure -height [expr $scry - $winy]
1016
                }
1017
        }
1018
        update idletasks
1019
        if {[winfo exists $w]} then {
1020
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1021
        wm minsize $w [winfo width $w] 100
1022
 
1023
        wm deiconify $w
1024
}
1025
}
1026
 
1027
proc update_menu2 {} {
1028
        global CONFIG_CLK_DCM
1029
        global CONFIG_CLK_ALTDLL
1030
        global CONFIG_CLK_LATDLL
1031
        global CONFIG_CLK_PRO3PLL
1032
        global CONFIG_CLK_CLKDLL
1033
        global CONFIG_CLK_LIB18T
1034
        global CONFIG_CLK_MUL
1035
        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}
1036
        global CONFIG_CLK_DIV
1037
        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}
1038
        global CONFIG_OCLK_DIV
1039
        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}
1040
        global CONFIG_PCI_CLKDLL
1041
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {
1042
        configure_entry .menu2.config.f.x4 normal {n l y}} else {configure_entry .menu2.config.f.x4 disabled {y n l}}
1043
        global CONFIG_CLK_NOFB
1044
        if {($CONFIG_CLK_DCM == 1)} then {
1045
        configure_entry .menu2.config.f.x5 normal {n l y}} else {configure_entry .menu2.config.f.x5 disabled {y n l}}
1046
        global CONFIG_PCI_ENABLE
1047
        global CONFIG_PCI_SYSCLK
1048
        if {($CONFIG_PCI_ENABLE != 1)} then {
1049
        configure_entry .menu2.config.f.x6 normal {n l y}} else {configure_entry .menu2.config.f.x6 disabled {y n l}}
1050
}
1051
 
1052
 
1053
proc update_define_menu2 {} {
1054
        update_define_mainmenu
1055
        global CONFIG_MODULES
1056
        global tmpvar_3
1057
        global CONFIG_CLK_INFERRED
1058
        if {$tmpvar_3 == "Inferred"} then {set CONFIG_CLK_INFERRED 1} else {set CONFIG_CLK_INFERRED 0}
1059
        global CONFIG_CLK_HCLKBUF
1060
        if {$tmpvar_3 == "Actel-HCLKBUF"} then {set CONFIG_CLK_HCLKBUF 1} else {set CONFIG_CLK_HCLKBUF 0}
1061
        global CONFIG_CLK_ALTDLL
1062
        if {$tmpvar_3 == "Altera-ALTPLL"} then {set CONFIG_CLK_ALTDLL 1} else {set CONFIG_CLK_ALTDLL 0}
1063
        global CONFIG_CLK_LATDLL
1064
        if {$tmpvar_3 == "Lattice-EXPLL"} then {set CONFIG_CLK_LATDLL 1} else {set CONFIG_CLK_LATDLL 0}
1065
        global CONFIG_CLK_PRO3PLL
1066
        if {$tmpvar_3 == "Proasic3-PLLL"} then {set CONFIG_CLK_PRO3PLL 1} else {set CONFIG_CLK_PRO3PLL 0}
1067
        global CONFIG_CLK_LIB18T
1068
        if {$tmpvar_3 == "RH-LIB18T-PLL"} then {set CONFIG_CLK_LIB18T 1} else {set CONFIG_CLK_LIB18T 0}
1069
        global CONFIG_CLK_RHUMC
1070
        if {$tmpvar_3 == "DARE-PLL"} then {set CONFIG_CLK_RHUMC 1} else {set CONFIG_CLK_RHUMC 0}
1071
        global CONFIG_CLK_CLKDLL
1072
        if {$tmpvar_3 == "Xilinx-CLKDLL"} then {set CONFIG_CLK_CLKDLL 1} else {set CONFIG_CLK_CLKDLL 0}
1073
        global CONFIG_CLK_DCM
1074
        if {$tmpvar_3 == "Xilinx-DCM"} then {set CONFIG_CLK_DCM 1} else {set CONFIG_CLK_DCM 0}
1075
        global CONFIG_CLK_MUL
1076
        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}
1077
        global CONFIG_CLK_DIV
1078
        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}
1079
        global CONFIG_OCLK_DIV
1080
        if {($CONFIG_CLK_PRO3PLL == 1)} then {validate_int CONFIG_OCLK_DIV "$CONFIG_OCLK_DIV" 2}
1081
        global CONFIG_PCI_CLKDLL
1082
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {
1083
        set CONFIG_PCI_CLKDLL [expr $CONFIG_PCI_CLKDLL&15]} else {set CONFIG_PCI_CLKDLL [expr $CONFIG_PCI_CLKDLL|16]}
1084
        global CONFIG_CLK_NOFB
1085
        if {($CONFIG_CLK_DCM == 1)} then {
1086
        set CONFIG_CLK_NOFB [expr $CONFIG_CLK_NOFB&15]} else {set CONFIG_CLK_NOFB [expr $CONFIG_CLK_NOFB|16]}
1087
        global CONFIG_PCI_ENABLE
1088
        global CONFIG_PCI_SYSCLK
1089
        if {($CONFIG_PCI_ENABLE != 1)} then {
1090
        set CONFIG_PCI_SYSCLK [expr $CONFIG_PCI_SYSCLK&15]} else {set CONFIG_PCI_SYSCLK [expr $CONFIG_PCI_SYSCLK|16]}
1091
}
1092
 
1093
 
1094
menu_option menu3 3 "Processor            "
1095
proc menu3 {w title} {
1096
        set oldFocus [focus]
1097
        catch {destroy $w; unregister_active 3}
1098
        toplevel $w -class Dialog
1099
        wm withdraw $w
1100
        global active_menus
1101
        set active_menus [lsort -integer [linsert $active_menus end 3]]
1102
        message $w.m -width 400 -aspect 300 -text \
1103
                "Processor            "  -relief raised
1104
        pack $w.m -pady 10 -side top -padx 10
1105
        wm title $w "Processor            "
1106
 
1107
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 3; break"
1108
        set nextscript "catch {focus $oldFocus}; menu4 .menu4 \"$title\""
1109
        frame $w.f
1110
        button $w.f.back -text "Main Menu" \
1111
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 3"
1112
        button $w.f.next -text "Next" -underline 0\
1113
                -width 15 -command $nextscript
1114
        bind all  $nextscript
1115
        button $w.f.prev -text "Prev" -underline 0\
1116
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu2 .menu2 \"$title\""
1117
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu2 .menu2 \"$title\";break"
1118
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1119
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1120
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1121
        pack $w.topline -side top -fill x
1122
 
1123
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1124
        pack $w.botline -side bottom -fill x
1125
 
1126
        frame $w.config
1127
        pack $w.config -fill y -expand on
1128
 
1129
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1130
        pack $w.config.vscroll -side right -fill y
1131
 
1132
        canvas $w.config.canvas -height 1\
1133
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1134
                -width [expr [winfo screenwidth .] * 1 / 2]
1135
        frame $w.config.f
1136
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1137
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1138
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1139
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1140
        bind $w  "$w.config.canvas yview moveto 0;break;"
1141
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1142
        pack $w.config.canvas -side right -fill y
1143
 
1144
 
1145
        bool $w.config.f 3 0 "Enable LEON3 SPARC V8 Processor" CONFIG_LEON3
1146
        int $w.config.f 3 1 "Number of processors" CONFIG_PROC_NUM
1147
        submenu $w.config.f 3 2 "Integer unit                                           " 4
1148
        submenu $w.config.f 3 3 "Floating-point unit" 5
1149
        submenu $w.config.f 3 4 "Cache system" 6
1150
        submenu $w.config.f 3 5 "MMU" 7
1151
        submenu $w.config.f 3 6 "Debug Support Unit        " 8
1152
        submenu $w.config.f 3 7 "Fault-tolerance  " 9
1153
        submenu $w.config.f 3 8 "VHDL debug settings       " 10
1154
 
1155
 
1156
 
1157
        focus $w
1158
        update_active
1159
        global winx; global winy
1160
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
1161
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1162
        update idletasks
1163
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1164
 
1165
        $w.config.canvas configure \
1166
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1167
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1168
                         [expr [winfo reqheight $w.config.f] + 1]"
1169
 
1170
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1171
        set scry [expr [winfo screenh $w] / 2]
1172
        set maxy [expr [winfo screenh $w] * 3 / 4]
1173
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1174
        if [expr $winy + $canvtotal < $maxy] {
1175
                $w.config.canvas configure -height $canvtotal
1176
        } else {
1177
                $w.config.canvas configure -height [expr $scry - $winy]
1178
                }
1179
        }
1180
        update idletasks
1181
        if {[winfo exists $w]} then {
1182
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1183
        wm minsize $w [winfo width $w] 100
1184
 
1185
        wm deiconify $w
1186
}
1187
}
1188
 
1189
proc update_menu3 {} {
1190
        global CONFIG_LEON3
1191
        global CONFIG_PROC_NUM
1192
        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}
1193
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x2 normal {m}} else {configure_entry .menu3.config.f.x2 disabled {m}}
1194
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x3 normal {m}} else {configure_entry .menu3.config.f.x3 disabled {m}}
1195
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x4 normal {m}} else {configure_entry .menu3.config.f.x4 disabled {m}}
1196
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x5 normal {m}} else {configure_entry .menu3.config.f.x5 disabled {m}}
1197
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x6 normal {m}} else {configure_entry .menu3.config.f.x6 disabled {m}}
1198
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x7 normal {m}} else {configure_entry .menu3.config.f.x7 disabled {m}}
1199
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x8 normal {m}} else {configure_entry .menu3.config.f.x8 disabled {m}}
1200
}
1201
 
1202
 
1203
proc update_define_menu3 {} {
1204
        update_define_mainmenu
1205
        global CONFIG_MODULES
1206
        global CONFIG_LEON3
1207
        global CONFIG_PROC_NUM
1208
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_PROC_NUM "$CONFIG_PROC_NUM" 1}
1209
}
1210
 
1211
 
1212
proc menu4 {w title} {
1213
        set oldFocus [focus]
1214
        catch {focus .menu3}
1215
        catch {destroy $w; unregister_active 4}
1216
        toplevel $w -class Dialog
1217
        wm withdraw $w
1218
        global active_menus
1219
        set active_menus [lsort -integer [linsert $active_menus end 4]]
1220
        message $w.m -width 400 -aspect 300 -text \
1221
                "Integer unit                                           "  -relief raised
1222
        pack $w.m -pady 10 -side top -padx 10
1223
        wm title $w "Integer unit                                           "
1224
 
1225
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 4; break"
1226
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu5 .menu5 \"$title\""
1227
        frame $w.f
1228
        button $w.f.back -text "OK" \
1229
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 4"
1230
        button $w.f.next -text "Next" -underline 0\
1231
                -width 15 -command $nextscript
1232
        bind all  $nextscript
1233
        button $w.f.prev -text "Prev" -underline 0\
1234
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu3 .menu3 \"$title\""
1235
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu3 .menu3 \"$title\";break"
1236
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1237
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1238
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1239
        pack $w.topline -side top -fill x
1240
 
1241
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1242
        pack $w.botline -side bottom -fill x
1243
 
1244
        frame $w.config
1245
        pack $w.config -fill y -expand on
1246
 
1247
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1248
        pack $w.config.vscroll -side right -fill y
1249
 
1250
        canvas $w.config.canvas -height 1\
1251
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1252
                -width [expr [winfo screenwidth .] * 1 / 2]
1253
        frame $w.config.f
1254
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1255
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1256
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1257
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1258
        bind $w  "$w.config.canvas yview moveto 0;break;"
1259
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1260
        pack $w.config.canvas -side right -fill y
1261
 
1262
 
1263
        int $w.config.f 4 0 "SPARC register windows" CONFIG_IU_NWINDOWS
1264
        bool $w.config.f 4 1 "SPARC V8 MUL/DIV instructions" CONFIG_IU_V8MULDIV
1265
        global tmpvar_4
1266
        minimenu $w.config.f 4 2 "Hardware multiplier latency" tmpvar_4 CONFIG_IU_MUL_LATENCY_4
1267
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"Hardware multiplier latency\""
1268
        $w.config.f.x2.x.menu add radiobutton -label "4-cycles" -variable tmpvar_4 -value "4-cycles" -command "update_active"
1269
        $w.config.f.x2.x.menu add radiobutton -label "5-cycles" -variable tmpvar_4 -value "5-cycles" -command "update_active"
1270
        menusplit $w $w.config.f.x2.x.menu 2
1271
        bool $w.config.f 4 3 "SPARC V8e SMAC/UMAC instructions     " CONFIG_IU_MUL_MAC
1272
        bool $w.config.f 4 4 "Single-vector trapping" CONFIG_IU_SVT
1273
        int $w.config.f 4 5 "Load delay" CONFIG_IU_LDELAY
1274
        int $w.config.f 4 6 "Hardware watchpoints" CONFIG_IU_WATCHPOINTS
1275
        bool $w.config.f 4 7 "Enable power-down mode " CONFIG_PWD
1276
        hex $w.config.f 4 8 " Reset start address (addr\[31:12\]) " CONFIG_IU_RSTADDR
1277
 
1278
 
1279
 
1280
        focus $w
1281
        update_active
1282
        global winx; global winy
1283
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
1284
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
1285
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1286
        update idletasks
1287
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1288
 
1289
        $w.config.canvas configure \
1290
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1291
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1292
                         [expr [winfo reqheight $w.config.f] + 1]"
1293
 
1294
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1295
        set scry [expr [winfo screenh $w] / 2]
1296
        set maxy [expr [winfo screenh $w] * 3 / 4]
1297
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1298
        if [expr $winy + $canvtotal < $maxy] {
1299
                $w.config.canvas configure -height $canvtotal
1300
        } else {
1301
                $w.config.canvas configure -height [expr $scry - $winy]
1302
                }
1303
        }
1304
        update idletasks
1305
        if {[winfo exists $w]} then {
1306
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1307
        wm minsize $w [winfo width $w] 100
1308
 
1309
        wm deiconify $w
1310
}
1311
}
1312
 
1313
proc update_menu4 {} {
1314
        global CONFIG_LEON3
1315
        global CONFIG_IU_NWINDOWS
1316
        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}
1317
        global CONFIG_IU_V8MULDIV
1318
        if {($CONFIG_LEON3 == 1)} then {
1319
        configure_entry .menu4.config.f.x1 normal {n l y}} else {configure_entry .menu4.config.f.x1 disabled {y n l}}
1320
        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}}
1321
        global CONFIG_IU_MUL_MAC
1322
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {
1323
        configure_entry .menu4.config.f.x3 normal {n l y}} else {configure_entry .menu4.config.f.x3 disabled {y n l}}
1324
        global CONFIG_IU_SVT
1325
        if {($CONFIG_LEON3 == 1)} then {
1326
        configure_entry .menu4.config.f.x4 normal {n l y}} else {configure_entry .menu4.config.f.x4 disabled {y n l}}
1327
        global CONFIG_IU_LDELAY
1328
        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}
1329
        global CONFIG_IU_WATCHPOINTS
1330
        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}
1331
        global CONFIG_PWD
1332
        if {($CONFIG_LEON3 == 1)} then {
1333
        configure_entry .menu4.config.f.x7 normal {n l y}} else {configure_entry .menu4.config.f.x7 disabled {y n l}}
1334
        global CONFIG_IU_RSTADDR
1335
        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}
1336
}
1337
 
1338
 
1339
proc update_define_menu4 {} {
1340
        update_define_mainmenu
1341
        global CONFIG_MODULES
1342
        global CONFIG_LEON3
1343
        global CONFIG_IU_NWINDOWS
1344
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_NWINDOWS "$CONFIG_IU_NWINDOWS" 8}
1345
        global CONFIG_IU_V8MULDIV
1346
        if {($CONFIG_LEON3 == 1)} then {
1347
        set CONFIG_IU_V8MULDIV [expr $CONFIG_IU_V8MULDIV&15]} else {set CONFIG_IU_V8MULDIV [expr $CONFIG_IU_V8MULDIV|16]}
1348
        global tmpvar_4
1349
        global CONFIG_IU_MUL_LATENCY_4
1350
        if {$tmpvar_4 == "4-cycles"} then {set CONFIG_IU_MUL_LATENCY_4 1} else {set CONFIG_IU_MUL_LATENCY_4 0}
1351
        global CONFIG_IU_MUL_LATENCY_5
1352
        if {$tmpvar_4 == "5-cycles"} then {set CONFIG_IU_MUL_LATENCY_5 1} else {set CONFIG_IU_MUL_LATENCY_5 0}
1353
        global CONFIG_IU_MUL_MAC
1354
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {
1355
        set CONFIG_IU_MUL_MAC [expr $CONFIG_IU_MUL_MAC&15]} else {set CONFIG_IU_MUL_MAC [expr $CONFIG_IU_MUL_MAC|16]}
1356
        global CONFIG_IU_SVT
1357
        if {($CONFIG_LEON3 == 1)} then {
1358
        set CONFIG_IU_SVT [expr $CONFIG_IU_SVT&15]} else {set CONFIG_IU_SVT [expr $CONFIG_IU_SVT|16]}
1359
        global CONFIG_IU_LDELAY
1360
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_LDELAY "$CONFIG_IU_LDELAY" 1}
1361
        global CONFIG_IU_WATCHPOINTS
1362
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_WATCHPOINTS "$CONFIG_IU_WATCHPOINTS" 0}
1363
        global CONFIG_PWD
1364
        if {($CONFIG_LEON3 == 1)} then {
1365
        set CONFIG_PWD [expr $CONFIG_PWD&15]} else {set CONFIG_PWD [expr $CONFIG_PWD|16]}
1366
        global CONFIG_IU_RSTADDR
1367
        if {($CONFIG_LEON3 == 1)} then {validate_hex CONFIG_IU_RSTADDR "$CONFIG_IU_RSTADDR" 00000}
1368
}
1369
 
1370
 
1371
proc menu5 {w title} {
1372
        set oldFocus [focus]
1373
        catch {focus .menu3}
1374
        catch {destroy $w; unregister_active 5}
1375
        toplevel $w -class Dialog
1376
        wm withdraw $w
1377
        global active_menus
1378
        set active_menus [lsort -integer [linsert $active_menus end 5]]
1379
        message $w.m -width 400 -aspect 300 -text \
1380
                "Floating-point unit"  -relief raised
1381
        pack $w.m -pady 10 -side top -padx 10
1382
        wm title $w "Floating-point unit"
1383
 
1384
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 5; break"
1385
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu6 .menu6 \"$title\""
1386
        frame $w.f
1387
        button $w.f.back -text "OK" \
1388
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 5"
1389
        button $w.f.next -text "Next" -underline 0\
1390
                -width 15 -command $nextscript
1391
        bind all  $nextscript
1392
        button $w.f.prev -text "Prev" -underline 0\
1393
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu4 .menu4 \"$title\""
1394
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu4 .menu4 \"$title\";break"
1395
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1396
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1397
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1398
        pack $w.topline -side top -fill x
1399
 
1400
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1401
        pack $w.botline -side bottom -fill x
1402
 
1403
        frame $w.config
1404
        pack $w.config -fill y -expand on
1405
 
1406
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1407
        pack $w.config.vscroll -side right -fill y
1408
 
1409
        canvas $w.config.canvas -height 1\
1410
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1411
                -width [expr [winfo screenwidth .] * 1 / 2]
1412
        frame $w.config.f
1413
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1414
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1415
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1416
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1417
        bind $w  "$w.config.canvas yview moveto 0;break;"
1418
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1419
        pack $w.config.canvas -side right -fill y
1420
 
1421
 
1422
        bool $w.config.f 5 0 "Enable FPU                             " CONFIG_FPU_ENABLE
1423
        global tmpvar_5
1424
        minimenu $w.config.f 5 1 "FPU core" tmpvar_5 CONFIG_FPU_GRFPU
1425
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"FPU core\""
1426
        $w.config.f.x1.x.menu add radiobutton -label "GRFPU" -variable tmpvar_5 -value "GRFPU" -command "update_active"
1427
        $w.config.f.x1.x.menu add radiobutton -label "GRFPU-LITE" -variable tmpvar_5 -value "GRFPU-LITE" -command "update_active"
1428
        $w.config.f.x1.x.menu add radiobutton -label "Meiko" -variable tmpvar_5 -value "Meiko" -command "update_active"
1429
        menusplit $w $w.config.f.x1.x.menu 3
1430
        global tmpvar_6
1431
        minimenu $w.config.f 5 2 "GRFPU multiplier" tmpvar_6 CONFIG_FPU_GRFPU_INFMUL
1432
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"GRFPU multiplier\""
1433
        $w.config.f.x2.x.menu add radiobutton -label "Inferred" -variable tmpvar_6 -value "Inferred" -command "update_active"
1434
        $w.config.f.x2.x.menu add radiobutton -label "DW" -variable tmpvar_6 -value "DW" -command "update_active"
1435
        $w.config.f.x2.x.menu add radiobutton -label "ModGen" -variable tmpvar_6 -value "ModGen" -command "update_active"
1436
        menusplit $w $w.config.f.x2.x.menu 3
1437
        global tmpvar_7
1438
        minimenu $w.config.f 5 3 "GRFPU-LITE controller" tmpvar_7 CONFIG_FPU_GRFPC0
1439
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"GRFPU-LITE controller\""
1440
        $w.config.f.x3.x.menu add radiobutton -label "Simple" -variable tmpvar_7 -value "Simple" -command "update_active"
1441
        $w.config.f.x3.x.menu add radiobutton -label "Data-forwarding" -variable tmpvar_7 -value "Data-forwarding" -command "update_active"
1442
        $w.config.f.x3.x.menu add radiobutton -label "Non-blocking" -variable tmpvar_7 -value "Non-blocking" -command "update_active"
1443
        menusplit $w $w.config.f.x3.x.menu 3
1444
        bool $w.config.f 5 4 "Use VHDL netlist          " CONFIG_FPU_NETLIST
1445
 
1446
 
1447
 
1448
        focus $w
1449
        update_active
1450
        global winx; global winy
1451
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
1452
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
1453
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1454
        update idletasks
1455
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1456
 
1457
        $w.config.canvas configure \
1458
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1459
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1460
                         [expr [winfo reqheight $w.config.f] + 1]"
1461
 
1462
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1463
        set scry [expr [winfo screenh $w] / 2]
1464
        set maxy [expr [winfo screenh $w] * 3 / 4]
1465
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1466
        if [expr $winy + $canvtotal < $maxy] {
1467
                $w.config.canvas configure -height $canvtotal
1468
        } else {
1469
                $w.config.canvas configure -height [expr $scry - $winy]
1470
                }
1471
        }
1472
        update idletasks
1473
        if {[winfo exists $w]} then {
1474
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1475
        wm minsize $w [winfo width $w] 100
1476
 
1477
        wm deiconify $w
1478
}
1479
}
1480
 
1481
proc update_menu5 {} {
1482
        global CONFIG_LEON3
1483
        global CONFIG_FPU_ENABLE
1484
        if {($CONFIG_LEON3 == 1)} then {
1485
        configure_entry .menu5.config.f.x0 normal {n l y}} else {configure_entry .menu5.config.f.x0 disabled {y n l}}
1486
        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}}
1487
        global CONFIG_FPU_GRFPU
1488
        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}}
1489
        global CONFIG_FPU_GRFPULITE
1490
        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}}
1491
        global CONFIG_FPU_NETLIST
1492
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
1493
        configure_entry .menu5.config.f.x4 normal {n l y}} else {configure_entry .menu5.config.f.x4 disabled {y n l}}
1494
}
1495
 
1496
 
1497
proc update_define_menu5 {} {
1498
        update_define_mainmenu
1499
        global CONFIG_MODULES
1500
        global CONFIG_LEON3
1501
        global CONFIG_FPU_ENABLE
1502
        if {($CONFIG_LEON3 == 1)} then {
1503
        set CONFIG_FPU_ENABLE [expr $CONFIG_FPU_ENABLE&15]} else {set CONFIG_FPU_ENABLE [expr $CONFIG_FPU_ENABLE|16]}
1504
        global tmpvar_5
1505
        global CONFIG_FPU_GRFPU
1506
        if {$tmpvar_5 == "GRFPU"} then {set CONFIG_FPU_GRFPU 1} else {set CONFIG_FPU_GRFPU 0}
1507
        global CONFIG_FPU_GRFPULITE
1508
        if {$tmpvar_5 == "GRFPU-LITE"} then {set CONFIG_FPU_GRFPULITE 1} else {set CONFIG_FPU_GRFPULITE 0}
1509
        global CONFIG_FPU_MEIKO
1510
        if {$tmpvar_5 == "Meiko"} then {set CONFIG_FPU_MEIKO 1} else {set CONFIG_FPU_MEIKO 0}
1511
        global tmpvar_6
1512
        global CONFIG_FPU_GRFPU_INFMUL
1513
        if {$tmpvar_6 == "Inferred"} then {set CONFIG_FPU_GRFPU_INFMUL 1} else {set CONFIG_FPU_GRFPU_INFMUL 0}
1514
        global CONFIG_FPU_GRFPU_DWMUL
1515
        if {$tmpvar_6 == "DW"} then {set CONFIG_FPU_GRFPU_DWMUL 1} else {set CONFIG_FPU_GRFPU_DWMUL 0}
1516
        global CONFIG_FPU_GRFPU_MODGEN
1517
        if {$tmpvar_6 == "ModGen"} then {set CONFIG_FPU_GRFPU_MODGEN 1} else {set CONFIG_FPU_GRFPU_MODGEN 0}
1518
        global tmpvar_7
1519
        global CONFIG_FPU_GRFPC0
1520
        if {$tmpvar_7 == "Simple"} then {set CONFIG_FPU_GRFPC0 1} else {set CONFIG_FPU_GRFPC0 0}
1521
        global CONFIG_FPU_GRFPC1
1522
        if {$tmpvar_7 == "Data-forwarding"} then {set CONFIG_FPU_GRFPC1 1} else {set CONFIG_FPU_GRFPC1 0}
1523
        global CONFIG_FPU_GRFPC2
1524
        if {$tmpvar_7 == "Non-blocking"} then {set CONFIG_FPU_GRFPC2 1} else {set CONFIG_FPU_GRFPC2 0}
1525
        global CONFIG_FPU_NETLIST
1526
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
1527
        set CONFIG_FPU_NETLIST [expr $CONFIG_FPU_NETLIST&15]} else {set CONFIG_FPU_NETLIST [expr $CONFIG_FPU_NETLIST|16]}
1528
}
1529
 
1530
 
1531
proc menu6 {w title} {
1532
        set oldFocus [focus]
1533
        catch {focus .menu3}
1534
        catch {destroy $w; unregister_active 6}
1535
        toplevel $w -class Dialog
1536
        wm withdraw $w
1537
        global active_menus
1538
        set active_menus [lsort -integer [linsert $active_menus end 6]]
1539
        message $w.m -width 400 -aspect 300 -text \
1540
                "Cache system"  -relief raised
1541
        pack $w.m -pady 10 -side top -padx 10
1542
        wm title $w "Cache system"
1543
 
1544
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 6; break"
1545
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu7 .menu7 \"$title\""
1546
        frame $w.f
1547
        button $w.f.back -text "OK" \
1548
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 6"
1549
        button $w.f.next -text "Next" -underline 0\
1550
                -width 15 -command $nextscript
1551
        bind all  $nextscript
1552
        button $w.f.prev -text "Prev" -underline 0\
1553
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu5 .menu5 \"$title\""
1554
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu5 .menu5 \"$title\";break"
1555
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1556
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1557
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1558
        pack $w.topline -side top -fill x
1559
 
1560
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1561
        pack $w.botline -side bottom -fill x
1562
 
1563
        frame $w.config
1564
        pack $w.config -fill y -expand on
1565
 
1566
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1567
        pack $w.config.vscroll -side right -fill y
1568
 
1569
        canvas $w.config.canvas -height 1\
1570
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1571
                -width [expr [winfo screenwidth .] * 1 / 2]
1572
        frame $w.config.f
1573
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1574
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1575
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1576
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1577
        bind $w  "$w.config.canvas yview moveto 0;break;"
1578
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1579
        pack $w.config.canvas -side right -fill y
1580
 
1581
 
1582
        bool $w.config.f 6 0 "Enable instruction cache       " CONFIG_ICACHE_ENABLE
1583
        global tmpvar_8
1584
        minimenu $w.config.f 6 1 "Associativity (sets)            " tmpvar_8 CONFIG_ICACHE_ASSO1
1585
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"Associativity (sets)            \""
1586
        $w.config.f.x1.x.menu add radiobutton -label "1" -variable tmpvar_8 -value "1" -command "update_active"
1587
        $w.config.f.x1.x.menu add radiobutton -label "2" -variable tmpvar_8 -value "2" -command "update_active"
1588
        $w.config.f.x1.x.menu add radiobutton -label "3" -variable tmpvar_8 -value "3" -command "update_active"
1589
        $w.config.f.x1.x.menu add radiobutton -label "4" -variable tmpvar_8 -value "4" -command "update_active"
1590
        menusplit $w $w.config.f.x1.x.menu 4
1591
        global tmpvar_9
1592
        minimenu $w.config.f 6 2 "Set size (kbytes/set)" tmpvar_9 CONFIG_ICACHE_SZ1
1593
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"Set size (kbytes/set)\""
1594
        $w.config.f.x2.x.menu add radiobutton -label "1" -variable tmpvar_9 -value "1" -command "update_active"
1595
        $w.config.f.x2.x.menu add radiobutton -label "2" -variable tmpvar_9 -value "2" -command "update_active"
1596
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_9 -value "4" -command "update_active"
1597
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_9 -value "8" -command "update_active"
1598
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_9 -value "16" -command "update_active"
1599
        $w.config.f.x2.x.menu add radiobutton -label "32" -variable tmpvar_9 -value "32" -command "update_active"
1600
        $w.config.f.x2.x.menu add radiobutton -label "64" -variable tmpvar_9 -value "64" -command "update_active"
1601
        $w.config.f.x2.x.menu add radiobutton -label "128" -variable tmpvar_9 -value "128" -command "update_active"
1602
        $w.config.f.x2.x.menu add radiobutton -label "256" -variable tmpvar_9 -value "256" -command "update_active"
1603
        menusplit $w $w.config.f.x2.x.menu 9
1604
        global tmpvar_10
1605
        minimenu $w.config.f 6 3 "Line size (bytes/line)" tmpvar_10 CONFIG_ICACHE_LZ16
1606
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"Line size (bytes/line)\""
1607
        $w.config.f.x3.x.menu add radiobutton -label "16" -variable tmpvar_10 -value "16" -command "update_active"
1608
        $w.config.f.x3.x.menu add radiobutton -label "32" -variable tmpvar_10 -value "32" -command "update_active"
1609
        menusplit $w $w.config.f.x3.x.menu 2
1610
        global tmpvar_11
1611
        minimenu $w.config.f 6 4 "Replacement alorithm" tmpvar_11 CONFIG_ICACHE_ALGORND
1612
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"Replacement alorithm\""
1613
        $w.config.f.x4.x.menu add radiobutton -label "Random" -variable tmpvar_11 -value "Random" -command "update_active"
1614
        $w.config.f.x4.x.menu add radiobutton -label "LRR" -variable tmpvar_11 -value "LRR" -command "update_active"
1615
        $w.config.f.x4.x.menu add radiobutton -label "LRU" -variable tmpvar_11 -value "LRU" -command "update_active"
1616
        menusplit $w $w.config.f.x4.x.menu 3
1617
        bool $w.config.f 6 5 "Cache locking      " CONFIG_ICACHE_LOCK
1618
        bool $w.config.f 6 6 "Enable local instruction RAM            " CONFIG_ICACHE_LRAM
1619
        global tmpvar_12
1620
        minimenu $w.config.f 6 7 "Local data RAM size (kbytes)" tmpvar_12 CONFIG_ICACHE_LRAM_SZ1
1621
        menu $w.config.f.x7.x.menu -tearoffcommand "menutitle \"Local data RAM size (kbytes)\""
1622
        $w.config.f.x7.x.menu add radiobutton -label "1" -variable tmpvar_12 -value "1" -command "update_active"
1623
        $w.config.f.x7.x.menu add radiobutton -label "2" -variable tmpvar_12 -value "2" -command "update_active"
1624
        $w.config.f.x7.x.menu add radiobutton -label "4" -variable tmpvar_12 -value "4" -command "update_active"
1625
        $w.config.f.x7.x.menu add radiobutton -label "8" -variable tmpvar_12 -value "8" -command "update_active"
1626
        $w.config.f.x7.x.menu add radiobutton -label "16" -variable tmpvar_12 -value "16" -command "update_active"
1627
        $w.config.f.x7.x.menu add radiobutton -label "32" -variable tmpvar_12 -value "32" -command "update_active"
1628
        $w.config.f.x7.x.menu add radiobutton -label "64" -variable tmpvar_12 -value "64" -command "update_active"
1629
        $w.config.f.x7.x.menu add radiobutton -label "128" -variable tmpvar_12 -value "128" -command "update_active"
1630
        $w.config.f.x7.x.menu add radiobutton -label "256" -variable tmpvar_12 -value "256" -command "update_active"
1631
        menusplit $w $w.config.f.x7.x.menu 9
1632
        hex $w.config.f 6 8 " Local instruction RAM start address (8 MSB) " CONFIG_ICACHE_LRSTART
1633
        bool $w.config.f 6 9 "Enable data cache       " CONFIG_DCACHE_ENABLE
1634
        global tmpvar_13
1635
        minimenu $w.config.f 6 10 "Associativity (sets)" tmpvar_13 CONFIG_DCACHE_ASSO1
1636
        menu $w.config.f.x10.x.menu -tearoffcommand "menutitle \"Associativity (sets)\""
1637
        $w.config.f.x10.x.menu add radiobutton -label "1" -variable tmpvar_13 -value "1" -command "update_active"
1638
        $w.config.f.x10.x.menu add radiobutton -label "2" -variable tmpvar_13 -value "2" -command "update_active"
1639
        $w.config.f.x10.x.menu add radiobutton -label "3" -variable tmpvar_13 -value "3" -command "update_active"
1640
        $w.config.f.x10.x.menu add radiobutton -label "4" -variable tmpvar_13 -value "4" -command "update_active"
1641
        menusplit $w $w.config.f.x10.x.menu 4
1642
        global tmpvar_14
1643
        minimenu $w.config.f 6 11 "Set size (kbytes/set)" tmpvar_14 CONFIG_DCACHE_SZ1
1644
        menu $w.config.f.x11.x.menu -tearoffcommand "menutitle \"Set size (kbytes/set)\""
1645
        $w.config.f.x11.x.menu add radiobutton -label "1" -variable tmpvar_14 -value "1" -command "update_active"
1646
        $w.config.f.x11.x.menu add radiobutton -label "2" -variable tmpvar_14 -value "2" -command "update_active"
1647
        $w.config.f.x11.x.menu add radiobutton -label "4" -variable tmpvar_14 -value "4" -command "update_active"
1648
        $w.config.f.x11.x.menu add radiobutton -label "8" -variable tmpvar_14 -value "8" -command "update_active"
1649
        $w.config.f.x11.x.menu add radiobutton -label "16" -variable tmpvar_14 -value "16" -command "update_active"
1650
        $w.config.f.x11.x.menu add radiobutton -label "32" -variable tmpvar_14 -value "32" -command "update_active"
1651
        $w.config.f.x11.x.menu add radiobutton -label "64" -variable tmpvar_14 -value "64" -command "update_active"
1652
        $w.config.f.x11.x.menu add radiobutton -label "128" -variable tmpvar_14 -value "128" -command "update_active"
1653
        $w.config.f.x11.x.menu add radiobutton -label "256" -variable tmpvar_14 -value "256" -command "update_active"
1654
        menusplit $w $w.config.f.x11.x.menu 9
1655
        global tmpvar_15
1656
        minimenu $w.config.f 6 12 "Line size (bytes/line)" tmpvar_15 CONFIG_DCACHE_LZ16
1657
        menu $w.config.f.x12.x.menu -tearoffcommand "menutitle \"Line size (bytes/line)\""
1658
        $w.config.f.x12.x.menu add radiobutton -label "16" -variable tmpvar_15 -value "16" -command "update_active"
1659
        $w.config.f.x12.x.menu add radiobutton -label "32" -variable tmpvar_15 -value "32" -command "update_active"
1660
        menusplit $w $w.config.f.x12.x.menu 2
1661
        global tmpvar_16
1662
        minimenu $w.config.f 6 13 "Replacement alorithm" tmpvar_16 CONFIG_DCACHE_ALGORND
1663
        menu $w.config.f.x13.x.menu -tearoffcommand "menutitle \"Replacement alorithm\""
1664
        $w.config.f.x13.x.menu add radiobutton -label "Random" -variable tmpvar_16 -value "Random" -command "update_active"
1665
        $w.config.f.x13.x.menu add radiobutton -label "LRR" -variable tmpvar_16 -value "LRR" -command "update_active"
1666
        $w.config.f.x13.x.menu add radiobutton -label "LRU" -variable tmpvar_16 -value "LRU" -command "update_active"
1667
        menusplit $w $w.config.f.x13.x.menu 3
1668
        bool $w.config.f 6 14 "Cache locking      " CONFIG_DCACHE_LOCK
1669
        bool $w.config.f 6 15 "AHB snooping       " CONFIG_DCACHE_SNOOP
1670
        bool $w.config.f 6 16 "Fast snooping       " CONFIG_DCACHE_SNOOP_FAST
1671
        bool $w.config.f 6 17 "Separate snoop tags  " CONFIG_DCACHE_SNOOP_SEPTAG
1672
        hex $w.config.f 6 18 "Fixed cacheability map  " CONFIG_CACHE_FIXED
1673
        bool $w.config.f 6 19 "Enable local data RAM            " CONFIG_DCACHE_LRAM
1674
        global tmpvar_17
1675
        minimenu $w.config.f 6 20 "Local data RAM size (kbytes)" tmpvar_17 CONFIG_DCACHE_LRAM_SZ1
1676
        menu $w.config.f.x20.x.menu -tearoffcommand "menutitle \"Local data RAM size (kbytes)\""
1677
        $w.config.f.x20.x.menu add radiobutton -label "1" -variable tmpvar_17 -value "1" -command "update_active"
1678
        $w.config.f.x20.x.menu add radiobutton -label "2" -variable tmpvar_17 -value "2" -command "update_active"
1679
        $w.config.f.x20.x.menu add radiobutton -label "4" -variable tmpvar_17 -value "4" -command "update_active"
1680
        $w.config.f.x20.x.menu add radiobutton -label "8" -variable tmpvar_17 -value "8" -command "update_active"
1681
        $w.config.f.x20.x.menu add radiobutton -label "16" -variable tmpvar_17 -value "16" -command "update_active"
1682
        $w.config.f.x20.x.menu add radiobutton -label "32" -variable tmpvar_17 -value "32" -command "update_active"
1683
        $w.config.f.x20.x.menu add radiobutton -label "64" -variable tmpvar_17 -value "64" -command "update_active"
1684
        $w.config.f.x20.x.menu add radiobutton -label "128" -variable tmpvar_17 -value "128" -command "update_active"
1685
        $w.config.f.x20.x.menu add radiobutton -label "256" -variable tmpvar_17 -value "256" -command "update_active"
1686
        menusplit $w $w.config.f.x20.x.menu 9
1687
        hex $w.config.f 6 21 " Local data RAM start address (8 MSB) " CONFIG_DCACHE_LRSTART
1688
 
1689
 
1690
 
1691
        focus $w
1692
        update_active
1693
        global winx; global winy
1694
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
1695
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
1696
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1697
        update idletasks
1698
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1699
 
1700
        $w.config.canvas configure \
1701
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1702
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1703
                         [expr [winfo reqheight $w.config.f] + 1]"
1704
 
1705
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1706
        set scry [expr [winfo screenh $w] / 2]
1707
        set maxy [expr [winfo screenh $w] * 3 / 4]
1708
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1709
        if [expr $winy + $canvtotal < $maxy] {
1710
                $w.config.canvas configure -height $canvtotal
1711
        } else {
1712
                $w.config.canvas configure -height [expr $scry - $winy]
1713
                }
1714
        }
1715
        update idletasks
1716
        if {[winfo exists $w]} then {
1717
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1718
        wm minsize $w [winfo width $w] 100
1719
 
1720
        wm deiconify $w
1721
}
1722
}
1723
 
1724
proc update_menu6 {} {
1725
        global CONFIG_LEON3
1726
        global CONFIG_ICACHE_ENABLE
1727
        if {($CONFIG_LEON3 == 1)} then {
1728
        configure_entry .menu6.config.f.x0 normal {n l y}} else {configure_entry .menu6.config.f.x0 disabled {y n l}}
1729
        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}}
1730
        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}}
1731
        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}}
1732
        global CONFIG_ICACHE_ASSO1
1733
        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}}
1734
        global CONFIG_ICACHE_LOCK
1735
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {
1736
        configure_entry .menu6.config.f.x5 normal {n l y}} else {configure_entry .menu6.config.f.x5 disabled {y n l}}
1737
        global CONFIG_MMU_ENABLE
1738
        global CONFIG_ICACHE_LRAM
1739
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1740
        configure_entry .menu6.config.f.x6 normal {n l y}} else {configure_entry .menu6.config.f.x6 disabled {y n l}}
1741
        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}}
1742
        global CONFIG_ICACHE_LRSTART
1743
        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}
1744
        global CONFIG_DCACHE_ENABLE
1745
        if {($CONFIG_LEON3 == 1)} then {
1746
        configure_entry .menu6.config.f.x9 normal {n l y}} else {configure_entry .menu6.config.f.x9 disabled {y n l}}
1747
        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}}
1748
        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}}
1749
        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}}
1750
        global CONFIG_DCACHE_ASSO1
1751
        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}}
1752
        global CONFIG_DCACHE_LOCK
1753
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {
1754
        configure_entry .menu6.config.f.x14 normal {n l y}} else {configure_entry .menu6.config.f.x14 disabled {y n l}}
1755
        global CONFIG_DCACHE_SNOOP
1756
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
1757
        configure_entry .menu6.config.f.x15 normal {n l y}} else {configure_entry .menu6.config.f.x15 disabled {y n l}}
1758
        global CONFIG_DCACHE_SNOOP_FAST
1759
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1760
        configure_entry .menu6.config.f.x16 normal {n l y}} else {configure_entry .menu6.config.f.x16 disabled {y n l}}
1761
        global CONFIG_DCACHE_SNOOP_SEPTAG
1762
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1763
        configure_entry .menu6.config.f.x17 normal {n l y}} else {configure_entry .menu6.config.f.x17 disabled {y n l}}
1764
        global CONFIG_CACHE_FIXED
1765
        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}
1766
        global CONFIG_DCACHE_LRAM
1767
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1768
        configure_entry .menu6.config.f.x19 normal {n l y}} else {configure_entry .menu6.config.f.x19 disabled {y n l}}
1769
        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}}
1770
        global CONFIG_DCACHE_LRSTART
1771
        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}
1772
}
1773
 
1774
 
1775
proc update_define_menu6 {} {
1776
        update_define_mainmenu
1777
        global CONFIG_MODULES
1778
        global CONFIG_LEON3
1779
        global CONFIG_ICACHE_ENABLE
1780
        if {($CONFIG_LEON3 == 1)} then {
1781
        set CONFIG_ICACHE_ENABLE [expr $CONFIG_ICACHE_ENABLE&15]} else {set CONFIG_ICACHE_ENABLE [expr $CONFIG_ICACHE_ENABLE|16]}
1782
        global tmpvar_8
1783
        global CONFIG_ICACHE_ASSO1
1784
        if {$tmpvar_8 == "1"} then {set CONFIG_ICACHE_ASSO1 1} else {set CONFIG_ICACHE_ASSO1 0}
1785
        global CONFIG_ICACHE_ASSO2
1786
        if {$tmpvar_8 == "2"} then {set CONFIG_ICACHE_ASSO2 1} else {set CONFIG_ICACHE_ASSO2 0}
1787
        global CONFIG_ICACHE_ASSO3
1788
        if {$tmpvar_8 == "3"} then {set CONFIG_ICACHE_ASSO3 1} else {set CONFIG_ICACHE_ASSO3 0}
1789
        global CONFIG_ICACHE_ASSO4
1790
        if {$tmpvar_8 == "4"} then {set CONFIG_ICACHE_ASSO4 1} else {set CONFIG_ICACHE_ASSO4 0}
1791
        global tmpvar_9
1792
        global CONFIG_ICACHE_SZ1
1793
        if {$tmpvar_9 == "1"} then {set CONFIG_ICACHE_SZ1 1} else {set CONFIG_ICACHE_SZ1 0}
1794
        global CONFIG_ICACHE_SZ2
1795
        if {$tmpvar_9 == "2"} then {set CONFIG_ICACHE_SZ2 1} else {set CONFIG_ICACHE_SZ2 0}
1796
        global CONFIG_ICACHE_SZ4
1797
        if {$tmpvar_9 == "4"} then {set CONFIG_ICACHE_SZ4 1} else {set CONFIG_ICACHE_SZ4 0}
1798
        global CONFIG_ICACHE_SZ8
1799
        if {$tmpvar_9 == "8"} then {set CONFIG_ICACHE_SZ8 1} else {set CONFIG_ICACHE_SZ8 0}
1800
        global CONFIG_ICACHE_SZ16
1801
        if {$tmpvar_9 == "16"} then {set CONFIG_ICACHE_SZ16 1} else {set CONFIG_ICACHE_SZ16 0}
1802
        global CONFIG_ICACHE_SZ32
1803
        if {$tmpvar_9 == "32"} then {set CONFIG_ICACHE_SZ32 1} else {set CONFIG_ICACHE_SZ32 0}
1804
        global CONFIG_ICACHE_SZ64
1805
        if {$tmpvar_9 == "64"} then {set CONFIG_ICACHE_SZ64 1} else {set CONFIG_ICACHE_SZ64 0}
1806
        global CONFIG_ICACHE_SZ128
1807
        if {$tmpvar_9 == "128"} then {set CONFIG_ICACHE_SZ128 1} else {set CONFIG_ICACHE_SZ128 0}
1808
        global CONFIG_ICACHE_SZ256
1809
        if {$tmpvar_9 == "256"} then {set CONFIG_ICACHE_SZ256 1} else {set CONFIG_ICACHE_SZ256 0}
1810
        global tmpvar_10
1811
        global CONFIG_ICACHE_LZ16
1812
        if {$tmpvar_10 == "16"} then {set CONFIG_ICACHE_LZ16 1} else {set CONFIG_ICACHE_LZ16 0}
1813
        global CONFIG_ICACHE_LZ32
1814
        if {$tmpvar_10 == "32"} then {set CONFIG_ICACHE_LZ32 1} else {set CONFIG_ICACHE_LZ32 0}
1815
        global tmpvar_11
1816
        global CONFIG_ICACHE_ALGORND
1817
        if {$tmpvar_11 == "Random"} then {set CONFIG_ICACHE_ALGORND 1} else {set CONFIG_ICACHE_ALGORND 0}
1818
        global CONFIG_ICACHE_ALGOLRR
1819
        if {$tmpvar_11 == "LRR"} then {set CONFIG_ICACHE_ALGOLRR 1} else {set CONFIG_ICACHE_ALGOLRR 0}
1820
        global CONFIG_ICACHE_ALGOLRU
1821
        if {$tmpvar_11 == "LRU"} then {set CONFIG_ICACHE_ALGOLRU 1} else {set CONFIG_ICACHE_ALGOLRU 0}
1822
        global CONFIG_ICACHE_LOCK
1823
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {
1824
        set CONFIG_ICACHE_LOCK [expr $CONFIG_ICACHE_LOCK&15]} else {set CONFIG_ICACHE_LOCK [expr $CONFIG_ICACHE_LOCK|16]}
1825
        global CONFIG_MMU_ENABLE
1826
        global CONFIG_ICACHE_LRAM
1827
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1828
        set CONFIG_ICACHE_LRAM [expr $CONFIG_ICACHE_LRAM&15]} else {set CONFIG_ICACHE_LRAM [expr $CONFIG_ICACHE_LRAM|16]}
1829
        global tmpvar_12
1830
        global CONFIG_ICACHE_LRAM_SZ1
1831
        if {$tmpvar_12 == "1"} then {set CONFIG_ICACHE_LRAM_SZ1 1} else {set CONFIG_ICACHE_LRAM_SZ1 0}
1832
        global CONFIG_ICACHE_LRAM_SZ2
1833
        if {$tmpvar_12 == "2"} then {set CONFIG_ICACHE_LRAM_SZ2 1} else {set CONFIG_ICACHE_LRAM_SZ2 0}
1834
        global CONFIG_ICACHE_LRAM_SZ4
1835
        if {$tmpvar_12 == "4"} then {set CONFIG_ICACHE_LRAM_SZ4 1} else {set CONFIG_ICACHE_LRAM_SZ4 0}
1836
        global CONFIG_ICACHE_LRAM_SZ8
1837
        if {$tmpvar_12 == "8"} then {set CONFIG_ICACHE_LRAM_SZ8 1} else {set CONFIG_ICACHE_LRAM_SZ8 0}
1838
        global CONFIG_ICACHE_LRAM_SZ16
1839
        if {$tmpvar_12 == "16"} then {set CONFIG_ICACHE_LRAM_SZ16 1} else {set CONFIG_ICACHE_LRAM_SZ16 0}
1840
        global CONFIG_ICACHE_LRAM_SZ32
1841
        if {$tmpvar_12 == "32"} then {set CONFIG_ICACHE_LRAM_SZ32 1} else {set CONFIG_ICACHE_LRAM_SZ32 0}
1842
        global CONFIG_ICACHE_LRAM_SZ64
1843
        if {$tmpvar_12 == "64"} then {set CONFIG_ICACHE_LRAM_SZ64 1} else {set CONFIG_ICACHE_LRAM_SZ64 0}
1844
        global CONFIG_ICACHE_LRAM_SZ128
1845
        if {$tmpvar_12 == "128"} then {set CONFIG_ICACHE_LRAM_SZ128 1} else {set CONFIG_ICACHE_LRAM_SZ128 0}
1846
        global CONFIG_ICACHE_LRAM_SZ256
1847
        if {$tmpvar_12 == "256"} then {set CONFIG_ICACHE_LRAM_SZ256 1} else {set CONFIG_ICACHE_LRAM_SZ256 0}
1848
        global CONFIG_ICACHE_LRSTART
1849
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {validate_hex CONFIG_ICACHE_LRSTART "$CONFIG_ICACHE_LRSTART" 8e}
1850
        global CONFIG_DCACHE_ENABLE
1851
        if {($CONFIG_LEON3 == 1)} then {
1852
        set CONFIG_DCACHE_ENABLE [expr $CONFIG_DCACHE_ENABLE&15]} else {set CONFIG_DCACHE_ENABLE [expr $CONFIG_DCACHE_ENABLE|16]}
1853
        global tmpvar_13
1854
        global CONFIG_DCACHE_ASSO1
1855
        if {$tmpvar_13 == "1"} then {set CONFIG_DCACHE_ASSO1 1} else {set CONFIG_DCACHE_ASSO1 0}
1856
        global CONFIG_DCACHE_ASSO2
1857
        if {$tmpvar_13 == "2"} then {set CONFIG_DCACHE_ASSO2 1} else {set CONFIG_DCACHE_ASSO2 0}
1858
        global CONFIG_DCACHE_ASSO3
1859
        if {$tmpvar_13 == "3"} then {set CONFIG_DCACHE_ASSO3 1} else {set CONFIG_DCACHE_ASSO3 0}
1860
        global CONFIG_DCACHE_ASSO4
1861
        if {$tmpvar_13 == "4"} then {set CONFIG_DCACHE_ASSO4 1} else {set CONFIG_DCACHE_ASSO4 0}
1862
        global tmpvar_14
1863
        global CONFIG_DCACHE_SZ1
1864
        if {$tmpvar_14 == "1"} then {set CONFIG_DCACHE_SZ1 1} else {set CONFIG_DCACHE_SZ1 0}
1865
        global CONFIG_DCACHE_SZ2
1866
        if {$tmpvar_14 == "2"} then {set CONFIG_DCACHE_SZ2 1} else {set CONFIG_DCACHE_SZ2 0}
1867
        global CONFIG_DCACHE_SZ4
1868
        if {$tmpvar_14 == "4"} then {set CONFIG_DCACHE_SZ4 1} else {set CONFIG_DCACHE_SZ4 0}
1869
        global CONFIG_DCACHE_SZ8
1870
        if {$tmpvar_14 == "8"} then {set CONFIG_DCACHE_SZ8 1} else {set CONFIG_DCACHE_SZ8 0}
1871
        global CONFIG_DCACHE_SZ16
1872
        if {$tmpvar_14 == "16"} then {set CONFIG_DCACHE_SZ16 1} else {set CONFIG_DCACHE_SZ16 0}
1873
        global CONFIG_DCACHE_SZ32
1874
        if {$tmpvar_14 == "32"} then {set CONFIG_DCACHE_SZ32 1} else {set CONFIG_DCACHE_SZ32 0}
1875
        global CONFIG_DCACHE_SZ64
1876
        if {$tmpvar_14 == "64"} then {set CONFIG_DCACHE_SZ64 1} else {set CONFIG_DCACHE_SZ64 0}
1877
        global CONFIG_DCACHE_SZ128
1878
        if {$tmpvar_14 == "128"} then {set CONFIG_DCACHE_SZ128 1} else {set CONFIG_DCACHE_SZ128 0}
1879
        global CONFIG_DCACHE_SZ256
1880
        if {$tmpvar_14 == "256"} then {set CONFIG_DCACHE_SZ256 1} else {set CONFIG_DCACHE_SZ256 0}
1881
        global tmpvar_15
1882
        global CONFIG_DCACHE_LZ16
1883
        if {$tmpvar_15 == "16"} then {set CONFIG_DCACHE_LZ16 1} else {set CONFIG_DCACHE_LZ16 0}
1884
        global CONFIG_DCACHE_LZ32
1885
        if {$tmpvar_15 == "32"} then {set CONFIG_DCACHE_LZ32 1} else {set CONFIG_DCACHE_LZ32 0}
1886
        global tmpvar_16
1887
        global CONFIG_DCACHE_ALGORND
1888
        if {$tmpvar_16 == "Random"} then {set CONFIG_DCACHE_ALGORND 1} else {set CONFIG_DCACHE_ALGORND 0}
1889
        global CONFIG_DCACHE_ALGOLRR
1890
        if {$tmpvar_16 == "LRR"} then {set CONFIG_DCACHE_ALGOLRR 1} else {set CONFIG_DCACHE_ALGOLRR 0}
1891
        global CONFIG_DCACHE_ALGOLRU
1892
        if {$tmpvar_16 == "LRU"} then {set CONFIG_DCACHE_ALGOLRU 1} else {set CONFIG_DCACHE_ALGOLRU 0}
1893
        global CONFIG_DCACHE_LOCK
1894
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {
1895
        set CONFIG_DCACHE_LOCK [expr $CONFIG_DCACHE_LOCK&15]} else {set CONFIG_DCACHE_LOCK [expr $CONFIG_DCACHE_LOCK|16]}
1896
        global CONFIG_DCACHE_SNOOP
1897
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
1898
        set CONFIG_DCACHE_SNOOP [expr $CONFIG_DCACHE_SNOOP&15]} else {set CONFIG_DCACHE_SNOOP [expr $CONFIG_DCACHE_SNOOP|16]}
1899
        global CONFIG_DCACHE_SNOOP_FAST
1900
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1901
        set CONFIG_DCACHE_SNOOP_FAST [expr $CONFIG_DCACHE_SNOOP_FAST&15]} else {set CONFIG_DCACHE_SNOOP_FAST [expr $CONFIG_DCACHE_SNOOP_FAST|16]}
1902
        global CONFIG_DCACHE_SNOOP_SEPTAG
1903
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1904
        set CONFIG_DCACHE_SNOOP_SEPTAG [expr $CONFIG_DCACHE_SNOOP_SEPTAG&15]} else {set CONFIG_DCACHE_SNOOP_SEPTAG [expr $CONFIG_DCACHE_SNOOP_SEPTAG|16]}
1905
        global CONFIG_CACHE_FIXED
1906
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1 || $CONFIG_DCACHE_ENABLE == 1)} then {validate_hex CONFIG_CACHE_FIXED "$CONFIG_CACHE_FIXED" 0}
1907
        global CONFIG_DCACHE_LRAM
1908
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1909
        set CONFIG_DCACHE_LRAM [expr $CONFIG_DCACHE_LRAM&15]} else {set CONFIG_DCACHE_LRAM [expr $CONFIG_DCACHE_LRAM|16]}
1910
        global tmpvar_17
1911
        global CONFIG_DCACHE_LRAM_SZ1
1912
        if {$tmpvar_17 == "1"} then {set CONFIG_DCACHE_LRAM_SZ1 1} else {set CONFIG_DCACHE_LRAM_SZ1 0}
1913
        global CONFIG_DCACHE_LRAM_SZ2
1914
        if {$tmpvar_17 == "2"} then {set CONFIG_DCACHE_LRAM_SZ2 1} else {set CONFIG_DCACHE_LRAM_SZ2 0}
1915
        global CONFIG_DCACHE_LRAM_SZ4
1916
        if {$tmpvar_17 == "4"} then {set CONFIG_DCACHE_LRAM_SZ4 1} else {set CONFIG_DCACHE_LRAM_SZ4 0}
1917
        global CONFIG_DCACHE_LRAM_SZ8
1918
        if {$tmpvar_17 == "8"} then {set CONFIG_DCACHE_LRAM_SZ8 1} else {set CONFIG_DCACHE_LRAM_SZ8 0}
1919
        global CONFIG_DCACHE_LRAM_SZ16
1920
        if {$tmpvar_17 == "16"} then {set CONFIG_DCACHE_LRAM_SZ16 1} else {set CONFIG_DCACHE_LRAM_SZ16 0}
1921
        global CONFIG_DCACHE_LRAM_SZ32
1922
        if {$tmpvar_17 == "32"} then {set CONFIG_DCACHE_LRAM_SZ32 1} else {set CONFIG_DCACHE_LRAM_SZ32 0}
1923
        global CONFIG_DCACHE_LRAM_SZ64
1924
        if {$tmpvar_17 == "64"} then {set CONFIG_DCACHE_LRAM_SZ64 1} else {set CONFIG_DCACHE_LRAM_SZ64 0}
1925
        global CONFIG_DCACHE_LRAM_SZ128
1926
        if {$tmpvar_17 == "128"} then {set CONFIG_DCACHE_LRAM_SZ128 1} else {set CONFIG_DCACHE_LRAM_SZ128 0}
1927
        global CONFIG_DCACHE_LRAM_SZ256
1928
        if {$tmpvar_17 == "256"} then {set CONFIG_DCACHE_LRAM_SZ256 1} else {set CONFIG_DCACHE_LRAM_SZ256 0}
1929
        global CONFIG_DCACHE_LRSTART
1930
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {validate_hex CONFIG_DCACHE_LRSTART "$CONFIG_DCACHE_LRSTART" 8f}
1931
}
1932
 
1933
 
1934
proc menu7 {w title} {
1935
        set oldFocus [focus]
1936
        catch {focus .menu3}
1937
        catch {destroy $w; unregister_active 7}
1938
        toplevel $w -class Dialog
1939
        wm withdraw $w
1940
        global active_menus
1941
        set active_menus [lsort -integer [linsert $active_menus end 7]]
1942
        message $w.m -width 400 -aspect 300 -text \
1943
                "MMU"  -relief raised
1944
        pack $w.m -pady 10 -side top -padx 10
1945
        wm title $w "MMU"
1946
 
1947
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 7; break"
1948
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu8 .menu8 \"$title\""
1949
        frame $w.f
1950
        button $w.f.back -text "OK" \
1951
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 7"
1952
        button $w.f.next -text "Next" -underline 0\
1953
                -width 15 -command $nextscript
1954
        bind all  $nextscript
1955
        button $w.f.prev -text "Prev" -underline 0\
1956
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu6 .menu6 \"$title\""
1957
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu6 .menu6 \"$title\";break"
1958
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1959
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1960
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1961
        pack $w.topline -side top -fill x
1962
 
1963
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1964
        pack $w.botline -side bottom -fill x
1965
 
1966
        frame $w.config
1967
        pack $w.config -fill y -expand on
1968
 
1969
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1970
        pack $w.config.vscroll -side right -fill y
1971
 
1972
        canvas $w.config.canvas -height 1\
1973
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1974
                -width [expr [winfo screenwidth .] * 1 / 2]
1975
        frame $w.config.f
1976
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1977
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1978
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1979
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1980
        bind $w  "$w.config.canvas yview moveto 0;break;"
1981
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1982
        pack $w.config.canvas -side right -fill y
1983
 
1984
 
1985
        bool $w.config.f 7 0 "Enable MMU       " CONFIG_MMU_ENABLE
1986
        global tmpvar_18
1987
        minimenu $w.config.f 7 1 "MMU type              " tmpvar_18 CONFIG_MMU_COMBINED
1988
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"MMU type              \""
1989
        $w.config.f.x1.x.menu add radiobutton -label "combined" -variable tmpvar_18 -value "combined" -command "update_active"
1990
        $w.config.f.x1.x.menu add radiobutton -label "split" -variable tmpvar_18 -value "split" -command "update_active"
1991
        menusplit $w $w.config.f.x1.x.menu 2
1992
        global tmpvar_19
1993
        minimenu $w.config.f 7 2 "TLB replacement sheme              " tmpvar_19 CONFIG_MMU_REPARRAY
1994
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"TLB replacement sheme              \""
1995
        $w.config.f.x2.x.menu add radiobutton -label "LRU" -variable tmpvar_19 -value "LRU" -command "update_active"
1996
        $w.config.f.x2.x.menu add radiobutton -label "Increment" -variable tmpvar_19 -value "Increment" -command "update_active"
1997
        menusplit $w $w.config.f.x2.x.menu 2
1998
        global tmpvar_20
1999
        minimenu $w.config.f 7 3 "Instruction (or combined) TLB entries" tmpvar_20 CONFIG_MMU_I2
2000
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"Instruction (or combined) TLB entries\""
2001
        $w.config.f.x3.x.menu add radiobutton -label "2" -variable tmpvar_20 -value "2" -command "update_active"
2002
        $w.config.f.x3.x.menu add radiobutton -label "4" -variable tmpvar_20 -value "4" -command "update_active"
2003
        $w.config.f.x3.x.menu add radiobutton -label "8" -variable tmpvar_20 -value "8" -command "update_active"
2004
        $w.config.f.x3.x.menu add radiobutton -label "16" -variable tmpvar_20 -value "16" -command "update_active"
2005
        $w.config.f.x3.x.menu add radiobutton -label "32" -variable tmpvar_20 -value "32" -command "update_active"
2006
        menusplit $w $w.config.f.x3.x.menu 5
2007
        global tmpvar_21
2008
        minimenu $w.config.f 7 4 "Data TLB entries" tmpvar_21 CONFIG_MMU_D2
2009
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"Data TLB entries\""
2010
        $w.config.f.x4.x.menu add radiobutton -label "2" -variable tmpvar_21 -value "2" -command "update_active"
2011
        $w.config.f.x4.x.menu add radiobutton -label "4" -variable tmpvar_21 -value "4" -command "update_active"
2012
        $w.config.f.x4.x.menu add radiobutton -label "8" -variable tmpvar_21 -value "8" -command "update_active"
2013
        $w.config.f.x4.x.menu add radiobutton -label "16" -variable tmpvar_21 -value "16" -command "update_active"
2014
        $w.config.f.x4.x.menu add radiobutton -label "32" -variable tmpvar_21 -value "32" -command "update_active"
2015
        menusplit $w $w.config.f.x4.x.menu 5
2016
 
2017
 
2018
 
2019
        focus $w
2020
        update_active
2021
        global winx; global winy
2022
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
2023
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
2024
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2025
        update idletasks
2026
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2027
 
2028
        $w.config.canvas configure \
2029
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2030
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2031
                         [expr [winfo reqheight $w.config.f] + 1]"
2032
 
2033
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2034
        set scry [expr [winfo screenh $w] / 2]
2035
        set maxy [expr [winfo screenh $w] * 3 / 4]
2036
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2037
        if [expr $winy + $canvtotal < $maxy] {
2038
                $w.config.canvas configure -height $canvtotal
2039
        } else {
2040
                $w.config.canvas configure -height [expr $scry - $winy]
2041
                }
2042
        }
2043
        update idletasks
2044
        if {[winfo exists $w]} then {
2045
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2046
        wm minsize $w [winfo width $w] 100
2047
 
2048
        wm deiconify $w
2049
}
2050
}
2051
 
2052
proc update_menu7 {} {
2053
        global CONFIG_LEON3
2054
        global CONFIG_MMU_ENABLE
2055
        if {($CONFIG_LEON3 == 1)} then {
2056
        configure_entry .menu7.config.f.x0 normal {n l y}} else {configure_entry .menu7.config.f.x0 disabled {y n l}}
2057
        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}}
2058
        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}}
2059
        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}}
2060
        global CONFIG_MMU_SPLIT
2061
        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}}
2062
}
2063
 
2064
 
2065
proc update_define_menu7 {} {
2066
        update_define_mainmenu
2067
        global CONFIG_MODULES
2068
        global CONFIG_LEON3
2069
        global CONFIG_MMU_ENABLE
2070
        if {($CONFIG_LEON3 == 1)} then {
2071
        set CONFIG_MMU_ENABLE [expr $CONFIG_MMU_ENABLE&15]} else {set CONFIG_MMU_ENABLE [expr $CONFIG_MMU_ENABLE|16]}
2072
        global tmpvar_18
2073
        global CONFIG_MMU_COMBINED
2074
        if {$tmpvar_18 == "combined"} then {set CONFIG_MMU_COMBINED 1} else {set CONFIG_MMU_COMBINED 0}
2075
        global CONFIG_MMU_SPLIT
2076
        if {$tmpvar_18 == "split"} then {set CONFIG_MMU_SPLIT 1} else {set CONFIG_MMU_SPLIT 0}
2077
        global tmpvar_19
2078
        global CONFIG_MMU_REPARRAY
2079
        if {$tmpvar_19 == "LRU"} then {set CONFIG_MMU_REPARRAY 1} else {set CONFIG_MMU_REPARRAY 0}
2080
        global CONFIG_MMU_REPINCREMENT
2081
        if {$tmpvar_19 == "Increment"} then {set CONFIG_MMU_REPINCREMENT 1} else {set CONFIG_MMU_REPINCREMENT 0}
2082
        global tmpvar_20
2083
        global CONFIG_MMU_I2
2084
        if {$tmpvar_20 == "2"} then {set CONFIG_MMU_I2 1} else {set CONFIG_MMU_I2 0}
2085
        global CONFIG_MMU_I4
2086
        if {$tmpvar_20 == "4"} then {set CONFIG_MMU_I4 1} else {set CONFIG_MMU_I4 0}
2087
        global CONFIG_MMU_I8
2088
        if {$tmpvar_20 == "8"} then {set CONFIG_MMU_I8 1} else {set CONFIG_MMU_I8 0}
2089
        global CONFIG_MMU_I16
2090
        if {$tmpvar_20 == "16"} then {set CONFIG_MMU_I16 1} else {set CONFIG_MMU_I16 0}
2091
        global CONFIG_MMU_I32
2092
        if {$tmpvar_20 == "32"} then {set CONFIG_MMU_I32 1} else {set CONFIG_MMU_I32 0}
2093
        global tmpvar_21
2094
        global CONFIG_MMU_D2
2095
        if {$tmpvar_21 == "2"} then {set CONFIG_MMU_D2 1} else {set CONFIG_MMU_D2 0}
2096
        global CONFIG_MMU_D4
2097
        if {$tmpvar_21 == "4"} then {set CONFIG_MMU_D4 1} else {set CONFIG_MMU_D4 0}
2098
        global CONFIG_MMU_D8
2099
        if {$tmpvar_21 == "8"} then {set CONFIG_MMU_D8 1} else {set CONFIG_MMU_D8 0}
2100
        global CONFIG_MMU_D16
2101
        if {$tmpvar_21 == "16"} then {set CONFIG_MMU_D16 1} else {set CONFIG_MMU_D16 0}
2102
        global CONFIG_MMU_D32
2103
        if {$tmpvar_21 == "32"} then {set CONFIG_MMU_D32 1} else {set CONFIG_MMU_D32 0}
2104
}
2105
 
2106
 
2107
proc menu8 {w title} {
2108
        set oldFocus [focus]
2109
        catch {focus .menu3}
2110
        catch {destroy $w; unregister_active 8}
2111
        toplevel $w -class Dialog
2112
        wm withdraw $w
2113
        global active_menus
2114
        set active_menus [lsort -integer [linsert $active_menus end 8]]
2115
        message $w.m -width 400 -aspect 300 -text \
2116
                "Debug Support Unit        "  -relief raised
2117
        pack $w.m -pady 10 -side top -padx 10
2118
        wm title $w "Debug Support Unit        "
2119
 
2120
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 8; break"
2121
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 8; menu9 .menu9 \"$title\""
2122
        frame $w.f
2123
        button $w.f.back -text "OK" \
2124
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 8"
2125
        button $w.f.next -text "Next" -underline 0\
2126
                -width 15 -command $nextscript
2127
        bind all  $nextscript
2128
        button $w.f.prev -text "Prev" -underline 0\
2129
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 8; menu7 .menu7 \"$title\""
2130
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 8; menu7 .menu7 \"$title\";break"
2131
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2132
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2133
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2134
        pack $w.topline -side top -fill x
2135
 
2136
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2137
        pack $w.botline -side bottom -fill x
2138
 
2139
        frame $w.config
2140
        pack $w.config -fill y -expand on
2141
 
2142
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2143
        pack $w.config.vscroll -side right -fill y
2144
 
2145
        canvas $w.config.canvas -height 1\
2146
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2147
                -width [expr [winfo screenwidth .] * 1 / 2]
2148
        frame $w.config.f
2149
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2150
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2151
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2152
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2153
        bind $w  "$w.config.canvas yview moveto 0;break;"
2154
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2155
        pack $w.config.canvas -side right -fill y
2156
 
2157
 
2158
        bool $w.config.f 8 0 "Enable LEON3 Debug support unit    " CONFIG_DSU_ENABLE
2159
        bool $w.config.f 8 1 "Instruction trace buffer" CONFIG_DSU_ITRACE
2160
        global tmpvar_22
2161
        minimenu $w.config.f 8 2 "Instruction trace buffer size (kbytes)" tmpvar_22 CONFIG_DSU_ITRACESZ1
2162
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"Instruction trace buffer size (kbytes)\""
2163
        $w.config.f.x2.x.menu add radiobutton -label "1" -variable tmpvar_22 -value "1" -command "update_active"
2164
        $w.config.f.x2.x.menu add radiobutton -label "2" -variable tmpvar_22 -value "2" -command "update_active"
2165
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_22 -value "4" -command "update_active"
2166
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_22 -value "8" -command "update_active"
2167
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_22 -value "16" -command "update_active"
2168
        menusplit $w $w.config.f.x2.x.menu 5
2169
        bool $w.config.f 8 3 "AHB trace buffer" CONFIG_DSU_ATRACE
2170
        global tmpvar_23
2171
        minimenu $w.config.f 8 4 "AHB trace buffer size (kbytes)" tmpvar_23 CONFIG_DSU_ATRACESZ1
2172
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"AHB trace buffer size (kbytes)\""
2173
        $w.config.f.x4.x.menu add radiobutton -label "1" -variable tmpvar_23 -value "1" -command "update_active"
2174
        $w.config.f.x4.x.menu add radiobutton -label "2" -variable tmpvar_23 -value "2" -command "update_active"
2175
        $w.config.f.x4.x.menu add radiobutton -label "4" -variable tmpvar_23 -value "4" -command "update_active"
2176
        $w.config.f.x4.x.menu add radiobutton -label "8" -variable tmpvar_23 -value "8" -command "update_active"
2177
        $w.config.f.x4.x.menu add radiobutton -label "16" -variable tmpvar_23 -value "16" -command "update_active"
2178
        menusplit $w $w.config.f.x4.x.menu 5
2179
 
2180
 
2181
 
2182
        focus $w
2183
        update_active
2184
        global winx; global winy
2185
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
2186
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
2187
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2188
        update idletasks
2189
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2190
 
2191
        $w.config.canvas configure \
2192
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2193
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2194
                         [expr [winfo reqheight $w.config.f] + 1]"
2195
 
2196
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2197
        set scry [expr [winfo screenh $w] / 2]
2198
        set maxy [expr [winfo screenh $w] * 3 / 4]
2199
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2200
        if [expr $winy + $canvtotal < $maxy] {
2201
                $w.config.canvas configure -height $canvtotal
2202
        } else {
2203
                $w.config.canvas configure -height [expr $scry - $winy]
2204
                }
2205
        }
2206
        update idletasks
2207
        if {[winfo exists $w]} then {
2208
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2209
        wm minsize $w [winfo width $w] 100
2210
 
2211
        wm deiconify $w
2212
}
2213
}
2214
 
2215
proc update_menu8 {} {
2216
        global CONFIG_LEON3
2217
        global CONFIG_DSU_ENABLE
2218
        if {($CONFIG_LEON3 == 1)} then {
2219
        configure_entry .menu8.config.f.x0 normal {n l y}} else {configure_entry .menu8.config.f.x0 disabled {y n l}}
2220
        global CONFIG_DSU_ITRACE
2221
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
2222
        configure_entry .menu8.config.f.x1 normal {n l y}} else {configure_entry .menu8.config.f.x1 disabled {y n l}}
2223
        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}}
2224
        global CONFIG_DSU_ATRACE
2225
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
2226
        configure_entry .menu8.config.f.x3 normal {n l y}} else {configure_entry .menu8.config.f.x3 disabled {y n l}}
2227
        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}}
2228
}
2229
 
2230
 
2231
proc update_define_menu8 {} {
2232
        update_define_mainmenu
2233
        global CONFIG_MODULES
2234
        global CONFIG_LEON3
2235
        global CONFIG_DSU_ENABLE
2236
        if {($CONFIG_LEON3 == 1)} then {
2237
        set CONFIG_DSU_ENABLE [expr $CONFIG_DSU_ENABLE&15]} else {set CONFIG_DSU_ENABLE [expr $CONFIG_DSU_ENABLE|16]}
2238
        global CONFIG_DSU_ITRACE
2239
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
2240
        set CONFIG_DSU_ITRACE [expr $CONFIG_DSU_ITRACE&15]} else {set CONFIG_DSU_ITRACE [expr $CONFIG_DSU_ITRACE|16]}
2241
        global tmpvar_22
2242
        global CONFIG_DSU_ITRACESZ1
2243
        if {$tmpvar_22 == "1"} then {set CONFIG_DSU_ITRACESZ1 1} else {set CONFIG_DSU_ITRACESZ1 0}
2244
        global CONFIG_DSU_ITRACESZ2
2245
        if {$tmpvar_22 == "2"} then {set CONFIG_DSU_ITRACESZ2 1} else {set CONFIG_DSU_ITRACESZ2 0}
2246
        global CONFIG_DSU_ITRACESZ4
2247
        if {$tmpvar_22 == "4"} then {set CONFIG_DSU_ITRACESZ4 1} else {set CONFIG_DSU_ITRACESZ4 0}
2248
        global CONFIG_DSU_ITRACESZ8
2249
        if {$tmpvar_22 == "8"} then {set CONFIG_DSU_ITRACESZ8 1} else {set CONFIG_DSU_ITRACESZ8 0}
2250
        global CONFIG_DSU_ITRACESZ16
2251
        if {$tmpvar_22 == "16"} then {set CONFIG_DSU_ITRACESZ16 1} else {set CONFIG_DSU_ITRACESZ16 0}
2252
        global CONFIG_DSU_ATRACE
2253
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
2254
        set CONFIG_DSU_ATRACE [expr $CONFIG_DSU_ATRACE&15]} else {set CONFIG_DSU_ATRACE [expr $CONFIG_DSU_ATRACE|16]}
2255
        global tmpvar_23
2256
        global CONFIG_DSU_ATRACESZ1
2257
        if {$tmpvar_23 == "1"} then {set CONFIG_DSU_ATRACESZ1 1} else {set CONFIG_DSU_ATRACESZ1 0}
2258
        global CONFIG_DSU_ATRACESZ2
2259
        if {$tmpvar_23 == "2"} then {set CONFIG_DSU_ATRACESZ2 1} else {set CONFIG_DSU_ATRACESZ2 0}
2260
        global CONFIG_DSU_ATRACESZ4
2261
        if {$tmpvar_23 == "4"} then {set CONFIG_DSU_ATRACESZ4 1} else {set CONFIG_DSU_ATRACESZ4 0}
2262
        global CONFIG_DSU_ATRACESZ8
2263
        if {$tmpvar_23 == "8"} then {set CONFIG_DSU_ATRACESZ8 1} else {set CONFIG_DSU_ATRACESZ8 0}
2264
        global CONFIG_DSU_ATRACESZ16
2265
        if {$tmpvar_23 == "16"} then {set CONFIG_DSU_ATRACESZ16 1} else {set CONFIG_DSU_ATRACESZ16 0}
2266
}
2267
 
2268
 
2269
proc menu9 {w title} {
2270
        set oldFocus [focus]
2271
        catch {focus .menu3}
2272
        catch {destroy $w; unregister_active 9}
2273
        toplevel $w -class Dialog
2274
        wm withdraw $w
2275
        global active_menus
2276
        set active_menus [lsort -integer [linsert $active_menus end 9]]
2277
        message $w.m -width 400 -aspect 300 -text \
2278
                "Fault-tolerance  "  -relief raised
2279
        pack $w.m -pady 10 -side top -padx 10
2280
        wm title $w "Fault-tolerance  "
2281
 
2282
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 9; break"
2283
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 9; menu10 .menu10 \"$title\""
2284
        frame $w.f
2285
        button $w.f.back -text "OK" \
2286
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 9"
2287
        button $w.f.next -text "Next" -underline 0\
2288
                -width 15 -command $nextscript
2289
        bind all  $nextscript
2290
        button $w.f.prev -text "Prev" -underline 0\
2291
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 9; menu8 .menu8 \"$title\""
2292
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 9; menu8 .menu8 \"$title\";break"
2293
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2294
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2295
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2296
        pack $w.topline -side top -fill x
2297
 
2298
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2299
        pack $w.botline -side bottom -fill x
2300
 
2301
        frame $w.config
2302
        pack $w.config -fill y -expand on
2303
 
2304
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2305
        pack $w.config.vscroll -side right -fill y
2306
 
2307
        canvas $w.config.canvas -height 1\
2308
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2309
                -width [expr [winfo screenwidth .] * 1 / 2]
2310
        frame $w.config.f
2311
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2312
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2313
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2314
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2315
        bind $w  "$w.config.canvas yview moveto 0;break;"
2316
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2317
        pack $w.config.canvas -side right -fill y
2318
 
2319
 
2320
        bool $w.config.f 9 0 "Use LEON3-FT processor core      " CONFIG_LEON3FT_EN
2321
        global tmpvar_24
2322
        minimenu $w.config.f 9 1 "IU Register file protection     " tmpvar_24 CONFIG_IUFT_NONE
2323
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"IU Register file protection     \""
2324
        $w.config.f.x1.x.menu add radiobutton -label "None" -variable tmpvar_24 -value "None" -command "update_active"
2325
        $w.config.f.x1.x.menu add radiobutton -label "Parity" -variable tmpvar_24 -value "Parity" -command "update_active"
2326
        $w.config.f.x1.x.menu add radiobutton -label "PDMR" -variable tmpvar_24 -value "PDMR" -command "update_active"
2327
        $w.config.f.x1.x.menu add radiobutton -label "BCH" -variable tmpvar_24 -value "BCH" -command "update_active"
2328
        $w.config.f.x1.x.menu add radiobutton -label "TMR" -variable tmpvar_24 -value "TMR" -command "update_active"
2329
        menusplit $w $w.config.f.x1.x.menu 5
2330
        bool $w.config.f 9 2 "FPU Register file protection   " CONFIG_FPUFT_EN
2331
        bool $w.config.f 9 3 "Register file error injection" CONFIG_RF_ERRINJ
2332
        bool $w.config.f 9 4 "Cache memory protection        " CONFIG_CACHE_FT_EN
2333
        int $w.config.f 9 5 "Cache memory error injection" CONFIG_CACHE_ERRINJ
2334
        bool $w.config.f 9 6 "Use LEON3FT netlist         " CONFIG_LEON3_NETLIST
2335
 
2336
 
2337
 
2338
        focus $w
2339
        update_active
2340
        global winx; global winy
2341
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
2342
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
2343
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2344
        update idletasks
2345
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2346
 
2347
        $w.config.canvas configure \
2348
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2349
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2350
                         [expr [winfo reqheight $w.config.f] + 1]"
2351
 
2352
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2353
        set scry [expr [winfo screenh $w] / 2]
2354
        set maxy [expr [winfo screenh $w] * 3 / 4]
2355
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2356
        if [expr $winy + $canvtotal < $maxy] {
2357
                $w.config.canvas configure -height $canvtotal
2358
        } else {
2359
                $w.config.canvas configure -height [expr $scry - $winy]
2360
                }
2361
        }
2362
        update idletasks
2363
        if {[winfo exists $w]} then {
2364
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2365
        wm minsize $w [winfo width $w] 100
2366
 
2367
        wm deiconify $w
2368
}
2369
}
2370
 
2371
proc update_menu9 {} {
2372
        global CONFIG_LEON3
2373
        global CONFIG_LEON3FT_PRESENT
2374
        global CONFIG_LEON3FT_EN
2375
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1)} then {
2376
        configure_entry .menu9.config.f.x0 normal {n l y}} else {configure_entry .menu9.config.f.x0 disabled {y n l}}
2377
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {configure_entry .menu9.config.f.x1 normal {x l}} else {configure_entry .menu9.config.f.x1 disabled {x l}}
2378
        global CONFIG_FPU_ENABLE
2379
        global CONFIG_FPUFT_EN
2380
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
2381
        configure_entry .menu9.config.f.x2 normal {n l y}} else {configure_entry .menu9.config.f.x2 disabled {y n l}}
2382
        global CONFIG_RF_ERRINJ
2383
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {
2384
        configure_entry .menu9.config.f.x3 normal {n l y}} else {configure_entry .menu9.config.f.x3 disabled {y n l}}
2385
        global CONFIG_CACHE_FT_EN
2386
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {
2387
        configure_entry .menu9.config.f.x4 normal {n l y}} else {configure_entry .menu9.config.f.x4 disabled {y n l}}
2388
        global CONFIG_CACHE_ERRINJ
2389
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {.menu9.config.f.x5.x configure -state normal -foreground [ cget .ref -foreground ]; .menu9.config.f.x5.l configure -state normal; } else {.menu9.config.f.x5.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu9.config.f.x5.l configure -state disabled}
2390
        global CONFIG_LEON3_NETLIST
2391
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {
2392
        configure_entry .menu9.config.f.x6 normal {n l y}} else {configure_entry .menu9.config.f.x6 disabled {y n l}}
2393
}
2394
 
2395
 
2396
proc update_define_menu9 {} {
2397
        update_define_mainmenu
2398
        global CONFIG_MODULES
2399
        global CONFIG_LEON3
2400
        global CONFIG_LEON3FT_PRESENT
2401
        global CONFIG_LEON3FT_EN
2402
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1)} then {
2403
        set CONFIG_LEON3FT_EN [expr $CONFIG_LEON3FT_EN&15]} else {set CONFIG_LEON3FT_EN [expr $CONFIG_LEON3FT_EN|16]}
2404
        global tmpvar_24
2405
        global CONFIG_IUFT_NONE
2406
        if {$tmpvar_24 == "None"} then {set CONFIG_IUFT_NONE 1} else {set CONFIG_IUFT_NONE 0}
2407
        global CONFIG_IUFT_PAR
2408
        if {$tmpvar_24 == "Parity"} then {set CONFIG_IUFT_PAR 1} else {set CONFIG_IUFT_PAR 0}
2409
        global CONFIG_IUFT_DMR
2410
        if {$tmpvar_24 == "PDMR"} then {set CONFIG_IUFT_DMR 1} else {set CONFIG_IUFT_DMR 0}
2411
        global CONFIG_IUFT_BCH
2412
        if {$tmpvar_24 == "BCH"} then {set CONFIG_IUFT_BCH 1} else {set CONFIG_IUFT_BCH 0}
2413
        global CONFIG_IUFT_TMR
2414
        if {$tmpvar_24 == "TMR"} then {set CONFIG_IUFT_TMR 1} else {set CONFIG_IUFT_TMR 0}
2415
        global CONFIG_FPU_ENABLE
2416
        global CONFIG_FPUFT_EN
2417
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
2418
        set CONFIG_FPUFT_EN [expr $CONFIG_FPUFT_EN&15]} else {set CONFIG_FPUFT_EN [expr $CONFIG_FPUFT_EN|16]}
2419
        global CONFIG_RF_ERRINJ
2420
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {
2421
        set CONFIG_RF_ERRINJ [expr $CONFIG_RF_ERRINJ&15]} else {set CONFIG_RF_ERRINJ [expr $CONFIG_RF_ERRINJ|16]}
2422
        global CONFIG_CACHE_FT_EN
2423
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {
2424
        set CONFIG_CACHE_FT_EN [expr $CONFIG_CACHE_FT_EN&15]} else {set CONFIG_CACHE_FT_EN [expr $CONFIG_CACHE_FT_EN|16]}
2425
        global CONFIG_CACHE_ERRINJ
2426
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {validate_int CONFIG_CACHE_ERRINJ "$CONFIG_CACHE_ERRINJ" 0}
2427
        global CONFIG_LEON3_NETLIST
2428
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {
2429
        set CONFIG_LEON3_NETLIST [expr $CONFIG_LEON3_NETLIST&15]} else {set CONFIG_LEON3_NETLIST [expr $CONFIG_LEON3_NETLIST|16]}
2430
}
2431
 
2432
 
2433
proc menu10 {w title} {
2434
        set oldFocus [focus]
2435
        catch {focus .menu3}
2436
        catch {destroy $w; unregister_active 10}
2437
        toplevel $w -class Dialog
2438
        wm withdraw $w
2439
        global active_menus
2440
        set active_menus [lsort -integer [linsert $active_menus end 10]]
2441
        message $w.m -width 400 -aspect 300 -text \
2442
                "VHDL debug settings       "  -relief raised
2443
        pack $w.m -pady 10 -side top -padx 10
2444
        wm title $w "VHDL debug settings       "
2445
 
2446
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 10; break"
2447
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 10; catch {destroy .menu3}; unregister_active 3; menu11 .menu11 \"$title\""
2448
        frame $w.f
2449
        button $w.f.back -text "OK" \
2450
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 10"
2451
        button $w.f.next -text "Next" -underline 0\
2452
                -width 15 -command $nextscript
2453
        bind all  $nextscript
2454
        button $w.f.prev -text "Prev" -underline 0\
2455
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 10; menu9 .menu9 \"$title\""
2456
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 10; menu9 .menu9 \"$title\";break"
2457
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2458
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2459
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2460
        pack $w.topline -side top -fill x
2461
 
2462
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2463
        pack $w.botline -side bottom -fill x
2464
 
2465
        frame $w.config
2466
        pack $w.config -fill y -expand on
2467
 
2468
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2469
        pack $w.config.vscroll -side right -fill y
2470
 
2471
        canvas $w.config.canvas -height 1\
2472
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2473
                -width [expr [winfo screenwidth .] * 1 / 2]
2474
        frame $w.config.f
2475
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2476
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2477
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2478
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2479
        bind $w  "$w.config.canvas yview moveto 0;break;"
2480
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2481
        pack $w.config.canvas -side right -fill y
2482
 
2483
 
2484
        bool $w.config.f 10 0 "Processor disassembly to console         " CONFIG_IU_DISAS
2485
        bool $w.config.f 10 1 "Processor disassembly in netlist         " CONFIG_IU_DISAS_NET
2486
        bool $w.config.f 10 2 "32-bit program counters       " CONFIG_DEBUG_PC32
2487
 
2488
 
2489
 
2490
        focus $w
2491
        update_active
2492
        global winx; global winy
2493
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
2494
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
2495
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2496
        update idletasks
2497
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2498
 
2499
        $w.config.canvas configure \
2500
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2501
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2502
                         [expr [winfo reqheight $w.config.f] + 1]"
2503
 
2504
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2505
        set scry [expr [winfo screenh $w] / 2]
2506
        set maxy [expr [winfo screenh $w] * 3 / 4]
2507
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2508
        if [expr $winy + $canvtotal < $maxy] {
2509
                $w.config.canvas configure -height $canvtotal
2510
        } else {
2511
                $w.config.canvas configure -height [expr $scry - $winy]
2512
                }
2513
        }
2514
        update idletasks
2515
        if {[winfo exists $w]} then {
2516
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2517
        wm minsize $w [winfo width $w] 100
2518
 
2519
        wm deiconify $w
2520
}
2521
}
2522
 
2523
proc update_menu10 {} {
2524
        global CONFIG_LEON3
2525
        global CONFIG_IU_DISAS
2526
        if {($CONFIG_LEON3 == 1)} then {
2527
        configure_entry .menu10.config.f.x0 normal {n l y}} else {configure_entry .menu10.config.f.x0 disabled {y n l}}
2528
        global CONFIG_IU_DISAS_NET
2529
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_DISAS == 1)} then {
2530
        configure_entry .menu10.config.f.x1 normal {n l y}} else {configure_entry .menu10.config.f.x1 disabled {y n l}}
2531
        global CONFIG_DEBUG_PC32
2532
        if {($CONFIG_LEON3 == 1)} then {
2533
        configure_entry .menu10.config.f.x2 normal {n l y}} else {configure_entry .menu10.config.f.x2 disabled {y n l}}
2534
}
2535
 
2536
 
2537
proc update_define_menu10 {} {
2538
        update_define_mainmenu
2539
        global CONFIG_MODULES
2540
        global CONFIG_LEON3
2541
        global CONFIG_IU_DISAS
2542
        if {($CONFIG_LEON3 == 1)} then {
2543
        set CONFIG_IU_DISAS [expr $CONFIG_IU_DISAS&15]} else {set CONFIG_IU_DISAS [expr $CONFIG_IU_DISAS|16]}
2544
        global CONFIG_IU_DISAS_NET
2545
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_DISAS == 1)} then {
2546
        set CONFIG_IU_DISAS_NET [expr $CONFIG_IU_DISAS_NET&15]} else {set CONFIG_IU_DISAS_NET [expr $CONFIG_IU_DISAS_NET|16]}
2547
        global CONFIG_DEBUG_PC32
2548
        if {($CONFIG_LEON3 == 1)} then {
2549
        set CONFIG_DEBUG_PC32 [expr $CONFIG_DEBUG_PC32&15]} else {set CONFIG_DEBUG_PC32 [expr $CONFIG_DEBUG_PC32|16]}
2550
}
2551
 
2552
 
2553
menu_option menu11 11 "AMBA configuration"
2554
proc menu11 {w title} {
2555
        set oldFocus [focus]
2556
        catch {destroy $w; unregister_active 11}
2557
        toplevel $w -class Dialog
2558
        wm withdraw $w
2559
        global active_menus
2560
        set active_menus [lsort -integer [linsert $active_menus end 11]]
2561
        message $w.m -width 400 -aspect 300 -text \
2562
                "AMBA configuration"  -relief raised
2563
        pack $w.m -pady 10 -side top -padx 10
2564
        wm title $w "AMBA configuration"
2565
 
2566
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 11; break"
2567
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 11; menu12 .menu12 \"$title\""
2568
        frame $w.f
2569
        button $w.f.back -text "Main Menu" \
2570
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 11"
2571
        button $w.f.next -text "Next" -underline 0\
2572
                -width 15 -command $nextscript
2573
        bind all  $nextscript
2574
        button $w.f.prev -text "Prev" -underline 0\
2575
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 11; menu10 .menu10 \"$title\""
2576
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 11; menu10 .menu10 \"$title\";break"
2577
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2578
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2579
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2580
        pack $w.topline -side top -fill x
2581
 
2582
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2583
        pack $w.botline -side bottom -fill x
2584
 
2585
        frame $w.config
2586
        pack $w.config -fill y -expand on
2587
 
2588
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2589
        pack $w.config.vscroll -side right -fill y
2590
 
2591
        canvas $w.config.canvas -height 1\
2592
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2593
                -width [expr [winfo screenwidth .] * 1 / 2]
2594
        frame $w.config.f
2595
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2596
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2597
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2598
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2599
        bind $w  "$w.config.canvas yview moveto 0;break;"
2600
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2601
        pack $w.config.canvas -side right -fill y
2602
 
2603
 
2604
        int $w.config.f 11 0 "Default AHB master" CONFIG_AHB_DEFMST
2605
        bool $w.config.f 11 1 "Round-robin arbiter                       " CONFIG_AHB_RROBIN
2606
        bool $w.config.f 11 2 "AHB split-transaction support             " CONFIG_AHB_SPLIT
2607
        hex $w.config.f 11 3 "I/O area start address (haddr\[31:20\]) " CONFIG_AHB_IOADDR
2608
        hex $w.config.f 11 4 "AHB/APB bridge address (haddr\[31:20\]) " CONFIG_APB_HADDR
2609
        bool $w.config.f 11 5 "Enable AMBA AHB monitor              " CONFIG_AHB_MON
2610
        bool $w.config.f 11 6 "Report AHB errors                  " CONFIG_AHB_MONERR
2611
        bool $w.config.f 11 7 "Report AHB warings                 " CONFIG_AHB_MONWAR
2612
 
2613
 
2614
 
2615
        focus $w
2616
        update_active
2617
        global winx; global winy
2618
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
2619
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2620
        update idletasks
2621
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2622
 
2623
        $w.config.canvas configure \
2624
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2625
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2626
                         [expr [winfo reqheight $w.config.f] + 1]"
2627
 
2628
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2629
        set scry [expr [winfo screenh $w] / 2]
2630
        set maxy [expr [winfo screenh $w] * 3 / 4]
2631
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2632
        if [expr $winy + $canvtotal < $maxy] {
2633
                $w.config.canvas configure -height $canvtotal
2634
        } else {
2635
                $w.config.canvas configure -height [expr $scry - $winy]
2636
                }
2637
        }
2638
        update idletasks
2639
        if {[winfo exists $w]} then {
2640
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2641
        wm minsize $w [winfo width $w] 100
2642
 
2643
        wm deiconify $w
2644
}
2645
}
2646
 
2647
proc update_menu11 {} {
2648
        global CONFIG_AHB_MON
2649
        global CONFIG_AHB_MONERR
2650
        if {($CONFIG_AHB_MON == 1)} then {
2651
        configure_entry .menu11.config.f.x6 normal {n l y}} else {configure_entry .menu11.config.f.x6 disabled {y n l}}
2652
        global CONFIG_AHB_MONWAR
2653
        if {($CONFIG_AHB_MON == 1)} then {
2654
        configure_entry .menu11.config.f.x7 normal {n l y}} else {configure_entry .menu11.config.f.x7 disabled {y n l}}
2655
}
2656
 
2657
 
2658
proc update_define_menu11 {} {
2659
        update_define_mainmenu
2660
        global CONFIG_MODULES
2661
        global CONFIG_AHB_MON
2662
        global CONFIG_AHB_MONERR
2663
        if {($CONFIG_AHB_MON == 1)} then {
2664
        set CONFIG_AHB_MONERR [expr $CONFIG_AHB_MONERR&15]} else {set CONFIG_AHB_MONERR [expr $CONFIG_AHB_MONERR|16]}
2665
        global CONFIG_AHB_MONWAR
2666
        if {($CONFIG_AHB_MON == 1)} then {
2667
        set CONFIG_AHB_MONWAR [expr $CONFIG_AHB_MONWAR&15]} else {set CONFIG_AHB_MONWAR [expr $CONFIG_AHB_MONWAR|16]}
2668
}
2669
 
2670
 
2671
menu_option menu12 12 "Debug Link           "
2672
proc menu12 {w title} {
2673
        set oldFocus [focus]
2674
        catch {destroy $w; unregister_active 12}
2675
        toplevel $w -class Dialog
2676
        wm withdraw $w
2677
        global active_menus
2678
        set active_menus [lsort -integer [linsert $active_menus end 12]]
2679
        message $w.m -width 400 -aspect 300 -text \
2680
                "Debug Link           "  -relief raised
2681
        pack $w.m -pady 10 -side top -padx 10
2682
        wm title $w "Debug Link           "
2683
 
2684
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 12; break"
2685
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 12; menu13 .menu13 \"$title\""
2686
        frame $w.f
2687
        button $w.f.back -text "Main Menu" \
2688
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 12"
2689
        button $w.f.next -text "Next" -underline 0\
2690
                -width 15 -command $nextscript
2691
        bind all  $nextscript
2692
        button $w.f.prev -text "Prev" -underline 0\
2693
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 12; menu11 .menu11 \"$title\""
2694
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 12; menu11 .menu11 \"$title\";break"
2695
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2696
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2697
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2698
        pack $w.topline -side top -fill x
2699
 
2700
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2701
        pack $w.botline -side bottom -fill x
2702
 
2703
        frame $w.config
2704
        pack $w.config -fill y -expand on
2705
 
2706
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2707
        pack $w.config.vscroll -side right -fill y
2708
 
2709
        canvas $w.config.canvas -height 1\
2710
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2711
                -width [expr [winfo screenwidth .] * 1 / 2]
2712
        frame $w.config.f
2713
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2714
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2715
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2716
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2717
        bind $w  "$w.config.canvas yview moveto 0;break;"
2718
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2719
        pack $w.config.canvas -side right -fill y
2720
 
2721
 
2722
        bool $w.config.f 12 0 "Serial Debug Link (RS232)                " CONFIG_DSU_UART
2723
        bool $w.config.f 12 1 "JTAG Debug Link" CONFIG_DSU_JTAG
2724
        bool $w.config.f 12 2 "Ethernet Debug Communication Link (EDCL)" CONFIG_DSU_ETH
2725
        global tmpvar_25
2726
        minimenu $w.config.f 12 3 "Ethernet/AHB bridge buffer size (kbytes)" tmpvar_25 CONFIG_DSU_ETHSZ1
2727
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"Ethernet/AHB bridge buffer size (kbytes)\""
2728
        $w.config.f.x3.x.menu add radiobutton -label "1" -variable tmpvar_25 -value "1" -command "update_active"
2729
        $w.config.f.x3.x.menu add radiobutton -label "2" -variable tmpvar_25 -value "2" -command "update_active"
2730
        $w.config.f.x3.x.menu add radiobutton -label "4" -variable tmpvar_25 -value "4" -command "update_active"
2731
        $w.config.f.x3.x.menu add radiobutton -label "8" -variable tmpvar_25 -value "8" -command "update_active"
2732
        $w.config.f.x3.x.menu add radiobutton -label "16" -variable tmpvar_25 -value "16" -command "update_active"
2733
        menusplit $w $w.config.f.x3.x.menu 5
2734
        hex $w.config.f 12 4 "MSB 16 bits of IP address (hex)       " CONFIG_DSU_IPMSB
2735
        hex $w.config.f 12 5 "LSB 16 bits of IP address (hex)       " CONFIG_DSU_IPLSB
2736
        hex $w.config.f 12 6 "MSB 24 bits of ethern number (hex)    " CONFIG_DSU_ETHMSB
2737
        hex $w.config.f 12 7 "LSB 24 bits of ethern number (hex)    " CONFIG_DSU_ETHLSB
2738
        bool $w.config.f 12 8 "Programmable 4-bit LSB of MAC/IP address" CONFIG_DSU_ETH_PROG
2739
 
2740
 
2741
 
2742
        focus $w
2743
        update_active
2744
        global winx; global winy
2745
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
2746
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2747
        update idletasks
2748
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2749
 
2750
        $w.config.canvas configure \
2751
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2752
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2753
                         [expr [winfo reqheight $w.config.f] + 1]"
2754
 
2755
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2756
        set scry [expr [winfo screenh $w] / 2]
2757
        set maxy [expr [winfo screenh $w] * 3 / 4]
2758
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2759
        if [expr $winy + $canvtotal < $maxy] {
2760
                $w.config.canvas configure -height $canvtotal
2761
        } else {
2762
                $w.config.canvas configure -height [expr $scry - $winy]
2763
                }
2764
        }
2765
        update idletasks
2766
        if {[winfo exists $w]} then {
2767
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2768
        wm minsize $w [winfo width $w] 100
2769
 
2770
        wm deiconify $w
2771
}
2772
}
2773
 
2774
proc update_menu12 {} {
2775
        global CONFIG_GRETH_ENABLE
2776
        global CONFIG_DSU_ETH
2777
        if {($CONFIG_GRETH_ENABLE == 1)} then {
2778
        configure_entry .menu12.config.f.x2 normal {n l y}} else {configure_entry .menu12.config.f.x2 disabled {y n l}}
2779
        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}}
2780
        global CONFIG_DSU_IPMSB
2781
        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}
2782
        global CONFIG_DSU_IPLSB
2783
        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}
2784
        global CONFIG_DSU_ETHMSB
2785
        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}
2786
        global CONFIG_DSU_ETHLSB
2787
        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}
2788
        global CONFIG_GRETH_GIGA
2789
        global CONFIG_DSU_ETH_PROG
2790
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1) && ($CONFIG_GRETH_GIGA == 0)} then {
2791
        configure_entry .menu12.config.f.x8 normal {n l y}} else {configure_entry .menu12.config.f.x8 disabled {y n l}}
2792
}
2793
 
2794
 
2795
proc update_define_menu12 {} {
2796
        update_define_mainmenu
2797
        global CONFIG_MODULES
2798
        global CONFIG_GRETH_ENABLE
2799
        global CONFIG_DSU_ETH
2800
        if {($CONFIG_GRETH_ENABLE == 1)} then {
2801
        set CONFIG_DSU_ETH [expr $CONFIG_DSU_ETH&15]} else {set CONFIG_DSU_ETH [expr $CONFIG_DSU_ETH|16]}
2802
        global tmpvar_25
2803
        global CONFIG_DSU_ETHSZ1
2804
        if {$tmpvar_25 == "1"} then {set CONFIG_DSU_ETHSZ1 1} else {set CONFIG_DSU_ETHSZ1 0}
2805
        global CONFIG_DSU_ETHSZ2
2806
        if {$tmpvar_25 == "2"} then {set CONFIG_DSU_ETHSZ2 1} else {set CONFIG_DSU_ETHSZ2 0}
2807
        global CONFIG_DSU_ETHSZ4
2808
        if {$tmpvar_25 == "4"} then {set CONFIG_DSU_ETHSZ4 1} else {set CONFIG_DSU_ETHSZ4 0}
2809
        global CONFIG_DSU_ETHSZ8
2810
        if {$tmpvar_25 == "8"} then {set CONFIG_DSU_ETHSZ8 1} else {set CONFIG_DSU_ETHSZ8 0}
2811
        global CONFIG_DSU_ETHSZ16
2812
        if {$tmpvar_25 == "16"} then {set CONFIG_DSU_ETHSZ16 1} else {set CONFIG_DSU_ETHSZ16 0}
2813
        global CONFIG_DSU_IPMSB
2814
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {validate_hex CONFIG_DSU_IPMSB "$CONFIG_DSU_IPMSB" C0A8}
2815
        global CONFIG_DSU_IPLSB
2816
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {validate_hex CONFIG_DSU_IPLSB "$CONFIG_DSU_IPLSB" 0033}
2817
        global CONFIG_DSU_ETHMSB
2818
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {validate_hex CONFIG_DSU_ETHMSB "$CONFIG_DSU_ETHMSB" 00007A}
2819
        global CONFIG_DSU_ETHLSB
2820
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {validate_hex CONFIG_DSU_ETHLSB "$CONFIG_DSU_ETHLSB" CC0001}
2821
        global CONFIG_GRETH_GIGA
2822
        global CONFIG_DSU_ETH_PROG
2823
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1) && ($CONFIG_GRETH_GIGA == 0)} then {
2824
        set CONFIG_DSU_ETH_PROG [expr $CONFIG_DSU_ETH_PROG&15]} else {set CONFIG_DSU_ETH_PROG [expr $CONFIG_DSU_ETH_PROG|16]}
2825
}
2826
 
2827
 
2828
menu_option menu13 13 "Memory controllers             "
2829
proc menu13 {w title} {
2830
        set oldFocus [focus]
2831
        catch {destroy $w; unregister_active 13}
2832
        toplevel $w -class Dialog
2833
        wm withdraw $w
2834
        global active_menus
2835
        set active_menus [lsort -integer [linsert $active_menus end 13]]
2836
        message $w.m -width 400 -aspect 300 -text \
2837
                "Memory controllers             "  -relief raised
2838
        pack $w.m -pady 10 -side top -padx 10
2839
        wm title $w "Memory controllers             "
2840
 
2841
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 13; break"
2842
        set nextscript "catch {focus $oldFocus}; menu14 .menu14 \"$title\""
2843
        frame $w.f
2844
        button $w.f.back -text "Main Menu" \
2845
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 13"
2846
        button $w.f.next -text "Next" -underline 0\
2847
                -width 15 -command $nextscript
2848
        bind all  $nextscript
2849
        button $w.f.prev -text "Prev" -underline 0\
2850
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 13; menu12 .menu12 \"$title\""
2851
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 13; menu12 .menu12 \"$title\";break"
2852
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2853
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2854
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2855
        pack $w.topline -side top -fill x
2856
 
2857
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2858
        pack $w.botline -side bottom -fill x
2859
 
2860
        frame $w.config
2861
        pack $w.config -fill y -expand on
2862
 
2863
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2864
        pack $w.config.vscroll -side right -fill y
2865
 
2866
        canvas $w.config.canvas -height 1\
2867
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2868
                -width [expr [winfo screenwidth .] * 1 / 2]
2869
        frame $w.config.f
2870
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2871
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2872
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2873
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2874
        bind $w  "$w.config.canvas yview moveto 0;break;"
2875
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2876
        pack $w.config.canvas -side right -fill y
2877
 
2878
 
2879
        submenu $w.config.f 13 0 "PROM/SRAM/SDRAM Memory controller with EDAC       " 14
2880
        submenu $w.config.f 13 1 "Leon2 memory controller        " 15
2881
        bool $w.config.f 13 2 "Enable AHB Status Register  " CONFIG_AHBSTAT_ENABLE
2882
        int $w.config.f 13 3 "Number of correctable-error slaves  " CONFIG_AHBSTAT_NFTSLV
2883
 
2884
 
2885
 
2886
        focus $w
2887
        update_active
2888
        global winx; global winy
2889
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
2890
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2891
        update idletasks
2892
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2893
 
2894
        $w.config.canvas configure \
2895
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2896
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2897
                         [expr [winfo reqheight $w.config.f] + 1]"
2898
 
2899
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2900
        set scry [expr [winfo screenh $w] / 2]
2901
        set maxy [expr [winfo screenh $w] * 3 / 4]
2902
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2903
        if [expr $winy + $canvtotal < $maxy] {
2904
                $w.config.canvas configure -height $canvtotal
2905
        } else {
2906
                $w.config.canvas configure -height [expr $scry - $winy]
2907
                }
2908
        }
2909
        update idletasks
2910
        if {[winfo exists $w]} then {
2911
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2912
        wm minsize $w [winfo width $w] 100
2913
 
2914
        wm deiconify $w
2915
}
2916
}
2917
 
2918
proc update_menu13 {} {
2919
        global CONFIG_AHBSTAT_ENABLE
2920
        global CONFIG_AHBSTAT_NFTSLV
2921
        if {($CONFIG_AHBSTAT_ENABLE == 1)} then {.menu13.config.f.x3.x configure -state normal -foreground [ cget .ref -foreground ]; .menu13.config.f.x3.l configure -state normal; } else {.menu13.config.f.x3.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu13.config.f.x3.l configure -state disabled}
2922
}
2923
 
2924
 
2925
proc update_define_menu13 {} {
2926
        update_define_mainmenu
2927
        global CONFIG_MODULES
2928
        global CONFIG_AHBSTAT_ENABLE
2929
        global CONFIG_AHBSTAT_NFTSLV
2930
        if {($CONFIG_AHBSTAT_ENABLE == 1)} then {validate_int CONFIG_AHBSTAT_NFTSLV "$CONFIG_AHBSTAT_NFTSLV" 1}
2931
}
2932
 
2933
 
2934
proc menu14 {w title} {
2935
        set oldFocus [focus]
2936
        catch {focus .menu13}
2937
        catch {destroy $w; unregister_active 14}
2938
        toplevel $w -class Dialog
2939
        wm withdraw $w
2940
        global active_menus
2941
        set active_menus [lsort -integer [linsert $active_menus end 14]]
2942
        message $w.m -width 400 -aspect 300 -text \
2943
                "PROM/SRAM/SDRAM Memory controller with EDAC       "  -relief raised
2944
        pack $w.m -pady 10 -side top -padx 10
2945
        wm title $w "PROM/SRAM/SDRAM Memory controller with EDAC       "
2946
 
2947
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 14; break"
2948
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 14; menu15 .menu15 \"$title\""
2949
        frame $w.f
2950
        button $w.f.back -text "OK" \
2951
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 14"
2952
        button $w.f.next -text "Next" -underline 0\
2953
                -width 15 -command $nextscript
2954
        bind all  $nextscript
2955
        button $w.f.prev -text "Prev" -underline 0\
2956
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 14; menu13 .menu13 \"$title\""
2957
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 14; menu13 .menu13 \"$title\";break"
2958
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2959
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2960
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2961
        pack $w.topline -side top -fill x
2962
 
2963
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2964
        pack $w.botline -side bottom -fill x
2965
 
2966
        frame $w.config
2967
        pack $w.config -fill y -expand on
2968
 
2969
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2970
        pack $w.config.vscroll -side right -fill y
2971
 
2972
        canvas $w.config.canvas -height 1\
2973
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2974
                -width [expr [winfo screenwidth .] * 1 / 2]
2975
        frame $w.config.f
2976
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2977
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2978
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2979
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2980
        bind $w  "$w.config.canvas yview moveto 0;break;"
2981
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2982
        pack $w.config.canvas -side right -fill y
2983
 
2984
 
2985
        bool $w.config.f 14 0 "Enable PROM/SRAM/SDRAM memory controller  " CONFIG_MCTRLFT
2986
        bool $w.config.f 14 1 "8-bit PROM/SRAM bus support    " CONFIG_MCTRLFT_8BIT
2987
        bool $w.config.f 14 2 "16-bit PROM/SRAM bus support    " CONFIG_MCTRLFT_16BIT
2988
        bool $w.config.f 14 3 "5th SRAM chip-select  " CONFIG_MCTRLFT_5CS
2989
        global tmpvar_26
2990
        minimenu $w.config.f 14 4 "PROM banks and sizes, or programmable" tmpvar_26 CONFIG_MCTRLFT_ROMASEL0
2991
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"PROM banks and sizes, or programmable\""
2992
        $w.config.f.x4.x.menu add radiobutton -label "4xprogrammable" -variable tmpvar_26 -value "4xprogrammable" -command "update_active"
2993
        $w.config.f.x4.x.menu add radiobutton -label "4x16_kByte" -variable tmpvar_26 -value "4x16_kByte" -command "update_active"
2994
        $w.config.f.x4.x.menu add radiobutton -label "4x32_kByte" -variable tmpvar_26 -value "4x32_kByte" -command "update_active"
2995
        $w.config.f.x4.x.menu add radiobutton -label "4x64_kByte" -variable tmpvar_26 -value "4x64_kByte" -command "update_active"
2996
        $w.config.f.x4.x.menu add radiobutton -label "4x128_kByte" -variable tmpvar_26 -value "4x128_kByte" -command "update_active"
2997
        $w.config.f.x4.x.menu add radiobutton -label "4x256_kByte" -variable tmpvar_26 -value "4x256_kByte" -command "update_active"
2998
        $w.config.f.x4.x.menu add radiobutton -label "4x512_kByte" -variable tmpvar_26 -value "4x512_kByte" -command "update_active"
2999
        $w.config.f.x4.x.menu add radiobutton -label "4x1_MByte" -variable tmpvar_26 -value "4x1_MByte" -command "update_active"
3000
        $w.config.f.x4.x.menu add radiobutton -label "4x2_MByte" -variable tmpvar_26 -value "4x2_MByte" -command "update_active"
3001
        $w.config.f.x4.x.menu add radiobutton -label "4x4_MByte" -variable tmpvar_26 -value "4x4_MByte" -command "update_active"
3002
        $w.config.f.x4.x.menu add radiobutton -label "4x8_MByte" -variable tmpvar_26 -value "4x8_MByte" -command "update_active"
3003
        $w.config.f.x4.x.menu add radiobutton -label "4x16_MByte" -variable tmpvar_26 -value "4x16_MByte" -command "update_active"
3004
        $w.config.f.x4.x.menu add radiobutton -label "4x32_MByte" -variable tmpvar_26 -value "4x32_MByte" -command "update_active"
3005
        $w.config.f.x4.x.menu add radiobutton -label "4x64_MByte" -variable tmpvar_26 -value "4x64_MByte" -command "update_active"
3006
        $w.config.f.x4.x.menu add radiobutton -label "4x128_MByte" -variable tmpvar_26 -value "4x128_MByte" -command "update_active"
3007
        $w.config.f.x4.x.menu add radiobutton -label "2x256_MByte" -variable tmpvar_26 -value "2x256_MByte" -command "update_active"
3008
        $w.config.f.x4.x.menu add radiobutton -label "2x64_kByte" -variable tmpvar_26 -value "2x64_kByte" -command "update_active"
3009
        $w.config.f.x4.x.menu add radiobutton -label "2x128_kByte" -variable tmpvar_26 -value "2x128_kByte" -command "update_active"
3010
        $w.config.f.x4.x.menu add radiobutton -label "2x256_kByte" -variable tmpvar_26 -value "2x256_kByte" -command "update_active"
3011
        $w.config.f.x4.x.menu add radiobutton -label "2x512_kByte" -variable tmpvar_26 -value "2x512_kByte" -command "update_active"
3012
        $w.config.f.x4.x.menu add radiobutton -label "2x1_MByte" -variable tmpvar_26 -value "2x1_MByte" -command "update_active"
3013
        $w.config.f.x4.x.menu add radiobutton -label "2x2_MByte" -variable tmpvar_26 -value "2x2_MByte" -command "update_active"
3014
        $w.config.f.x4.x.menu add radiobutton -label "2x4_MByte" -variable tmpvar_26 -value "2x4_MByte" -command "update_active"
3015
        $w.config.f.x4.x.menu add radiobutton -label "2x8_MByte" -variable tmpvar_26 -value "2x8_MByte" -command "update_active"
3016
        $w.config.f.x4.x.menu add radiobutton -label "2x16_MByte" -variable tmpvar_26 -value "2x16_MByte" -command "update_active"
3017
        $w.config.f.x4.x.menu add radiobutton -label "2x32_MByte" -variable tmpvar_26 -value "2x32_MByte" -command "update_active"
3018
        $w.config.f.x4.x.menu add radiobutton -label "2x64_MByte" -variable tmpvar_26 -value "2x64_MByte" -command "update_active"
3019
        $w.config.f.x4.x.menu add radiobutton -label "2x128_MByte" -variable tmpvar_26 -value "2x128_MByte" -command "update_active"
3020
        $w.config.f.x4.x.menu add radiobutton -label "2x256_MByte" -variable tmpvar_26 -value "2x256_MByte" -command "update_active"
3021
        menusplit $w $w.config.f.x4.x.menu 29
3022
        bool $w.config.f 14 5 "SDRAM controller       " CONFIG_MCTRLFT_SDRAM
3023
        bool $w.config.f 14 6 "Separate address and data buses" CONFIG_MCTRLFT_SDRAM_SEPBUS
3024
        bool $w.config.f 14 7 "Inverted sdclock" CONFIG_MCTRLFT_SDRAM_INVCLK
3025
        bool $w.config.f 14 8 "Enable page burst operation     " CONFIG_MCTRLFT_PAGE
3026
        bool $w.config.f 14 9 "Enable programmable page burst " CONFIG_MCTRLFT_PROGPAGE
3027
        bool $w.config.f 14 10 "Enable EDAC                     " CONFIG_MCTRLFT_EDAC
3028
        bool $w.config.f 14 11 "Enable pipelined EDAC   " CONFIG_MCTRLFT_EDACPIPE
3029
        bool $w.config.f 14 12 "Extended data bus drive         " CONFIG_MCTRLFT_WFB
3030
 
3031
 
3032
 
3033
        focus $w
3034
        update_active
3035
        global winx; global winy
3036
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Memory controllers             "}
3037
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
3038
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3039
        update idletasks
3040
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3041
 
3042
        $w.config.canvas configure \
3043
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3044
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3045
                         [expr [winfo reqheight $w.config.f] + 1]"
3046
 
3047
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3048
        set scry [expr [winfo screenh $w] / 2]
3049
        set maxy [expr [winfo screenh $w] * 3 / 4]
3050
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3051
        if [expr $winy + $canvtotal < $maxy] {
3052
                $w.config.canvas configure -height $canvtotal
3053
        } else {
3054
                $w.config.canvas configure -height [expr $scry - $winy]
3055
                }
3056
        }
3057
        update idletasks
3058
        if {[winfo exists $w]} then {
3059
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3060
        wm minsize $w [winfo width $w] 100
3061
 
3062
        wm deiconify $w
3063
}
3064
}
3065
 
3066
proc update_menu14 {} {
3067
        global CONFIG_MCTRLFT
3068
        global CONFIG_MCTRLFT_8BIT
3069
        if {($CONFIG_MCTRLFT == 1)} then {
3070
        configure_entry .menu14.config.f.x1 normal {n l y}} else {configure_entry .menu14.config.f.x1 disabled {y n l}}
3071
        global CONFIG_MCTRLFT_16BIT
3072
        if {($CONFIG_MCTRLFT == 1)} then {
3073
        configure_entry .menu14.config.f.x2 normal {n l y}} else {configure_entry .menu14.config.f.x2 disabled {y n l}}
3074
        global CONFIG_MCTRLFT_5CS
3075
        if {($CONFIG_MCTRLFT == 1)} then {
3076
        configure_entry .menu14.config.f.x3 normal {n l y}} else {configure_entry .menu14.config.f.x3 disabled {y n l}}
3077
        if {($CONFIG_MCTRLFT == 1)} then {configure_entry .menu14.config.f.x4 normal {x l}} else {configure_entry .menu14.config.f.x4 disabled {x l}}
3078
        global CONFIG_MCTRLFT_SDRAM
3079
        if {($CONFIG_MCTRLFT == 1)} then {
3080
        configure_entry .menu14.config.f.x5 normal {n l y}} else {configure_entry .menu14.config.f.x5 disabled {y n l}}
3081
        global CONFIG_MCTRLFT_SDRAM_SEPBUS
3082
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1)} then {
3083
        configure_entry .menu14.config.f.x6 normal {n l y}} else {configure_entry .menu14.config.f.x6 disabled {y n l}}
3084
        global CONFIG_MCTRLFT_SDRAM_INVCLK
3085
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1)} then {
3086
        configure_entry .menu14.config.f.x7 normal {n l y}} else {configure_entry .menu14.config.f.x7 disabled {y n l}}
3087
        global CONFIG_MCTRLFT_PAGE
3088
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1)} then {
3089
        configure_entry .menu14.config.f.x8 normal {n l y}} else {configure_entry .menu14.config.f.x8 disabled {y n l}}
3090
        global CONFIG_MCTRLFT_PROGPAGE
3091
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1) && ($CONFIG_MCTRLFT_PAGE == 1)} then {
3092
        configure_entry .menu14.config.f.x9 normal {n l y}} else {configure_entry .menu14.config.f.x9 disabled {y n l}}
3093
        global CONFIG_MCTRLFT_EDAC
3094
        if {($CONFIG_MCTRLFT == 1)} then {
3095
        configure_entry .menu14.config.f.x10 normal {n l y}} else {configure_entry .menu14.config.f.x10 disabled {y n l}}
3096
        global CONFIG_MCTRLFT_EDACPIPE
3097
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_EDAC == 1)} then {
3098
        configure_entry .menu14.config.f.x11 normal {n l y}} else {configure_entry .menu14.config.f.x11 disabled {y n l}}
3099
        global CONFIG_MCTRLFT_WFB
3100
        if {($CONFIG_MCTRLFT == 1)} then {
3101
        configure_entry .menu14.config.f.x12 normal {n l y}} else {configure_entry .menu14.config.f.x12 disabled {y n l}}
3102
}
3103
 
3104
 
3105
proc update_define_menu14 {} {
3106
        update_define_mainmenu
3107
        global CONFIG_MODULES
3108
        global CONFIG_MCTRLFT
3109
        global CONFIG_MCTRLFT_8BIT
3110
        if {($CONFIG_MCTRLFT == 1)} then {
3111
        set CONFIG_MCTRLFT_8BIT [expr $CONFIG_MCTRLFT_8BIT&15]} else {set CONFIG_MCTRLFT_8BIT [expr $CONFIG_MCTRLFT_8BIT|16]}
3112
        global CONFIG_MCTRLFT_16BIT
3113
        if {($CONFIG_MCTRLFT == 1)} then {
3114
        set CONFIG_MCTRLFT_16BIT [expr $CONFIG_MCTRLFT_16BIT&15]} else {set CONFIG_MCTRLFT_16BIT [expr $CONFIG_MCTRLFT_16BIT|16]}
3115
        global CONFIG_MCTRLFT_5CS
3116
        if {($CONFIG_MCTRLFT == 1)} then {
3117
        set CONFIG_MCTRLFT_5CS [expr $CONFIG_MCTRLFT_5CS&15]} else {set CONFIG_MCTRLFT_5CS [expr $CONFIG_MCTRLFT_5CS|16]}
3118
        global tmpvar_26
3119
        global CONFIG_MCTRLFT_ROMASEL0
3120
        if {$tmpvar_26 == "4xprogrammable"} then {set CONFIG_MCTRLFT_ROMASEL0 1} else {set CONFIG_MCTRLFT_ROMASEL0 0}
3121
        global CONFIG_MCTRLFT_ROMASEL1
3122
        if {$tmpvar_26 == "4x16_kByte"} then {set CONFIG_MCTRLFT_ROMASEL1 1} else {set CONFIG_MCTRLFT_ROMASEL1 0}
3123
        global CONFIG_MCTRLFT_ROMASEL2
3124
        if {$tmpvar_26 == "4x32_kByte"} then {set CONFIG_MCTRLFT_ROMASEL2 1} else {set CONFIG_MCTRLFT_ROMASEL2 0}
3125
        global CONFIG_MCTRLFT_ROMASEL3
3126
        if {$tmpvar_26 == "4x64_kByte"} then {set CONFIG_MCTRLFT_ROMASEL3 1} else {set CONFIG_MCTRLFT_ROMASEL3 0}
3127
        global CONFIG_MCTRLFT_ROMASEL4
3128
        if {$tmpvar_26 == "4x128_kByte"} then {set CONFIG_MCTRLFT_ROMASEL4 1} else {set CONFIG_MCTRLFT_ROMASEL4 0}
3129
        global CONFIG_MCTRLFT_ROMASEL5
3130
        if {$tmpvar_26 == "4x256_kByte"} then {set CONFIG_MCTRLFT_ROMASEL5 1} else {set CONFIG_MCTRLFT_ROMASEL5 0}
3131
        global CONFIG_MCTRLFT_ROMASEL6
3132
        if {$tmpvar_26 == "4x512_kByte"} then {set CONFIG_MCTRLFT_ROMASEL6 1} else {set CONFIG_MCTRLFT_ROMASEL6 0}
3133
        global CONFIG_MCTRLFT_ROMASEL7
3134
        if {$tmpvar_26 == "4x1_MByte"} then {set CONFIG_MCTRLFT_ROMASEL7 1} else {set CONFIG_MCTRLFT_ROMASEL7 0}
3135
        global CONFIG_MCTRLFT_ROMASEL8
3136
        if {$tmpvar_26 == "4x2_MByte"} then {set CONFIG_MCTRLFT_ROMASEL8 1} else {set CONFIG_MCTRLFT_ROMASEL8 0}
3137
        global CONFIG_MCTRLFT_ROMASEL9
3138
        if {$tmpvar_26 == "4x4_MByte"} then {set CONFIG_MCTRLFT_ROMASEL9 1} else {set CONFIG_MCTRLFT_ROMASEL9 0}
3139
        global CONFIG_MCTRLFT_ROMASEL10
3140
        if {$tmpvar_26 == "4x8_MByte"} then {set CONFIG_MCTRLFT_ROMASEL10 1} else {set CONFIG_MCTRLFT_ROMASEL10 0}
3141
        global CONFIG_MCTRLFT_ROMASEL11
3142
        if {$tmpvar_26 == "4x16_MByte"} then {set CONFIG_MCTRLFT_ROMASEL11 1} else {set CONFIG_MCTRLFT_ROMASEL11 0}
3143
        global CONFIG_MCTRLFT_ROMASEL12
3144
        if {$tmpvar_26 == "4x32_MByte"} then {set CONFIG_MCTRLFT_ROMASEL12 1} else {set CONFIG_MCTRLFT_ROMASEL12 0}
3145
        global CONFIG_MCTRLFT_ROMASEL13
3146
        if {$tmpvar_26 == "4x64_MByte"} then {set CONFIG_MCTRLFT_ROMASEL13 1} else {set CONFIG_MCTRLFT_ROMASEL13 0}
3147
        global CONFIG_MCTRLFT_ROMASEL14
3148
        if {$tmpvar_26 == "4x128_MByte"} then {set CONFIG_MCTRLFT_ROMASEL14 1} else {set CONFIG_MCTRLFT_ROMASEL14 0}
3149
        global CONFIG_MCTRLFT_ROMASEL15
3150
        if {$tmpvar_26 == "2x256_MByte"} then {set CONFIG_MCTRLFT_ROMASEL15 1} else {set CONFIG_MCTRLFT_ROMASEL15 0}
3151
        global CONFIG_MCTRLFT_ROMASEL16
3152
        if {$tmpvar_26 == "2x64_kByte"} then {set CONFIG_MCTRLFT_ROMASEL16 1} else {set CONFIG_MCTRLFT_ROMASEL16 0}
3153
        global CONFIG_MCTRLFT_ROMASEL17
3154
        if {$tmpvar_26 == "2x128_kByte"} then {set CONFIG_MCTRLFT_ROMASEL17 1} else {set CONFIG_MCTRLFT_ROMASEL17 0}
3155
        global CONFIG_MCTRLFT_ROMASEL18
3156
        if {$tmpvar_26 == "2x256_kByte"} then {set CONFIG_MCTRLFT_ROMASEL18 1} else {set CONFIG_MCTRLFT_ROMASEL18 0}
3157
        global CONFIG_MCTRLFT_ROMASEL19
3158
        if {$tmpvar_26 == "2x512_kByte"} then {set CONFIG_MCTRLFT_ROMASEL19 1} else {set CONFIG_MCTRLFT_ROMASEL19 0}
3159
        global CONFIG_MCTRLFT_ROMASEL20
3160
        if {$tmpvar_26 == "2x1_MByte"} then {set CONFIG_MCTRLFT_ROMASEL20 1} else {set CONFIG_MCTRLFT_ROMASEL20 0}
3161
        global CONFIG_MCTRLFT_ROMASEL21
3162
        if {$tmpvar_26 == "2x2_MByte"} then {set CONFIG_MCTRLFT_ROMASEL21 1} else {set CONFIG_MCTRLFT_ROMASEL21 0}
3163
        global CONFIG_MCTRLFT_ROMASEL22
3164
        if {$tmpvar_26 == "2x4_MByte"} then {set CONFIG_MCTRLFT_ROMASEL22 1} else {set CONFIG_MCTRLFT_ROMASEL22 0}
3165
        global CONFIG_MCTRLFT_ROMASEL23
3166
        if {$tmpvar_26 == "2x8_MByte"} then {set CONFIG_MCTRLFT_ROMASEL23 1} else {set CONFIG_MCTRLFT_ROMASEL23 0}
3167
        global CONFIG_MCTRLFT_ROMASEL24
3168
        if {$tmpvar_26 == "2x16_MByte"} then {set CONFIG_MCTRLFT_ROMASEL24 1} else {set CONFIG_MCTRLFT_ROMASEL24 0}
3169
        global CONFIG_MCTRLFT_ROMASEL25
3170
        if {$tmpvar_26 == "2x32_MByte"} then {set CONFIG_MCTRLFT_ROMASEL25 1} else {set CONFIG_MCTRLFT_ROMASEL25 0}
3171
        global CONFIG_MCTRLFT_ROMASEL26
3172
        if {$tmpvar_26 == "2x64_MByte"} then {set CONFIG_MCTRLFT_ROMASEL26 1} else {set CONFIG_MCTRLFT_ROMASEL26 0}
3173
        global CONFIG_MCTRLFT_ROMASEL27
3174
        if {$tmpvar_26 == "2x128_MByte"} then {set CONFIG_MCTRLFT_ROMASEL27 1} else {set CONFIG_MCTRLFT_ROMASEL27 0}
3175
        global CONFIG_MCTRLFT_ROMASEL28
3176
        if {$tmpvar_26 == "2x256_MByte"} then {set CONFIG_MCTRLFT_ROMASEL28 1} else {set CONFIG_MCTRLFT_ROMASEL28 0}
3177
        global CONFIG_MCTRLFT_SDRAM
3178
        if {($CONFIG_MCTRLFT == 1)} then {
3179
        set CONFIG_MCTRLFT_SDRAM [expr $CONFIG_MCTRLFT_SDRAM&15]} else {set CONFIG_MCTRLFT_SDRAM [expr $CONFIG_MCTRLFT_SDRAM|16]}
3180
        global CONFIG_MCTRLFT_SDRAM_SEPBUS
3181
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1)} then {
3182
        set CONFIG_MCTRLFT_SDRAM_SEPBUS [expr $CONFIG_MCTRLFT_SDRAM_SEPBUS&15]} else {set CONFIG_MCTRLFT_SDRAM_SEPBUS [expr $CONFIG_MCTRLFT_SDRAM_SEPBUS|16]}
3183
        global CONFIG_MCTRLFT_SDRAM_INVCLK
3184
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1)} then {
3185
        set CONFIG_MCTRLFT_SDRAM_INVCLK [expr $CONFIG_MCTRLFT_SDRAM_INVCLK&15]} else {set CONFIG_MCTRLFT_SDRAM_INVCLK [expr $CONFIG_MCTRLFT_SDRAM_INVCLK|16]}
3186
        global CONFIG_MCTRLFT_PAGE
3187
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1)} then {
3188
        set CONFIG_MCTRLFT_PAGE [expr $CONFIG_MCTRLFT_PAGE&15]} else {set CONFIG_MCTRLFT_PAGE [expr $CONFIG_MCTRLFT_PAGE|16]}
3189
        global CONFIG_MCTRLFT_PROGPAGE
3190
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1) && ($CONFIG_MCTRLFT_PAGE == 1)} then {
3191
        set CONFIG_MCTRLFT_PROGPAGE [expr $CONFIG_MCTRLFT_PROGPAGE&15]} else {set CONFIG_MCTRLFT_PROGPAGE [expr $CONFIG_MCTRLFT_PROGPAGE|16]}
3192
        global CONFIG_MCTRLFT_EDAC
3193
        if {($CONFIG_MCTRLFT == 1)} then {
3194
        set CONFIG_MCTRLFT_EDAC [expr $CONFIG_MCTRLFT_EDAC&15]} else {set CONFIG_MCTRLFT_EDAC [expr $CONFIG_MCTRLFT_EDAC|16]}
3195
        global CONFIG_MCTRLFT_EDACPIPE
3196
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_EDAC == 1)} then {
3197
        set CONFIG_MCTRLFT_EDACPIPE [expr $CONFIG_MCTRLFT_EDACPIPE&15]} else {set CONFIG_MCTRLFT_EDACPIPE [expr $CONFIG_MCTRLFT_EDACPIPE|16]}
3198
        global CONFIG_MCTRLFT_WFB
3199
        if {($CONFIG_MCTRLFT == 1)} then {
3200
        set CONFIG_MCTRLFT_WFB [expr $CONFIG_MCTRLFT_WFB&15]} else {set CONFIG_MCTRLFT_WFB [expr $CONFIG_MCTRLFT_WFB|16]}
3201
}
3202
 
3203
 
3204
proc menu15 {w title} {
3205
        set oldFocus [focus]
3206
        catch {focus .menu13}
3207
        catch {destroy $w; unregister_active 15}
3208
        toplevel $w -class Dialog
3209
        wm withdraw $w
3210
        global active_menus
3211
        set active_menus [lsort -integer [linsert $active_menus end 15]]
3212
        message $w.m -width 400 -aspect 300 -text \
3213
                "Leon2 memory controller        "  -relief raised
3214
        pack $w.m -pady 10 -side top -padx 10
3215
        wm title $w "Leon2 memory controller        "
3216
 
3217
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 15; break"
3218
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 15; catch {destroy .menu13}; unregister_active 13; menu16 .menu16 \"$title\""
3219
        frame $w.f
3220
        button $w.f.back -text "OK" \
3221
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 15"
3222
        button $w.f.next -text "Next" -underline 0\
3223
                -width 15 -command $nextscript
3224
        bind all  $nextscript
3225
        button $w.f.prev -text "Prev" -underline 0\
3226
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 15; menu14 .menu14 \"$title\""
3227
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 15; menu14 .menu14 \"$title\";break"
3228
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3229
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3230
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3231
        pack $w.topline -side top -fill x
3232
 
3233
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3234
        pack $w.botline -side bottom -fill x
3235
 
3236
        frame $w.config
3237
        pack $w.config -fill y -expand on
3238
 
3239
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3240
        pack $w.config.vscroll -side right -fill y
3241
 
3242
        canvas $w.config.canvas -height 1\
3243
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3244
                -width [expr [winfo screenwidth .] * 1 / 2]
3245
        frame $w.config.f
3246
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3247
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3248
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3249
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3250
        bind $w  "$w.config.canvas yview moveto 0;break;"
3251
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3252
        pack $w.config.canvas -side right -fill y
3253
 
3254
 
3255
        bool $w.config.f 15 0 "Enable Leon2 memory controller  " CONFIG_MCTRL_LEON2
3256
        bool $w.config.f 15 1 "8-bit PROM/SRAM bus support    " CONFIG_MCTRL_8BIT
3257
        bool $w.config.f 15 2 "16-bit PROM/SRAM bus support    " CONFIG_MCTRL_16BIT
3258
        bool $w.config.f 15 3 "5th SRAM chip-select  " CONFIG_MCTRL_5CS
3259
        bool $w.config.f 15 4 "SDRAM controller       " CONFIG_MCTRL_SDRAM
3260
        bool $w.config.f 15 5 "Separate address and data buses" CONFIG_MCTRL_SDRAM_SEPBUS
3261
        bool $w.config.f 15 6 "64-bit SDRAM data bus" CONFIG_MCTRL_SDRAM_BUS64
3262
        bool $w.config.f 15 7 "Unsynchronized sdclock" CONFIG_MCTRL_SDRAM_INVCLK
3263
        bool $w.config.f 15 8 "Enable page burst operation     " CONFIG_MCTRL_PAGE
3264
        bool $w.config.f 15 9 "Enable programmable page burst " CONFIG_MCTRL_PROGPAGE
3265
 
3266
 
3267
 
3268
        focus $w
3269
        update_active
3270
        global winx; global winy
3271
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Memory controllers             "}
3272
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
3273
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3274
        update idletasks
3275
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3276
 
3277
        $w.config.canvas configure \
3278
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3279
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3280
                         [expr [winfo reqheight $w.config.f] + 1]"
3281
 
3282
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3283
        set scry [expr [winfo screenh $w] / 2]
3284
        set maxy [expr [winfo screenh $w] * 3 / 4]
3285
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3286
        if [expr $winy + $canvtotal < $maxy] {
3287
                $w.config.canvas configure -height $canvtotal
3288
        } else {
3289
                $w.config.canvas configure -height [expr $scry - $winy]
3290
                }
3291
        }
3292
        update idletasks
3293
        if {[winfo exists $w]} then {
3294
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3295
        wm minsize $w [winfo width $w] 100
3296
 
3297
        wm deiconify $w
3298
}
3299
}
3300
 
3301
proc update_menu15 {} {
3302
        global CONFIG_MCTRL_LEON2
3303
        global CONFIG_MCTRL_8BIT
3304
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3305
        configure_entry .menu15.config.f.x1 normal {n l y}} else {configure_entry .menu15.config.f.x1 disabled {y n l}}
3306
        global CONFIG_MCTRL_16BIT
3307
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3308
        configure_entry .menu15.config.f.x2 normal {n l y}} else {configure_entry .menu15.config.f.x2 disabled {y n l}}
3309
        global CONFIG_MCTRL_5CS
3310
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3311
        configure_entry .menu15.config.f.x3 normal {n l y}} else {configure_entry .menu15.config.f.x3 disabled {y n l}}
3312
        global CONFIG_MCTRL_SDRAM
3313
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3314
        configure_entry .menu15.config.f.x4 normal {n l y}} else {configure_entry .menu15.config.f.x4 disabled {y n l}}
3315
        global CONFIG_MCTRL_SDRAM_SEPBUS
3316
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {
3317
        configure_entry .menu15.config.f.x5 normal {n l y}} else {configure_entry .menu15.config.f.x5 disabled {y n l}}
3318
        global CONFIG_MCTRL_SDRAM_BUS64
3319
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_SDRAM_SEPBUS == 1)} then {
3320
        configure_entry .menu15.config.f.x6 normal {n l y}} else {configure_entry .menu15.config.f.x6 disabled {y n l}}
3321
        global CONFIG_MCTRL_SDRAM_INVCLK
3322
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_SDRAM_SEPBUS == 1)} then {
3323
        configure_entry .menu15.config.f.x7 normal {n l y}} else {configure_entry .menu15.config.f.x7 disabled {y n l}}
3324
        global CONFIG_MCTRL_PAGE
3325
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {
3326
        configure_entry .menu15.config.f.x8 normal {n l y}} else {configure_entry .menu15.config.f.x8 disabled {y n l}}
3327
        global CONFIG_MCTRL_PROGPAGE
3328
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_PAGE == 1)} then {
3329
        configure_entry .menu15.config.f.x9 normal {n l y}} else {configure_entry .menu15.config.f.x9 disabled {y n l}}
3330
}
3331
 
3332
 
3333
proc update_define_menu15 {} {
3334
        update_define_mainmenu
3335
        global CONFIG_MODULES
3336
        global CONFIG_MCTRL_LEON2
3337
        global CONFIG_MCTRL_8BIT
3338
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3339
        set CONFIG_MCTRL_8BIT [expr $CONFIG_MCTRL_8BIT&15]} else {set CONFIG_MCTRL_8BIT [expr $CONFIG_MCTRL_8BIT|16]}
3340
        global CONFIG_MCTRL_16BIT
3341
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3342
        set CONFIG_MCTRL_16BIT [expr $CONFIG_MCTRL_16BIT&15]} else {set CONFIG_MCTRL_16BIT [expr $CONFIG_MCTRL_16BIT|16]}
3343
        global CONFIG_MCTRL_5CS
3344
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3345
        set CONFIG_MCTRL_5CS [expr $CONFIG_MCTRL_5CS&15]} else {set CONFIG_MCTRL_5CS [expr $CONFIG_MCTRL_5CS|16]}
3346
        global CONFIG_MCTRL_SDRAM
3347
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3348
        set CONFIG_MCTRL_SDRAM [expr $CONFIG_MCTRL_SDRAM&15]} else {set CONFIG_MCTRL_SDRAM [expr $CONFIG_MCTRL_SDRAM|16]}
3349
        global CONFIG_MCTRL_SDRAM_SEPBUS
3350
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {
3351
        set CONFIG_MCTRL_SDRAM_SEPBUS [expr $CONFIG_MCTRL_SDRAM_SEPBUS&15]} else {set CONFIG_MCTRL_SDRAM_SEPBUS [expr $CONFIG_MCTRL_SDRAM_SEPBUS|16]}
3352
        global CONFIG_MCTRL_SDRAM_BUS64
3353
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_SDRAM_SEPBUS == 1)} then {
3354
        set CONFIG_MCTRL_SDRAM_BUS64 [expr $CONFIG_MCTRL_SDRAM_BUS64&15]} else {set CONFIG_MCTRL_SDRAM_BUS64 [expr $CONFIG_MCTRL_SDRAM_BUS64|16]}
3355
        global CONFIG_MCTRL_SDRAM_INVCLK
3356
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_SDRAM_SEPBUS == 1)} then {
3357
        set CONFIG_MCTRL_SDRAM_INVCLK [expr $CONFIG_MCTRL_SDRAM_INVCLK&15]} else {set CONFIG_MCTRL_SDRAM_INVCLK [expr $CONFIG_MCTRL_SDRAM_INVCLK|16]}
3358
        global CONFIG_MCTRL_PAGE
3359
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {
3360
        set CONFIG_MCTRL_PAGE [expr $CONFIG_MCTRL_PAGE&15]} else {set CONFIG_MCTRL_PAGE [expr $CONFIG_MCTRL_PAGE|16]}
3361
        global CONFIG_MCTRL_PROGPAGE
3362
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_PAGE == 1)} then {
3363
        set CONFIG_MCTRL_PROGPAGE [expr $CONFIG_MCTRL_PROGPAGE&15]} else {set CONFIG_MCTRL_PROGPAGE [expr $CONFIG_MCTRL_PROGPAGE|16]}
3364
}
3365
 
3366
 
3367
menu_option menu16 16 "Peripherals             "
3368
proc menu16 {w title} {
3369
        set oldFocus [focus]
3370
        catch {destroy $w; unregister_active 16}
3371
        toplevel $w -class Dialog
3372
        wm withdraw $w
3373
        global active_menus
3374
        set active_menus [lsort -integer [linsert $active_menus end 16]]
3375
        message $w.m -width 400 -aspect 300 -text \
3376
                "Peripherals             "  -relief raised
3377
        pack $w.m -pady 10 -side top -padx 10
3378
        wm title $w "Peripherals             "
3379
 
3380
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 16; break"
3381
        set nextscript "catch {focus $oldFocus}; menu17 .menu17 \"$title\""
3382
        frame $w.f
3383
        button $w.f.back -text "Main Menu" \
3384
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 16"
3385
        button $w.f.next -text "Next" -underline 0\
3386
                -width 15 -command $nextscript
3387
        bind all  $nextscript
3388
        button $w.f.prev -text "Prev" -underline 0\
3389
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 16; menu15 .menu15 \"$title\""
3390
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 16; menu15 .menu15 \"$title\";break"
3391
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3392
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3393
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3394
        pack $w.topline -side top -fill x
3395
 
3396
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3397
        pack $w.botline -side bottom -fill x
3398
 
3399
        frame $w.config
3400
        pack $w.config -fill y -expand on
3401
 
3402
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3403
        pack $w.config.vscroll -side right -fill y
3404
 
3405
        canvas $w.config.canvas -height 1\
3406
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3407
                -width [expr [winfo screenwidth .] * 1 / 2]
3408
        frame $w.config.f
3409
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3410
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3411
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3412
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3413
        bind $w  "$w.config.canvas yview moveto 0;break;"
3414
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3415
        pack $w.config.canvas -side right -fill y
3416
 
3417
 
3418
        submenu $w.config.f 16 0 "Ethernet             " 17
3419
        submenu $w.config.f 16 1 "CAN                     " 18
3420
        submenu $w.config.f 16 2 "PCI              " 19
3421
        submenu $w.config.f 16 3 "Spacewire " 20
3422
        submenu $w.config.f 16 4 "UARTs, timers and irq control         " 21
3423
 
3424
 
3425
 
3426
        focus $w
3427
        update_active
3428
        global winx; global winy
3429
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
3430
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3431
        update idletasks
3432
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3433
 
3434
        $w.config.canvas configure \
3435
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3436
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3437
                         [expr [winfo reqheight $w.config.f] + 1]"
3438
 
3439
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3440
        set scry [expr [winfo screenh $w] / 2]
3441
        set maxy [expr [winfo screenh $w] * 3 / 4]
3442
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3443
        if [expr $winy + $canvtotal < $maxy] {
3444
                $w.config.canvas configure -height $canvtotal
3445
        } else {
3446
                $w.config.canvas configure -height [expr $scry - $winy]
3447
                }
3448
        }
3449
        update idletasks
3450
        if {[winfo exists $w]} then {
3451
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3452
        wm minsize $w [winfo width $w] 100
3453
 
3454
        wm deiconify $w
3455
}
3456
}
3457
 
3458
proc update_menu16 {} {
3459
}
3460
 
3461
 
3462
proc update_define_menu16 {} {
3463
        update_define_mainmenu
3464
        global CONFIG_MODULES
3465
}
3466
 
3467
 
3468
proc menu17 {w title} {
3469
        set oldFocus [focus]
3470
        catch {focus .menu16}
3471
        catch {destroy $w; unregister_active 17}
3472
        toplevel $w -class Dialog
3473
        wm withdraw $w
3474
        global active_menus
3475
        set active_menus [lsort -integer [linsert $active_menus end 17]]
3476
        message $w.m -width 400 -aspect 300 -text \
3477
                "Ethernet             "  -relief raised
3478
        pack $w.m -pady 10 -side top -padx 10
3479
        wm title $w "Ethernet             "
3480
 
3481
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 17; break"
3482
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 17; menu18 .menu18 \"$title\""
3483
        frame $w.f
3484
        button $w.f.back -text "OK" \
3485
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 17"
3486
        button $w.f.next -text "Next" -underline 0\
3487
                -width 15 -command $nextscript
3488
        bind all  $nextscript
3489
        button $w.f.prev -text "Prev" -underline 0\
3490
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 17; menu16 .menu16 \"$title\""
3491
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 17; menu16 .menu16 \"$title\";break"
3492
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3493
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3494
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3495
        pack $w.topline -side top -fill x
3496
 
3497
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3498
        pack $w.botline -side bottom -fill x
3499
 
3500
        frame $w.config
3501
        pack $w.config -fill y -expand on
3502
 
3503
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3504
        pack $w.config.vscroll -side right -fill y
3505
 
3506
        canvas $w.config.canvas -height 1\
3507
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3508
                -width [expr [winfo screenwidth .] * 1 / 2]
3509
        frame $w.config.f
3510
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3511
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3512
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3513
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3514
        bind $w  "$w.config.canvas yview moveto 0;break;"
3515
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3516
        pack $w.config.canvas -side right -fill y
3517
 
3518
 
3519
        bool $w.config.f 17 0 "Gaisler Research 10/100/1000 Mbit Ethernet MAC " CONFIG_GRETH_ENABLE
3520
        bool $w.config.f 17 1 "Enable 1000 Mbit support    " CONFIG_GRETH_GIGA
3521
        global tmpvar_27
3522
        minimenu $w.config.f 17 2 "AHB FIFO size (words)            " tmpvar_27 CONFIG_GRETH_FIFO4
3523
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"AHB FIFO size (words)            \""
3524
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_27 -value "4" -command "update_active"
3525
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_27 -value "8" -command "update_active"
3526
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_27 -value "16" -command "update_active"
3527
        $w.config.f.x2.x.menu add radiobutton -label "32" -variable tmpvar_27 -value "32" -command "update_active"
3528
        $w.config.f.x2.x.menu add radiobutton -label "64" -variable tmpvar_27 -value "64" -command "update_active"
3529
        menusplit $w $w.config.f.x2.x.menu 5
3530
 
3531
 
3532
 
3533
        focus $w
3534
        update_active
3535
        global winx; global winy
3536
        if {[winfo exists .menu16] == 0} then {menu16 .menu16 "Peripherals             "}
3537
        set winx [expr [winfo x .menu16]+30]; set winy [expr [winfo y .menu16]+30]
3538
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3539
        update idletasks
3540
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3541
 
3542
        $w.config.canvas configure \
3543
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3544
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3545
                         [expr [winfo reqheight $w.config.f] + 1]"
3546
 
3547
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3548
        set scry [expr [winfo screenh $w] / 2]
3549
        set maxy [expr [winfo screenh $w] * 3 / 4]
3550
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3551
        if [expr $winy + $canvtotal < $maxy] {
3552
                $w.config.canvas configure -height $canvtotal
3553
        } else {
3554
                $w.config.canvas configure -height [expr $scry - $winy]
3555
                }
3556
        }
3557
        update idletasks
3558
        if {[winfo exists $w]} then {
3559
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3560
        wm minsize $w [winfo width $w] 100
3561
 
3562
        wm deiconify $w
3563
}
3564
}
3565
 
3566
proc update_menu17 {} {
3567
        global CONFIG_GRETH_ENABLE
3568
        global CONFIG_GRETH_GIGA
3569
        if {($CONFIG_GRETH_ENABLE == 1)} then {
3570
        configure_entry .menu17.config.f.x1 normal {n l y}} else {configure_entry .menu17.config.f.x1 disabled {y n l}}
3571
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_GRETH_GIGA == 0)} then {configure_entry .menu17.config.f.x2 normal {x l}} else {configure_entry .menu17.config.f.x2 disabled {x l}}
3572
}
3573
 
3574
 
3575
proc update_define_menu17 {} {
3576
        update_define_mainmenu
3577
        global CONFIG_MODULES
3578
        global CONFIG_GRETH_ENABLE
3579
        global CONFIG_GRETH_GIGA
3580
        if {($CONFIG_GRETH_ENABLE == 1)} then {
3581
        set CONFIG_GRETH_GIGA [expr $CONFIG_GRETH_GIGA&15]} else {set CONFIG_GRETH_GIGA [expr $CONFIG_GRETH_GIGA|16]}
3582
        global tmpvar_27
3583
        global CONFIG_GRETH_FIFO4
3584
        if {$tmpvar_27 == "4"} then {set CONFIG_GRETH_FIFO4 1} else {set CONFIG_GRETH_FIFO4 0}
3585
        global CONFIG_GRETH_FIFO8
3586
        if {$tmpvar_27 == "8"} then {set CONFIG_GRETH_FIFO8 1} else {set CONFIG_GRETH_FIFO8 0}
3587
        global CONFIG_GRETH_FIFO16
3588
        if {$tmpvar_27 == "16"} then {set CONFIG_GRETH_FIFO16 1} else {set CONFIG_GRETH_FIFO16 0}
3589
        global CONFIG_GRETH_FIFO32
3590
        if {$tmpvar_27 == "32"} then {set CONFIG_GRETH_FIFO32 1} else {set CONFIG_GRETH_FIFO32 0}
3591
        global CONFIG_GRETH_FIFO64
3592
        if {$tmpvar_27 == "64"} then {set CONFIG_GRETH_FIFO64 1} else {set CONFIG_GRETH_FIFO64 0}
3593
}
3594
 
3595
 
3596
proc menu18 {w title} {
3597
        set oldFocus [focus]
3598
        catch {focus .menu16}
3599
        catch {destroy $w; unregister_active 18}
3600
        toplevel $w -class Dialog
3601
        wm withdraw $w
3602
        global active_menus
3603
        set active_menus [lsort -integer [linsert $active_menus end 18]]
3604
        message $w.m -width 400 -aspect 300 -text \
3605
                "CAN                     "  -relief raised
3606
        pack $w.m -pady 10 -side top -padx 10
3607
        wm title $w "CAN                     "
3608
 
3609
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 18; break"
3610
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 18; menu19 .menu19 \"$title\""
3611
        frame $w.f
3612
        button $w.f.back -text "OK" \
3613
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 18"
3614
        button $w.f.next -text "Next" -underline 0\
3615
                -width 15 -command $nextscript
3616
        bind all  $nextscript
3617
        button $w.f.prev -text "Prev" -underline 0\
3618
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 18; menu17 .menu17 \"$title\""
3619
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 18; menu17 .menu17 \"$title\";break"
3620
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3621
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3622
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3623
        pack $w.topline -side top -fill x
3624
 
3625
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3626
        pack $w.botline -side bottom -fill x
3627
 
3628
        frame $w.config
3629
        pack $w.config -fill y -expand on
3630
 
3631
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3632
        pack $w.config.vscroll -side right -fill y
3633
 
3634
        canvas $w.config.canvas -height 1\
3635
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3636
                -width [expr [winfo screenwidth .] * 1 / 2]
3637
        frame $w.config.f
3638
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3639
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3640
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3641
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3642
        bind $w  "$w.config.canvas yview moveto 0;break;"
3643
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3644
        pack $w.config.canvas -side right -fill y
3645
 
3646
 
3647
        bool $w.config.f 18 0 "Enable multi-core CAN interface                 " CONFIG_CAN_ENABLE
3648
        int $w.config.f 18 1 "Number of CAN cores                      " CONFIG_CAN_NUM
3649
        hex $w.config.f 18 2 "CAN I/O area start address (haddr\[19:8\]) " CONFIG_CANIO
3650
        int $w.config.f 18 3 "Interrupt number                      " CONFIG_CANIRQ
3651
        bool $w.config.f 18 4 "Enable separate interrupts           " CONFIG_CANSEPIRQ
3652
        bool $w.config.f 18 5 "Enable synchronous reset             " CONFIG_CAN_SYNCRST
3653
        bool $w.config.f 18 6 "Enable FT FIFO memory                " CONFIG_CAN_FT
3654
 
3655
 
3656
 
3657
        focus $w
3658
        update_active
3659
        global winx; global winy
3660
        if {[winfo exists .menu16] == 0} then {menu16 .menu16 "Peripherals             "}
3661
        set winx [expr [winfo x .menu16]+30]; set winy [expr [winfo y .menu16]+30]
3662
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3663
        update idletasks
3664
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3665
 
3666
        $w.config.canvas configure \
3667
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3668
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3669
                         [expr [winfo reqheight $w.config.f] + 1]"
3670
 
3671
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3672
        set scry [expr [winfo screenh $w] / 2]
3673
        set maxy [expr [winfo screenh $w] * 3 / 4]
3674
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3675
        if [expr $winy + $canvtotal < $maxy] {
3676
                $w.config.canvas configure -height $canvtotal
3677
        } else {
3678
                $w.config.canvas configure -height [expr $scry - $winy]
3679
                }
3680
        }
3681
        update idletasks
3682
        if {[winfo exists $w]} then {
3683
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3684
        wm minsize $w [winfo width $w] 100
3685
 
3686
        wm deiconify $w
3687
}
3688
}
3689
 
3690
proc update_menu18 {} {
3691
        global CONFIG_CAN_ENABLE
3692
        global CONFIG_CAN_NUM
3693
        if {($CONFIG_CAN_ENABLE == 1)} then {.menu18.config.f.x1.x configure -state normal -foreground [ cget .ref -foreground ]; .menu18.config.f.x1.l configure -state normal; } else {.menu18.config.f.x1.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu18.config.f.x1.l configure -state disabled}
3694
        global CONFIG_CANIO
3695
        if {($CONFIG_CAN_ENABLE == 1)} then {.menu18.config.f.x2.x configure -state normal -foreground [ cget .ref -foreground ]; .menu18.config.f.x2.l configure -state normal; } else {.menu18.config.f.x2.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu18.config.f.x2.l configure -state disabled}
3696
        global CONFIG_CANIRQ
3697
        if {($CONFIG_CAN_ENABLE == 1)} then {.menu18.config.f.x3.x configure -state normal -foreground [ cget .ref -foreground ]; .menu18.config.f.x3.l configure -state normal; } else {.menu18.config.f.x3.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu18.config.f.x3.l configure -state disabled}
3698
        global CONFIG_CANSEPIRQ
3699
        if {($CONFIG_CAN_ENABLE == 1)} then {
3700
        configure_entry .menu18.config.f.x4 normal {n l y}} else {configure_entry .menu18.config.f.x4 disabled {y n l}}
3701
        global CONFIG_CAN_SYNCRST
3702
        if {($CONFIG_CAN_ENABLE == 1)} then {
3703
        configure_entry .menu18.config.f.x5 normal {n l y}} else {configure_entry .menu18.config.f.x5 disabled {y n l}}
3704
        global CONFIG_CAN_FT
3705
        if {($CONFIG_CAN_ENABLE == 1)} then {
3706
        configure_entry .menu18.config.f.x6 normal {n l y}} else {configure_entry .menu18.config.f.x6 disabled {y n l}}
3707
}
3708
 
3709
 
3710
proc update_define_menu18 {} {
3711
        update_define_mainmenu
3712
        global CONFIG_MODULES
3713
        global CONFIG_CAN_ENABLE
3714
        global CONFIG_CAN_NUM
3715
        if {($CONFIG_CAN_ENABLE == 1)} then {validate_int CONFIG_CAN_NUM "$CONFIG_CAN_NUM" 1}
3716
        global CONFIG_CANIO
3717
        if {($CONFIG_CAN_ENABLE == 1)} then {validate_hex CONFIG_CANIO "$CONFIG_CANIO" C00}
3718
        global CONFIG_CANIRQ
3719
        if {($CONFIG_CAN_ENABLE == 1)} then {validate_int CONFIG_CANIRQ "$CONFIG_CANIRQ" 13}
3720
        global CONFIG_CANSEPIRQ
3721
        if {($CONFIG_CAN_ENABLE == 1)} then {
3722
        set CONFIG_CANSEPIRQ [expr $CONFIG_CANSEPIRQ&15]} else {set CONFIG_CANSEPIRQ [expr $CONFIG_CANSEPIRQ|16]}
3723
        global CONFIG_CAN_SYNCRST
3724
        if {($CONFIG_CAN_ENABLE == 1)} then {
3725
        set CONFIG_CAN_SYNCRST [expr $CONFIG_CAN_SYNCRST&15]} else {set CONFIG_CAN_SYNCRST [expr $CONFIG_CAN_SYNCRST|16]}
3726
        global CONFIG_CAN_FT
3727
        if {($CONFIG_CAN_ENABLE == 1)} then {
3728
        set CONFIG_CAN_FT [expr $CONFIG_CAN_FT&15]} else {set CONFIG_CAN_FT [expr $CONFIG_CAN_FT|16]}
3729
}
3730
 
3731
 
3732
proc menu19 {w title} {
3733
        set oldFocus [focus]
3734
        catch {focus .menu16}
3735
        catch {destroy $w; unregister_active 19}
3736
        toplevel $w -class Dialog
3737
        wm withdraw $w
3738
        global active_menus
3739
        set active_menus [lsort -integer [linsert $active_menus end 19]]
3740
        message $w.m -width 400 -aspect 300 -text \
3741
                "PCI              "  -relief raised
3742
        pack $w.m -pady 10 -side top -padx 10
3743
        wm title $w "PCI              "
3744
 
3745
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 19; break"
3746
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 19; menu20 .menu20 \"$title\""
3747
        frame $w.f
3748
        button $w.f.back -text "OK" \
3749
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 19"
3750
        button $w.f.next -text "Next" -underline 0\
3751
                -width 15 -command $nextscript
3752
        bind all  $nextscript
3753
        button $w.f.prev -text "Prev" -underline 0\
3754
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 19; menu18 .menu18 \"$title\""
3755
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 19; menu18 .menu18 \"$title\";break"
3756
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3757
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3758
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3759
        pack $w.topline -side top -fill x
3760
 
3761
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3762
        pack $w.botline -side bottom -fill x
3763
 
3764
        frame $w.config
3765
        pack $w.config -fill y -expand on
3766
 
3767
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3768
        pack $w.config.vscroll -side right -fill y
3769
 
3770
        canvas $w.config.canvas -height 1\
3771
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3772
                -width [expr [winfo screenwidth .] * 1 / 2]
3773
        frame $w.config.f
3774
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3775
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3776
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3777
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3778
        bind $w  "$w.config.canvas yview moveto 0;break;"
3779
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3780
        pack $w.config.canvas -side right -fill y
3781
 
3782
 
3783
        bool $w.config.f 19 0 "PCI interface, target-only     " CONFIG_PCI_SIMPLE_TARGET
3784
        bool $w.config.f 19 1 "PCI interface, master-target     " CONFIG_PCI_MASTER_TARGET
3785
        bool $w.config.f 19 2 "PCI DMA controller               " CONFIG_PCI_MASTER_TARGET_DMA
3786
        hex $w.config.f 19 3 "PCI vendor ID" CONFIG_PCI_VENDORID
3787
        hex $w.config.f 19 4 "PCI device ID" CONFIG_PCI_DEVICEID
3788
        global tmpvar_28
3789
        minimenu $w.config.f 19 5 "PCI FIFO depth" tmpvar_28 CONFIG_PCI_FIFO0
3790
        menu $w.config.f.x5.x.menu -tearoffcommand "menutitle \"PCI FIFO depth\""
3791
        $w.config.f.x5.x.menu add radiobutton -label "None" -variable tmpvar_28 -value "None" -command "update_active"
3792
        $w.config.f.x5.x.menu add radiobutton -label "8" -variable tmpvar_28 -value "8" -command "update_active"
3793
        $w.config.f.x5.x.menu add radiobutton -label "16" -variable tmpvar_28 -value "16" -command "update_active"
3794
        $w.config.f.x5.x.menu add radiobutton -label "32" -variable tmpvar_28 -value "32" -command "update_active"
3795
        $w.config.f.x5.x.menu add radiobutton -label "64" -variable tmpvar_28 -value "64" -command "update_active"
3796
        $w.config.f.x5.x.menu add radiobutton -label "128" -variable tmpvar_28 -value "128" -command "update_active"
3797
        menusplit $w $w.config.f.x5.x.menu 6
3798
        hex $w.config.f 19 6 "PCI initiator address (haddr\[31:20\]) " CONFIG_PCI_HADDR
3799
        bool $w.config.f 19 7 "PCI arbiter  " CONFIG_PCI_ARBITER
3800
        bool $w.config.f 19 8 "PCI arbiter APB interface " CONFIG_PCI_ARBITER_APB
3801
        int $w.config.f 19 9 "Number of PCI REQ/GNT pairs" CONFIG_PCI_ARBITER_NREQ
3802
        bool $w.config.f 19 10 "Enable PCI trace buffer              " CONFIG_PCI_TRACE
3803
        global tmpvar_29
3804
        minimenu $w.config.f 19 11 "PCI trace buffer depth" tmpvar_29 CONFIG_PCI_TRACE256
3805
        menu $w.config.f.x11.x.menu -tearoffcommand "menutitle \"PCI trace buffer depth\""
3806
        $w.config.f.x11.x.menu add radiobutton -label "256" -variable tmpvar_29 -value "256" -command "update_active"
3807
        $w.config.f.x11.x.menu add radiobutton -label "512" -variable tmpvar_29 -value "512" -command "update_active"
3808
        $w.config.f.x11.x.menu add radiobutton -label "1024" -variable tmpvar_29 -value "1024" -command "update_active"
3809
        $w.config.f.x11.x.menu add radiobutton -label "2048" -variable tmpvar_29 -value "2048" -command "update_active"
3810
        $w.config.f.x11.x.menu add radiobutton -label "4096" -variable tmpvar_29 -value "4096" -command "update_active"
3811
        menusplit $w $w.config.f.x11.x.menu 5
3812
 
3813
 
3814
 
3815
        focus $w
3816
        update_active
3817
        global winx; global winy
3818
        if {[winfo exists .menu16] == 0} then {menu16 .menu16 "Peripherals             "}
3819
        set winx [expr [winfo x .menu16]+30]; set winy [expr [winfo y .menu16]+30]
3820
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3821
        update idletasks
3822
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3823
 
3824
        $w.config.canvas configure \
3825
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3826
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3827
                         [expr [winfo reqheight $w.config.f] + 1]"
3828
 
3829
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3830
        set scry [expr [winfo screenh $w] / 2]
3831
        set maxy [expr [winfo screenh $w] * 3 / 4]
3832
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3833
        if [expr $winy + $canvtotal < $maxy] {
3834
                $w.config.canvas configure -height $canvtotal
3835
        } else {
3836
                $w.config.canvas configure -height [expr $scry - $winy]
3837
                }
3838
        }
3839
        update idletasks
3840
        if {[winfo exists $w]} then {
3841
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3842
        wm minsize $w [winfo width $w] 100
3843
 
3844
        wm deiconify $w
3845
}
3846
}
3847
 
3848
proc update_menu19 {} {
3849
        global CONFIG_PCI_ACTEL
3850
        global CONFIG_PCI_SIMPLE_TARGET
3851
        if {($CONFIG_PCI_ACTEL != 1)} then {
3852
        configure_entry .menu19.config.f.x0 normal {n l y}} else {configure_entry .menu19.config.f.x0 disabled {y n l}}
3853
        global CONFIG_PCI_MASTER_TARGET
3854
        if {($CONFIG_PCI_SIMPLE_TARGET != 1 && $CONFIG_PCI_ACTEL != 1)} then {
3855
        configure_entry .menu19.config.f.x1 normal {n l y}} else {configure_entry .menu19.config.f.x1 disabled {y n l}}
3856
        global CONFIG_PCI_MASTER_TARGET_DMA
3857
        if {($CONFIG_PCI_MASTER_TARGET == 1)} then {
3858
        configure_entry .menu19.config.f.x2 normal {n l y}} else {configure_entry .menu19.config.f.x2 disabled {y n l}}
3859
        global CONFIG_PCI_VENDORID
3860
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {.menu19.config.f.x3.x configure -state normal -foreground [ cget .ref -foreground ]; .menu19.config.f.x3.l configure -state normal; } else {.menu19.config.f.x3.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu19.config.f.x3.l configure -state disabled}
3861
        global CONFIG_PCI_DEVICEID
3862
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {.menu19.config.f.x4.x configure -state normal -foreground [ cget .ref -foreground ]; .menu19.config.f.x4.l configure -state normal; } else {.menu19.config.f.x4.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu19.config.f.x4.l configure -state disabled}
3863
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1) && ($CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {configure_entry .menu19.config.f.x5 normal {x l}} else {configure_entry .menu19.config.f.x5 disabled {x l}}
3864
        global CONFIG_PCI_HADDR
3865
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1) && ($CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {.menu19.config.f.x6.x configure -state normal -foreground [ cget .ref -foreground ]; .menu19.config.f.x6.l configure -state normal; } else {.menu19.config.f.x6.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu19.config.f.x6.l configure -state disabled}
3866
        global CONFIG_PCI_ARBITER
3867
        global CONFIG_PCI_ARBITER_APB
3868
        if {($CONFIG_PCI_ARBITER == 1)} then {
3869
        configure_entry .menu19.config.f.x8 normal {n l y}} else {configure_entry .menu19.config.f.x8 disabled {y n l}}
3870
        global CONFIG_PCI_ARBITER_NREQ
3871
        if {($CONFIG_PCI_ARBITER == 1)} then {.menu19.config.f.x9.x configure -state normal -foreground [ cget .ref -foreground ]; .menu19.config.f.x9.l configure -state normal; } else {.menu19.config.f.x9.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu19.config.f.x9.l configure -state disabled}
3872
        global CONFIG_PCI_TRACE
3873
        if {($CONFIG_PCI_TRACE == 1)} then {configure_entry .menu19.config.f.x11 normal {x l}} else {configure_entry .menu19.config.f.x11 disabled {x l}}
3874
}
3875
 
3876
 
3877
proc update_define_menu19 {} {
3878
        update_define_mainmenu
3879
        global CONFIG_MODULES
3880
        global CONFIG_PCI_ACTEL
3881
        global CONFIG_PCI_SIMPLE_TARGET
3882
        if {($CONFIG_PCI_ACTEL != 1)} then {
3883
        set CONFIG_PCI_SIMPLE_TARGET [expr $CONFIG_PCI_SIMPLE_TARGET&15]} else {set CONFIG_PCI_SIMPLE_TARGET [expr $CONFIG_PCI_SIMPLE_TARGET|16]}
3884
        global CONFIG_PCI_MASTER_TARGET
3885
        if {($CONFIG_PCI_SIMPLE_TARGET != 1 && $CONFIG_PCI_ACTEL != 1)} then {
3886
        set CONFIG_PCI_MASTER_TARGET [expr $CONFIG_PCI_MASTER_TARGET&15]} else {set CONFIG_PCI_MASTER_TARGET [expr $CONFIG_PCI_MASTER_TARGET|16]}
3887
        global CONFIG_PCI_MASTER_TARGET_DMA
3888
        if {($CONFIG_PCI_MASTER_TARGET == 1)} then {
3889
        set CONFIG_PCI_MASTER_TARGET_DMA [expr $CONFIG_PCI_MASTER_TARGET_DMA&15]} else {set CONFIG_PCI_MASTER_TARGET_DMA [expr $CONFIG_PCI_MASTER_TARGET_DMA|16]}
3890
        global CONFIG_PCI_VENDORID
3891
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {validate_hex CONFIG_PCI_VENDORID "$CONFIG_PCI_VENDORID" 16E3}
3892
        global CONFIG_PCI_DEVICEID
3893
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {validate_hex CONFIG_PCI_DEVICEID "$CONFIG_PCI_DEVICEID" 0210}
3894
        global tmpvar_28
3895
        global CONFIG_PCI_FIFO0
3896
        if {$tmpvar_28 == "None"} then {set CONFIG_PCI_FIFO0 1} else {set CONFIG_PCI_FIFO0 0}
3897
        global CONFIG_PCI_FIFO8
3898
        if {$tmpvar_28 == "8"} then {set CONFIG_PCI_FIFO8 1} else {set CONFIG_PCI_FIFO8 0}
3899
        global CONFIG_PCI_FIFO16
3900
        if {$tmpvar_28 == "16"} then {set CONFIG_PCI_FIFO16 1} else {set CONFIG_PCI_FIFO16 0}
3901
        global CONFIG_PCI_FIFO32
3902
        if {$tmpvar_28 == "32"} then {set CONFIG_PCI_FIFO32 1} else {set CONFIG_PCI_FIFO32 0}
3903
        global CONFIG_PCI_FIFO64
3904
        if {$tmpvar_28 == "64"} then {set CONFIG_PCI_FIFO64 1} else {set CONFIG_PCI_FIFO64 0}
3905
        global CONFIG_PCI_FIFO128
3906
        if {$tmpvar_28 == "128"} then {set CONFIG_PCI_FIFO128 1} else {set CONFIG_PCI_FIFO128 0}
3907
        global CONFIG_PCI_HADDR
3908
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1) && ($CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {validate_hex CONFIG_PCI_HADDR "$CONFIG_PCI_HADDR" E00}
3909
        global CONFIG_PCI_ARBITER
3910
        global CONFIG_PCI_ARBITER_APB
3911
        if {($CONFIG_PCI_ARBITER == 1)} then {
3912
        set CONFIG_PCI_ARBITER_APB [expr $CONFIG_PCI_ARBITER_APB&15]} else {set CONFIG_PCI_ARBITER_APB [expr $CONFIG_PCI_ARBITER_APB|16]}
3913
        global CONFIG_PCI_ARBITER_NREQ
3914
        if {($CONFIG_PCI_ARBITER == 1)} then {validate_int CONFIG_PCI_ARBITER_NREQ "$CONFIG_PCI_ARBITER_NREQ" 4}
3915
        global tmpvar_29
3916
        global CONFIG_PCI_TRACE256
3917
        if {$tmpvar_29 == "256"} then {set CONFIG_PCI_TRACE256 1} else {set CONFIG_PCI_TRACE256 0}
3918
        global CONFIG_PCI_TRACE512
3919
        if {$tmpvar_29 == "512"} then {set CONFIG_PCI_TRACE512 1} else {set CONFIG_PCI_TRACE512 0}
3920
        global CONFIG_PCI_TRACE1024
3921
        if {$tmpvar_29 == "1024"} then {set CONFIG_PCI_TRACE1024 1} else {set CONFIG_PCI_TRACE1024 0}
3922
        global CONFIG_PCI_TRACE2048
3923
        if {$tmpvar_29 == "2048"} then {set CONFIG_PCI_TRACE2048 1} else {set CONFIG_PCI_TRACE2048 0}
3924
        global CONFIG_PCI_TRACE4096
3925
        if {$tmpvar_29 == "4096"} then {set CONFIG_PCI_TRACE4096 1} else {set CONFIG_PCI_TRACE4096 0}
3926
}
3927
 
3928
 
3929
proc menu20 {w title} {
3930
        set oldFocus [focus]
3931
        catch {focus .menu16}
3932
        catch {destroy $w; unregister_active 20}
3933
        toplevel $w -class Dialog
3934
        wm withdraw $w
3935
        global active_menus
3936
        set active_menus [lsort -integer [linsert $active_menus end 20]]
3937
        message $w.m -width 400 -aspect 300 -text \
3938
                "Spacewire "  -relief raised
3939
        pack $w.m -pady 10 -side top -padx 10
3940
        wm title $w "Spacewire "
3941
 
3942
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 20; break"
3943
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 20; menu21 .menu21 \"$title\""
3944
        frame $w.f
3945
        button $w.f.back -text "OK" \
3946
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 20"
3947
        button $w.f.next -text "Next" -underline 0\
3948
                -width 15 -command $nextscript
3949
        bind all  $nextscript
3950
        button $w.f.prev -text "Prev" -underline 0\
3951
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 20; menu19 .menu19 \"$title\""
3952
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 20; menu19 .menu19 \"$title\";break"
3953
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3954
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3955
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3956
        pack $w.topline -side top -fill x
3957
 
3958
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3959
        pack $w.botline -side bottom -fill x
3960
 
3961
        frame $w.config
3962
        pack $w.config -fill y -expand on
3963
 
3964
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3965
        pack $w.config.vscroll -side right -fill y
3966
 
3967
        canvas $w.config.canvas -height 1\
3968
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3969
                -width [expr [winfo screenwidth .] * 1 / 2]
3970
        frame $w.config.f
3971
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3972
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3973
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3974
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3975
        bind $w  "$w.config.canvas yview moveto 0;break;"
3976
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3977
        pack $w.config.canvas -side right -fill y
3978
 
3979
 
3980
        bool $w.config.f 20 0 "Enable Spacewire links              " CONFIG_SPW_ENABLE
3981
        int $w.config.f 20 1 "Number of links (1 - 3)" CONFIG_SPW_NUM
3982
        global tmpvar_30
3983
        minimenu $w.config.f 20 2 "AHB RX/TX FIFO size (32-bit words)     " tmpvar_30 CONFIG_SPW_AHBFIFO4
3984
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"AHB RX/TX FIFO size (32-bit words)     \""
3985
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_30 -value "4" -command "update_active"
3986
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_30 -value "8" -command "update_active"
3987
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_30 -value "16" -command "update_active"
3988
        $w.config.f.x2.x.menu add radiobutton -label "32" -variable tmpvar_30 -value "32" -command "update_active"
3989
        menusplit $w $w.config.f.x2.x.menu 4
3990
        global tmpvar_31
3991
        minimenu $w.config.f 20 3 "Receiver FIFO size (bytes)        " tmpvar_31 CONFIG_SPW_RXFIFO16
3992
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"Receiver FIFO size (bytes)        \""
3993
        $w.config.f.x3.x.menu add radiobutton -label "16" -variable tmpvar_31 -value "16" -command "update_active"
3994
        $w.config.f.x3.x.menu add radiobutton -label "32" -variable tmpvar_31 -value "32" -command "update_active"
3995
        $w.config.f.x3.x.menu add radiobutton -label "64" -variable tmpvar_31 -value "64" -command "update_active"
3996
        menusplit $w $w.config.f.x3.x.menu 3
3997
        bool $w.config.f 20 4 "Enable RMAP protocol   " CONFIG_SPW_RMAP
3998
        global tmpvar_32
3999
        minimenu $w.config.f 20 5 "RMAP buffer size (bytes)    " tmpvar_32 CONFIG_SPW_RMAPBUF2
4000
        menu $w.config.f.x5.x.menu -tearoffcommand "menutitle \"RMAP buffer size (bytes)    \""
4001
        $w.config.f.x5.x.menu add radiobutton -label "64" -variable tmpvar_32 -value "64" -command "update_active"
4002
        $w.config.f.x5.x.menu add radiobutton -label "128" -variable tmpvar_32 -value "128" -command "update_active"
4003
        $w.config.f.x5.x.menu add radiobutton -label "192" -variable tmpvar_32 -value "192" -command "update_active"
4004
        $w.config.f.x5.x.menu add radiobutton -label "256" -variable tmpvar_32 -value "256" -command "update_active"
4005
        menusplit $w $w.config.f.x5.x.menu 4
4006
        bool $w.config.f 20 6 "Enable RMAP CRC check  " CONFIG_SPW_RMAPCRC
4007
        bool $w.config.f 20 7 "Spacewire FIFO protection           " CONFIG_SPW_FT
4008
        bool $w.config.f 20 8 "Use GRSPWC netlist     " CONFIG_SPW_NETLIST
4009
 
4010
 
4011
 
4012
        focus $w
4013
        update_active
4014
        global winx; global winy
4015
        if {[winfo exists .menu16] == 0} then {menu16 .menu16 "Peripherals             "}
4016
        set winx [expr [winfo x .menu16]+30]; set winy [expr [winfo y .menu16]+30]
4017
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
4018
        update idletasks
4019
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
4020
 
4021
        $w.config.canvas configure \
4022
                -width [expr [winfo reqwidth $w.config.f] + 1]\
4023
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
4024
                         [expr [winfo reqheight $w.config.f] + 1]"
4025
 
4026
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
4027
        set scry [expr [winfo screenh $w] / 2]
4028
        set maxy [expr [winfo screenh $w] * 3 / 4]
4029
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
4030
        if [expr $winy + $canvtotal < $maxy] {
4031
                $w.config.canvas configure -height $canvtotal
4032
        } else {
4033
                $w.config.canvas configure -height [expr $scry - $winy]
4034
                }
4035
        }
4036
        update idletasks
4037
        if {[winfo exists $w]} then {
4038
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
4039
        wm minsize $w [winfo width $w] 100
4040
 
4041
        wm deiconify $w
4042
}
4043
}
4044
 
4045
proc update_menu20 {} {
4046
        global CONFIG_SPW_ENABLE
4047
        global CONFIG_SPW_NUM
4048
        if {($CONFIG_SPW_ENABLE == 1)} then {.menu20.config.f.x1.x configure -state normal -foreground [ cget .ref -foreground ]; .menu20.config.f.x1.l configure -state normal; } else {.menu20.config.f.x1.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu20.config.f.x1.l configure -state disabled}
4049
        if {($CONFIG_SPW_ENABLE == 1)} then {configure_entry .menu20.config.f.x2 normal {x l}} else {configure_entry .menu20.config.f.x2 disabled {x l}}
4050
        if {($CONFIG_SPW_ENABLE == 1)} then {configure_entry .menu20.config.f.x3 normal {x l}} else {configure_entry .menu20.config.f.x3 disabled {x l}}
4051
        global CONFIG_SPW_RMAP
4052
        if {($CONFIG_SPW_ENABLE == 1)} then {
4053
        configure_entry .menu20.config.f.x4 normal {n l y}} else {configure_entry .menu20.config.f.x4 disabled {y n l}}
4054
        if {($CONFIG_SPW_ENABLE == 1) && ($CONFIG_SPW_RMAP == 1)} then {configure_entry .menu20.config.f.x5 normal {x l}} else {configure_entry .menu20.config.f.x5 disabled {x l}}
4055
        global CONFIG_SPW_RMAPCRC
4056
        if {($CONFIG_SPW_ENABLE == 1)} then {
4057
        configure_entry .menu20.config.f.x6 normal {n l y}} else {configure_entry .menu20.config.f.x6 disabled {y n l}}
4058
        global CONFIG_SPW_FT
4059
        if {($CONFIG_SPW_ENABLE == 1)} then {
4060
        configure_entry .menu20.config.f.x7 normal {n l y}} else {configure_entry .menu20.config.f.x7 disabled {y n l}}
4061
        global CONFIG_SPW_NETLIST
4062
        if {($CONFIG_SPW_ENABLE == 1)} then {
4063
        configure_entry .menu20.config.f.x8 normal {n l y}} else {configure_entry .menu20.config.f.x8 disabled {y n l}}
4064
}
4065
 
4066
 
4067
proc update_define_menu20 {} {
4068
        update_define_mainmenu
4069
        global CONFIG_MODULES
4070
        global CONFIG_SPW_ENABLE
4071
        global CONFIG_SPW_NUM
4072
        if {($CONFIG_SPW_ENABLE == 1)} then {validate_int CONFIG_SPW_NUM "$CONFIG_SPW_NUM" 1}
4073
        global tmpvar_30
4074
        global CONFIG_SPW_AHBFIFO4
4075
        if {$tmpvar_30 == "4"} then {set CONFIG_SPW_AHBFIFO4 1} else {set CONFIG_SPW_AHBFIFO4 0}
4076
        global CONFIG_SPW_AHBFIFO8
4077
        if {$tmpvar_30 == "8"} then {set CONFIG_SPW_AHBFIFO8 1} else {set CONFIG_SPW_AHBFIFO8 0}
4078
        global CONFIG_SPW_AHBFIFO16
4079
        if {$tmpvar_30 == "16"} then {set CONFIG_SPW_AHBFIFO16 1} else {set CONFIG_SPW_AHBFIFO16 0}
4080
        global CONFIG_SPW_AHBFIFO32
4081
        if {$tmpvar_30 == "32"} then {set CONFIG_SPW_AHBFIFO32 1} else {set CONFIG_SPW_AHBFIFO32 0}
4082
        global tmpvar_31
4083
        global CONFIG_SPW_RXFIFO16
4084
        if {$tmpvar_31 == "16"} then {set CONFIG_SPW_RXFIFO16 1} else {set CONFIG_SPW_RXFIFO16 0}
4085
        global CONFIG_SPW_RXFIFO32
4086
        if {$tmpvar_31 == "32"} then {set CONFIG_SPW_RXFIFO32 1} else {set CONFIG_SPW_RXFIFO32 0}
4087
        global CONFIG_SPW_RXFIFO64
4088
        if {$tmpvar_31 == "64"} then {set CONFIG_SPW_RXFIFO64 1} else {set CONFIG_SPW_RXFIFO64 0}
4089
        global CONFIG_SPW_RMAP
4090
        if {($CONFIG_SPW_ENABLE == 1)} then {
4091
        set CONFIG_SPW_RMAP [expr $CONFIG_SPW_RMAP&15]} else {set CONFIG_SPW_RMAP [expr $CONFIG_SPW_RMAP|16]}
4092
        global tmpvar_32
4093
        global CONFIG_SPW_RMAPBUF2
4094
        if {$tmpvar_32 == "64"} then {set CONFIG_SPW_RMAPBUF2 1} else {set CONFIG_SPW_RMAPBUF2 0}
4095
        global CONFIG_SPW_RMAPBUF4
4096
        if {$tmpvar_32 == "128"} then {set CONFIG_SPW_RMAPBUF4 1} else {set CONFIG_SPW_RMAPBUF4 0}
4097
        global CONFIG_SPW_RMAPBUF6
4098
        if {$tmpvar_32 == "192"} then {set CONFIG_SPW_RMAPBUF6 1} else {set CONFIG_SPW_RMAPBUF6 0}
4099
        global CONFIG_SPW_RMAPBUF8
4100
        if {$tmpvar_32 == "256"} then {set CONFIG_SPW_RMAPBUF8 1} else {set CONFIG_SPW_RMAPBUF8 0}
4101
        global CONFIG_SPW_RMAPCRC
4102
        if {($CONFIG_SPW_ENABLE == 1)} then {
4103
        set CONFIG_SPW_RMAPCRC [expr $CONFIG_SPW_RMAPCRC&15]} else {set CONFIG_SPW_RMAPCRC [expr $CONFIG_SPW_RMAPCRC|16]}
4104
        global CONFIG_SPW_FT
4105
        if {($CONFIG_SPW_ENABLE == 1)} then {
4106
        set CONFIG_SPW_FT [expr $CONFIG_SPW_FT&15]} else {set CONFIG_SPW_FT [expr $CONFIG_SPW_FT|16]}
4107
        global CONFIG_SPW_NETLIST
4108
        if {($CONFIG_SPW_ENABLE == 1)} then {
4109
        set CONFIG_SPW_NETLIST [expr $CONFIG_SPW_NETLIST&15]} else {set CONFIG_SPW_NETLIST [expr $CONFIG_SPW_NETLIST|16]}
4110
}
4111
 
4112
 
4113
proc menu21 {w title} {
4114
        set oldFocus [focus]
4115
        catch {focus .menu16}
4116
        catch {destroy $w; unregister_active 21}
4117
        toplevel $w -class Dialog
4118
        wm withdraw $w
4119
        global active_menus
4120
        set active_menus [lsort -integer [linsert $active_menus end 21]]
4121
        message $w.m -width 400 -aspect 300 -text \
4122
                "UARTs, timers and irq control         "  -relief raised
4123
        pack $w.m -pady 10 -side top -padx 10
4124
        wm title $w "UARTs, timers and irq control         "
4125
 
4126
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 21; break"
4127
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 21; catch {destroy .menu16}; unregister_active 16; menu22 .menu22 \"$title\""
4128
        frame $w.f
4129
        button $w.f.back -text "OK" \
4130
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 21"
4131
        button $w.f.next -text "Next" -underline 0\
4132
                -width 15 -command $nextscript
4133
        bind all  $nextscript
4134
        button $w.f.prev -text "Prev" -underline 0\
4135
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 21; menu20 .menu20 \"$title\""
4136
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 21; menu20 .menu20 \"$title\";break"
4137
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
4138
        pack $w.f -pady 10 -side bottom -anchor w -fill x
4139
        frame $w.topline -relief ridge -borderwidth 2 -height 2
4140
        pack $w.topline -side top -fill x
4141
 
4142
        frame $w.botline -relief ridge -borderwidth 2 -height 2
4143
        pack $w.botline -side bottom -fill x
4144
 
4145
        frame $w.config
4146
        pack $w.config -fill y -expand on
4147
 
4148
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
4149
        pack $w.config.vscroll -side right -fill y
4150
 
4151
        canvas $w.config.canvas -height 1\
4152
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
4153
                -width [expr [winfo screenwidth .] * 1 / 2]
4154
        frame $w.config.f
4155
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
4156
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
4157
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
4158
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
4159
        bind $w  "$w.config.canvas yview moveto 0;break;"
4160
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
4161
        pack $w.config.canvas -side right -fill y
4162
 
4163
 
4164
        bool $w.config.f 21 0 "Enable console UART                  " CONFIG_UART1_ENABLE
4165
        global tmpvar_33
4166
        minimenu $w.config.f 21 1 "UART1 FIFO depth" tmpvar_33 CONFIG_UA1_FIFO1
4167
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"UART1 FIFO depth\""
4168
        $w.config.f.x1.x.menu add radiobutton -label "1" -variable tmpvar_33 -value "1" -command "update_active"
4169
        $w.config.f.x1.x.menu add radiobutton -label "2" -variable tmpvar_33 -value "2" -command "update_active"
4170
        $w.config.f.x1.x.menu add radiobutton -label "4" -variable tmpvar_33 -value "4" -command "update_active"
4171
        $w.config.f.x1.x.menu add radiobutton -label "8" -variable tmpvar_33 -value "8" -command "update_active"
4172
        $w.config.f.x1.x.menu add radiobutton -label "16" -variable tmpvar_33 -value "16" -command "update_active"
4173
        $w.config.f.x1.x.menu add radiobutton -label "32" -variable tmpvar_33 -value "32" -command "update_active"
4174
        menusplit $w $w.config.f.x1.x.menu 6
4175
        bool $w.config.f 21 2 "Enable secondary UART                " CONFIG_UART2_ENABLE
4176
        global tmpvar_34
4177
        minimenu $w.config.f 21 3 "UART2 FIFO depth" tmpvar_34 CONFIG_UA2_FIFO1
4178
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"UART2 FIFO depth\""
4179
        $w.config.f.x3.x.menu add radiobutton -label "1" -variable tmpvar_34 -value "1" -command "update_active"
4180
        $w.config.f.x3.x.menu add radiobutton -label "2" -variable tmpvar_34 -value "2" -command "update_active"
4181
        $w.config.f.x3.x.menu add radiobutton -label "4" -variable tmpvar_34 -value "4" -command "update_active"
4182
        $w.config.f.x3.x.menu add radiobutton -label "8" -variable tmpvar_34 -value "8" -command "update_active"
4183
        $w.config.f.x3.x.menu add radiobutton -label "16" -variable tmpvar_34 -value "16" -command "update_active"
4184
        $w.config.f.x3.x.menu add radiobutton -label "32" -variable tmpvar_34 -value "32" -command "update_active"
4185
        menusplit $w $w.config.f.x3.x.menu 6
4186
        bool $w.config.f 21 4 "Enable LEON3 interrupt controller    " CONFIG_IRQ3_ENABLE
4187
        bool $w.config.f 21 5 "Enable Timer Unit                    " CONFIG_GPT_ENABLE
4188
        int $w.config.f 21 6 "Number of timers (1 - 7)              " CONFIG_GPT_NTIM
4189
        int $w.config.f 21 7 "Scaler width (2 - 16)                 " CONFIG_GPT_SW
4190
        int $w.config.f 21 8 "Timer width (2 - 32)                  " CONFIG_GPT_TW
4191
        int $w.config.f 21 9 "Timer unit interrupt                  " CONFIG_GPT_IRQ
4192
        bool $w.config.f 21 10 "Separate interrupts                  " CONFIG_GPT_SEPIRQ
4193
        bool $w.config.f 21 11 "Watchdog enable                      " CONFIG_GPT_WDOGEN
4194
        hex $w.config.f 21 12 "Initial watchdog time-out value       " CONFIG_GPT_WDOG
4195
        bool $w.config.f 21 13 "Enable generic GPIO port              " CONFIG_GRGPIO_ENABLE
4196
        int $w.config.f 21 14 "GPIO width            " CONFIG_GRGPIO_WIDTH
4197
        hex $w.config.f 21 15 "GPIO interrupt mask   " CONFIG_GRGPIO_IMASK
4198
 
4199
 
4200
 
4201
        focus $w
4202
        update_active
4203
        global winx; global winy
4204
        if {[winfo exists .menu16] == 0} then {menu16 .menu16 "Peripherals             "}
4205
        set winx [expr [winfo x .menu16]+30]; set winy [expr [winfo y .menu16]+30]
4206
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
4207
        update idletasks
4208
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
4209
 
4210
        $w.config.canvas configure \
4211
                -width [expr [winfo reqwidth $w.config.f] + 1]\
4212
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
4213
                         [expr [winfo reqheight $w.config.f] + 1]"
4214
 
4215
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
4216
        set scry [expr [winfo screenh $w] / 2]
4217
        set maxy [expr [winfo screenh $w] * 3 / 4]
4218
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
4219
        if [expr $winy + $canvtotal < $maxy] {
4220
                $w.config.canvas configure -height $canvtotal
4221
        } else {
4222
                $w.config.canvas configure -height [expr $scry - $winy]
4223
                }
4224
        }
4225
        update idletasks
4226
        if {[winfo exists $w]} then {
4227
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
4228
        wm minsize $w [winfo width $w] 100
4229
 
4230
        wm deiconify $w
4231
}
4232
}
4233
 
4234
proc update_menu21 {} {
4235
        global CONFIG_UART1_ENABLE
4236
        if {($CONFIG_UART1_ENABLE == 1)} then {configure_entry .menu21.config.f.x1 normal {x l}} else {configure_entry .menu21.config.f.x1 disabled {x l}}
4237
        global CONFIG_UART2_ENABLE
4238
        if {($CONFIG_UART2_ENABLE == 1)} then {configure_entry .menu21.config.f.x3 normal {x l}} else {configure_entry .menu21.config.f.x3 disabled {x l}}
4239
        global CONFIG_GPT_ENABLE
4240
        global CONFIG_GPT_NTIM
4241
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu21.config.f.x6.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x6.l configure -state normal; } else {.menu21.config.f.x6.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x6.l configure -state disabled}
4242
        global CONFIG_GPT_SW
4243
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu21.config.f.x7.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x7.l configure -state normal; } else {.menu21.config.f.x7.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x7.l configure -state disabled}
4244
        global CONFIG_GPT_TW
4245
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu21.config.f.x8.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x8.l configure -state normal; } else {.menu21.config.f.x8.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x8.l configure -state disabled}
4246
        global CONFIG_GPT_IRQ
4247
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu21.config.f.x9.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x9.l configure -state normal; } else {.menu21.config.f.x9.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x9.l configure -state disabled}
4248
        global CONFIG_GPT_SEPIRQ
4249
        if {($CONFIG_GPT_ENABLE == 1)} then {
4250
        configure_entry .menu21.config.f.x10 normal {n l y}} else {configure_entry .menu21.config.f.x10 disabled {y n l}}
4251
        global CONFIG_GPT_WDOGEN
4252
        if {($CONFIG_GPT_ENABLE == 1)} then {
4253
        configure_entry .menu21.config.f.x11 normal {n l y}} else {configure_entry .menu21.config.f.x11 disabled {y n l}}
4254
        global CONFIG_GPT_WDOG
4255
        if {($CONFIG_GPT_ENABLE == 1) && ($CONFIG_GPT_WDOGEN == 1)} then {.menu21.config.f.x12.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x12.l configure -state normal; } else {.menu21.config.f.x12.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x12.l configure -state disabled}
4256
        global CONFIG_GRGPIO_ENABLE
4257
        global CONFIG_GRGPIO_WIDTH
4258
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {.menu21.config.f.x14.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x14.l configure -state normal; } else {.menu21.config.f.x14.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x14.l configure -state disabled}
4259
        global CONFIG_GRGPIO_IMASK
4260
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {.menu21.config.f.x15.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x15.l configure -state normal; } else {.menu21.config.f.x15.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x15.l configure -state disabled}
4261
}
4262
 
4263
 
4264
proc update_define_menu21 {} {
4265
        update_define_mainmenu
4266
        global CONFIG_MODULES
4267
        global tmpvar_33
4268
        global CONFIG_UA1_FIFO1
4269
        if {$tmpvar_33 == "1"} then {set CONFIG_UA1_FIFO1 1} else {set CONFIG_UA1_FIFO1 0}
4270
        global CONFIG_UA1_FIFO2
4271
        if {$tmpvar_33 == "2"} then {set CONFIG_UA1_FIFO2 1} else {set CONFIG_UA1_FIFO2 0}
4272
        global CONFIG_UA1_FIFO4
4273
        if {$tmpvar_33 == "4"} then {set CONFIG_UA1_FIFO4 1} else {set CONFIG_UA1_FIFO4 0}
4274
        global CONFIG_UA1_FIFO8
4275
        if {$tmpvar_33 == "8"} then {set CONFIG_UA1_FIFO8 1} else {set CONFIG_UA1_FIFO8 0}
4276
        global CONFIG_UA1_FIFO16
4277
        if {$tmpvar_33 == "16"} then {set CONFIG_UA1_FIFO16 1} else {set CONFIG_UA1_FIFO16 0}
4278
        global CONFIG_UA1_FIFO32
4279
        if {$tmpvar_33 == "32"} then {set CONFIG_UA1_FIFO32 1} else {set CONFIG_UA1_FIFO32 0}
4280
        global tmpvar_34
4281
        global CONFIG_UA2_FIFO1
4282
        if {$tmpvar_34 == "1"} then {set CONFIG_UA2_FIFO1 1} else {set CONFIG_UA2_FIFO1 0}
4283
        global CONFIG_UA2_FIFO2
4284
        if {$tmpvar_34 == "2"} then {set CONFIG_UA2_FIFO2 1} else {set CONFIG_UA2_FIFO2 0}
4285
        global CONFIG_UA2_FIFO4
4286
        if {$tmpvar_34 == "4"} then {set CONFIG_UA2_FIFO4 1} else {set CONFIG_UA2_FIFO4 0}
4287
        global CONFIG_UA2_FIFO8
4288
        if {$tmpvar_34 == "8"} then {set CONFIG_UA2_FIFO8 1} else {set CONFIG_UA2_FIFO8 0}
4289
        global CONFIG_UA2_FIFO16
4290
        if {$tmpvar_34 == "16"} then {set CONFIG_UA2_FIFO16 1} else {set CONFIG_UA2_FIFO16 0}
4291
        global CONFIG_UA2_FIFO32
4292
        if {$tmpvar_34 == "32"} then {set CONFIG_UA2_FIFO32 1} else {set CONFIG_UA2_FIFO32 0}
4293
        global CONFIG_GPT_ENABLE
4294
        global CONFIG_GPT_NTIM
4295
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_NTIM "$CONFIG_GPT_NTIM" 2}
4296
        global CONFIG_GPT_SW
4297
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_SW "$CONFIG_GPT_SW" 8}
4298
        global CONFIG_GPT_TW
4299
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_TW "$CONFIG_GPT_TW" 32}
4300
        global CONFIG_GPT_IRQ
4301
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_IRQ "$CONFIG_GPT_IRQ" 8}
4302
        global CONFIG_GPT_SEPIRQ
4303
        if {($CONFIG_GPT_ENABLE == 1)} then {
4304
        set CONFIG_GPT_SEPIRQ [expr $CONFIG_GPT_SEPIRQ&15]} else {set CONFIG_GPT_SEPIRQ [expr $CONFIG_GPT_SEPIRQ|16]}
4305
        global CONFIG_GPT_WDOGEN
4306
        if {($CONFIG_GPT_ENABLE == 1)} then {
4307
        set CONFIG_GPT_WDOGEN [expr $CONFIG_GPT_WDOGEN&15]} else {set CONFIG_GPT_WDOGEN [expr $CONFIG_GPT_WDOGEN|16]}
4308
        global CONFIG_GPT_WDOG
4309
        if {($CONFIG_GPT_ENABLE == 1) && ($CONFIG_GPT_WDOGEN == 1)} then {validate_hex CONFIG_GPT_WDOG "$CONFIG_GPT_WDOG" FFFF}
4310
        global CONFIG_GRGPIO_ENABLE
4311
        global CONFIG_GRGPIO_WIDTH
4312
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {validate_int CONFIG_GRGPIO_WIDTH "$CONFIG_GRGPIO_WIDTH" 8}
4313
        global CONFIG_GRGPIO_IMASK
4314
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {validate_hex CONFIG_GRGPIO_IMASK "$CONFIG_GRGPIO_IMASK" 0000}
4315
}
4316
 
4317
 
4318
menu_option menu22 22 "VHDL Debugging        "
4319
proc menu22 {w title} {
4320
        set oldFocus [focus]
4321
        catch {destroy $w; unregister_active 22}
4322
        toplevel $w -class Dialog
4323
        wm withdraw $w
4324
        global active_menus
4325
        set active_menus [lsort -integer [linsert $active_menus end 22]]
4326
        message $w.m -width 400 -aspect 300 -text \
4327
                "VHDL Debugging        "  -relief raised
4328
        pack $w.m -pady 10 -side top -padx 10
4329
        wm title $w "VHDL Debugging        "
4330
 
4331
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 22; break"
4332
        set nextscript "catch {focus $oldFocus}; menu23 .menu23 \"$title\""
4333
        frame $w.f
4334
        button $w.f.back -text "Main Menu" \
4335
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 22"
4336
        button $w.f.next -text "Next" -underline 0\
4337
                -width 15 -command $nextscript
4338
        $w.f.next configure -state disabled
4339
        bind all  "puts \"no more menus\" "
4340
        button $w.f.prev -text "Prev" -underline 0\
4341
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 22; menu21 .menu21 \"$title\""
4342
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 22; menu21 .menu21 \"$title\";break"
4343
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
4344
        pack $w.f -pady 10 -side bottom -anchor w -fill x
4345
        frame $w.topline -relief ridge -borderwidth 2 -height 2
4346
        pack $w.topline -side top -fill x
4347
 
4348
        frame $w.botline -relief ridge -borderwidth 2 -height 2
4349
        pack $w.botline -side bottom -fill x
4350
 
4351
        frame $w.config
4352
        pack $w.config -fill y -expand on
4353
 
4354
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
4355
        pack $w.config.vscroll -side right -fill y
4356
 
4357
        canvas $w.config.canvas -height 1\
4358
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
4359
                -width [expr [winfo screenwidth .] * 1 / 2]
4360
        frame $w.config.f
4361
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
4362
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
4363
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
4364
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
4365
        bind $w  "$w.config.canvas yview moveto 0;break;"
4366
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
4367
        pack $w.config.canvas -side right -fill y
4368
 
4369
 
4370
        bool $w.config.f 22 0 "Accelerated UART tracing       " CONFIG_DEBUG_UART
4371
 
4372
 
4373
 
4374
        focus $w
4375
        update_active
4376
        global winx; global winy
4377
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
4378
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
4379
        update idletasks
4380
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
4381
 
4382
        $w.config.canvas configure \
4383
                -width [expr [winfo reqwidth $w.config.f] + 1]\
4384
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
4385
                         [expr [winfo reqheight $w.config.f] + 1]"
4386
 
4387
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
4388
        set scry [expr [winfo screenh $w] / 2]
4389
        set maxy [expr [winfo screenh $w] * 3 / 4]
4390
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
4391
        if [expr $winy + $canvtotal < $maxy] {
4392
                $w.config.canvas configure -height $canvtotal
4393
        } else {
4394
                $w.config.canvas configure -height [expr $scry - $winy]
4395
                }
4396
        }
4397
        update idletasks
4398
        if {[winfo exists $w]} then {
4399
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
4400
        wm minsize $w [winfo width $w] 100
4401
 
4402
        wm deiconify $w
4403
}
4404
}
4405
 
4406
proc update_menu22 {} {
4407
}
4408
 
4409
 
4410
proc update_define_menu22 {} {
4411
        update_define_mainmenu
4412
        global CONFIG_MODULES
4413
}
4414
 
4415
 
4416
proc update_mainmenu {}  {
4417
}
4418
 
4419
 
4420
set tmpvar_0 "(not set)"
4421
set CONFIG_SYN_INFERRED 0
4422
set CONFIG_SYN_STRATIX 0
4423
set CONFIG_SYN_STRATIXII 0
4424
set CONFIG_SYN_STRATIXIII 0
4425
set CONFIG_SYN_CYCLONEIII 0
4426
set CONFIG_SYN_ALTERA 0
4427
set CONFIG_SYN_AXCEL 0
4428
set CONFIG_SYN_PROASIC 0
4429
set CONFIG_SYN_PROASICPLUS 0
4430
set CONFIG_SYN_PROASIC3 0
4431
set CONFIG_SYN_UT025CRH 0
4432
set CONFIG_SYN_ATC18 0
4433
set CONFIG_SYN_CUSTOM1 0
4434
set CONFIG_SYN_IHP25 0
4435
set CONFIG_SYN_IHP25RH 0
4436
set CONFIG_SYN_LATTICE 0
4437
set CONFIG_SYN_ECLIPSE 0
4438
set CONFIG_SYN_PEREGRINE 0
4439
set CONFIG_SYN_RH_LIB18T 0
4440
set CONFIG_SYN_RHUMC 0
4441
set CONFIG_SYN_SPARTAN2 0
4442
set CONFIG_SYN_SPARTAN3 0
4443
set CONFIG_SYN_SPARTAN3E 0
4444
set CONFIG_SYN_VIRTEX 0
4445
set CONFIG_SYN_VIRTEXE 0
4446
set CONFIG_SYN_VIRTEX2 0
4447
set CONFIG_SYN_VIRTEX4 0
4448
set CONFIG_SYN_VIRTEX5 0
4449
set CONFIG_SYN_UMC 0
4450
set CONFIG_SYN_TSMC90 0
4451
set tmpvar_1 "(not set)"
4452
set CONFIG_MEM_INFERRED 0
4453
set CONFIG_MEM_UMC 0
4454
set CONFIG_MEM_RHUMC 0
4455
set CONFIG_MEM_ARTISAN 0
4456
set CONFIG_MEM_CUSTOM1 0
4457
set CONFIG_MEM_VIRAGE 0
4458
set CONFIG_MEM_VIRAGE90 0
4459
set CONFIG_SYN_INFER_RAM 0
4460
set CONFIG_SYN_INFER_PADS 0
4461
set CONFIG_SYN_NO_ASYNC 0
4462
set CONFIG_SYN_SCAN 0
4463
set tmpvar_2 "(not set)"
4464
set CONFIG_FPGA_LX100 0
4465
set CONFIG_FPGA_LX160 0
4466
set CONFIG_FPGA_LX200 0
4467
set tmpvar_3 "(not set)"
4468
set CONFIG_CLK_INFERRED 0
4469
set CONFIG_CLK_HCLKBUF 0
4470
set CONFIG_CLK_ALTDLL 0
4471
set CONFIG_CLK_LATDLL 0
4472
set CONFIG_CLK_PRO3PLL 0
4473
set CONFIG_CLK_LIB18T 0
4474
set CONFIG_CLK_RHUMC 0
4475
set CONFIG_CLK_CLKDLL 0
4476
set CONFIG_CLK_DCM 0
4477
set CONFIG_CLK_MUL 2
4478
set CONFIG_CLK_DIV 2
4479
set CONFIG_OCLK_DIV 2
4480
set CONFIG_PCI_CLKDLL 0
4481
set CONFIG_CLK_NOFB 0
4482
set CONFIG_PCI_SYSCLK 0
4483
set CONFIG_LEON3 0
4484
set CONFIG_PROC_NUM 1
4485
set CONFIG_IU_NWINDOWS 8
4486
set CONFIG_IU_V8MULDIV 0
4487
set tmpvar_4 "(not set)"
4488
set CONFIG_IU_MUL_LATENCY_4 0
4489
set CONFIG_IU_MUL_LATENCY_5 0
4490
set CONFIG_IU_MUL_MAC 0
4491
set CONFIG_IU_SVT 0
4492
set CONFIG_IU_LDELAY 1
4493
set CONFIG_IU_WATCHPOINTS 0
4494
set CONFIG_PWD 0
4495
set CONFIG_IU_RSTADDR 00000
4496
set CONFIG_FPU_ENABLE 0
4497
set tmpvar_5 "(not set)"
4498
set CONFIG_FPU_GRFPU 0
4499
set CONFIG_FPU_GRFPULITE 0
4500
set CONFIG_FPU_MEIKO 0
4501
set tmpvar_6 "(not set)"
4502
set CONFIG_FPU_GRFPU_INFMUL 0
4503
set CONFIG_FPU_GRFPU_DWMUL 0
4504
set CONFIG_FPU_GRFPU_MODGEN 0
4505
set tmpvar_7 "(not set)"
4506
set CONFIG_FPU_GRFPC0 0
4507
set CONFIG_FPU_GRFPC1 0
4508
set CONFIG_FPU_GRFPC2 0
4509
set CONFIG_FPU_NETLIST 0
4510
set CONFIG_ICACHE_ENABLE 0
4511
set tmpvar_8 "(not set)"
4512
set CONFIG_ICACHE_ASSO1 0
4513
set CONFIG_ICACHE_ASSO2 0
4514
set CONFIG_ICACHE_ASSO3 0
4515
set CONFIG_ICACHE_ASSO4 0
4516
set tmpvar_9 "(not set)"
4517
set CONFIG_ICACHE_SZ1 0
4518
set CONFIG_ICACHE_SZ2 0
4519
set CONFIG_ICACHE_SZ4 0
4520
set CONFIG_ICACHE_SZ8 0
4521
set CONFIG_ICACHE_SZ16 0
4522
set CONFIG_ICACHE_SZ32 0
4523
set CONFIG_ICACHE_SZ64 0
4524
set CONFIG_ICACHE_SZ128 0
4525
set CONFIG_ICACHE_SZ256 0
4526
set tmpvar_10 "(not set)"
4527
set CONFIG_ICACHE_LZ16 0
4528
set CONFIG_ICACHE_LZ32 0
4529
set tmpvar_11 "(not set)"
4530
set CONFIG_ICACHE_ALGORND 0
4531
set CONFIG_ICACHE_ALGOLRR 0
4532
set CONFIG_ICACHE_ALGOLRU 0
4533
set CONFIG_ICACHE_LOCK 0
4534
set CONFIG_ICACHE_LRAM 0
4535
set tmpvar_12 "(not set)"
4536
set CONFIG_ICACHE_LRAM_SZ1 0
4537
set CONFIG_ICACHE_LRAM_SZ2 0
4538
set CONFIG_ICACHE_LRAM_SZ4 0
4539
set CONFIG_ICACHE_LRAM_SZ8 0
4540
set CONFIG_ICACHE_LRAM_SZ16 0
4541
set CONFIG_ICACHE_LRAM_SZ32 0
4542
set CONFIG_ICACHE_LRAM_SZ64 0
4543
set CONFIG_ICACHE_LRAM_SZ128 0
4544
set CONFIG_ICACHE_LRAM_SZ256 0
4545
set CONFIG_ICACHE_LRSTART 8e
4546
set CONFIG_DCACHE_ENABLE 0
4547
set tmpvar_13 "(not set)"
4548
set CONFIG_DCACHE_ASSO1 0
4549
set CONFIG_DCACHE_ASSO2 0
4550
set CONFIG_DCACHE_ASSO3 0
4551
set CONFIG_DCACHE_ASSO4 0
4552
set tmpvar_14 "(not set)"
4553
set CONFIG_DCACHE_SZ1 0
4554
set CONFIG_DCACHE_SZ2 0
4555
set CONFIG_DCACHE_SZ4 0
4556
set CONFIG_DCACHE_SZ8 0
4557
set CONFIG_DCACHE_SZ16 0
4558
set CONFIG_DCACHE_SZ32 0
4559
set CONFIG_DCACHE_SZ64 0
4560
set CONFIG_DCACHE_SZ128 0
4561
set CONFIG_DCACHE_SZ256 0
4562
set tmpvar_15 "(not set)"
4563
set CONFIG_DCACHE_LZ16 0
4564
set CONFIG_DCACHE_LZ32 0
4565
set tmpvar_16 "(not set)"
4566
set CONFIG_DCACHE_ALGORND 0
4567
set CONFIG_DCACHE_ALGOLRR 0
4568
set CONFIG_DCACHE_ALGOLRU 0
4569
set CONFIG_DCACHE_LOCK 0
4570
set CONFIG_DCACHE_SNOOP 0
4571
set CONFIG_DCACHE_SNOOP_FAST 0
4572
set CONFIG_DCACHE_SNOOP_SEPTAG 0
4573
set CONFIG_CACHE_FIXED 0
4574
set CONFIG_DCACHE_LRAM 0
4575
set tmpvar_17 "(not set)"
4576
set CONFIG_DCACHE_LRAM_SZ1 0
4577
set CONFIG_DCACHE_LRAM_SZ2 0
4578
set CONFIG_DCACHE_LRAM_SZ4 0
4579
set CONFIG_DCACHE_LRAM_SZ8 0
4580
set CONFIG_DCACHE_LRAM_SZ16 0
4581
set CONFIG_DCACHE_LRAM_SZ32 0
4582
set CONFIG_DCACHE_LRAM_SZ64 0
4583
set CONFIG_DCACHE_LRAM_SZ128 0
4584
set CONFIG_DCACHE_LRAM_SZ256 0
4585
set CONFIG_DCACHE_LRSTART 8f
4586
set CONFIG_MMU_ENABLE 0
4587
set tmpvar_18 "(not set)"
4588
set CONFIG_MMU_COMBINED 0
4589
set CONFIG_MMU_SPLIT 0
4590
set tmpvar_19 "(not set)"
4591
set CONFIG_MMU_REPARRAY 0
4592
set CONFIG_MMU_REPINCREMENT 0
4593
set tmpvar_20 "(not set)"
4594
set CONFIG_MMU_I2 0
4595
set CONFIG_MMU_I4 0
4596
set CONFIG_MMU_I8 0
4597
set CONFIG_MMU_I16 0
4598
set CONFIG_MMU_I32 0
4599
set tmpvar_21 "(not set)"
4600
set CONFIG_MMU_D2 0
4601
set CONFIG_MMU_D4 0
4602
set CONFIG_MMU_D8 0
4603
set CONFIG_MMU_D16 0
4604
set CONFIG_MMU_D32 0
4605
set CONFIG_DSU_ENABLE 0
4606
set CONFIG_DSU_ITRACE 0
4607
set tmpvar_22 "(not set)"
4608
set CONFIG_DSU_ITRACESZ1 0
4609
set CONFIG_DSU_ITRACESZ2 0
4610
set CONFIG_DSU_ITRACESZ4 0
4611
set CONFIG_DSU_ITRACESZ8 0
4612
set CONFIG_DSU_ITRACESZ16 0
4613
set CONFIG_DSU_ATRACE 0
4614
set tmpvar_23 "(not set)"
4615
set CONFIG_DSU_ATRACESZ1 0
4616
set CONFIG_DSU_ATRACESZ2 0
4617
set CONFIG_DSU_ATRACESZ4 0
4618
set CONFIG_DSU_ATRACESZ8 0
4619
set CONFIG_DSU_ATRACESZ16 0
4620
set CONFIG_LEON3FT_EN 0
4621
set tmpvar_24 "(not set)"
4622
set CONFIG_IUFT_NONE 0
4623
set CONFIG_IUFT_PAR 0
4624
set CONFIG_IUFT_DMR 0
4625
set CONFIG_IUFT_BCH 0
4626
set CONFIG_IUFT_TMR 0
4627
set CONFIG_FPUFT_EN 0
4628
set CONFIG_RF_ERRINJ 0
4629
set CONFIG_CACHE_FT_EN 0
4630
set CONFIG_CACHE_ERRINJ 0
4631
set CONFIG_LEON3_NETLIST 0
4632
set CONFIG_IU_DISAS 0
4633
set CONFIG_IU_DISAS_NET 0
4634
set CONFIG_DEBUG_PC32 0
4635
set CONFIG_AHB_DEFMST 0
4636
set CONFIG_AHB_RROBIN 0
4637
set CONFIG_AHB_SPLIT 0
4638
set CONFIG_AHB_IOADDR FFF
4639
set CONFIG_APB_HADDR 800
4640
set CONFIG_AHB_MON 0
4641
set CONFIG_AHB_MONERR 0
4642
set CONFIG_AHB_MONWAR 0
4643
set CONFIG_DSU_UART 0
4644
set CONFIG_DSU_JTAG 0
4645
set CONFIG_DSU_ETH 0
4646
set tmpvar_25 "(not set)"
4647
set CONFIG_DSU_ETHSZ1 0
4648
set CONFIG_DSU_ETHSZ2 0
4649
set CONFIG_DSU_ETHSZ4 0
4650
set CONFIG_DSU_ETHSZ8 0
4651
set CONFIG_DSU_ETHSZ16 0
4652
set CONFIG_DSU_IPMSB C0A8
4653
set CONFIG_DSU_IPLSB 0033
4654
set CONFIG_DSU_ETHMSB 00007A
4655
set CONFIG_DSU_ETHLSB CC0001
4656
set CONFIG_DSU_ETH_PROG 0
4657
set CONFIG_MCTRLFT 0
4658
set CONFIG_MCTRLFT_8BIT 0
4659
set CONFIG_MCTRLFT_16BIT 0
4660
set CONFIG_MCTRLFT_5CS 0
4661
set tmpvar_26 "(not set)"
4662
set CONFIG_MCTRLFT_ROMASEL0 0
4663
set CONFIG_MCTRLFT_ROMASEL1 0
4664
set CONFIG_MCTRLFT_ROMASEL2 0
4665
set CONFIG_MCTRLFT_ROMASEL3 0
4666
set CONFIG_MCTRLFT_ROMASEL4 0
4667
set CONFIG_MCTRLFT_ROMASEL5 0
4668
set CONFIG_MCTRLFT_ROMASEL6 0
4669
set CONFIG_MCTRLFT_ROMASEL7 0
4670
set CONFIG_MCTRLFT_ROMASEL8 0
4671
set CONFIG_MCTRLFT_ROMASEL9 0
4672
set CONFIG_MCTRLFT_ROMASEL10 0
4673
set CONFIG_MCTRLFT_ROMASEL11 0
4674
set CONFIG_MCTRLFT_ROMASEL12 0
4675
set CONFIG_MCTRLFT_ROMASEL13 0
4676
set CONFIG_MCTRLFT_ROMASEL14 0
4677
set CONFIG_MCTRLFT_ROMASEL15 0
4678
set CONFIG_MCTRLFT_ROMASEL16 0
4679
set CONFIG_MCTRLFT_ROMASEL17 0
4680
set CONFIG_MCTRLFT_ROMASEL18 0
4681
set CONFIG_MCTRLFT_ROMASEL19 0
4682
set CONFIG_MCTRLFT_ROMASEL20 0
4683
set CONFIG_MCTRLFT_ROMASEL21 0
4684
set CONFIG_MCTRLFT_ROMASEL22 0
4685
set CONFIG_MCTRLFT_ROMASEL23 0
4686
set CONFIG_MCTRLFT_ROMASEL24 0
4687
set CONFIG_MCTRLFT_ROMASEL25 0
4688
set CONFIG_MCTRLFT_ROMASEL26 0
4689
set CONFIG_MCTRLFT_ROMASEL27 0
4690
set CONFIG_MCTRLFT_ROMASEL28 0
4691
set CONFIG_MCTRLFT_SDRAM 0
4692
set CONFIG_MCTRLFT_SDRAM_SEPBUS 0
4693
set CONFIG_MCTRLFT_SDRAM_INVCLK 0
4694
set CONFIG_MCTRLFT_PAGE 0
4695
set CONFIG_MCTRLFT_PROGPAGE 0
4696
set CONFIG_MCTRLFT_EDAC 0
4697
set CONFIG_MCTRLFT_EDACPIPE 0
4698
set CONFIG_MCTRLFT_WFB 0
4699
set CONFIG_MCTRL_LEON2 0
4700
set CONFIG_MCTRL_8BIT 0
4701
set CONFIG_MCTRL_16BIT 0
4702
set CONFIG_MCTRL_5CS 0
4703
set CONFIG_MCTRL_SDRAM 0
4704
set CONFIG_MCTRL_SDRAM_SEPBUS 0
4705
set CONFIG_MCTRL_SDRAM_BUS64 0
4706
set CONFIG_MCTRL_SDRAM_INVCLK 0
4707
set CONFIG_MCTRL_PAGE 0
4708
set CONFIG_MCTRL_PROGPAGE 0
4709
set CONFIG_AHBSTAT_ENABLE 0
4710
set CONFIG_AHBSTAT_NFTSLV 1
4711
set CONFIG_GRETH_ENABLE 0
4712
set CONFIG_GRETH_GIGA 0
4713
set tmpvar_27 "(not set)"
4714
set CONFIG_GRETH_FIFO4 0
4715
set CONFIG_GRETH_FIFO8 0
4716
set CONFIG_GRETH_FIFO16 0
4717
set CONFIG_GRETH_FIFO32 0
4718
set CONFIG_GRETH_FIFO64 0
4719
set CONFIG_CAN_ENABLE 0
4720
set CONFIG_CAN_NUM 1
4721
set CONFIG_CANIO C00
4722
set CONFIG_CANIRQ 13
4723
set CONFIG_CANSEPIRQ 0
4724
set CONFIG_CAN_SYNCRST 0
4725
set CONFIG_CAN_FT 0
4726
set CONFIG_PCI_SIMPLE_TARGET 0
4727
set CONFIG_PCI_MASTER_TARGET 0
4728
set CONFIG_PCI_MASTER_TARGET_DMA 0
4729
set CONFIG_PCI_VENDORID 16E3
4730
set CONFIG_PCI_DEVICEID 0210
4731
set tmpvar_28 "(not set)"
4732
set CONFIG_PCI_FIFO0 0
4733
set CONFIG_PCI_FIFO8 0
4734
set CONFIG_PCI_FIFO16 0
4735
set CONFIG_PCI_FIFO32 0
4736
set CONFIG_PCI_FIFO64 0
4737
set CONFIG_PCI_FIFO128 0
4738
set CONFIG_PCI_HADDR E00
4739
set CONFIG_PCI_ARBITER 0
4740
set CONFIG_PCI_ARBITER_APB 0
4741
set CONFIG_PCI_ARBITER_NREQ 4
4742
set CONFIG_PCI_TRACE 0
4743
set tmpvar_29 "(not set)"
4744
set CONFIG_PCI_TRACE256 0
4745
set CONFIG_PCI_TRACE512 0
4746
set CONFIG_PCI_TRACE1024 0
4747
set CONFIG_PCI_TRACE2048 0
4748
set CONFIG_PCI_TRACE4096 0
4749
set CONFIG_SPW_ENABLE 0
4750
set CONFIG_SPW_NUM 1
4751
set tmpvar_30 "(not set)"
4752
set CONFIG_SPW_AHBFIFO4 0
4753
set CONFIG_SPW_AHBFIFO8 0
4754
set CONFIG_SPW_AHBFIFO16 0
4755
set CONFIG_SPW_AHBFIFO32 0
4756
set tmpvar_31 "(not set)"
4757
set CONFIG_SPW_RXFIFO16 0
4758
set CONFIG_SPW_RXFIFO32 0
4759
set CONFIG_SPW_RXFIFO64 0
4760
set CONFIG_SPW_RMAP 0
4761
set tmpvar_32 "(not set)"
4762
set CONFIG_SPW_RMAPBUF2 0
4763
set CONFIG_SPW_RMAPBUF4 0
4764
set CONFIG_SPW_RMAPBUF6 0
4765
set CONFIG_SPW_RMAPBUF8 0
4766
set CONFIG_SPW_RMAPCRC 0
4767
set CONFIG_SPW_FT 0
4768
set CONFIG_SPW_NETLIST 0
4769
set CONFIG_UART1_ENABLE 0
4770
set tmpvar_33 "(not set)"
4771
set CONFIG_UA1_FIFO1 0
4772
set CONFIG_UA1_FIFO2 0
4773
set CONFIG_UA1_FIFO4 0
4774
set CONFIG_UA1_FIFO8 0
4775
set CONFIG_UA1_FIFO16 0
4776
set CONFIG_UA1_FIFO32 0
4777
set CONFIG_UART2_ENABLE 0
4778
set tmpvar_34 "(not set)"
4779
set CONFIG_UA2_FIFO1 0
4780
set CONFIG_UA2_FIFO2 0
4781
set CONFIG_UA2_FIFO4 0
4782
set CONFIG_UA2_FIFO8 0
4783
set CONFIG_UA2_FIFO16 0
4784
set CONFIG_UA2_FIFO32 0
4785
set CONFIG_IRQ3_ENABLE 0
4786
set CONFIG_GPT_ENABLE 0
4787
set CONFIG_GPT_NTIM 2
4788
set CONFIG_GPT_SW 8
4789
set CONFIG_GPT_TW 32
4790
set CONFIG_GPT_IRQ 8
4791
set CONFIG_GPT_SEPIRQ 0
4792
set CONFIG_GPT_WDOGEN 0
4793
set CONFIG_GPT_WDOG FFFF
4794
set CONFIG_GRGPIO_ENABLE 0
4795
set CONFIG_GRGPIO_WIDTH 8
4796
set CONFIG_GRGPIO_IMASK 0000
4797
set CONFIG_DEBUG_UART 0
4798
set CONFIG_LEON3FT_PRESENT 4
4799
set CONFIG_SYN_ARTISAN 4
4800
set CONFIG_PCI_ENABLE 4
4801
set CONFIG_HAS_SHARED_GRFPU 4
4802
set CONFIG_FPU_GRFPU_SH 4
4803
set CONFIG_PCI_ACTEL 4
4804
set CONFIG_MODULES 4
4805
proc writeconfig {file1 file2} {
4806
        set cfg [open $file1 w]
4807
        set autocfg [open $file2 w]
4808
        set notmod 1
4809
        set notset 0
4810
        puts $cfg "#"
4811
        puts $cfg "# Automatically generated make config: don't edit"
4812
        puts $cfg "#"
4813
        puts $autocfg "/*"
4814
        puts $autocfg " * Automatically generated C config: don't edit"
4815
        puts $autocfg " */"
4816
        puts $autocfg "#define AUTOCONF_INCLUDED"
4817
        global CONFIG_LEON3FT_PRESENT
4818
        global CONSTANT_Y
4819
        write_tristate $cfg $autocfg CONFIG_LEON3FT_PRESENT $CONFIG_LEON3FT_PRESENT [list $notmod] 2
4820
        write_comment $cfg $autocfg "Synthesis      "
4821
        global tmpvar_0
4822
 
4823
        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 }
4824
        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 }
4825
        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 }
4826
        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 }
4827
        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 }
4828
        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 }
4829
        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 }
4830
        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 }
4831
        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 }
4832
        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 }
4833
        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 }
4834
        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 }
4835
        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 }
4836
        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 }
4837
        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 }
4838
        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 }
4839
        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 }
4840
        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 }
4841
        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 }
4842
        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 }
4843
        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 }
4844
        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 }
4845
        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 }
4846
        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 }
4847
        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 }
4848
        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 }
4849
        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 }
4850
        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 }
4851
        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 }
4852
        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 }
4853
        global tmpvar_1
4854
        global CONFIG_SYN_INFERRED
4855
        global CONFIG_SYN_CUSTOM1
4856
        global CONFIG_SYN_ATC18
4857
        global CONFIG_SYN_TSMC90
4858
        global CONFIG_SYN_RHUMC
4859
        global CONFIG_SYN_ARTISAN
4860
        if {($CONFIG_SYN_INFERRED == 1 || $CONFIG_SYN_CUSTOM1 == 1 || $CONFIG_SYN_ATC18 == 1 || $CONFIG_SYN_TSMC90 == 1 || $CONFIG_SYN_RHUMC == 1 || $CONFIG_SYN_ARTISAN == 1)} then {
4861
        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 }
4862
        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 }
4863
        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 }
4864
        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 }
4865
        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 }
4866
        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 }
4867
        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 }}
4868
        global CONFIG_SYN_INFER_RAM
4869
        if {($CONFIG_SYN_INFERRED != 1)} then {write_tristate $cfg $autocfg CONFIG_SYN_INFER_RAM $CONFIG_SYN_INFER_RAM [list $notmod] 2 }
4870
        global CONFIG_SYN_INFER_PADS
4871
        if {($CONFIG_SYN_INFERRED != 1)} then {write_tristate $cfg $autocfg CONFIG_SYN_INFER_PADS $CONFIG_SYN_INFER_PADS [list $notmod] 2 }
4872
        global CONFIG_SYN_NO_ASYNC
4873
        write_tristate $cfg $autocfg CONFIG_SYN_NO_ASYNC $CONFIG_SYN_NO_ASYNC [list $notmod] 2
4874
        global CONFIG_SYN_SCAN
4875
        write_tristate $cfg $autocfg CONFIG_SYN_SCAN $CONFIG_SYN_SCAN [list $notmod] 2
4876
        global tmpvar_2
4877
 
4878
        if { $tmpvar_2 == "XC4V-LX100" } then { write_tristate $cfg $autocfg CONFIG_FPGA_LX100 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPGA_LX100 0 [list $notmod] 2 }
4879
        if { $tmpvar_2 == "XC4V-LX160" } then { write_tristate $cfg $autocfg CONFIG_FPGA_LX160 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPGA_LX160 0 [list $notmod] 2 }
4880
        if { $tmpvar_2 == "XC4V-LX200" } then { write_tristate $cfg $autocfg CONFIG_FPGA_LX200 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_FPGA_LX200 0 [list $notmod] 2 }
4881
        write_comment $cfg $autocfg "Clock generation"
4882
        global tmpvar_3
4883
 
4884
        if { $tmpvar_3 == "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 }
4885
        if { $tmpvar_3 == "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 }
4886
        if { $tmpvar_3 == "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 }
4887
        if { $tmpvar_3 == "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 }
4888
        if { $tmpvar_3 == "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 }
4889
        if { $tmpvar_3 == "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 }
4890
        if { $tmpvar_3 == "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 }
4891
        if { $tmpvar_3 == "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 }
4892
        if { $tmpvar_3 == "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 }
4893
        global CONFIG_CLK_MUL
4894
        global CONFIG_CLK_DCM
4895
        global CONFIG_CLK_ALTDLL
4896
        global CONFIG_CLK_LATDLL
4897
        global CONFIG_CLK_PRO3PLL
4898
        global CONFIG_CLK_CLKDLL
4899
        global CONFIG_CLK_LIB18T
4900
        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 }
4901
        global CONFIG_CLK_DIV
4902
        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 }
4903
        global CONFIG_OCLK_DIV
4904
        if {($CONFIG_CLK_PRO3PLL == 1)} then {write_int $cfg $autocfg CONFIG_OCLK_DIV $CONFIG_OCLK_DIV $notmod }
4905
        global CONFIG_PCI_CLKDLL
4906
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_CLKDLL $CONFIG_PCI_CLKDLL [list $notmod] 2 }
4907
        global CONFIG_CLK_NOFB
4908
        if {($CONFIG_CLK_DCM == 1)} then {write_tristate $cfg $autocfg CONFIG_CLK_NOFB $CONFIG_CLK_NOFB [list $notmod] 2 }
4909
        global CONFIG_PCI_SYSCLK
4910
        global CONFIG_PCI_ENABLE
4911
        if {($CONFIG_PCI_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_SYSCLK $CONFIG_PCI_SYSCLK [list $notmod] 2 }
4912
        global CONFIG_LEON3
4913
        write_tristate $cfg $autocfg CONFIG_LEON3 $CONFIG_LEON3 [list $notmod] 2
4914
        global CONFIG_PROC_NUM
4915
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_PROC_NUM $CONFIG_PROC_NUM $notmod }
4916
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Processor            "}
4917
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Integer unit                                           "}
4918
        global CONFIG_IU_NWINDOWS
4919
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_NWINDOWS $CONFIG_IU_NWINDOWS $notmod }
4920
        global CONFIG_IU_V8MULDIV
4921
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_V8MULDIV $CONFIG_IU_V8MULDIV [list $notmod] 2 }
4922
        global tmpvar_4
4923
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {
4924
        if { $tmpvar_4 == "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 }
4925
        if { $tmpvar_4 == "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 }}
4926
        global CONFIG_IU_MUL_MAC
4927
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_MUL_MAC $CONFIG_IU_MUL_MAC [list $notmod] 2 }
4928
        global CONFIG_IU_SVT
4929
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_SVT $CONFIG_IU_SVT [list $notmod] 2 }
4930
        global CONFIG_IU_LDELAY
4931
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_LDELAY $CONFIG_IU_LDELAY $notmod }
4932
        global CONFIG_IU_WATCHPOINTS
4933
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_WATCHPOINTS $CONFIG_IU_WATCHPOINTS $notmod }
4934
        global CONFIG_PWD
4935
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_PWD $CONFIG_PWD [list $notmod] 2 }
4936
        global CONFIG_IU_RSTADDR
4937
        if {($CONFIG_LEON3 == 1)} then {write_hex $cfg $autocfg CONFIG_IU_RSTADDR $CONFIG_IU_RSTADDR $notmod }
4938
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Floating-point unit"}
4939
        global CONFIG_FPU_ENABLE
4940
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_FPU_ENABLE $CONFIG_FPU_ENABLE [list $notmod] 2 }
4941
        global tmpvar_5
4942
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
4943
        if { $tmpvar_5 == "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 }
4944
        if { $tmpvar_5 == "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 }
4945
        if { $tmpvar_5 == "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 }}
4946
        global tmpvar_6
4947
        global CONFIG_FPU_GRFPU
4948
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPU == 1)} then {
4949
        if { $tmpvar_6 == "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 }
4950
        if { $tmpvar_6 == "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 }
4951
        if { $tmpvar_6 == "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 }}
4952
        global tmpvar_7
4953
        global CONFIG_FPU_GRFPULITE
4954
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPULITE == 1)} then {
4955
        if { $tmpvar_7 == "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 }
4956
        if { $tmpvar_7 == "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 }
4957
        if { $tmpvar_7 == "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 }}
4958
        global CONFIG_FPU_NETLIST
4959
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_FPU_NETLIST $CONFIG_FPU_NETLIST [list $notmod] 2 }
4960
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Cache system"}
4961
        global CONFIG_ICACHE_ENABLE
4962
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_ICACHE_ENABLE $CONFIG_ICACHE_ENABLE [list $notmod] 2 }
4963
        global tmpvar_8
4964
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
4965
        if { $tmpvar_8 == "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 }
4966
        if { $tmpvar_8 == "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 }
4967
        if { $tmpvar_8 == "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 }
4968
        if { $tmpvar_8 == "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 }}
4969
        global tmpvar_9
4970
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
4971
        if { $tmpvar_9 == "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 }
4972
        if { $tmpvar_9 == "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 }
4973
        if { $tmpvar_9 == "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 }
4974
        if { $tmpvar_9 == "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 }
4975
        if { $tmpvar_9 == "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 }
4976
        if { $tmpvar_9 == "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 }
4977
        if { $tmpvar_9 == "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 }
4978
        if { $tmpvar_9 == "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 }
4979
        if { $tmpvar_9 == "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 }}
4980
        global tmpvar_10
4981
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
4982
        if { $tmpvar_10 == "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 }
4983
        if { $tmpvar_10 == "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 }}
4984
        global tmpvar_11
4985
        global CONFIG_ICACHE_ASSO1
4986
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {
4987
        if { $tmpvar_11 == "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 }
4988
        if { $tmpvar_11 == "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 }
4989
        if { $tmpvar_11 == "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 }}
4990
        global CONFIG_ICACHE_LOCK
4991
        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 }
4992
        global CONFIG_ICACHE_LRAM
4993
        global CONFIG_MMU_ENABLE
4994
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM $CONFIG_ICACHE_LRAM [list $notmod] 2 }
4995
        global tmpvar_12
4996
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {
4997
        if { $tmpvar_12 == "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 }
4998
        if { $tmpvar_12 == "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 }
4999
        if { $tmpvar_12 == "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 }
5000
        if { $tmpvar_12 == "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 }
5001
        if { $tmpvar_12 == "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 }
5002
        if { $tmpvar_12 == "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 }
5003
        if { $tmpvar_12 == "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 }
5004
        if { $tmpvar_12 == "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 }
5005
        if { $tmpvar_12 == "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 }}
5006
        global CONFIG_ICACHE_LRSTART
5007
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {write_hex $cfg $autocfg CONFIG_ICACHE_LRSTART $CONFIG_ICACHE_LRSTART $notmod }
5008
        global CONFIG_DCACHE_ENABLE
5009
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_ENABLE $CONFIG_DCACHE_ENABLE [list $notmod] 2 }
5010
        global tmpvar_13
5011
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
5012
        if { $tmpvar_13 == "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 }
5013
        if { $tmpvar_13 == "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 }
5014
        if { $tmpvar_13 == "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 }
5015
        if { $tmpvar_13 == "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 }}
5016
        global tmpvar_14
5017
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
5018
        if { $tmpvar_14 == "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 }
5019
        if { $tmpvar_14 == "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 }
5020
        if { $tmpvar_14 == "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 }
5021
        if { $tmpvar_14 == "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 }
5022
        if { $tmpvar_14 == "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 }
5023
        if { $tmpvar_14 == "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 }
5024
        if { $tmpvar_14 == "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 }
5025
        if { $tmpvar_14 == "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 }
5026
        if { $tmpvar_14 == "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 }}
5027
        global tmpvar_15
5028
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
5029
        if { $tmpvar_15 == "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 }
5030
        if { $tmpvar_15 == "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 }}
5031
        global tmpvar_16
5032
        global CONFIG_DCACHE_ASSO1
5033
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {
5034
        if { $tmpvar_16 == "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 }
5035
        if { $tmpvar_16 == "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 }
5036
        if { $tmpvar_16 == "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 }}
5037
        global CONFIG_DCACHE_LOCK
5038
        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 }
5039
        global CONFIG_DCACHE_SNOOP
5040
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_SNOOP $CONFIG_DCACHE_SNOOP [list $notmod] 2 }
5041
        global CONFIG_DCACHE_SNOOP_FAST
5042
        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 }
5043
        global CONFIG_DCACHE_SNOOP_SEPTAG
5044
        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 }
5045
        global CONFIG_CACHE_FIXED
5046
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1 || $CONFIG_DCACHE_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_CACHE_FIXED $CONFIG_CACHE_FIXED $notmod }
5047
        global CONFIG_DCACHE_LRAM
5048
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM $CONFIG_DCACHE_LRAM [list $notmod] 2 }
5049
        global tmpvar_17
5050
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {
5051
        if { $tmpvar_17 == "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 }
5052
        if { $tmpvar_17 == "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 }
5053
        if { $tmpvar_17 == "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 }
5054
        if { $tmpvar_17 == "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 }
5055
        if { $tmpvar_17 == "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 }
5056
        if { $tmpvar_17 == "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 }
5057
        if { $tmpvar_17 == "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 }
5058
        if { $tmpvar_17 == "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 }
5059
        if { $tmpvar_17 == "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 }}
5060
        global CONFIG_DCACHE_LRSTART
5061
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {write_hex $cfg $autocfg CONFIG_DCACHE_LRSTART $CONFIG_DCACHE_LRSTART $notmod }
5062
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "MMU"}
5063
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_MMU_ENABLE $CONFIG_MMU_ENABLE [list $notmod] 2 }
5064
        global tmpvar_18
5065
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
5066
        if { $tmpvar_18 == "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 }
5067
        if { $tmpvar_18 == "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 }}
5068
        global tmpvar_19
5069
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
5070
        if { $tmpvar_19 == "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 }
5071
        if { $tmpvar_19 == "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 }}
5072
        global tmpvar_20
5073
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
5074
        if { $tmpvar_20 == "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 }
5075
        if { $tmpvar_20 == "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 }
5076
        if { $tmpvar_20 == "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 }
5077
        if { $tmpvar_20 == "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 }
5078
        if { $tmpvar_20 == "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 }}
5079
        global tmpvar_21
5080
        global CONFIG_MMU_SPLIT
5081
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {
5082
        if { $tmpvar_21 == "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 }
5083
        if { $tmpvar_21 == "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 }
5084
        if { $tmpvar_21 == "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 }
5085
        if { $tmpvar_21 == "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 }
5086
        if { $tmpvar_21 == "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 }}
5087
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Debug Support Unit        "}
5088
        global CONFIG_DSU_ENABLE
5089
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ENABLE $CONFIG_DSU_ENABLE [list $notmod] 2 }
5090
        global CONFIG_DSU_ITRACE
5091
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ITRACE $CONFIG_DSU_ITRACE [list $notmod] 2 }
5092
        global tmpvar_22
5093
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ITRACE == 1)} then {
5094
        if { $tmpvar_22 == "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 }
5095
        if { $tmpvar_22 == "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 }
5096
        if { $tmpvar_22 == "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 }
5097
        if { $tmpvar_22 == "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 }
5098
        if { $tmpvar_22 == "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 }}
5099
        global CONFIG_DSU_ATRACE
5100
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ATRACE $CONFIG_DSU_ATRACE [list $notmod] 2 }
5101
        global tmpvar_23
5102
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ATRACE == 1)} then {
5103
        if { $tmpvar_23 == "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 }
5104
        if { $tmpvar_23 == "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 }
5105
        if { $tmpvar_23 == "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 }
5106
        if { $tmpvar_23 == "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 }
5107
        if { $tmpvar_23 == "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 }}
5108
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Fault-tolerance  "}
5109
        global CONFIG_LEON3FT_EN
5110
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1)} then {write_tristate $cfg $autocfg CONFIG_LEON3FT_EN $CONFIG_LEON3FT_EN [list $notmod] 2 }
5111
        global tmpvar_24
5112
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {
5113
        if { $tmpvar_24 == "None" } then { write_tristate $cfg $autocfg CONFIG_IUFT_NONE 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_IUFT_NONE 0 [list $notmod] 2 }
5114
        if { $tmpvar_24 == "Parity" } then { write_tristate $cfg $autocfg CONFIG_IUFT_PAR 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_IUFT_PAR 0 [list $notmod] 2 }
5115
        if { $tmpvar_24 == "PDMR" } then { write_tristate $cfg $autocfg CONFIG_IUFT_DMR 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_IUFT_DMR 0 [list $notmod] 2 }
5116
        if { $tmpvar_24 == "BCH" } then { write_tristate $cfg $autocfg CONFIG_IUFT_BCH 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_IUFT_BCH 0 [list $notmod] 2 }
5117
        if { $tmpvar_24 == "TMR" } then { write_tristate $cfg $autocfg CONFIG_IUFT_TMR 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_IUFT_TMR 0 [list $notmod] 2 }}
5118
        global CONFIG_FPUFT_EN
5119
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1) && ($CONFIG_FPU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_FPUFT_EN $CONFIG_FPUFT_EN [list $notmod] 2 }
5120
        global CONFIG_RF_ERRINJ
5121
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {write_tristate $cfg $autocfg CONFIG_RF_ERRINJ $CONFIG_RF_ERRINJ [list $notmod] 2 }
5122
        global CONFIG_CACHE_FT_EN
5123
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {write_tristate $cfg $autocfg CONFIG_CACHE_FT_EN $CONFIG_CACHE_FT_EN [list $notmod] 2 }
5124
        global CONFIG_CACHE_ERRINJ
5125
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {write_int $cfg $autocfg CONFIG_CACHE_ERRINJ $CONFIG_CACHE_ERRINJ $notmod }
5126
        global CONFIG_LEON3_NETLIST
5127
        if {($CONFIG_LEON3 == 1) && ($CONFIG_LEON3FT_PRESENT == 1) && ($CONFIG_LEON3FT_EN == 1)} then {write_tristate $cfg $autocfg CONFIG_LEON3_NETLIST $CONFIG_LEON3_NETLIST [list $notmod] 2 }
5128
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "VHDL debug settings       "}
5129
        global CONFIG_IU_DISAS
5130
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_DISAS $CONFIG_IU_DISAS [list $notmod] 2 }
5131
        global CONFIG_IU_DISAS_NET
5132
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_DISAS == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_DISAS_NET $CONFIG_IU_DISAS_NET [list $notmod] 2 }
5133
        global CONFIG_DEBUG_PC32
5134
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DEBUG_PC32 $CONFIG_DEBUG_PC32 [list $notmod] 2 }
5135
        write_comment $cfg $autocfg "AMBA configuration"
5136
        global CONFIG_AHB_DEFMST
5137
        write_int $cfg $autocfg CONFIG_AHB_DEFMST $CONFIG_AHB_DEFMST $notmod
5138
        global CONFIG_AHB_RROBIN
5139
        write_tristate $cfg $autocfg CONFIG_AHB_RROBIN $CONFIG_AHB_RROBIN [list $notmod] 2
5140
        global CONFIG_AHB_SPLIT
5141
        write_tristate $cfg $autocfg CONFIG_AHB_SPLIT $CONFIG_AHB_SPLIT [list $notmod] 2
5142
        global CONFIG_AHB_IOADDR
5143
        write_hex $cfg $autocfg CONFIG_AHB_IOADDR $CONFIG_AHB_IOADDR $notmod
5144
        global CONFIG_APB_HADDR
5145
        write_hex $cfg $autocfg CONFIG_APB_HADDR $CONFIG_APB_HADDR $notmod
5146
        global CONFIG_AHB_MON
5147
        write_tristate $cfg $autocfg CONFIG_AHB_MON $CONFIG_AHB_MON [list $notmod] 2
5148
        global CONFIG_AHB_MONERR
5149
        if {($CONFIG_AHB_MON == 1)} then {write_tristate $cfg $autocfg CONFIG_AHB_MONERR $CONFIG_AHB_MONERR [list $notmod] 2 }
5150
        global CONFIG_AHB_MONWAR
5151
        if {($CONFIG_AHB_MON == 1)} then {write_tristate $cfg $autocfg CONFIG_AHB_MONWAR $CONFIG_AHB_MONWAR [list $notmod] 2 }
5152
        write_comment $cfg $autocfg "Debug Link           "
5153
        global CONFIG_DSU_UART
5154
        write_tristate $cfg $autocfg CONFIG_DSU_UART $CONFIG_DSU_UART [list $notmod] 2
5155
        global CONFIG_DSU_JTAG
5156
        write_tristate $cfg $autocfg CONFIG_DSU_JTAG $CONFIG_DSU_JTAG [list $notmod] 2
5157
        global CONFIG_DSU_ETH
5158
        global CONFIG_GRETH_ENABLE
5159
        if {($CONFIG_GRETH_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ETH $CONFIG_DSU_ETH [list $notmod] 2 }
5160
        global tmpvar_25
5161
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {
5162
        if { $tmpvar_25 == "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 }
5163
        if { $tmpvar_25 == "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 }
5164
        if { $tmpvar_25 == "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 }
5165
        if { $tmpvar_25 == "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 }
5166
        if { $tmpvar_25 == "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 }}
5167
        global CONFIG_DSU_IPMSB
5168
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_IPMSB $CONFIG_DSU_IPMSB $notmod }
5169
        global CONFIG_DSU_IPLSB
5170
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_IPLSB $CONFIG_DSU_IPLSB $notmod }
5171
        global CONFIG_DSU_ETHMSB
5172
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_ETHMSB $CONFIG_DSU_ETHMSB $notmod }
5173
        global CONFIG_DSU_ETHLSB
5174
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_ETHLSB $CONFIG_DSU_ETHLSB $notmod }
5175
        global CONFIG_DSU_ETH_PROG
5176
        global CONFIG_GRETH_GIGA
5177
        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 }
5178
        write_comment $cfg $autocfg "Memory controllers             "
5179
        write_comment $cfg $autocfg "PROM/SRAM/SDRAM Memory controller with EDAC       "
5180
        global CONFIG_MCTRLFT
5181
        write_tristate $cfg $autocfg CONFIG_MCTRLFT $CONFIG_MCTRLFT [list $notmod] 2
5182
        global CONFIG_MCTRLFT_8BIT
5183
        if {($CONFIG_MCTRLFT == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_8BIT $CONFIG_MCTRLFT_8BIT [list $notmod] 2 }
5184
        global CONFIG_MCTRLFT_16BIT
5185
        if {($CONFIG_MCTRLFT == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_16BIT $CONFIG_MCTRLFT_16BIT [list $notmod] 2 }
5186
        global CONFIG_MCTRLFT_5CS
5187
        if {($CONFIG_MCTRLFT == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_5CS $CONFIG_MCTRLFT_5CS [list $notmod] 2 }
5188
        global tmpvar_26
5189
        if {($CONFIG_MCTRLFT == 1)} then {
5190
        if { $tmpvar_26 == "4xprogrammable" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL0 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL0 0 [list $notmod] 2 }
5191
        if { $tmpvar_26 == "4x16_kByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL1 0 [list $notmod] 2 }
5192
        if { $tmpvar_26 == "4x32_kByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL2 0 [list $notmod] 2 }
5193
        if { $tmpvar_26 == "4x64_kByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL3 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL3 0 [list $notmod] 2 }
5194
        if { $tmpvar_26 == "4x128_kByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL4 0 [list $notmod] 2 }
5195
        if { $tmpvar_26 == "4x256_kByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL5 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL5 0 [list $notmod] 2 }
5196
        if { $tmpvar_26 == "4x512_kByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL6 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL6 0 [list $notmod] 2 }
5197
        if { $tmpvar_26 == "4x1_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL7 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL7 0 [list $notmod] 2 }
5198
        if { $tmpvar_26 == "4x2_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL8 0 [list $notmod] 2 }
5199
        if { $tmpvar_26 == "4x4_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL9 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL9 0 [list $notmod] 2 }
5200
        if { $tmpvar_26 == "4x8_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL10 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL10 0 [list $notmod] 2 }
5201
        if { $tmpvar_26 == "4x16_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL11 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL11 0 [list $notmod] 2 }
5202
        if { $tmpvar_26 == "4x32_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL12 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL12 0 [list $notmod] 2 }
5203
        if { $tmpvar_26 == "4x64_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL13 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL13 0 [list $notmod] 2 }
5204
        if { $tmpvar_26 == "4x128_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL14 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL14 0 [list $notmod] 2 }
5205
        if { $tmpvar_26 == "2x256_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL15 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL15 0 [list $notmod] 2 }
5206
        if { $tmpvar_26 == "2x64_kByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL16 0 [list $notmod] 2 }
5207
        if { $tmpvar_26 == "2x128_kByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL17 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL17 0 [list $notmod] 2 }
5208
        if { $tmpvar_26 == "2x256_kByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL18 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL18 0 [list $notmod] 2 }
5209
        if { $tmpvar_26 == "2x512_kByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL19 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL19 0 [list $notmod] 2 }
5210
        if { $tmpvar_26 == "2x1_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL20 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL20 0 [list $notmod] 2 }
5211
        if { $tmpvar_26 == "2x2_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL21 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL21 0 [list $notmod] 2 }
5212
        if { $tmpvar_26 == "2x4_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL22 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL22 0 [list $notmod] 2 }
5213
        if { $tmpvar_26 == "2x8_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL23 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL23 0 [list $notmod] 2 }
5214
        if { $tmpvar_26 == "2x16_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL24 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL24 0 [list $notmod] 2 }
5215
        if { $tmpvar_26 == "2x32_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL25 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL25 0 [list $notmod] 2 }
5216
        if { $tmpvar_26 == "2x64_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL26 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL26 0 [list $notmod] 2 }
5217
        if { $tmpvar_26 == "2x128_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL27 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL27 0 [list $notmod] 2 }
5218
        if { $tmpvar_26 == "2x256_MByte" } then { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL28 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_MCTRLFT_ROMASEL28 0 [list $notmod] 2 }}
5219
        global CONFIG_MCTRLFT_SDRAM
5220
        if {($CONFIG_MCTRLFT == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_SDRAM $CONFIG_MCTRLFT_SDRAM [list $notmod] 2 }
5221
        global CONFIG_MCTRLFT_SDRAM_SEPBUS
5222
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_SDRAM_SEPBUS $CONFIG_MCTRLFT_SDRAM_SEPBUS [list $notmod] 2 }
5223
        global CONFIG_MCTRLFT_SDRAM_INVCLK
5224
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_SDRAM_INVCLK $CONFIG_MCTRLFT_SDRAM_INVCLK [list $notmod] 2 }
5225
        global CONFIG_MCTRLFT_PAGE
5226
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_PAGE $CONFIG_MCTRLFT_PAGE [list $notmod] 2 }
5227
        global CONFIG_MCTRLFT_PROGPAGE
5228
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_SDRAM == 1) && ($CONFIG_MCTRLFT_PAGE == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_PROGPAGE $CONFIG_MCTRLFT_PROGPAGE [list $notmod] 2 }
5229
        global CONFIG_MCTRLFT_EDAC
5230
        if {($CONFIG_MCTRLFT == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_EDAC $CONFIG_MCTRLFT_EDAC [list $notmod] 2 }
5231
        global CONFIG_MCTRLFT_EDACPIPE
5232
        if {($CONFIG_MCTRLFT == 1) && ($CONFIG_MCTRLFT_EDAC == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_EDACPIPE $CONFIG_MCTRLFT_EDACPIPE [list $notmod] 2 }
5233
        global CONFIG_MCTRLFT_WFB
5234
        if {($CONFIG_MCTRLFT == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRLFT_WFB $CONFIG_MCTRLFT_WFB [list $notmod] 2 }
5235
        write_comment $cfg $autocfg "Leon2 memory controller        "
5236
        global CONFIG_MCTRL_LEON2
5237
        write_tristate $cfg $autocfg CONFIG_MCTRL_LEON2 $CONFIG_MCTRL_LEON2 [list $notmod] 2
5238
        global CONFIG_MCTRL_8BIT
5239
        if {($CONFIG_MCTRL_LEON2 == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_8BIT $CONFIG_MCTRL_8BIT [list $notmod] 2 }
5240
        global CONFIG_MCTRL_16BIT
5241
        if {($CONFIG_MCTRL_LEON2 == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_16BIT $CONFIG_MCTRL_16BIT [list $notmod] 2 }
5242
        global CONFIG_MCTRL_5CS
5243
        if {($CONFIG_MCTRL_LEON2 == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_5CS $CONFIG_MCTRL_5CS [list $notmod] 2 }
5244
        global CONFIG_MCTRL_SDRAM
5245
        if {($CONFIG_MCTRL_LEON2 == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_SDRAM $CONFIG_MCTRL_SDRAM [list $notmod] 2 }
5246
        global CONFIG_MCTRL_SDRAM_SEPBUS
5247
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_SDRAM_SEPBUS $CONFIG_MCTRL_SDRAM_SEPBUS [list $notmod] 2 }
5248
        global CONFIG_MCTRL_SDRAM_BUS64
5249
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_SDRAM_SEPBUS == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_SDRAM_BUS64 $CONFIG_MCTRL_SDRAM_BUS64 [list $notmod] 2 }
5250
        global CONFIG_MCTRL_SDRAM_INVCLK
5251
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_SDRAM_SEPBUS == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_SDRAM_INVCLK $CONFIG_MCTRL_SDRAM_INVCLK [list $notmod] 2 }
5252
        global CONFIG_MCTRL_PAGE
5253
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_PAGE $CONFIG_MCTRL_PAGE [list $notmod] 2 }
5254
        global CONFIG_MCTRL_PROGPAGE
5255
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_PAGE == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_PROGPAGE $CONFIG_MCTRL_PROGPAGE [list $notmod] 2 }
5256
        global CONFIG_AHBSTAT_ENABLE
5257
        write_tristate $cfg $autocfg CONFIG_AHBSTAT_ENABLE $CONFIG_AHBSTAT_ENABLE [list $notmod] 2
5258
        global CONFIG_AHBSTAT_NFTSLV
5259
        if {($CONFIG_AHBSTAT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_AHBSTAT_NFTSLV $CONFIG_AHBSTAT_NFTSLV $notmod }
5260
        write_comment $cfg $autocfg "Peripherals             "
5261
        write_comment $cfg $autocfg "Ethernet             "
5262
        write_tristate $cfg $autocfg CONFIG_GRETH_ENABLE $CONFIG_GRETH_ENABLE [list $notmod] 2
5263
        if {($CONFIG_GRETH_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_GRETH_GIGA $CONFIG_GRETH_GIGA [list $notmod] 2 }
5264
        global tmpvar_27
5265
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_GRETH_GIGA == 0)} then {
5266
        if { $tmpvar_27 == "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 }
5267
        if { $tmpvar_27 == "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 }
5268
        if { $tmpvar_27 == "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 }
5269
        if { $tmpvar_27 == "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 }
5270
        if { $tmpvar_27 == "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 }}
5271
        write_comment $cfg $autocfg "CAN                     "
5272
        global CONFIG_CAN_ENABLE
5273
        write_tristate $cfg $autocfg CONFIG_CAN_ENABLE $CONFIG_CAN_ENABLE [list $notmod] 2
5274
        global CONFIG_CAN_NUM
5275
        if {($CONFIG_CAN_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_CAN_NUM $CONFIG_CAN_NUM $notmod }
5276
        global CONFIG_CANIO
5277
        if {($CONFIG_CAN_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_CANIO $CONFIG_CANIO $notmod }
5278
        global CONFIG_CANIRQ
5279
        if {($CONFIG_CAN_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_CANIRQ $CONFIG_CANIRQ $notmod }
5280
        global CONFIG_CANSEPIRQ
5281
        if {($CONFIG_CAN_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_CANSEPIRQ $CONFIG_CANSEPIRQ [list $notmod] 2 }
5282
        global CONFIG_CAN_SYNCRST
5283
        if {($CONFIG_CAN_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_CAN_SYNCRST $CONFIG_CAN_SYNCRST [list $notmod] 2 }
5284
        global CONFIG_CAN_FT
5285
        if {($CONFIG_CAN_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_CAN_FT $CONFIG_CAN_FT [list $notmod] 2 }
5286
        write_comment $cfg $autocfg "PCI              "
5287
        global CONFIG_PCI_SIMPLE_TARGET
5288
        global CONFIG_PCI_ACTEL
5289
        if {($CONFIG_PCI_ACTEL != 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_SIMPLE_TARGET $CONFIG_PCI_SIMPLE_TARGET [list $notmod] 2 }
5290
        global CONFIG_PCI_MASTER_TARGET
5291
        if {($CONFIG_PCI_SIMPLE_TARGET != 1 && $CONFIG_PCI_ACTEL != 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_MASTER_TARGET $CONFIG_PCI_MASTER_TARGET [list $notmod] 2 }
5292
        global CONFIG_PCI_MASTER_TARGET_DMA
5293
        if {($CONFIG_PCI_MASTER_TARGET == 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_MASTER_TARGET_DMA $CONFIG_PCI_MASTER_TARGET_DMA [list $notmod] 2 }
5294
        global CONFIG_PCI_VENDORID
5295
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {write_hex $cfg $autocfg CONFIG_PCI_VENDORID $CONFIG_PCI_VENDORID $notmod }
5296
        global CONFIG_PCI_DEVICEID
5297
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {write_hex $cfg $autocfg CONFIG_PCI_DEVICEID $CONFIG_PCI_DEVICEID $notmod }
5298
        global tmpvar_28
5299
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1) && ($CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {
5300
        if { $tmpvar_28 == "None" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO0 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO0 0 [list $notmod] 2 }
5301
        if { $tmpvar_28 == "8" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO8 0 [list $notmod] 2 }
5302
        if { $tmpvar_28 == "16" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO16 0 [list $notmod] 2 }
5303
        if { $tmpvar_28 == "32" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO32 0 [list $notmod] 2 }
5304
        if { $tmpvar_28 == "64" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO64 0 [list $notmod] 2 }
5305
        if { $tmpvar_28 == "128" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO128 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO128 0 [list $notmod] 2 }}
5306
        global CONFIG_PCI_HADDR
5307
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1) && ($CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {write_hex $cfg $autocfg CONFIG_PCI_HADDR $CONFIG_PCI_HADDR $notmod }
5308
        global CONFIG_PCI_ARBITER
5309
        write_tristate $cfg $autocfg CONFIG_PCI_ARBITER $CONFIG_PCI_ARBITER [list $notmod] 2
5310
        global CONFIG_PCI_ARBITER_APB
5311
        if {($CONFIG_PCI_ARBITER == 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_ARBITER_APB $CONFIG_PCI_ARBITER_APB [list $notmod] 2 }
5312
        global CONFIG_PCI_ARBITER_NREQ
5313
        if {($CONFIG_PCI_ARBITER == 1)} then {write_int $cfg $autocfg CONFIG_PCI_ARBITER_NREQ $CONFIG_PCI_ARBITER_NREQ $notmod }
5314
        global CONFIG_PCI_TRACE
5315
        write_tristate $cfg $autocfg CONFIG_PCI_TRACE $CONFIG_PCI_TRACE [list $notmod] 2
5316
        global tmpvar_29
5317
        if {($CONFIG_PCI_TRACE == 1)} then {
5318
        if { $tmpvar_29 == "256" } then { write_tristate $cfg $autocfg CONFIG_PCI_TRACE256 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_TRACE256 0 [list $notmod] 2 }
5319
        if { $tmpvar_29 == "512" } then { write_tristate $cfg $autocfg CONFIG_PCI_TRACE512 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_TRACE512 0 [list $notmod] 2 }
5320
        if { $tmpvar_29 == "1024" } then { write_tristate $cfg $autocfg CONFIG_PCI_TRACE1024 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_TRACE1024 0 [list $notmod] 2 }
5321
        if { $tmpvar_29 == "2048" } then { write_tristate $cfg $autocfg CONFIG_PCI_TRACE2048 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_TRACE2048 0 [list $notmod] 2 }
5322
        if { $tmpvar_29 == "4096" } then { write_tristate $cfg $autocfg CONFIG_PCI_TRACE4096 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_TRACE4096 0 [list $notmod] 2 }}
5323
        write_comment $cfg $autocfg "Spacewire "
5324
        global CONFIG_SPW_ENABLE
5325
        write_tristate $cfg $autocfg CONFIG_SPW_ENABLE $CONFIG_SPW_ENABLE [list $notmod] 2
5326
        global CONFIG_SPW_NUM
5327
        if {($CONFIG_SPW_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_SPW_NUM $CONFIG_SPW_NUM $notmod }
5328
        global tmpvar_30
5329
        if {($CONFIG_SPW_ENABLE == 1)} then {
5330
        if { $tmpvar_30 == "4" } then { write_tristate $cfg $autocfg CONFIG_SPW_AHBFIFO4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_AHBFIFO4 0 [list $notmod] 2 }
5331
        if { $tmpvar_30 == "8" } then { write_tristate $cfg $autocfg CONFIG_SPW_AHBFIFO8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_AHBFIFO8 0 [list $notmod] 2 }
5332
        if { $tmpvar_30 == "16" } then { write_tristate $cfg $autocfg CONFIG_SPW_AHBFIFO16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_AHBFIFO16 0 [list $notmod] 2 }
5333
        if { $tmpvar_30 == "32" } then { write_tristate $cfg $autocfg CONFIG_SPW_AHBFIFO32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_AHBFIFO32 0 [list $notmod] 2 }}
5334
        global tmpvar_31
5335
        if {($CONFIG_SPW_ENABLE == 1)} then {
5336
        if { $tmpvar_31 == "16" } then { write_tristate $cfg $autocfg CONFIG_SPW_RXFIFO16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_RXFIFO16 0 [list $notmod] 2 }
5337
        if { $tmpvar_31 == "32" } then { write_tristate $cfg $autocfg CONFIG_SPW_RXFIFO32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_RXFIFO32 0 [list $notmod] 2 }
5338
        if { $tmpvar_31 == "64" } then { write_tristate $cfg $autocfg CONFIG_SPW_RXFIFO64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_RXFIFO64 0 [list $notmod] 2 }}
5339
        global CONFIG_SPW_RMAP
5340
        if {($CONFIG_SPW_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_SPW_RMAP $CONFIG_SPW_RMAP [list $notmod] 2 }
5341
        global tmpvar_32
5342
        if {($CONFIG_SPW_ENABLE == 1) && ($CONFIG_SPW_RMAP == 1)} then {
5343
        if { $tmpvar_32 == "64" } then { write_tristate $cfg $autocfg CONFIG_SPW_RMAPBUF2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_RMAPBUF2 0 [list $notmod] 2 }
5344
        if { $tmpvar_32 == "128" } then { write_tristate $cfg $autocfg CONFIG_SPW_RMAPBUF4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_RMAPBUF4 0 [list $notmod] 2 }
5345
        if { $tmpvar_32 == "192" } then { write_tristate $cfg $autocfg CONFIG_SPW_RMAPBUF6 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_RMAPBUF6 0 [list $notmod] 2 }
5346
        if { $tmpvar_32 == "256" } then { write_tristate $cfg $autocfg CONFIG_SPW_RMAPBUF8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SPW_RMAPBUF8 0 [list $notmod] 2 }}
5347
        global CONFIG_SPW_RMAPCRC
5348
        if {($CONFIG_SPW_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_SPW_RMAPCRC $CONFIG_SPW_RMAPCRC [list $notmod] 2 }
5349
        global CONFIG_SPW_FT
5350
        if {($CONFIG_SPW_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_SPW_FT $CONFIG_SPW_FT [list $notmod] 2 }
5351
        global CONFIG_SPW_NETLIST
5352
        if {($CONFIG_SPW_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_SPW_NETLIST $CONFIG_SPW_NETLIST [list $notmod] 2 }
5353
        write_comment $cfg $autocfg "UARTs, timers and irq control         "
5354
        global CONFIG_UART1_ENABLE
5355
        write_tristate $cfg $autocfg CONFIG_UART1_ENABLE $CONFIG_UART1_ENABLE [list $notmod] 2
5356
        global tmpvar_33
5357
        if {($CONFIG_UART1_ENABLE == 1)} then {
5358
        if { $tmpvar_33 == "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 }
5359
        if { $tmpvar_33 == "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 }
5360
        if { $tmpvar_33 == "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 }
5361
        if { $tmpvar_33 == "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 }
5362
        if { $tmpvar_33 == "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 }
5363
        if { $tmpvar_33 == "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 }}
5364
        global CONFIG_UART2_ENABLE
5365
        write_tristate $cfg $autocfg CONFIG_UART2_ENABLE $CONFIG_UART2_ENABLE [list $notmod] 2
5366
        global tmpvar_34
5367
        if {($CONFIG_UART2_ENABLE == 1)} then {
5368
        if { $tmpvar_34 == "1" } then { write_tristate $cfg $autocfg CONFIG_UA2_FIFO1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA2_FIFO1 0 [list $notmod] 2 }
5369
        if { $tmpvar_34 == "2" } then { write_tristate $cfg $autocfg CONFIG_UA2_FIFO2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA2_FIFO2 0 [list $notmod] 2 }
5370
        if { $tmpvar_34 == "4" } then { write_tristate $cfg $autocfg CONFIG_UA2_FIFO4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA2_FIFO4 0 [list $notmod] 2 }
5371
        if { $tmpvar_34 == "8" } then { write_tristate $cfg $autocfg CONFIG_UA2_FIFO8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA2_FIFO8 0 [list $notmod] 2 }
5372
        if { $tmpvar_34 == "16" } then { write_tristate $cfg $autocfg CONFIG_UA2_FIFO16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA2_FIFO16 0 [list $notmod] 2 }
5373
        if { $tmpvar_34 == "32" } then { write_tristate $cfg $autocfg CONFIG_UA2_FIFO32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_UA2_FIFO32 0 [list $notmod] 2 }}
5374
        global CONFIG_IRQ3_ENABLE
5375
        write_tristate $cfg $autocfg CONFIG_IRQ3_ENABLE $CONFIG_IRQ3_ENABLE [list $notmod] 2
5376
        global CONFIG_GPT_ENABLE
5377
        write_tristate $cfg $autocfg CONFIG_GPT_ENABLE $CONFIG_GPT_ENABLE [list $notmod] 2
5378
        global CONFIG_GPT_NTIM
5379
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_NTIM $CONFIG_GPT_NTIM $notmod }
5380
        global CONFIG_GPT_SW
5381
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_SW $CONFIG_GPT_SW $notmod }
5382
        global CONFIG_GPT_TW
5383
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_TW $CONFIG_GPT_TW $notmod }
5384
        global CONFIG_GPT_IRQ
5385
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_IRQ $CONFIG_GPT_IRQ $notmod }
5386
        global CONFIG_GPT_SEPIRQ
5387
        if {($CONFIG_GPT_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_GPT_SEPIRQ $CONFIG_GPT_SEPIRQ [list $notmod] 2 }
5388
        global CONFIG_GPT_WDOGEN
5389
        if {($CONFIG_GPT_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_GPT_WDOGEN $CONFIG_GPT_WDOGEN [list $notmod] 2 }
5390
        global CONFIG_GPT_WDOG
5391
        if {($CONFIG_GPT_ENABLE == 1) && ($CONFIG_GPT_WDOGEN == 1)} then {write_hex $cfg $autocfg CONFIG_GPT_WDOG $CONFIG_GPT_WDOG $notmod }
5392
        global CONFIG_GRGPIO_ENABLE
5393
        write_tristate $cfg $autocfg CONFIG_GRGPIO_ENABLE $CONFIG_GRGPIO_ENABLE [list $notmod] 2
5394
        global CONFIG_GRGPIO_WIDTH
5395
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GRGPIO_WIDTH $CONFIG_GRGPIO_WIDTH $notmod }
5396
        global CONFIG_GRGPIO_IMASK
5397
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_GRGPIO_IMASK $CONFIG_GRGPIO_IMASK $notmod }
5398
        write_comment $cfg $autocfg "VHDL Debugging        "
5399
        global CONFIG_DEBUG_UART
5400
        write_tristate $cfg $autocfg CONFIG_DEBUG_UART $CONFIG_DEBUG_UART [list $notmod] 2
5401
        close $cfg
5402
        close $autocfg
5403
}
5404
 
5405
 
5406
proc clear_choices { } {
5407
        global CONFIG_SYN_INFERRED; set CONFIG_SYN_INFERRED 0
5408
        global CONFIG_SYN_STRATIX; set CONFIG_SYN_STRATIX 0
5409
        global CONFIG_SYN_STRATIXII; set CONFIG_SYN_STRATIXII 0
5410
        global CONFIG_SYN_STRATIXIII; set CONFIG_SYN_STRATIXIII 0
5411
        global CONFIG_SYN_CYCLONEIII; set CONFIG_SYN_CYCLONEIII 0
5412
        global CONFIG_SYN_ALTERA; set CONFIG_SYN_ALTERA 0
5413
        global CONFIG_SYN_AXCEL; set CONFIG_SYN_AXCEL 0
5414
        global CONFIG_SYN_PROASIC; set CONFIG_SYN_PROASIC 0
5415
        global CONFIG_SYN_PROASICPLUS; set CONFIG_SYN_PROASICPLUS 0
5416
        global CONFIG_SYN_PROASIC3; set CONFIG_SYN_PROASIC3 0
5417
        global CONFIG_SYN_UT025CRH; set CONFIG_SYN_UT025CRH 0
5418
        global CONFIG_SYN_ATC18; set CONFIG_SYN_ATC18 0
5419
        global CONFIG_SYN_CUSTOM1; set CONFIG_SYN_CUSTOM1 0
5420
        global CONFIG_SYN_IHP25; set CONFIG_SYN_IHP25 0
5421
        global CONFIG_SYN_IHP25RH; set CONFIG_SYN_IHP25RH 0
5422
        global CONFIG_SYN_LATTICE; set CONFIG_SYN_LATTICE 0
5423
        global CONFIG_SYN_ECLIPSE; set CONFIG_SYN_ECLIPSE 0
5424
        global CONFIG_SYN_PEREGRINE; set CONFIG_SYN_PEREGRINE 0
5425
        global CONFIG_SYN_RH_LIB18T; set CONFIG_SYN_RH_LIB18T 0
5426
        global CONFIG_SYN_RHUMC; set CONFIG_SYN_RHUMC 0
5427
        global CONFIG_SYN_SPARTAN2; set CONFIG_SYN_SPARTAN2 0
5428
        global CONFIG_SYN_SPARTAN3; set CONFIG_SYN_SPARTAN3 0
5429
        global CONFIG_SYN_SPARTAN3E; set CONFIG_SYN_SPARTAN3E 0
5430
        global CONFIG_SYN_VIRTEX; set CONFIG_SYN_VIRTEX 0
5431
        global CONFIG_SYN_VIRTEXE; set CONFIG_SYN_VIRTEXE 0
5432
        global CONFIG_SYN_VIRTEX2; set CONFIG_SYN_VIRTEX2 0
5433
        global CONFIG_SYN_VIRTEX4; set CONFIG_SYN_VIRTEX4 0
5434
        global CONFIG_SYN_VIRTEX5; set CONFIG_SYN_VIRTEX5 0
5435
        global CONFIG_SYN_UMC; set CONFIG_SYN_UMC 0
5436
        global CONFIG_SYN_TSMC90; set CONFIG_SYN_TSMC90 0
5437
        global CONFIG_MEM_INFERRED; set CONFIG_MEM_INFERRED 0
5438
        global CONFIG_MEM_UMC; set CONFIG_MEM_UMC 0
5439
        global CONFIG_MEM_RHUMC; set CONFIG_MEM_RHUMC 0
5440
        global CONFIG_MEM_ARTISAN; set CONFIG_MEM_ARTISAN 0
5441
        global CONFIG_MEM_CUSTOM1; set CONFIG_MEM_CUSTOM1 0
5442
        global CONFIG_MEM_VIRAGE; set CONFIG_MEM_VIRAGE 0
5443
        global CONFIG_MEM_VIRAGE90; set CONFIG_MEM_VIRAGE90 0
5444
        global CONFIG_FPGA_LX100; set CONFIG_FPGA_LX100 0
5445
        global CONFIG_FPGA_LX160; set CONFIG_FPGA_LX160 0
5446
        global CONFIG_FPGA_LX200; set CONFIG_FPGA_LX200 0
5447
        global CONFIG_CLK_INFERRED; set CONFIG_CLK_INFERRED 0
5448
        global CONFIG_CLK_HCLKBUF; set CONFIG_CLK_HCLKBUF 0
5449
        global CONFIG_CLK_ALTDLL; set CONFIG_CLK_ALTDLL 0
5450
        global CONFIG_CLK_LATDLL; set CONFIG_CLK_LATDLL 0
5451
        global CONFIG_CLK_PRO3PLL; set CONFIG_CLK_PRO3PLL 0
5452
        global CONFIG_CLK_LIB18T; set CONFIG_CLK_LIB18T 0
5453
        global CONFIG_CLK_RHUMC; set CONFIG_CLK_RHUMC 0
5454
        global CONFIG_CLK_CLKDLL; set CONFIG_CLK_CLKDLL 0
5455
        global CONFIG_CLK_DCM; set CONFIG_CLK_DCM 0
5456
        global CONFIG_IU_MUL_LATENCY_4; set CONFIG_IU_MUL_LATENCY_4 0
5457
        global CONFIG_IU_MUL_LATENCY_5; set CONFIG_IU_MUL_LATENCY_5 0
5458
        global CONFIG_FPU_GRFPU; set CONFIG_FPU_GRFPU 0
5459
        global CONFIG_FPU_GRFPULITE; set CONFIG_FPU_GRFPULITE 0
5460
        global CONFIG_FPU_MEIKO; set CONFIG_FPU_MEIKO 0
5461
        global CONFIG_FPU_GRFPU_INFMUL; set CONFIG_FPU_GRFPU_INFMUL 0
5462
        global CONFIG_FPU_GRFPU_DWMUL; set CONFIG_FPU_GRFPU_DWMUL 0
5463
        global CONFIG_FPU_GRFPU_MODGEN; set CONFIG_FPU_GRFPU_MODGEN 0
5464
        global CONFIG_FPU_GRFPC0; set CONFIG_FPU_GRFPC0 0
5465
        global CONFIG_FPU_GRFPC1; set CONFIG_FPU_GRFPC1 0
5466
        global CONFIG_FPU_GRFPC2; set CONFIG_FPU_GRFPC2 0
5467
        global CONFIG_ICACHE_ASSO1; set CONFIG_ICACHE_ASSO1 0
5468
        global CONFIG_ICACHE_ASSO2; set CONFIG_ICACHE_ASSO2 0
5469
        global CONFIG_ICACHE_ASSO3; set CONFIG_ICACHE_ASSO3 0
5470
        global CONFIG_ICACHE_ASSO4; set CONFIG_ICACHE_ASSO4 0
5471
        global CONFIG_ICACHE_SZ1; set CONFIG_ICACHE_SZ1 0
5472
        global CONFIG_ICACHE_SZ2; set CONFIG_ICACHE_SZ2 0
5473
        global CONFIG_ICACHE_SZ4; set CONFIG_ICACHE_SZ4 0
5474
        global CONFIG_ICACHE_SZ8; set CONFIG_ICACHE_SZ8 0
5475
        global CONFIG_ICACHE_SZ16; set CONFIG_ICACHE_SZ16 0
5476
        global CONFIG_ICACHE_SZ32; set CONFIG_ICACHE_SZ32 0
5477
        global CONFIG_ICACHE_SZ64; set CONFIG_ICACHE_SZ64 0
5478
        global CONFIG_ICACHE_SZ128; set CONFIG_ICACHE_SZ128 0
5479
        global CONFIG_ICACHE_SZ256; set CONFIG_ICACHE_SZ256 0
5480
        global CONFIG_ICACHE_LZ16; set CONFIG_ICACHE_LZ16 0
5481
        global CONFIG_ICACHE_LZ32; set CONFIG_ICACHE_LZ32 0
5482
        global CONFIG_ICACHE_ALGORND; set CONFIG_ICACHE_ALGORND 0
5483
        global CONFIG_ICACHE_ALGOLRR; set CONFIG_ICACHE_ALGOLRR 0
5484
        global CONFIG_ICACHE_ALGOLRU; set CONFIG_ICACHE_ALGOLRU 0
5485
        global CONFIG_ICACHE_LRAM_SZ1; set CONFIG_ICACHE_LRAM_SZ1 0
5486
        global CONFIG_ICACHE_LRAM_SZ2; set CONFIG_ICACHE_LRAM_SZ2 0
5487
        global CONFIG_ICACHE_LRAM_SZ4; set CONFIG_ICACHE_LRAM_SZ4 0
5488
        global CONFIG_ICACHE_LRAM_SZ8; set CONFIG_ICACHE_LRAM_SZ8 0
5489
        global CONFIG_ICACHE_LRAM_SZ16; set CONFIG_ICACHE_LRAM_SZ16 0
5490
        global CONFIG_ICACHE_LRAM_SZ32; set CONFIG_ICACHE_LRAM_SZ32 0
5491
        global CONFIG_ICACHE_LRAM_SZ64; set CONFIG_ICACHE_LRAM_SZ64 0
5492
        global CONFIG_ICACHE_LRAM_SZ128; set CONFIG_ICACHE_LRAM_SZ128 0
5493
        global CONFIG_ICACHE_LRAM_SZ256; set CONFIG_ICACHE_LRAM_SZ256 0
5494
        global CONFIG_DCACHE_ASSO1; set CONFIG_DCACHE_ASSO1 0
5495
        global CONFIG_DCACHE_ASSO2; set CONFIG_DCACHE_ASSO2 0
5496
        global CONFIG_DCACHE_ASSO3; set CONFIG_DCACHE_ASSO3 0
5497
        global CONFIG_DCACHE_ASSO4; set CONFIG_DCACHE_ASSO4 0
5498
        global CONFIG_DCACHE_SZ1; set CONFIG_DCACHE_SZ1 0
5499
        global CONFIG_DCACHE_SZ2; set CONFIG_DCACHE_SZ2 0
5500
        global CONFIG_DCACHE_SZ4; set CONFIG_DCACHE_SZ4 0
5501
        global CONFIG_DCACHE_SZ8; set CONFIG_DCACHE_SZ8 0
5502
        global CONFIG_DCACHE_SZ16; set CONFIG_DCACHE_SZ16 0
5503
        global CONFIG_DCACHE_SZ32; set CONFIG_DCACHE_SZ32 0
5504
        global CONFIG_DCACHE_SZ64; set CONFIG_DCACHE_SZ64 0
5505
        global CONFIG_DCACHE_SZ128; set CONFIG_DCACHE_SZ128 0
5506
        global CONFIG_DCACHE_SZ256; set CONFIG_DCACHE_SZ256 0
5507
        global CONFIG_DCACHE_LZ16; set CONFIG_DCACHE_LZ16 0
5508
        global CONFIG_DCACHE_LZ32; set CONFIG_DCACHE_LZ32 0
5509
        global CONFIG_DCACHE_ALGORND; set CONFIG_DCACHE_ALGORND 0
5510
        global CONFIG_DCACHE_ALGOLRR; set CONFIG_DCACHE_ALGOLRR 0
5511
        global CONFIG_DCACHE_ALGOLRU; set CONFIG_DCACHE_ALGOLRU 0
5512
        global CONFIG_DCACHE_LRAM_SZ1; set CONFIG_DCACHE_LRAM_SZ1 0
5513
        global CONFIG_DCACHE_LRAM_SZ2; set CONFIG_DCACHE_LRAM_SZ2 0
5514
        global CONFIG_DCACHE_LRAM_SZ4; set CONFIG_DCACHE_LRAM_SZ4 0
5515
        global CONFIG_DCACHE_LRAM_SZ8; set CONFIG_DCACHE_LRAM_SZ8 0
5516
        global CONFIG_DCACHE_LRAM_SZ16; set CONFIG_DCACHE_LRAM_SZ16 0
5517
        global CONFIG_DCACHE_LRAM_SZ32; set CONFIG_DCACHE_LRAM_SZ32 0
5518
        global CONFIG_DCACHE_LRAM_SZ64; set CONFIG_DCACHE_LRAM_SZ64 0
5519
        global CONFIG_DCACHE_LRAM_SZ128; set CONFIG_DCACHE_LRAM_SZ128 0
5520
        global CONFIG_DCACHE_LRAM_SZ256; set CONFIG_DCACHE_LRAM_SZ256 0
5521
        global CONFIG_MMU_COMBINED; set CONFIG_MMU_COMBINED 0
5522
        global CONFIG_MMU_SPLIT; set CONFIG_MMU_SPLIT 0
5523
        global CONFIG_MMU_REPARRAY; set CONFIG_MMU_REPARRAY 0
5524
        global CONFIG_MMU_REPINCREMENT; set CONFIG_MMU_REPINCREMENT 0
5525
        global CONFIG_MMU_I2; set CONFIG_MMU_I2 0
5526
        global CONFIG_MMU_I4; set CONFIG_MMU_I4 0
5527
        global CONFIG_MMU_I8; set CONFIG_MMU_I8 0
5528
        global CONFIG_MMU_I16; set CONFIG_MMU_I16 0
5529
        global CONFIG_MMU_I32; set CONFIG_MMU_I32 0
5530
        global CONFIG_MMU_D2; set CONFIG_MMU_D2 0
5531
        global CONFIG_MMU_D4; set CONFIG_MMU_D4 0
5532
        global CONFIG_MMU_D8; set CONFIG_MMU_D8 0
5533
        global CONFIG_MMU_D16; set CONFIG_MMU_D16 0
5534
        global CONFIG_MMU_D32; set CONFIG_MMU_D32 0
5535
        global CONFIG_DSU_ITRACESZ1; set CONFIG_DSU_ITRACESZ1 0
5536
        global CONFIG_DSU_ITRACESZ2; set CONFIG_DSU_ITRACESZ2 0
5537
        global CONFIG_DSU_ITRACESZ4; set CONFIG_DSU_ITRACESZ4 0
5538
        global CONFIG_DSU_ITRACESZ8; set CONFIG_DSU_ITRACESZ8 0
5539
        global CONFIG_DSU_ITRACESZ16; set CONFIG_DSU_ITRACESZ16 0
5540
        global CONFIG_DSU_ATRACESZ1; set CONFIG_DSU_ATRACESZ1 0
5541
        global CONFIG_DSU_ATRACESZ2; set CONFIG_DSU_ATRACESZ2 0
5542
        global CONFIG_DSU_ATRACESZ4; set CONFIG_DSU_ATRACESZ4 0
5543
        global CONFIG_DSU_ATRACESZ8; set CONFIG_DSU_ATRACESZ8 0
5544
        global CONFIG_DSU_ATRACESZ16; set CONFIG_DSU_ATRACESZ16 0
5545
        global CONFIG_IUFT_NONE; set CONFIG_IUFT_NONE 0
5546
        global CONFIG_IUFT_PAR; set CONFIG_IUFT_PAR 0
5547
        global CONFIG_IUFT_DMR; set CONFIG_IUFT_DMR 0
5548
        global CONFIG_IUFT_BCH; set CONFIG_IUFT_BCH 0
5549
        global CONFIG_IUFT_TMR; set CONFIG_IUFT_TMR 0
5550
        global CONFIG_DSU_ETHSZ1; set CONFIG_DSU_ETHSZ1 0
5551
        global CONFIG_DSU_ETHSZ2; set CONFIG_DSU_ETHSZ2 0
5552
        global CONFIG_DSU_ETHSZ4; set CONFIG_DSU_ETHSZ4 0
5553
        global CONFIG_DSU_ETHSZ8; set CONFIG_DSU_ETHSZ8 0
5554
        global CONFIG_DSU_ETHSZ16; set CONFIG_DSU_ETHSZ16 0
5555
        global CONFIG_MCTRLFT_ROMASEL0; set CONFIG_MCTRLFT_ROMASEL0 0
5556
        global CONFIG_MCTRLFT_ROMASEL1; set CONFIG_MCTRLFT_ROMASEL1 0
5557
        global CONFIG_MCTRLFT_ROMASEL2; set CONFIG_MCTRLFT_ROMASEL2 0
5558
        global CONFIG_MCTRLFT_ROMASEL3; set CONFIG_MCTRLFT_ROMASEL3 0
5559
        global CONFIG_MCTRLFT_ROMASEL4; set CONFIG_MCTRLFT_ROMASEL4 0
5560
        global CONFIG_MCTRLFT_ROMASEL5; set CONFIG_MCTRLFT_ROMASEL5 0
5561
        global CONFIG_MCTRLFT_ROMASEL6; set CONFIG_MCTRLFT_ROMASEL6 0
5562
        global CONFIG_MCTRLFT_ROMASEL7; set CONFIG_MCTRLFT_ROMASEL7 0
5563
        global CONFIG_MCTRLFT_ROMASEL8; set CONFIG_MCTRLFT_ROMASEL8 0
5564
        global CONFIG_MCTRLFT_ROMASEL9; set CONFIG_MCTRLFT_ROMASEL9 0
5565
        global CONFIG_MCTRLFT_ROMASEL10; set CONFIG_MCTRLFT_ROMASEL10 0
5566
        global CONFIG_MCTRLFT_ROMASEL11; set CONFIG_MCTRLFT_ROMASEL11 0
5567
        global CONFIG_MCTRLFT_ROMASEL12; set CONFIG_MCTRLFT_ROMASEL12 0
5568
        global CONFIG_MCTRLFT_ROMASEL13; set CONFIG_MCTRLFT_ROMASEL13 0
5569
        global CONFIG_MCTRLFT_ROMASEL14; set CONFIG_MCTRLFT_ROMASEL14 0
5570
        global CONFIG_MCTRLFT_ROMASEL15; set CONFIG_MCTRLFT_ROMASEL15 0
5571
        global CONFIG_MCTRLFT_ROMASEL16; set CONFIG_MCTRLFT_ROMASEL16 0
5572
        global CONFIG_MCTRLFT_ROMASEL17; set CONFIG_MCTRLFT_ROMASEL17 0
5573
        global CONFIG_MCTRLFT_ROMASEL18; set CONFIG_MCTRLFT_ROMASEL18 0
5574
        global CONFIG_MCTRLFT_ROMASEL19; set CONFIG_MCTRLFT_ROMASEL19 0
5575
        global CONFIG_MCTRLFT_ROMASEL20; set CONFIG_MCTRLFT_ROMASEL20 0
5576
        global CONFIG_MCTRLFT_ROMASEL21; set CONFIG_MCTRLFT_ROMASEL21 0
5577
        global CONFIG_MCTRLFT_ROMASEL22; set CONFIG_MCTRLFT_ROMASEL22 0
5578
        global CONFIG_MCTRLFT_ROMASEL23; set CONFIG_MCTRLFT_ROMASEL23 0
5579
        global CONFIG_MCTRLFT_ROMASEL24; set CONFIG_MCTRLFT_ROMASEL24 0
5580
        global CONFIG_MCTRLFT_ROMASEL25; set CONFIG_MCTRLFT_ROMASEL25 0
5581
        global CONFIG_MCTRLFT_ROMASEL26; set CONFIG_MCTRLFT_ROMASEL26 0
5582
        global CONFIG_MCTRLFT_ROMASEL27; set CONFIG_MCTRLFT_ROMASEL27 0
5583
        global CONFIG_MCTRLFT_ROMASEL28; set CONFIG_MCTRLFT_ROMASEL28 0
5584
        global CONFIG_GRETH_FIFO4; set CONFIG_GRETH_FIFO4 0
5585
        global CONFIG_GRETH_FIFO8; set CONFIG_GRETH_FIFO8 0
5586
        global CONFIG_GRETH_FIFO16; set CONFIG_GRETH_FIFO16 0
5587
        global CONFIG_GRETH_FIFO32; set CONFIG_GRETH_FIFO32 0
5588
        global CONFIG_GRETH_FIFO64; set CONFIG_GRETH_FIFO64 0
5589
        global CONFIG_PCI_FIFO0; set CONFIG_PCI_FIFO0 0
5590
        global CONFIG_PCI_FIFO8; set CONFIG_PCI_FIFO8 0
5591
        global CONFIG_PCI_FIFO16; set CONFIG_PCI_FIFO16 0
5592
        global CONFIG_PCI_FIFO32; set CONFIG_PCI_FIFO32 0
5593
        global CONFIG_PCI_FIFO64; set CONFIG_PCI_FIFO64 0
5594
        global CONFIG_PCI_FIFO128; set CONFIG_PCI_FIFO128 0
5595
        global CONFIG_PCI_TRACE256; set CONFIG_PCI_TRACE256 0
5596
        global CONFIG_PCI_TRACE512; set CONFIG_PCI_TRACE512 0
5597
        global CONFIG_PCI_TRACE1024; set CONFIG_PCI_TRACE1024 0
5598
        global CONFIG_PCI_TRACE2048; set CONFIG_PCI_TRACE2048 0
5599
        global CONFIG_PCI_TRACE4096; set CONFIG_PCI_TRACE4096 0
5600
        global CONFIG_SPW_AHBFIFO4; set CONFIG_SPW_AHBFIFO4 0
5601
        global CONFIG_SPW_AHBFIFO8; set CONFIG_SPW_AHBFIFO8 0
5602
        global CONFIG_SPW_AHBFIFO16; set CONFIG_SPW_AHBFIFO16 0
5603
        global CONFIG_SPW_AHBFIFO32; set CONFIG_SPW_AHBFIFO32 0
5604
        global CONFIG_SPW_RXFIFO16; set CONFIG_SPW_RXFIFO16 0
5605
        global CONFIG_SPW_RXFIFO32; set CONFIG_SPW_RXFIFO32 0
5606
        global CONFIG_SPW_RXFIFO64; set CONFIG_SPW_RXFIFO64 0
5607
        global CONFIG_SPW_RMAPBUF2; set CONFIG_SPW_RMAPBUF2 0
5608
        global CONFIG_SPW_RMAPBUF4; set CONFIG_SPW_RMAPBUF4 0
5609
        global CONFIG_SPW_RMAPBUF6; set CONFIG_SPW_RMAPBUF6 0
5610
        global CONFIG_SPW_RMAPBUF8; set CONFIG_SPW_RMAPBUF8 0
5611
        global CONFIG_UA1_FIFO1; set CONFIG_UA1_FIFO1 0
5612
        global CONFIG_UA1_FIFO2; set CONFIG_UA1_FIFO2 0
5613
        global CONFIG_UA1_FIFO4; set CONFIG_UA1_FIFO4 0
5614
        global CONFIG_UA1_FIFO8; set CONFIG_UA1_FIFO8 0
5615
        global CONFIG_UA1_FIFO16; set CONFIG_UA1_FIFO16 0
5616
        global CONFIG_UA1_FIFO32; set CONFIG_UA1_FIFO32 0
5617
        global CONFIG_UA2_FIFO1; set CONFIG_UA2_FIFO1 0
5618
        global CONFIG_UA2_FIFO2; set CONFIG_UA2_FIFO2 0
5619
        global CONFIG_UA2_FIFO4; set CONFIG_UA2_FIFO4 0
5620
        global CONFIG_UA2_FIFO8; set CONFIG_UA2_FIFO8 0
5621
        global CONFIG_UA2_FIFO16; set CONFIG_UA2_FIFO16 0
5622
        global CONFIG_UA2_FIFO32; set CONFIG_UA2_FIFO32 0
5623
}
5624
 
5625
 
5626
proc update_choices { } {
5627
        global tmpvar_0
5628
        set tmpvar_0 "Inferred"
5629
        global CONFIG_SYN_INFERRED
5630
        if { $CONFIG_SYN_INFERRED == 1 } then { set tmpvar_0 "Inferred" }
5631
        global CONFIG_SYN_STRATIX
5632
        if { $CONFIG_SYN_STRATIX == 1 } then { set tmpvar_0 "Altera-Stratix" }
5633
        global CONFIG_SYN_STRATIXII
5634
        if { $CONFIG_SYN_STRATIXII == 1 } then { set tmpvar_0 "Altera-StratixII" }
5635
        global CONFIG_SYN_STRATIXIII
5636
        if { $CONFIG_SYN_STRATIXIII == 1 } then { set tmpvar_0 "Altera-StratixIII" }
5637
        global CONFIG_SYN_CYCLONEIII
5638
        if { $CONFIG_SYN_CYCLONEIII == 1 } then { set tmpvar_0 "Altera-CycloneIII" }
5639
        global CONFIG_SYN_ALTERA
5640
        if { $CONFIG_SYN_ALTERA == 1 } then { set tmpvar_0 "Altera-Others" }
5641
        global CONFIG_SYN_AXCEL
5642
        if { $CONFIG_SYN_AXCEL == 1 } then { set tmpvar_0 "Actel-Axcelerator" }
5643
        global CONFIG_SYN_PROASIC
5644
        if { $CONFIG_SYN_PROASIC == 1 } then { set tmpvar_0 "Actel-Proasic" }
5645
        global CONFIG_SYN_PROASICPLUS
5646
        if { $CONFIG_SYN_PROASICPLUS == 1 } then { set tmpvar_0 "Actel-ProasicPlus" }
5647
        global CONFIG_SYN_PROASIC3
5648
        if { $CONFIG_SYN_PROASIC3 == 1 } then { set tmpvar_0 "Actel-Proasic3" }
5649
        global CONFIG_SYN_UT025CRH
5650
        if { $CONFIG_SYN_UT025CRH == 1 } then { set tmpvar_0 "Aeroflex-UT025CRH" }
5651
        global CONFIG_SYN_ATC18
5652
        if { $CONFIG_SYN_ATC18 == 1 } then { set tmpvar_0 "Atmel-ATC18" }
5653
        global CONFIG_SYN_CUSTOM1
5654
        if { $CONFIG_SYN_CUSTOM1 == 1 } then { set tmpvar_0 "Custom1" }
5655
        global CONFIG_SYN_IHP25
5656
        if { $CONFIG_SYN_IHP25 == 1 } then { set tmpvar_0 "IHP25" }
5657
        global CONFIG_SYN_IHP25RH
5658
        if { $CONFIG_SYN_IHP25RH == 1 } then { set tmpvar_0 "IHP25RH" }
5659
        global CONFIG_SYN_LATTICE
5660
        if { $CONFIG_SYN_LATTICE == 1 } then { set tmpvar_0 "Lattice-EC/ECP/XP" }
5661
        global CONFIG_SYN_ECLIPSE
5662
        if { $CONFIG_SYN_ECLIPSE == 1 } then { set tmpvar_0 "Quicklogic-Eclipse" }
5663
        global CONFIG_SYN_PEREGRINE
5664
        if { $CONFIG_SYN_PEREGRINE == 1 } then { set tmpvar_0 "Peregrine" }
5665
        global CONFIG_SYN_RH_LIB18T
5666
        if { $CONFIG_SYN_RH_LIB18T == 1 } then { set tmpvar_0 "RH-LIB18T" }
5667
        global CONFIG_SYN_RHUMC
5668
        if { $CONFIG_SYN_RHUMC == 1 } then { set tmpvar_0 "RH-UMC" }
5669
        global CONFIG_SYN_SPARTAN2
5670
        if { $CONFIG_SYN_SPARTAN2 == 1 } then { set tmpvar_0 "Xilinx-Spartan2" }
5671
        global CONFIG_SYN_SPARTAN3
5672
        if { $CONFIG_SYN_SPARTAN3 == 1 } then { set tmpvar_0 "Xilinx-Spartan3" }
5673
        global CONFIG_SYN_SPARTAN3E
5674
        if { $CONFIG_SYN_SPARTAN3E == 1 } then { set tmpvar_0 "Xilinx-Spartan3E" }
5675
        global CONFIG_SYN_VIRTEX
5676
        if { $CONFIG_SYN_VIRTEX == 1 } then { set tmpvar_0 "Xilinx-Virtex" }
5677
        global CONFIG_SYN_VIRTEXE
5678
        if { $CONFIG_SYN_VIRTEXE == 1 } then { set tmpvar_0 "Xilinx-VirtexE" }
5679
        global CONFIG_SYN_VIRTEX2
5680
        if { $CONFIG_SYN_VIRTEX2 == 1 } then { set tmpvar_0 "Xilinx-Virtex2" }
5681
        global CONFIG_SYN_VIRTEX4
5682
        if { $CONFIG_SYN_VIRTEX4 == 1 } then { set tmpvar_0 "Xilinx-Virtex4" }
5683
        global CONFIG_SYN_VIRTEX5
5684
        if { $CONFIG_SYN_VIRTEX5 == 1 } then { set tmpvar_0 "Xilinx-Virtex5" }
5685
        global CONFIG_SYN_UMC
5686
        if { $CONFIG_SYN_UMC == 1 } then { set tmpvar_0 "UMC18" }
5687
        global CONFIG_SYN_TSMC90
5688
        if { $CONFIG_SYN_TSMC90 == 1 } then { set tmpvar_0 "TSMC90" }
5689
        global tmpvar_1
5690
        set tmpvar_1 "Inferred"
5691
        global CONFIG_MEM_INFERRED
5692
        if { $CONFIG_MEM_INFERRED == 1 } then { set tmpvar_1 "Inferred" }
5693
        global CONFIG_MEM_UMC
5694
        if { $CONFIG_MEM_UMC == 1 } then { set tmpvar_1 "UMC18" }
5695
        global CONFIG_MEM_RHUMC
5696
        if { $CONFIG_MEM_RHUMC == 1 } then { set tmpvar_1 "RH-UMC" }
5697
        global CONFIG_MEM_ARTISAN
5698
        if { $CONFIG_MEM_ARTISAN == 1 } then { set tmpvar_1 "Artisan" }
5699
        global CONFIG_MEM_CUSTOM1
5700
        if { $CONFIG_MEM_CUSTOM1 == 1 } then { set tmpvar_1 "Custom1" }
5701
        global CONFIG_MEM_VIRAGE
5702
        if { $CONFIG_MEM_VIRAGE == 1 } then { set tmpvar_1 "Virage" }
5703
        global CONFIG_MEM_VIRAGE90
5704
        if { $CONFIG_MEM_VIRAGE90 == 1 } then { set tmpvar_1 "Virage-TSMC90" }
5705
        global tmpvar_2
5706
        set tmpvar_2 "XC4V-LX100"
5707
        global CONFIG_FPGA_LX100
5708
        if { $CONFIG_FPGA_LX100 == 1 } then { set tmpvar_2 "XC4V-LX100" }
5709
        global CONFIG_FPGA_LX160
5710
        if { $CONFIG_FPGA_LX160 == 1 } then { set tmpvar_2 "XC4V-LX160" }
5711
        global CONFIG_FPGA_LX200
5712
        if { $CONFIG_FPGA_LX200 == 1 } then { set tmpvar_2 "XC4V-LX200" }
5713
        global tmpvar_3
5714
        set tmpvar_3 "Inferred"
5715
        global CONFIG_CLK_INFERRED
5716
        if { $CONFIG_CLK_INFERRED == 1 } then { set tmpvar_3 "Inferred" }
5717
        global CONFIG_CLK_HCLKBUF
5718
        if { $CONFIG_CLK_HCLKBUF == 1 } then { set tmpvar_3 "Actel-HCLKBUF" }
5719
        global CONFIG_CLK_ALTDLL
5720
        if { $CONFIG_CLK_ALTDLL == 1 } then { set tmpvar_3 "Altera-ALTPLL" }
5721
        global CONFIG_CLK_LATDLL
5722
        if { $CONFIG_CLK_LATDLL == 1 } then { set tmpvar_3 "Lattice-EXPLL" }
5723
        global CONFIG_CLK_PRO3PLL
5724
        if { $CONFIG_CLK_PRO3PLL == 1 } then { set tmpvar_3 "Proasic3-PLLL" }
5725
        global CONFIG_CLK_LIB18T
5726
        if { $CONFIG_CLK_LIB18T == 1 } then { set tmpvar_3 "RH-LIB18T-PLL" }
5727
        global CONFIG_CLK_RHUMC
5728
        if { $CONFIG_CLK_RHUMC == 1 } then { set tmpvar_3 "DARE-PLL" }
5729
        global CONFIG_CLK_CLKDLL
5730
        if { $CONFIG_CLK_CLKDLL == 1 } then { set tmpvar_3 "Xilinx-CLKDLL" }
5731
        global CONFIG_CLK_DCM
5732
        if { $CONFIG_CLK_DCM == 1 } then { set tmpvar_3 "Xilinx-DCM" }
5733
        global tmpvar_4
5734
        set tmpvar_4 "5-cycles"
5735
        global CONFIG_IU_MUL_LATENCY_4
5736
        if { $CONFIG_IU_MUL_LATENCY_4 == 1 } then { set tmpvar_4 "4-cycles" }
5737
        global CONFIG_IU_MUL_LATENCY_5
5738
        if { $CONFIG_IU_MUL_LATENCY_5 == 1 } then { set tmpvar_4 "5-cycles" }
5739
        global tmpvar_5
5740
        set tmpvar_5 "GRFPU"
5741
        global CONFIG_FPU_GRFPU
5742
        if { $CONFIG_FPU_GRFPU == 1 } then { set tmpvar_5 "GRFPU" }
5743
        global CONFIG_FPU_GRFPULITE
5744
        if { $CONFIG_FPU_GRFPULITE == 1 } then { set tmpvar_5 "GRFPU-LITE" }
5745
        global CONFIG_FPU_MEIKO
5746
        if { $CONFIG_FPU_MEIKO == 1 } then { set tmpvar_5 "Meiko" }
5747
        global tmpvar_6
5748
        set tmpvar_6 "Inferred"
5749
        global CONFIG_FPU_GRFPU_INFMUL
5750
        if { $CONFIG_FPU_GRFPU_INFMUL == 1 } then { set tmpvar_6 "Inferred" }
5751
        global CONFIG_FPU_GRFPU_DWMUL
5752
        if { $CONFIG_FPU_GRFPU_DWMUL == 1 } then { set tmpvar_6 "DW" }
5753
        global CONFIG_FPU_GRFPU_MODGEN
5754
        if { $CONFIG_FPU_GRFPU_MODGEN == 1 } then { set tmpvar_6 "ModGen" }
5755
        global tmpvar_7
5756
        set tmpvar_7 "Simple"
5757
        global CONFIG_FPU_GRFPC0
5758
        if { $CONFIG_FPU_GRFPC0 == 1 } then { set tmpvar_7 "Simple" }
5759
        global CONFIG_FPU_GRFPC1
5760
        if { $CONFIG_FPU_GRFPC1 == 1 } then { set tmpvar_7 "Data-forwarding" }
5761
        global CONFIG_FPU_GRFPC2
5762
        if { $CONFIG_FPU_GRFPC2 == 1 } then { set tmpvar_7 "Non-blocking" }
5763
        global tmpvar_8
5764
        set tmpvar_8 "1"
5765
        global CONFIG_ICACHE_ASSO1
5766
        if { $CONFIG_ICACHE_ASSO1 == 1 } then { set tmpvar_8 "1" }
5767
        global CONFIG_ICACHE_ASSO2
5768
        if { $CONFIG_ICACHE_ASSO2 == 1 } then { set tmpvar_8 "2" }
5769
        global CONFIG_ICACHE_ASSO3
5770
        if { $CONFIG_ICACHE_ASSO3 == 1 } then { set tmpvar_8 "3" }
5771
        global CONFIG_ICACHE_ASSO4
5772
        if { $CONFIG_ICACHE_ASSO4 == 1 } then { set tmpvar_8 "4" }
5773
        global tmpvar_9
5774
        set tmpvar_9 "4"
5775
        global CONFIG_ICACHE_SZ1
5776
        if { $CONFIG_ICACHE_SZ1 == 1 } then { set tmpvar_9 "1" }
5777
        global CONFIG_ICACHE_SZ2
5778
        if { $CONFIG_ICACHE_SZ2 == 1 } then { set tmpvar_9 "2" }
5779
        global CONFIG_ICACHE_SZ4
5780
        if { $CONFIG_ICACHE_SZ4 == 1 } then { set tmpvar_9 "4" }
5781
        global CONFIG_ICACHE_SZ8
5782
        if { $CONFIG_ICACHE_SZ8 == 1 } then { set tmpvar_9 "8" }
5783
        global CONFIG_ICACHE_SZ16
5784
        if { $CONFIG_ICACHE_SZ16 == 1 } then { set tmpvar_9 "16" }
5785
        global CONFIG_ICACHE_SZ32
5786
        if { $CONFIG_ICACHE_SZ32 == 1 } then { set tmpvar_9 "32" }
5787
        global CONFIG_ICACHE_SZ64
5788
        if { $CONFIG_ICACHE_SZ64 == 1 } then { set tmpvar_9 "64" }
5789
        global CONFIG_ICACHE_SZ128
5790
        if { $CONFIG_ICACHE_SZ128 == 1 } then { set tmpvar_9 "128" }
5791
        global CONFIG_ICACHE_SZ256
5792
        if { $CONFIG_ICACHE_SZ256 == 1 } then { set tmpvar_9 "256" }
5793
        global tmpvar_10
5794
        set tmpvar_10 "32"
5795
        global CONFIG_ICACHE_LZ16
5796
        if { $CONFIG_ICACHE_LZ16 == 1 } then { set tmpvar_10 "16" }
5797
        global CONFIG_ICACHE_LZ32
5798
        if { $CONFIG_ICACHE_LZ32 == 1 } then { set tmpvar_10 "32" }
5799
        global tmpvar_11
5800
        set tmpvar_11 "Random"
5801
        global CONFIG_ICACHE_ALGORND
5802
        if { $CONFIG_ICACHE_ALGORND == 1 } then { set tmpvar_11 "Random" }
5803
        global CONFIG_ICACHE_ALGOLRR
5804
        if { $CONFIG_ICACHE_ALGOLRR == 1 } then { set tmpvar_11 "LRR" }
5805
        global CONFIG_ICACHE_ALGOLRU
5806
        if { $CONFIG_ICACHE_ALGOLRU == 1 } then { set tmpvar_11 "LRU" }
5807
        global tmpvar_12
5808
        set tmpvar_12 "4"
5809
        global CONFIG_ICACHE_LRAM_SZ1
5810
        if { $CONFIG_ICACHE_LRAM_SZ1 == 1 } then { set tmpvar_12 "1" }
5811
        global CONFIG_ICACHE_LRAM_SZ2
5812
        if { $CONFIG_ICACHE_LRAM_SZ2 == 1 } then { set tmpvar_12 "2" }
5813
        global CONFIG_ICACHE_LRAM_SZ4
5814
        if { $CONFIG_ICACHE_LRAM_SZ4 == 1 } then { set tmpvar_12 "4" }
5815
        global CONFIG_ICACHE_LRAM_SZ8
5816
        if { $CONFIG_ICACHE_LRAM_SZ8 == 1 } then { set tmpvar_12 "8" }
5817
        global CONFIG_ICACHE_LRAM_SZ16
5818
        if { $CONFIG_ICACHE_LRAM_SZ16 == 1 } then { set tmpvar_12 "16" }
5819
        global CONFIG_ICACHE_LRAM_SZ32
5820
        if { $CONFIG_ICACHE_LRAM_SZ32 == 1 } then { set tmpvar_12 "32" }
5821
        global CONFIG_ICACHE_LRAM_SZ64
5822
        if { $CONFIG_ICACHE_LRAM_SZ64 == 1 } then { set tmpvar_12 "64" }
5823
        global CONFIG_ICACHE_LRAM_SZ128
5824
        if { $CONFIG_ICACHE_LRAM_SZ128 == 1 } then { set tmpvar_12 "128" }
5825
        global CONFIG_ICACHE_LRAM_SZ256
5826
        if { $CONFIG_ICACHE_LRAM_SZ256 == 1 } then { set tmpvar_12 "256" }
5827
        global tmpvar_13
5828
        set tmpvar_13 "1"
5829
        global CONFIG_DCACHE_ASSO1
5830
        if { $CONFIG_DCACHE_ASSO1 == 1 } then { set tmpvar_13 "1" }
5831
        global CONFIG_DCACHE_ASSO2
5832
        if { $CONFIG_DCACHE_ASSO2 == 1 } then { set tmpvar_13 "2" }
5833
        global CONFIG_DCACHE_ASSO3
5834
        if { $CONFIG_DCACHE_ASSO3 == 1 } then { set tmpvar_13 "3" }
5835
        global CONFIG_DCACHE_ASSO4
5836
        if { $CONFIG_DCACHE_ASSO4 == 1 } then { set tmpvar_13 "4" }
5837
        global tmpvar_14
5838
        set tmpvar_14 "4"
5839
        global CONFIG_DCACHE_SZ1
5840
        if { $CONFIG_DCACHE_SZ1 == 1 } then { set tmpvar_14 "1" }
5841
        global CONFIG_DCACHE_SZ2
5842
        if { $CONFIG_DCACHE_SZ2 == 1 } then { set tmpvar_14 "2" }
5843
        global CONFIG_DCACHE_SZ4
5844
        if { $CONFIG_DCACHE_SZ4 == 1 } then { set tmpvar_14 "4" }
5845
        global CONFIG_DCACHE_SZ8
5846
        if { $CONFIG_DCACHE_SZ8 == 1 } then { set tmpvar_14 "8" }
5847
        global CONFIG_DCACHE_SZ16
5848
        if { $CONFIG_DCACHE_SZ16 == 1 } then { set tmpvar_14 "16" }
5849
        global CONFIG_DCACHE_SZ32
5850
        if { $CONFIG_DCACHE_SZ32 == 1 } then { set tmpvar_14 "32" }
5851
        global CONFIG_DCACHE_SZ64
5852
        if { $CONFIG_DCACHE_SZ64 == 1 } then { set tmpvar_14 "64" }
5853
        global CONFIG_DCACHE_SZ128
5854
        if { $CONFIG_DCACHE_SZ128 == 1 } then { set tmpvar_14 "128" }
5855
        global CONFIG_DCACHE_SZ256
5856
        if { $CONFIG_DCACHE_SZ256 == 1 } then { set tmpvar_14 "256" }
5857
        global tmpvar_15
5858
        set tmpvar_15 "32"
5859
        global CONFIG_DCACHE_LZ16
5860
        if { $CONFIG_DCACHE_LZ16 == 1 } then { set tmpvar_15 "16" }
5861
        global CONFIG_DCACHE_LZ32
5862
        if { $CONFIG_DCACHE_LZ32 == 1 } then { set tmpvar_15 "32" }
5863
        global tmpvar_16
5864
        set tmpvar_16 "Random"
5865
        global CONFIG_DCACHE_ALGORND
5866
        if { $CONFIG_DCACHE_ALGORND == 1 } then { set tmpvar_16 "Random" }
5867
        global CONFIG_DCACHE_ALGOLRR
5868
        if { $CONFIG_DCACHE_ALGOLRR == 1 } then { set tmpvar_16 "LRR" }
5869
        global CONFIG_DCACHE_ALGOLRU
5870
        if { $CONFIG_DCACHE_ALGOLRU == 1 } then { set tmpvar_16 "LRU" }
5871
        global tmpvar_17
5872
        set tmpvar_17 "4"
5873
        global CONFIG_DCACHE_LRAM_SZ1
5874
        if { $CONFIG_DCACHE_LRAM_SZ1 == 1 } then { set tmpvar_17 "1" }
5875
        global CONFIG_DCACHE_LRAM_SZ2
5876
        if { $CONFIG_DCACHE_LRAM_SZ2 == 1 } then { set tmpvar_17 "2" }
5877
        global CONFIG_DCACHE_LRAM_SZ4
5878
        if { $CONFIG_DCACHE_LRAM_SZ4 == 1 } then { set tmpvar_17 "4" }
5879
        global CONFIG_DCACHE_LRAM_SZ8
5880
        if { $CONFIG_DCACHE_LRAM_SZ8 == 1 } then { set tmpvar_17 "8" }
5881
        global CONFIG_DCACHE_LRAM_SZ16
5882
        if { $CONFIG_DCACHE_LRAM_SZ16 == 1 } then { set tmpvar_17 "16" }
5883
        global CONFIG_DCACHE_LRAM_SZ32
5884
        if { $CONFIG_DCACHE_LRAM_SZ32 == 1 } then { set tmpvar_17 "32" }
5885
        global CONFIG_DCACHE_LRAM_SZ64
5886
        if { $CONFIG_DCACHE_LRAM_SZ64 == 1 } then { set tmpvar_17 "64" }
5887
        global CONFIG_DCACHE_LRAM_SZ128
5888
        if { $CONFIG_DCACHE_LRAM_SZ128 == 1 } then { set tmpvar_17 "128" }
5889
        global CONFIG_DCACHE_LRAM_SZ256
5890
        if { $CONFIG_DCACHE_LRAM_SZ256 == 1 } then { set tmpvar_17 "256" }
5891
        global tmpvar_18
5892
        set tmpvar_18 "combined"
5893
        global CONFIG_MMU_COMBINED
5894
        if { $CONFIG_MMU_COMBINED == 1 } then { set tmpvar_18 "combined" }
5895
        global CONFIG_MMU_SPLIT
5896
        if { $CONFIG_MMU_SPLIT == 1 } then { set tmpvar_18 "split" }
5897
        global tmpvar_19
5898
        set tmpvar_19 "Increment"
5899
        global CONFIG_MMU_REPARRAY
5900
        if { $CONFIG_MMU_REPARRAY == 1 } then { set tmpvar_19 "LRU" }
5901
        global CONFIG_MMU_REPINCREMENT
5902
        if { $CONFIG_MMU_REPINCREMENT == 1 } then { set tmpvar_19 "Increment" }
5903
        global tmpvar_20
5904
        set tmpvar_20 "8"
5905
        global CONFIG_MMU_I2
5906
        if { $CONFIG_MMU_I2 == 1 } then { set tmpvar_20 "2" }
5907
        global CONFIG_MMU_I4
5908
        if { $CONFIG_MMU_I4 == 1 } then { set tmpvar_20 "4" }
5909
        global CONFIG_MMU_I8
5910
        if { $CONFIG_MMU_I8 == 1 } then { set tmpvar_20 "8" }
5911
        global CONFIG_MMU_I16
5912
        if { $CONFIG_MMU_I16 == 1 } then { set tmpvar_20 "16" }
5913
        global CONFIG_MMU_I32
5914
        if { $CONFIG_MMU_I32 == 1 } then { set tmpvar_20 "32" }
5915
        global tmpvar_21
5916
        set tmpvar_21 "8"
5917
        global CONFIG_MMU_D2
5918
        if { $CONFIG_MMU_D2 == 1 } then { set tmpvar_21 "2" }
5919
        global CONFIG_MMU_D4
5920
        if { $CONFIG_MMU_D4 == 1 } then { set tmpvar_21 "4" }
5921
        global CONFIG_MMU_D8
5922
        if { $CONFIG_MMU_D8 == 1 } then { set tmpvar_21 "8" }
5923
        global CONFIG_MMU_D16
5924
        if { $CONFIG_MMU_D16 == 1 } then { set tmpvar_21 "16" }
5925
        global CONFIG_MMU_D32
5926
        if { $CONFIG_MMU_D32 == 1 } then { set tmpvar_21 "32" }
5927
        global tmpvar_22
5928
        set tmpvar_22 "1"
5929
        global CONFIG_DSU_ITRACESZ1
5930
        if { $CONFIG_DSU_ITRACESZ1 == 1 } then { set tmpvar_22 "1" }
5931
        global CONFIG_DSU_ITRACESZ2
5932
        if { $CONFIG_DSU_ITRACESZ2 == 1 } then { set tmpvar_22 "2" }
5933
        global CONFIG_DSU_ITRACESZ4
5934
        if { $CONFIG_DSU_ITRACESZ4 == 1 } then { set tmpvar_22 "4" }
5935
        global CONFIG_DSU_ITRACESZ8
5936
        if { $CONFIG_DSU_ITRACESZ8 == 1 } then { set tmpvar_22 "8" }
5937
        global CONFIG_DSU_ITRACESZ16
5938
        if { $CONFIG_DSU_ITRACESZ16 == 1 } then { set tmpvar_22 "16" }
5939
        global tmpvar_23
5940
        set tmpvar_23 "1"
5941
        global CONFIG_DSU_ATRACESZ1
5942
        if { $CONFIG_DSU_ATRACESZ1 == 1 } then { set tmpvar_23 "1" }
5943
        global CONFIG_DSU_ATRACESZ2
5944
        if { $CONFIG_DSU_ATRACESZ2 == 1 } then { set tmpvar_23 "2" }
5945
        global CONFIG_DSU_ATRACESZ4
5946
        if { $CONFIG_DSU_ATRACESZ4 == 1 } then { set tmpvar_23 "4" }
5947
        global CONFIG_DSU_ATRACESZ8
5948
        if { $CONFIG_DSU_ATRACESZ8 == 1 } then { set tmpvar_23 "8" }
5949
        global CONFIG_DSU_ATRACESZ16
5950
        if { $CONFIG_DSU_ATRACESZ16 == 1 } then { set tmpvar_23 "16" }
5951
        global tmpvar_24
5952
        set tmpvar_24 "None"
5953
        global CONFIG_IUFT_NONE
5954
        if { $CONFIG_IUFT_NONE == 1 } then { set tmpvar_24 "None" }
5955
        global CONFIG_IUFT_PAR
5956
        if { $CONFIG_IUFT_PAR == 1 } then { set tmpvar_24 "Parity" }
5957
        global CONFIG_IUFT_DMR
5958
        if { $CONFIG_IUFT_DMR == 1 } then { set tmpvar_24 "PDMR" }
5959
        global CONFIG_IUFT_BCH
5960
        if { $CONFIG_IUFT_BCH == 1 } then { set tmpvar_24 "BCH" }
5961
        global CONFIG_IUFT_TMR
5962
        if { $CONFIG_IUFT_TMR == 1 } then { set tmpvar_24 "TMR" }
5963
        global tmpvar_25
5964
        set tmpvar_25 "2"
5965
        global CONFIG_DSU_ETHSZ1
5966
        if { $CONFIG_DSU_ETHSZ1 == 1 } then { set tmpvar_25 "1" }
5967
        global CONFIG_DSU_ETHSZ2
5968
        if { $CONFIG_DSU_ETHSZ2 == 1 } then { set tmpvar_25 "2" }
5969
        global CONFIG_DSU_ETHSZ4
5970
        if { $CONFIG_DSU_ETHSZ4 == 1 } then { set tmpvar_25 "4" }
5971
        global CONFIG_DSU_ETHSZ8
5972
        if { $CONFIG_DSU_ETHSZ8 == 1 } then { set tmpvar_25 "8" }
5973
        global CONFIG_DSU_ETHSZ16
5974
        if { $CONFIG_DSU_ETHSZ16 == 1 } then { set tmpvar_25 "16" }
5975
        global tmpvar_26
5976
        set tmpvar_26 "4xprogrammable"
5977
        global CONFIG_MCTRLFT_ROMASEL0
5978
        if { $CONFIG_MCTRLFT_ROMASEL0 == 1 } then { set tmpvar_26 "4xprogrammable" }
5979
        global CONFIG_MCTRLFT_ROMASEL1
5980
        if { $CONFIG_MCTRLFT_ROMASEL1 == 1 } then { set tmpvar_26 "4x16_kByte" }
5981
        global CONFIG_MCTRLFT_ROMASEL2
5982
        if { $CONFIG_MCTRLFT_ROMASEL2 == 1 } then { set tmpvar_26 "4x32_kByte" }
5983
        global CONFIG_MCTRLFT_ROMASEL3
5984
        if { $CONFIG_MCTRLFT_ROMASEL3 == 1 } then { set tmpvar_26 "4x64_kByte" }
5985
        global CONFIG_MCTRLFT_ROMASEL4
5986
        if { $CONFIG_MCTRLFT_ROMASEL4 == 1 } then { set tmpvar_26 "4x128_kByte" }
5987
        global CONFIG_MCTRLFT_ROMASEL5
5988
        if { $CONFIG_MCTRLFT_ROMASEL5 == 1 } then { set tmpvar_26 "4x256_kByte" }
5989
        global CONFIG_MCTRLFT_ROMASEL6
5990
        if { $CONFIG_MCTRLFT_ROMASEL6 == 1 } then { set tmpvar_26 "4x512_kByte" }
5991
        global CONFIG_MCTRLFT_ROMASEL7
5992
        if { $CONFIG_MCTRLFT_ROMASEL7 == 1 } then { set tmpvar_26 "4x1_MByte" }
5993
        global CONFIG_MCTRLFT_ROMASEL8
5994
        if { $CONFIG_MCTRLFT_ROMASEL8 == 1 } then { set tmpvar_26 "4x2_MByte" }
5995
        global CONFIG_MCTRLFT_ROMASEL9
5996
        if { $CONFIG_MCTRLFT_ROMASEL9 == 1 } then { set tmpvar_26 "4x4_MByte" }
5997
        global CONFIG_MCTRLFT_ROMASEL10
5998
        if { $CONFIG_MCTRLFT_ROMASEL10 == 1 } then { set tmpvar_26 "4x8_MByte" }
5999
        global CONFIG_MCTRLFT_ROMASEL11
6000
        if { $CONFIG_MCTRLFT_ROMASEL11 == 1 } then { set tmpvar_26 "4x16_MByte" }
6001
        global CONFIG_MCTRLFT_ROMASEL12
6002
        if { $CONFIG_MCTRLFT_ROMASEL12 == 1 } then { set tmpvar_26 "4x32_MByte" }
6003
        global CONFIG_MCTRLFT_ROMASEL13
6004
        if { $CONFIG_MCTRLFT_ROMASEL13 == 1 } then { set tmpvar_26 "4x64_MByte" }
6005
        global CONFIG_MCTRLFT_ROMASEL14
6006
        if { $CONFIG_MCTRLFT_ROMASEL14 == 1 } then { set tmpvar_26 "4x128_MByte" }
6007
        global CONFIG_MCTRLFT_ROMASEL15
6008
        if { $CONFIG_MCTRLFT_ROMASEL15 == 1 } then { set tmpvar_26 "2x256_MByte" }
6009
        global CONFIG_MCTRLFT_ROMASEL16
6010
        if { $CONFIG_MCTRLFT_ROMASEL16 == 1 } then { set tmpvar_26 "2x64_kByte" }
6011
        global CONFIG_MCTRLFT_ROMASEL17
6012
        if { $CONFIG_MCTRLFT_ROMASEL17 == 1 } then { set tmpvar_26 "2x128_kByte" }
6013
        global CONFIG_MCTRLFT_ROMASEL18
6014
        if { $CONFIG_MCTRLFT_ROMASEL18 == 1 } then { set tmpvar_26 "2x256_kByte" }
6015
        global CONFIG_MCTRLFT_ROMASEL19
6016
        if { $CONFIG_MCTRLFT_ROMASEL19 == 1 } then { set tmpvar_26 "2x512_kByte" }
6017
        global CONFIG_MCTRLFT_ROMASEL20
6018
        if { $CONFIG_MCTRLFT_ROMASEL20 == 1 } then { set tmpvar_26 "2x1_MByte" }
6019
        global CONFIG_MCTRLFT_ROMASEL21
6020
        if { $CONFIG_MCTRLFT_ROMASEL21 == 1 } then { set tmpvar_26 "2x2_MByte" }
6021
        global CONFIG_MCTRLFT_ROMASEL22
6022
        if { $CONFIG_MCTRLFT_ROMASEL22 == 1 } then { set tmpvar_26 "2x4_MByte" }
6023
        global CONFIG_MCTRLFT_ROMASEL23
6024
        if { $CONFIG_MCTRLFT_ROMASEL23 == 1 } then { set tmpvar_26 "2x8_MByte" }
6025
        global CONFIG_MCTRLFT_ROMASEL24
6026
        if { $CONFIG_MCTRLFT_ROMASEL24 == 1 } then { set tmpvar_26 "2x16_MByte" }
6027
        global CONFIG_MCTRLFT_ROMASEL25
6028
        if { $CONFIG_MCTRLFT_ROMASEL25 == 1 } then { set tmpvar_26 "2x32_MByte" }
6029
        global CONFIG_MCTRLFT_ROMASEL26
6030
        if { $CONFIG_MCTRLFT_ROMASEL26 == 1 } then { set tmpvar_26 "2x64_MByte" }
6031
        global CONFIG_MCTRLFT_ROMASEL27
6032
        if { $CONFIG_MCTRLFT_ROMASEL27 == 1 } then { set tmpvar_26 "2x128_MByte" }
6033
        global CONFIG_MCTRLFT_ROMASEL28
6034
        if { $CONFIG_MCTRLFT_ROMASEL28 == 1 } then { set tmpvar_26 "2x256_MByte" }
6035
        global tmpvar_27
6036
        set tmpvar_27 "8"
6037
        global CONFIG_GRETH_FIFO4
6038
        if { $CONFIG_GRETH_FIFO4 == 1 } then { set tmpvar_27 "4" }
6039
        global CONFIG_GRETH_FIFO8
6040
        if { $CONFIG_GRETH_FIFO8 == 1 } then { set tmpvar_27 "8" }
6041
        global CONFIG_GRETH_FIFO16
6042
        if { $CONFIG_GRETH_FIFO16 == 1 } then { set tmpvar_27 "16" }
6043
        global CONFIG_GRETH_FIFO32
6044
        if { $CONFIG_GRETH_FIFO32 == 1 } then { set tmpvar_27 "32" }
6045
        global CONFIG_GRETH_FIFO64
6046
        if { $CONFIG_GRETH_FIFO64 == 1 } then { set tmpvar_27 "64" }
6047
        global tmpvar_28
6048
        set tmpvar_28 "8"
6049
        global CONFIG_PCI_FIFO0
6050
        if { $CONFIG_PCI_FIFO0 == 1 } then { set tmpvar_28 "None" }
6051
        global CONFIG_PCI_FIFO8
6052
        if { $CONFIG_PCI_FIFO8 == 1 } then { set tmpvar_28 "8" }
6053
        global CONFIG_PCI_FIFO16
6054
        if { $CONFIG_PCI_FIFO16 == 1 } then { set tmpvar_28 "16" }
6055
        global CONFIG_PCI_FIFO32
6056
        if { $CONFIG_PCI_FIFO32 == 1 } then { set tmpvar_28 "32" }
6057
        global CONFIG_PCI_FIFO64
6058
        if { $CONFIG_PCI_FIFO64 == 1 } then { set tmpvar_28 "64" }
6059
        global CONFIG_PCI_FIFO128
6060
        if { $CONFIG_PCI_FIFO128 == 1 } then { set tmpvar_28 "128" }
6061
        global tmpvar_29
6062
        set tmpvar_29 "256"
6063
        global CONFIG_PCI_TRACE256
6064
        if { $CONFIG_PCI_TRACE256 == 1 } then { set tmpvar_29 "256" }
6065
        global CONFIG_PCI_TRACE512
6066
        if { $CONFIG_PCI_TRACE512 == 1 } then { set tmpvar_29 "512" }
6067
        global CONFIG_PCI_TRACE1024
6068
        if { $CONFIG_PCI_TRACE1024 == 1 } then { set tmpvar_29 "1024" }
6069
        global CONFIG_PCI_TRACE2048
6070
        if { $CONFIG_PCI_TRACE2048 == 1 } then { set tmpvar_29 "2048" }
6071
        global CONFIG_PCI_TRACE4096
6072
        if { $CONFIG_PCI_TRACE4096 == 1 } then { set tmpvar_29 "4096" }
6073
        global tmpvar_30
6074
        set tmpvar_30 "16"
6075
        global CONFIG_SPW_AHBFIFO4
6076
        if { $CONFIG_SPW_AHBFIFO4 == 1 } then { set tmpvar_30 "4" }
6077
        global CONFIG_SPW_AHBFIFO8
6078
        if { $CONFIG_SPW_AHBFIFO8 == 1 } then { set tmpvar_30 "8" }
6079
        global CONFIG_SPW_AHBFIFO16
6080
        if { $CONFIG_SPW_AHBFIFO16 == 1 } then { set tmpvar_30 "16" }
6081
        global CONFIG_SPW_AHBFIFO32
6082
        if { $CONFIG_SPW_AHBFIFO32 == 1 } then { set tmpvar_30 "32" }
6083
        global tmpvar_31
6084
        set tmpvar_31 "16"
6085
        global CONFIG_SPW_RXFIFO16
6086
        if { $CONFIG_SPW_RXFIFO16 == 1 } then { set tmpvar_31 "16" }
6087
        global CONFIG_SPW_RXFIFO32
6088
        if { $CONFIG_SPW_RXFIFO32 == 1 } then { set tmpvar_31 "32" }
6089
        global CONFIG_SPW_RXFIFO64
6090
        if { $CONFIG_SPW_RXFIFO64 == 1 } then { set tmpvar_31 "64" }
6091
        global tmpvar_32
6092
        set tmpvar_32 "64"
6093
        global CONFIG_SPW_RMAPBUF2
6094
        if { $CONFIG_SPW_RMAPBUF2 == 1 } then { set tmpvar_32 "64" }
6095
        global CONFIG_SPW_RMAPBUF4
6096
        if { $CONFIG_SPW_RMAPBUF4 == 1 } then { set tmpvar_32 "128" }
6097
        global CONFIG_SPW_RMAPBUF6
6098
        if { $CONFIG_SPW_RMAPBUF6 == 1 } then { set tmpvar_32 "192" }
6099
        global CONFIG_SPW_RMAPBUF8
6100
        if { $CONFIG_SPW_RMAPBUF8 == 1 } then { set tmpvar_32 "256" }
6101
        global tmpvar_33
6102
        set tmpvar_33 "1"
6103
        global CONFIG_UA1_FIFO1
6104
        if { $CONFIG_UA1_FIFO1 == 1 } then { set tmpvar_33 "1" }
6105
        global CONFIG_UA1_FIFO2
6106
        if { $CONFIG_UA1_FIFO2 == 1 } then { set tmpvar_33 "2" }
6107
        global CONFIG_UA1_FIFO4
6108
        if { $CONFIG_UA1_FIFO4 == 1 } then { set tmpvar_33 "4" }
6109
        global CONFIG_UA1_FIFO8
6110
        if { $CONFIG_UA1_FIFO8 == 1 } then { set tmpvar_33 "8" }
6111
        global CONFIG_UA1_FIFO16
6112
        if { $CONFIG_UA1_FIFO16 == 1 } then { set tmpvar_33 "16" }
6113
        global CONFIG_UA1_FIFO32
6114
        if { $CONFIG_UA1_FIFO32 == 1 } then { set tmpvar_33 "32" }
6115
        global tmpvar_34
6116
        set tmpvar_34 "1"
6117
        global CONFIG_UA2_FIFO1
6118
        if { $CONFIG_UA2_FIFO1 == 1 } then { set tmpvar_34 "1" }
6119
        global CONFIG_UA2_FIFO2
6120
        if { $CONFIG_UA2_FIFO2 == 1 } then { set tmpvar_34 "2" }
6121
        global CONFIG_UA2_FIFO4
6122
        if { $CONFIG_UA2_FIFO4 == 1 } then { set tmpvar_34 "4" }
6123
        global CONFIG_UA2_FIFO8
6124
        if { $CONFIG_UA2_FIFO8 == 1 } then { set tmpvar_34 "8" }
6125
        global CONFIG_UA2_FIFO16
6126
        if { $CONFIG_UA2_FIFO16 == 1 } then { set tmpvar_34 "16" }
6127
        global CONFIG_UA2_FIFO32
6128
        if { $CONFIG_UA2_FIFO32 == 1 } then { set tmpvar_34 "32" }
6129
}
6130
 
6131
 
6132
proc update_define_mainmenu {} {
6133
        global CONFIG_MODULES
6134
        global CONFIG_LEON3FT_PRESENT
6135
        global CONSTANT_Y
6136
        set CONFIG_LEON3FT_PRESENT $CONSTANT_Y
6137
}
6138
 
6139
 
6140
# FILE: tail.tk
6141
# This file is boilerplate TCL/TK function definitions for 'make xconfig'.
6142
#
6143
# CHANGES
6144
# =======
6145
#
6146
# 8 January 1998, Michael Elizabeth Chastain, 
6147
# Arrange buttons in three columns for better screen fitting.
6148
#
6149
 
6150
#
6151
# Read the user's settings from .config.  These will override whatever is
6152
# in config.in.  Don't do this if the user specified a -D to force
6153
# the defaults.
6154
#
6155
 
6156
set defaults defconfig
6157
 
6158
if { [file readable .config] == 1} then {
6159
        if { $argc > 0 } then {
6160
                if { [lindex $argv 0] != "-D" } then {
6161
                        read_config .config
6162
                }
6163
                else
6164
                {
6165
                        read_config $defaults
6166
                }
6167
        } else {
6168
                read_config .config
6169
        }
6170
} else {
6171
        read_config $defaults
6172
}
6173
 
6174
update_define 1 $total_menus 0
6175
update_mainmenu
6176
 
6177
button .f0.right.save -anchor w -text "Save and Exit" -underline 0\
6178
    -command { catch {exec cp -f .config .config.old}; \
6179
                writeconfig .config config.h; wrapup .wrap }
6180
 
6181
button .f0.right.quit -anchor w -text "Quit Without Saving" -underline 0\
6182
    -command { maybe_exit .maybe }
6183
 
6184
button .f0.right.load -anchor w -text "Load Configuration from File" \
6185
    -command { load_configfile .load "Load Configuration from file" read_config_file
6186
}
6187
 
6188
button .f0.right.store -anchor w -text "Store Configuration to File" \
6189
    -command { load_configfile .load "Store Configuration to file" write_config_file }
6190
 
6191
#
6192
# Now pack everything.
6193
#
6194
 
6195
pack .f0.right.store .f0.right.load .f0.right.quit .f0.right.save \
6196
    -padx 0 -pady 0 -side bottom -fill x
6197
pack .f0.left .f0.middle .f0.right -side left -padx 5 -pady 0 -fill y
6198
pack .f0 -padx 5 -pady 5
6199
 
6200
update idletasks
6201
set winy [expr 10 + [winfo reqheight .f0]]
6202
set scry [lindex [wm maxsize .] 1]
6203
set winx [expr 10 + [winfo reqwidth .f0]]
6204
set scrx [lindex [wm maxsize .] 0]
6205
if {$winx < $scrx} then {set maxx -1} else {set maxx $winx}
6206
if {$winy < $scry} then {set maxy -1} else {set maxy $winy}
6207
.f0 configure -width $winx -height $winy
6208
wm maxsize . $maxx $maxy
6209
 
6210
#
6211
# If we cannot write our config files, disable the write button.
6212
#
6213
if { [file exists .config] == 1 } then {
6214
                if { [file writable .config] == 0 } then {
6215
                        .f0.right.save configure -state disabled
6216
                }
6217
        } else {
6218
                if { [file writable .] == 0 } then {
6219
                        .f0.right.save configure -state disabled
6220
                }
6221
        }
6222
 
6223
#if { [file exists include/linux/autoconf.h] == 1 } then {
6224
#               if { [file writable include/linux/autoconf.h] == 0 } then {
6225
#                       .f0.right.save configure -state disabled
6226
#               }
6227
#       } else {
6228
#               if { [file writable include/linux/] == 0 } then {
6229
#                       .f0.right.save configure -state disabled
6230
#               }
6231
#       }

powered by: WebSVN 2.1.0

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