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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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