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

Subversion Repositories mips_enhanced

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

powered by: WebSVN 2.1.0

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