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

powered by: WebSVN 2.1.0

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