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

powered by: WebSVN 2.1.0

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