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

powered by: WebSVN 2.1.0

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