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-altera-ep3c25-eek/] [lconfig.tk] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
# FILE: header.tk
2
# This file is boilerplate TCL/TK function definitions for 'make xconfig'.
3
#
4
# CHANGES
5
# =======
6
#
7
# 8 January 1999, Michael Elizabeth Chastain, 
8
# - Remove unused do_cmd function (part of the 2.0 sound support).
9
# - Arrange buttons in three columns for better screen fitting.
10
# - Add CONSTANT_Y, CONSTANT_M, CONSTANT_N for commands like:
11
#     dep_tristate 'foo' CONFIG_FOO m
12
#
13
# 23 January 1999, Michael Elizabeth Chastain, 
14
# - Shut vfix the hell up.
15
#
16
# 24 January 1999, Michael Elizabeth Chastain, 
17
# - Improve the exit message (Jeff Ronne).
18
 
19
#
20
# This is a handy replacement for ".widget cget" that requires neither tk4
21
# nor additional source code uglification.
22
#
23
proc cget { w option } {
24
        return "[lindex [$w configure $option] 4]"
25
}
26
 
27
#
28
# Function to compensate for broken config.in scripts like the sound driver,
29
# which make dependencies on variables that are never even conditionally
30
# defined.
31
#
32
proc vfix { var } {
33
        global $var
34
        if [ catch {eval concat $$var} ] {
35
                set $var 4
36
        }
37
}
38
 
39
#
40
# Constant values used by certain dep_tristate commands.
41
#
42
set CONSTANT_Y 1
43
set CONSTANT_M 2
44
set CONSTANT_N 0
45
set CONSTANT_E 4
46
 
47
#
48
# Create a "reference" object to steal colors from.
49
#
50
button .ref
51
 
52
#
53
# On monochrome displays, -disabledforeground is blank by default; that's
54
# bad.  Fill it with -foreground instead.
55
#
56
if { [cget .ref -disabledforeground] == "" } {
57
        .ref configure -disabledforeground [cget .ref -foreground]
58
}
59
 
60
 
61
#
62
# Define some macros we will need to parse the config.in file.
63
#
64
 
65
proc mainmenu_name { text } {
66
        wm title . "$text"
67
}
68
 
69
proc menu_option { w menu_num text } {
70
        global menus_per_column
71
        global processed_top_level
72
        set processed_top_level [expr $processed_top_level + 1]
73
        if { $processed_top_level <= $menus_per_column } then {
74
            set myframe left
75
        } elseif { $processed_top_level <= [expr 2 * $menus_per_column] } then {
76
            set myframe middle
77
        } else {
78
            set myframe right
79
        }
80
        button .f0.x$menu_num -anchor w -text "$text" \
81
            -command "$w .$w \"$text\""
82
        pack .f0.x$menu_num -pady 0 -side top -fill x -in .f0.$myframe
83
}
84
 
85
proc load_configfile { w title func } {
86
        catch {destroy $w}
87
        toplevel $w -class Dialog
88
        global loadfile
89
        frame $w.x
90
        label $w.bm -bitmap questhead
91
        pack  $w.bm -pady 10 -side top -padx 10
92
        label $w.x.l -text "Enter filename:" -relief raised
93
        entry $w.x.x -width 35 -relief sunken -borderwidth 2 \
94
                -textvariable loadfile
95
        pack $w.x.l $w.x.x -anchor w -side left
96
        pack $w.x -side top -pady 10
97
        wm title $w "$title"
98
 
99
        set oldFocus [focus]
100
        frame $w.f
101
        button $w.f.back -text "OK" -width 20 \
102
                -command "destroy $w; focus $oldFocus;$func .fileio"
103
        button $w.f.canc -text "Cancel" \
104
                -width 20 -command "destroy $w; focus $oldFocus"
105
        pack $w.f.back $w.f.canc -side left -pady 10 -padx 45
106
        pack $w.f -pady 10 -side bottom -padx 10 -anchor w
107
        focus $w
108
        global winx; global winy
109
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
110
        wm geometry $w +$winx+$winy
111
}
112
 
113
bind all  {maybe_exit .maybe}
114
 
115
proc maybe_exit { w } {
116
        catch {destroy $w}
117
        toplevel $w -class Dialog
118
        label $w.bm -bitmap questhead
119
        pack  $w.bm -pady 10 -side top -padx 10
120
        message $w.m -width 400 -aspect 300 \
121
                -text "Changes will be lost.  Are you sure?" -relief flat
122
        pack  $w.m -pady 10 -side top -padx 10
123
        wm title $w "Are you sure?"
124
 
125
        set oldFocus [focus]
126
        frame $w.f
127
        button $w.f.back -text "OK" -width 20 \
128
                -command "exit 1"
129
        button $w.f.canc -text "Cancel" \
130
                -width 20 -command "destroy $w; focus $oldFocus"
131
        pack $w.f.back $w.f.canc -side left -pady 10 -padx 45
132
        pack $w.f -pady 10 -side bottom -padx 10 -anchor w
133
        bind $w  "exit 1"
134
        bind $w  "destroy $w; focus $oldFocus"
135
        focus $w
136
        global winx; global winy
137
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
138
        wm geometry $w +$winx+$winy
139
}
140
 
141
proc read_config_file { w } {
142
        global loadfile
143
        if { [string length $loadfile] != 0 && [file readable $loadfile] == 1 } then {
144
                read_config $loadfile
145
        } else {
146
                catch {destroy $w}
147
                toplevel $w -class Dialog
148
                message $w.m -width 400 -aspect 300 -text \
149
                        "Unable to read file $loadfile" \
150
                         -relief raised
151
                label $w.bm -bitmap error
152
                pack $w.bm $w.m -pady 10 -side top -padx 10
153
                wm title $w "Xconfig Internal Error"
154
 
155
                set oldFocus [focus]
156
                frame $w.f
157
                button $w.f.back -text "Bummer" \
158
                        -width 10 -command "destroy $w; focus $oldFocus"
159
                pack $w.f.back -side bottom -pady 10 -anchor s
160
                pack $w.f -pady 10 -side top -padx 10 -anchor s
161
                focus $w
162
                global winx; global winy
163
                set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
164
                wm geometry $w +$winx+$winy
165
        }
166
}
167
 
168
proc write_config_file  { w } {
169
        global loadfile
170
        if { [string length $loadfile] != 0
171
                && ([file writable $loadfile] == 1 || ([file exists $loadfile] == 0 && [file writable [file dirname $loadfile]] == 1)) } then {
172
                writeconfig $loadfile .null
173
        } else {
174
                catch {destroy $w}
175
                toplevel $w -class Dialog
176
                message $w.m -width 400 -aspect 300 -text \
177
                        "Unable to write file $loadfile" \
178
                         -relief raised
179
                label $w.bm -bitmap error
180
                pack $w.bm $w.m -pady 10 -side top -padx 10
181
                wm title $w "Xconfig Internal Error"
182
 
183
                set oldFocus [focus]
184
                frame $w.f
185
                button $w.f.back -text "OK" \
186
                        -width 10 -command "destroy $w; focus $oldFocus"
187
                pack $w.f.back -side bottom -pady 10 -anchor s
188
                pack $w.f -pady 10 -side top -padx 10 -anchor s
189
                focus $w
190
                global winx; global winy
191
                set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
192
                wm geometry $w +$winx+$winy
193
        }
194
}
195
 
196
proc read_config { filename } {
197
        set file1 [open $filename r]
198
        clear_choices
199
        while { [gets $file1 line] >= 0} {
200
                if [regexp {([0-9A-Za-z_]+)=([ynm])} $line foo var value] {
201
                        if { $value == "y" } then { set cmd "global $var; set $var 1" }
202
                        if { $value == "n" } then { set cmd "global $var; set $var 0" }
203
                        if { $value == "m" } then { set cmd "global $var; set $var 2" }
204
                        eval $cmd
205
                }
206
                if [regexp {# ([0-9A-Za-z_]+) is not set} $line foo var] {
207
                        set cmd "global $var; set $var 0"
208
                        eval $cmd
209
                }
210
                if [regexp {([0-9A-Za-z_]+)=([0-9A-Fa-f]+)} $line foo var value] {
211
                        set cmd "global $var; set $var $value"
212
                        eval $cmd
213
                }
214
                if [regexp {([0-9A-Za-z_]+)="([^"]*)"} $line foo var value] {
215
                        set cmd "global $var; set $var \"$value\""
216
                        eval $cmd
217
                }
218
        }
219
        close $file1
220
        update_choices
221
        update_mainmenu
222
}
223
proc write_comment { file1 file2 text } {
224
        puts $file1 ""
225
        puts $file1 "#"
226
        puts $file1 "# $text"
227
        puts $file1 "#"
228
        puts $file2 "/*"
229
        puts $file2 " * $text"
230
        puts $file2 " */"
231
}
232
 
233
proc effective_dep { deplist } {
234
        global CONFIG_MODULES
235
        set depend 1
236
        foreach i $deplist {
237
                if {$i == 0} then {set depend 0}
238
                if {$i == 2 && $depend == 1} then {set depend 2}
239
        }
240
        if {$depend == 2 && $CONFIG_MODULES == 0} then {set depend 0}
241
        return $depend
242
}
243
 
244
proc sync_tristate { var dep } {
245
        global CONFIG_MODULES
246
        if {$dep == 0 && ($var == 1 || $var == 2)} then {
247
                set var 0
248
        } elseif {$dep == 2 && $var == 1} then {
249
                set var 2
250
        } elseif {$var == 2 && $CONFIG_MODULES == 0} then {
251
                if {$dep == 1} then {set var 1} else {set var 0}
252
        }
253
        return $var
254
}
255
 
256
proc sync_bool { var dep modset } {
257
        set var [sync_tristate $var $dep]
258
        if {$dep == 2 && $var == 2} then {
259
                set var $modset
260
        }
261
        return $var
262
}
263
 
264
proc write_tristate { file1 file2 varname variable deplist modset } {
265
        set variable [sync_tristate $variable [effective_dep $deplist]]
266
        if { $variable == 2 } \
267
                then { set variable $modset }
268
        if { $variable == 1 } \
269
                then { puts $file1 "$varname=y"; \
270
                       puts $file2 "#define $varname 1" } \
271
        elseif { $variable == 2 } \
272
                then { puts $file1 "$varname=m"; \
273
                       puts $file2 "#undef  $varname"; \
274
                       puts $file2 "#define ${varname}_MODULE 1" } \
275
        elseif { $variable == 0 } \
276
                then { puts $file1 "# $varname is not set"; \
277
                       puts $file2 "#undef  $varname"} \
278
        else { \
279
            puts stdout "ERROR - Attempting to write value for unconfigured variable ($varname)." \
280
        }
281
}
282
 
283
proc write_int { file1 file2 varname variable dep } {
284
        if { $dep == 0 } \
285
                then { puts $file1 "# $varname is not set"; \
286
                       puts $file2 "#undef  $varname"} \
287
        else {
288
                puts $file1 "$varname=$variable"; \
289
                puts $file2 "#define $varname ($variable)"; \
290
        }
291
}
292
 
293
proc write_hex { file1 file2 varname variable dep } {
294
        if { $dep == 0 } \
295
                then { puts $file1 "# $varname is not set"; \
296
                       puts $file2 "#undef  $varname"} \
297
        else {
298
                puts $file1 "$varname=$variable"; \
299
                puts -nonewline $file2 "#define $varname "; \
300
                puts $file2 [exec echo $variable | sed s/^0\[xX\]//]; \
301
        }
302
}
303
 
304
proc write_string { file1 file2 varname variable dep } {
305
        if { $dep == 0 } \
306
                then { puts $file1 "# $varname is not set"; \
307
                       puts $file2 "#undef  $varname"} \
308
        else {
309
                puts $file1 "$varname=\"$variable\""; \
310
                puts $file2 "#define $varname \"$variable\""; \
311
        }
312
}
313
 
314
proc option_name {w mnum line text helpidx} {
315
        button $w.x$line.l -text "$text" -relief groove -anchor w
316
        $w.x$line.l configure -activefore [cget $w.x$line.l -fg] \
317
                                -activeback [cget $w.x$line.l -bg]
318
        button $w.x$line.help -text "Help" -relief raised \
319
                -command "dohelp .dohelp $helpidx .menu$mnum"
320
        pack $w.x$line.help -side right -fill y
321
        pack $w.x$line.l -side right -fill both -expand on
322
}
323
 
324
proc toggle_switch2 {w mnum line text variable} {
325
        frame $w.x$line -relief sunken
326
        radiobutton $w.x$line.y -text "y" -variable $variable -value 1 \
327
                -relief groove -width 2 -command "update_active"
328
#       radiobutton $w.x$line.m -text "-"  -variable $variable -value 2 \
329
#               -relief groove -width 2 -command "update_active"
330
        radiobutton $w.x$line.n -text "n"  -variable $variable -value 0 \
331
                -relief groove -width 2 -command "update_active"
332
 
333
        option_name $w $mnum $line $text $variable
334
 
335
        pack $w.x$line.n $w.x$line.y -side right -fill y
336
}
337
 
338
proc toggle_switch3 {w mnum line text variable} {
339
        frame $w.x$line -relief sunken
340
        radiobutton $w.x$line.y -text "y" -variable $variable -value 1 \
341
                -relief groove -width 2 -command "update_active"
342
        radiobutton $w.x$line.m -text "m"  -variable $variable -value 2 \
343
                -relief groove -width 2 -command "update_active"
344
        radiobutton $w.x$line.n -text "n"  -variable $variable -value 0 \
345
                -relief groove -width 2 -command "update_active"
346
 
347
        option_name $w $mnum $line $text $variable
348
 
349
        global CONFIG_MODULES
350
        if {($CONFIG_MODULES == 0)} then {
351
                $w.x$line.m configure -state disabled
352
        }
353
        pack $w.x$line.n $w.x$line.m $w.x$line.y -side right -fill y
354
}
355
 
356
proc bool {w mnum line text variable} {
357
        toggle_switch2 $w $mnum $line $text $variable
358
#       $w.x$line.m configure -state disabled
359
        pack $w.x$line -anchor w -fill both -expand on
360
}
361
 
362
proc tristate {w mnum line text variable } {
363
        toggle_switch3 $w $mnum $line $text $variable
364
        pack $w.x$line -anchor w -fill both -expand on
365
}
366
 
367
proc dep_tristate {w mnum line text variable } {
368
        tristate $w $mnum $line $text $variable
369
}
370
 
371
proc dep_bool {w mnum line text variable } {
372
        bool $w $mnum $line $text $variable
373
}
374
 
375
proc int { w mnum line text variable } {
376
        frame $w.x$line
377
        entry $w.x$line.x -width 11 -relief sunken -borderwidth 2 \
378
                -textvariable $variable
379
        option_name $w $mnum $line $text $variable
380
        pack $w.x$line.x -anchor w -side right -fill y
381
        pack $w.x$line -anchor w -fill both -expand on
382
}
383
 
384
proc hex { w mnum line text variable } {
385
        int $w $mnum $line $text $variable
386
}
387
 
388
proc istring { w mnum line text variable } {
389
        frame $w.x$line
390
        entry $w.x$line.x -width 18 -relief sunken -borderwidth 2 \
391
                -textvariable $variable
392
        option_name $w $mnum $line $text $variable
393
        pack $w.x$line.x -anchor w -side right -fill y
394
        pack $w.x$line -anchor w -fill both -expand on
395
}
396
 
397
proc minimenu { w mnum line text variable helpidx } {
398
        frame $w.x$line
399
        menubutton $w.x$line.x -textvariable $variable -menu \
400
                $w.x$line.x.menu -relief raised \
401
                -anchor w
402
        option_name $w $mnum $line $text $helpidx
403
        pack $w.x$line.x -anchor w -side right -fill y
404
        pack $w.x$line -anchor w -fill both -expand on
405
}
406
 
407
proc menusplit {w m n} {
408
        if { $n > 2 } then {
409
                update idletasks
410
                set menuoptsize [expr [$m yposition 2] - [$m yposition 1]]
411
                set maxsize [winfo screenheight $w]
412
                set splitpoint [expr $maxsize * 4 / 5 / $menuoptsize - 1]
413
                for {set i [expr $splitpoint + 1]} {$i <= $n} {incr i $splitpoint} {
414
                        $m entryconfigure $i -columnbreak 1
415
                }
416
        }
417
}
418
 
419
proc menutitle {text menu w} {
420
        wm title $w "$text"
421
}
422
 
423
proc submenu { w mnum line text subnum } {
424
        frame $w.x$line
425
        button $w.x$line.l -text "" -width 9 -relief groove
426
        $w.x$line.l configure -activefore [cget $w.x$line.l -fg] \
427
                -activeback [cget $w.x$line.l -bg] -state disabled
428
        button $w.x$line.m -text "$text" -relief raised -anchor w \
429
                -command "catch {destroy .menu$subnum}; menu$subnum .menu$subnum \"$text\""
430
        pack $w.x$line.l -side left -fill both
431
        pack $w.x$line.m -anchor w -side right -fill both -expand on
432
        pack $w.x$line -anchor w -fill both -expand on
433
}
434
 
435
proc comment {w mnum line text } {
436
        frame $w.x$line
437
        button $w.x$line.l -text "" -width 15 -relief groove
438
        $w.x$line.l configure -activefore [cget $w.x$line.l -fg] \
439
                -activeback [cget $w.x$line.l -bg] -state disabled
440
        button $w.x$line.m -text "$text" -relief groove -anchor w
441
        $w.x$line.m configure -activefore [cget $w.x$line.m -fg] \
442
                -activeback [cget $w.x$line.m -bg]
443
        pack $w.x$line.l -side left -fill both
444
        pack $w.x$line.m -anchor w -side right -fill both -expand on
445
        pack $w.x$line -anchor w -fill both -expand on
446
}
447
 
448
proc readhelp {tag fn}  {
449
        set message ""
450
        set b 0
451
        if { [file readable $fn] == 1} then {
452
                set fhandle [open $fn r]
453
                while {[gets $fhandle inline] >= 0} {
454
                        if { $b == 0 } {
455
                                if { [regexp $tag $inline ] } {
456
                                        set b 1
457
                                        set message "$inline:\n"
458
                                }
459
                        } else {
460
                                if { [regexp {^[^ \t]} $inline]} {
461
                                        break
462
                                }
463
                                set message "$message\n$inline"
464
                        }
465
                }
466
                close $fhandle
467
        }
468
        return $message
469
}
470
 
471
proc dohelp {w var parent}  {
472
        catch {destroy $w}
473
        toplevel $w -class Dialog
474
 
475
        set filefound 0
476
        set found 0
477
        set lineno 0
478
 
479
        if { [file readable config.help] == 1} then {
480
                set filefound 1
481
                # First escape sed regexp special characters in var:
482
                set var [exec echo "$var" | sed s/\[\]\[\/.^$*\]/\\\\&/g]
483
                # Now pick out right help text:
484
                set message [readhelp $var config.help]
485
                set found [expr [string length "$message"] > 0]
486
        }
487
 
488
        frame $w.f1
489
        pack $w.f1 -fill both -expand on
490
 
491
        # Do the OK button
492
        #
493
        set oldFocus [focus]
494
        frame $w.f2
495
        button $w.f2.ok -text "OK" \
496
                -width 10 -command "destroy $w; catch {focus $oldFocus}"
497
        pack $w.f2.ok -side bottom -pady 6 -anchor n
498
        pack $w.f2 -side bottom -padx 10 -anchor s
499
 
500
        scrollbar $w.f1.vscroll -command "$w.f1.canvas yview"
501
        pack $w.f1.vscroll -side right -fill y
502
 
503
        canvas $w.f1.canvas -relief flat -borderwidth 0 \
504
                -yscrollcommand "$w.f1.vscroll set"
505
        frame $w.f1.f
506
        pack $w.f1.canvas -side right -fill y -expand on
507
 
508
        if { $found == 0 } then {
509
                if { $filefound == 0 } then {
510
                message $w.f1.f.m -width 750 -aspect 300 -relief flat -text \
511
                        "No help available - unable to open file config.help."
512
                } else {
513
                message $w.f1.f.m -width 400 -aspect 300 -relief flat -text \
514
                        "No help available for $var"
515
                }
516
                label $w.f1.bm -bitmap error
517
                wm title $w "RTFM"
518
        } else {
519
                text $w.f1.f.m -width 73 -relief flat -wrap word
520
                $w.f1.f.m insert 0.0 $message
521
                $w.f1.f.m conf -state disabled -height [$w.f1.f.m index end]
522
 
523
                label $w.f1.bm -bitmap info
524
                wm title $w "Configuration help"
525
        }
526
        pack $w.f1.f.m -side left
527
        pack $w.f1.bm $w.f1.f -side left -padx 10
528
 
529
        focus $w
530
        set winx [expr [winfo x $parent]+20]
531
        set winy [expr [winfo y $parent]+20]
532
        wm geometry $w +$winx+$winy
533
        set sizok [expr [winfo reqheight $w.f2.ok] + 12]
534
        set maxy [expr [winfo screenheight .] * 3 / 4]
535
        set canvtotal [winfo reqheight $w.f1.f.m]
536
        if [expr $sizok + $canvtotal < $maxy] {
537
                set sizy $canvtotal
538
        } else {
539
                set sizy [expr $maxy - $sizok]
540
        }
541
        $w.f1.canvas configure -height $sizy -width [winfo reqwidth $w.f1.f.m] \
542
                -scrollregion "0 0 [winfo reqwidth $w.f1.f.m] \
543
                        [winfo reqheight $w.f1.f.m]"
544
        $w.f1.canvas create window 0 0 -anchor nw -window $w.f1.f
545
        update idletasks
546
 
547
        set maxy [winfo screenheight .]
548
        if [expr $sizok + $canvtotal < $maxy] {
549
                set sizy [expr $sizok + $canvtotal]
550
        } else {
551
                set sizy $maxy
552
        }
553
        wm maxsize $w [winfo width $w] $sizy
554
}
555
 
556
bind all  { catch {exec cp -f .config .config.old}; \
557
                writeconfig .config config.h; wrapup .wrap }
558
 
559
proc wrapup {w }  {
560
        catch {destroy $w}
561
        toplevel $w -class Dialog
562
 
563
        global CONFIG_MODVERSIONS; vfix CONFIG_MODVERSIONS
564
        message $w.m -width 460 -aspect 300 -relief raised -text \
565
                "End of design configuration. "
566
        label $w.bm -bitmap info
567
        pack $w.bm $w.m -pady 10 -side top -padx 10
568
        wm title $w "LEON build instructions"
569
 
570
        set oldFocus [focus]
571
        frame $w.f
572
        button $w.f.back -text "OK" \
573
                -width 10 -command "exit 2"
574
        pack $w.f.back -side bottom -pady 10 -anchor s
575
        pack $w.f -pady 10 -side top -padx 10 -anchor s
576
        focus $w
577
        bind $w  "exit 2"
578
        global winx; global winy
579
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
580
        wm geometry $w +$winx+$winy
581
 
582
}
583
 
584
proc unregister_active {num} {
585
        global active_menus
586
        set index [lsearch -exact $active_menus $num]
587
        if {$index != -1} then {set active_menus [lreplace $active_menus $index $index]}
588
}
589
 
590
proc update_active {} {
591
        global active_menus total_menus
592
        set max 0
593
        if {[llength $active_menus] > 0} then {
594
                set max [lindex $active_menus end]
595
                update_define [toplevel_menu [lindex $active_menus 0]] $max 0
596
        }
597
        foreach i $active_menus {
598
                if {[winfo exists .menu$i] == 0} then {
599
                        unregister_active $i
600
                } else {
601
                        update_menu$i
602
                }
603
        }
604
        update_define [expr $max + 1] $total_menus 1
605
        update_mainmenu
606
}
607
 
608
proc configure_entry {w option items} {
609
        foreach i $items {
610
                $w.$i configure -state $option
611
        }
612
}
613
 
614
proc validate_int {name val default} {
615
        if {([exec echo $val | sed s/^-//g | tr -d \[:digit:\] ] != "")} then {
616
                global $name; set $name $default
617
        }
618
}
619
 
620
proc validate_hex {name val default} {
621
        if {([exec echo $val | tr -d \[:xdigit:\] ] != "")} then {
622
                global $name; set $name $default
623
        }
624
}
625
 
626
proc update_define {first last allow_update} {
627
        for {set i $first} {$i <= $last} {incr i} {
628
                update_define_menu$i
629
                if {$allow_update == 1} then update
630
        }
631
}
632
 
633
#
634
# Next set up the particulars for the top level menu, and define a few
635
# buttons which we will stick down at the bottom.
636
#
637
 
638
frame .f0
639
frame .f0.left
640
frame .f0.middle
641
frame .f0.right
642
 
643
set active_menus [list]
644
set processed_top_level 0
645
set ARCH sparc
646
set menus_per_column 4
647
set total_menus 24
648
 
649
proc toplevel_menu {num} {
650
        if {$num == 4} then {return 3}
651
        if {$num == 5} then {return 3}
652
        if {$num == 6} then {return 3}
653
        if {$num == 7} then {return 3}
654
        if {$num == 8} then {return 3}
655
        if {$num == 9} then {return 3}
656
        if {$num == 10} then {return 3}
657
        if {$num == 14} then {return 13}
658
        if {$num == 15} then {return 14}
659
        if {$num == 16} then {return 14}
660
        if {$num == 17} then {return 14}
661
        if {$num == 18} then {return 14}
662
        if {$num == 19} then {return 13}
663
        if {$num == 20} then {return 13}
664
        if {$num == 21} then {return 13}
665
        if {$num == 22} then {return 13}
666
        if {$num == 23} then {return 13}
667
        return $num
668
}
669
 
670
mainmenu_name "LEON3 Altera EP3C25-EEK Design Configuration"
671
menu_option menu1 1 "Synthesis      "
672
proc menu1 {w title} {
673
        set oldFocus [focus]
674
        catch {destroy $w; unregister_active 1}
675
        toplevel $w -class Dialog
676
        wm withdraw $w
677
        global active_menus
678
        set active_menus [lsort -integer [linsert $active_menus end 1]]
679
        message $w.m -width 400 -aspect 300 -text \
680
                "Synthesis      "  -relief raised
681
        pack $w.m -pady 10 -side top -padx 10
682
        wm title $w "Synthesis      "
683
 
684
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 1; break"
685
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 1; menu2 .menu2 \"$title\""
686
        frame $w.f
687
        button $w.f.back -text "Main Menu" \
688
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 1"
689
        button $w.f.next -text "Next" -underline 0\
690
                -width 15 -command $nextscript
691
        bind all  $nextscript
692
        button $w.f.prev -text "Prev" -underline 0\
693
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 1; menu0 .menu0 \"$title\""
694
        $w.f.prev configure -state disabled
695
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
696
        pack $w.f -pady 10 -side bottom -anchor w -fill x
697
        frame $w.topline -relief ridge -borderwidth 2 -height 2
698
        pack $w.topline -side top -fill x
699
 
700
        frame $w.botline -relief ridge -borderwidth 2 -height 2
701
        pack $w.botline -side bottom -fill x
702
 
703
        frame $w.config
704
        pack $w.config -fill y -expand on
705
 
706
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
707
        pack $w.config.vscroll -side right -fill y
708
 
709
        canvas $w.config.canvas -height 1\
710
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
711
                -width [expr [winfo screenwidth .] * 1 / 2]
712
        frame $w.config.f
713
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
714
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
715
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
716
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
717
        bind $w  "$w.config.canvas yview moveto 0;break;"
718
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
719
        pack $w.config.canvas -side right -fill y
720
 
721
 
722
        global tmpvar_0
723
        minimenu $w.config.f 1 0 "Target technology                           " tmpvar_0 CONFIG_SYN_INFERRED
724
        menu $w.config.f.x0.x.menu -tearoffcommand "menutitle \"Target technology                           \""
725
        $w.config.f.x0.x.menu add radiobutton -label "Inferred" -variable tmpvar_0 -value "Inferred" -command "update_active"
726
        $w.config.f.x0.x.menu add radiobutton -label "Altera-Stratix" -variable tmpvar_0 -value "Altera-Stratix" -command "update_active"
727
        $w.config.f.x0.x.menu add radiobutton -label "Altera-StratixII" -variable tmpvar_0 -value "Altera-StratixII" -command "update_active"
728
        $w.config.f.x0.x.menu add radiobutton -label "Altera-StratixIII" -variable tmpvar_0 -value "Altera-StratixIII" -command "update_active"
729
        $w.config.f.x0.x.menu add radiobutton -label "Altera-CycloneIII" -variable tmpvar_0 -value "Altera-CycloneIII" -command "update_active"
730
        $w.config.f.x0.x.menu add radiobutton -label "Altera-Others" -variable tmpvar_0 -value "Altera-Others" -command "update_active"
731
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Axcelerator" -variable tmpvar_0 -value "Actel-Axcelerator" -command "update_active"
732
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Proasic" -variable tmpvar_0 -value "Actel-Proasic" -command "update_active"
733
        $w.config.f.x0.x.menu add radiobutton -label "Actel-ProasicPlus" -variable tmpvar_0 -value "Actel-ProasicPlus" -command "update_active"
734
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Proasic3" -variable tmpvar_0 -value "Actel-Proasic3" -command "update_active"
735
        $w.config.f.x0.x.menu add radiobutton -label "Aeroflex-UT025CRH" -variable tmpvar_0 -value "Aeroflex-UT025CRH" -command "update_active"
736
        $w.config.f.x0.x.menu add radiobutton -label "Atmel-ATC18" -variable tmpvar_0 -value "Atmel-ATC18" -command "update_active"
737
        $w.config.f.x0.x.menu add radiobutton -label "Atmel-ATC18RHA" -variable tmpvar_0 -value "Atmel-ATC18RHA" -command "update_active"
738
        $w.config.f.x0.x.menu add radiobutton -label "Custom1" -variable tmpvar_0 -value "Custom1" -command "update_active"
739
        $w.config.f.x0.x.menu add radiobutton -label "eASIC90" -variable tmpvar_0 -value "eASIC90" -command "update_active"
740
        $w.config.f.x0.x.menu add radiobutton -label "IHP25" -variable tmpvar_0 -value "IHP25" -command "update_active"
741
        $w.config.f.x0.x.menu add radiobutton -label "IHP25RH" -variable tmpvar_0 -value "IHP25RH" -command "update_active"
742
        $w.config.f.x0.x.menu add radiobutton -label "Lattice-EC/ECP/XP" -variable tmpvar_0 -value "Lattice-EC/ECP/XP" -command "update_active"
743
        $w.config.f.x0.x.menu add radiobutton -label "Quicklogic-Eclipse" -variable tmpvar_0 -value "Quicklogic-Eclipse" -command "update_active"
744
        $w.config.f.x0.x.menu add radiobutton -label "Peregrine" -variable tmpvar_0 -value "Peregrine" -command "update_active"
745
        $w.config.f.x0.x.menu add radiobutton -label "RH-LIB18T" -variable tmpvar_0 -value "RH-LIB18T" -command "update_active"
746
        $w.config.f.x0.x.menu add radiobutton -label "RH-UMC" -variable tmpvar_0 -value "RH-UMC" -command "update_active"
747
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan2" -variable tmpvar_0 -value "Xilinx-Spartan2" -command "update_active"
748
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan3" -variable tmpvar_0 -value "Xilinx-Spartan3" -command "update_active"
749
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan3E" -variable tmpvar_0 -value "Xilinx-Spartan3E" -command "update_active"
750
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex" -variable tmpvar_0 -value "Xilinx-Virtex" -command "update_active"
751
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-VirtexE" -variable tmpvar_0 -value "Xilinx-VirtexE" -command "update_active"
752
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex2" -variable tmpvar_0 -value "Xilinx-Virtex2" -command "update_active"
753
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex4" -variable tmpvar_0 -value "Xilinx-Virtex4" -command "update_active"
754
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex5" -variable tmpvar_0 -value "Xilinx-Virtex5" -command "update_active"
755
        $w.config.f.x0.x.menu add radiobutton -label "UMC18" -variable tmpvar_0 -value "UMC18" -command "update_active"
756
        $w.config.f.x0.x.menu add radiobutton -label "TSMC90" -variable tmpvar_0 -value "TSMC90" -command "update_active"
757
        menusplit $w $w.config.f.x0.x.menu 32
758
        global tmpvar_1
759
        minimenu $w.config.f 1 1 "Memory Library                           " tmpvar_1 CONFIG_MEM_INFERRED
760
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"Memory Library                           \""
761
        $w.config.f.x1.x.menu add radiobutton -label "Inferred" -variable tmpvar_1 -value "Inferred" -command "update_active"
762
        $w.config.f.x1.x.menu add radiobutton -label "UMC18" -variable tmpvar_1 -value "UMC18" -command "update_active"
763
        $w.config.f.x1.x.menu add radiobutton -label "RH-UMC" -variable tmpvar_1 -value "RH-UMC" -command "update_active"
764
        $w.config.f.x1.x.menu add radiobutton -label "Artisan" -variable tmpvar_1 -value "Artisan" -command "update_active"
765
        $w.config.f.x1.x.menu add radiobutton -label "Custom1" -variable tmpvar_1 -value "Custom1" -command "update_active"
766
        $w.config.f.x1.x.menu add radiobutton -label "Virage" -variable tmpvar_1 -value "Virage" -command "update_active"
767
        $w.config.f.x1.x.menu add radiobutton -label "Virage-TSMC90" -variable tmpvar_1 -value "Virage-TSMC90" -command "update_active"
768
        menusplit $w $w.config.f.x1.x.menu 7
769
        bool $w.config.f 1 2 "Infer RAM" CONFIG_SYN_INFER_RAM
770
        bool $w.config.f 1 3 "Infer pads" CONFIG_SYN_INFER_PADS
771
        bool $w.config.f 1 4 "Disable asynchronous reset" CONFIG_SYN_NO_ASYNC
772
        bool $w.config.f 1 5 "Enable scan support       " CONFIG_SYN_SCAN
773
 
774
 
775
 
776
        focus $w
777
        update_active
778
        global winx; global winy
779
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
780
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
781
        update idletasks
782
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
783
 
784
        $w.config.canvas configure \
785
                -width [expr [winfo reqwidth $w.config.f] + 1]\
786
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
787
                         [expr [winfo reqheight $w.config.f] + 1]"
788
 
789
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
790
        set scry [expr [winfo screenh $w] / 2]
791
        set maxy [expr [winfo screenh $w] * 3 / 4]
792
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
793
        if [expr $winy + $canvtotal < $maxy] {
794
                $w.config.canvas configure -height $canvtotal
795
        } else {
796
                $w.config.canvas configure -height [expr $scry - $winy]
797
                }
798
        }
799
        update idletasks
800
        if {[winfo exists $w]} then {
801
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
802
        wm minsize $w [winfo width $w] 100
803
 
804
        wm deiconify $w
805
}
806
}
807
 
808
proc update_menu1 {} {
809
        global CONFIG_SYN_INFERRED
810
        global CONFIG_SYN_CUSTOM1
811
        global CONFIG_SYN_ATC18
812
        global CONFIG_SYN_TSMC90
813
        global CONFIG_SYN_UMC
814
        global CONFIG_SYN_RHUMC
815
        global CONFIG_SYN_ARTISAN
816
        if {($CONFIG_SYN_INFERRED == 1 || $CONFIG_SYN_CUSTOM1 == 1 || $CONFIG_SYN_ATC18 == 1 || $CONFIG_SYN_TSMC90 == 1 || $CONFIG_SYN_UMC == 1 || $CONFIG_SYN_RHUMC == 1 || $CONFIG_SYN_ARTISAN == 1)} then {configure_entry .menu1.config.f.x1 normal {x l}} else {configure_entry .menu1.config.f.x1 disabled {x l}}
817
        global CONFIG_SYN_INFER_RAM
818
        if {($CONFIG_SYN_INFERRED != 1)} then {
819
        configure_entry .menu1.config.f.x2 normal {n l y}} else {configure_entry .menu1.config.f.x2 disabled {y n l}}
820
        global CONFIG_SYN_INFER_PADS
821
        if {($CONFIG_SYN_INFERRED != 1)} then {
822
        configure_entry .menu1.config.f.x3 normal {n l y}} else {configure_entry .menu1.config.f.x3 disabled {y n l}}
823
}
824
 
825
 
826
proc update_define_menu1 {} {
827
        update_define_mainmenu
828
        global CONFIG_MODULES
829
        global tmpvar_0
830
        global CONFIG_SYN_INFERRED
831
        if {$tmpvar_0 == "Inferred"} then {set CONFIG_SYN_INFERRED 1} else {set CONFIG_SYN_INFERRED 0}
832
        global CONFIG_SYN_STRATIX
833
        if {$tmpvar_0 == "Altera-Stratix"} then {set CONFIG_SYN_STRATIX 1} else {set CONFIG_SYN_STRATIX 0}
834
        global CONFIG_SYN_STRATIXII
835
        if {$tmpvar_0 == "Altera-StratixII"} then {set CONFIG_SYN_STRATIXII 1} else {set CONFIG_SYN_STRATIXII 0}
836
        global CONFIG_SYN_STRATIXIII
837
        if {$tmpvar_0 == "Altera-StratixIII"} then {set CONFIG_SYN_STRATIXIII 1} else {set CONFIG_SYN_STRATIXIII 0}
838
        global CONFIG_SYN_CYCLONEIII
839
        if {$tmpvar_0 == "Altera-CycloneIII"} then {set CONFIG_SYN_CYCLONEIII 1} else {set CONFIG_SYN_CYCLONEIII 0}
840
        global CONFIG_SYN_ALTERA
841
        if {$tmpvar_0 == "Altera-Others"} then {set CONFIG_SYN_ALTERA 1} else {set CONFIG_SYN_ALTERA 0}
842
        global CONFIG_SYN_AXCEL
843
        if {$tmpvar_0 == "Actel-Axcelerator"} then {set CONFIG_SYN_AXCEL 1} else {set CONFIG_SYN_AXCEL 0}
844
        global CONFIG_SYN_PROASIC
845
        if {$tmpvar_0 == "Actel-Proasic"} then {set CONFIG_SYN_PROASIC 1} else {set CONFIG_SYN_PROASIC 0}
846
        global CONFIG_SYN_PROASICPLUS
847
        if {$tmpvar_0 == "Actel-ProasicPlus"} then {set CONFIG_SYN_PROASICPLUS 1} else {set CONFIG_SYN_PROASICPLUS 0}
848
        global CONFIG_SYN_PROASIC3
849
        if {$tmpvar_0 == "Actel-Proasic3"} then {set CONFIG_SYN_PROASIC3 1} else {set CONFIG_SYN_PROASIC3 0}
850
        global CONFIG_SYN_UT025CRH
851
        if {$tmpvar_0 == "Aeroflex-UT025CRH"} then {set CONFIG_SYN_UT025CRH 1} else {set CONFIG_SYN_UT025CRH 0}
852
        global CONFIG_SYN_ATC18
853
        if {$tmpvar_0 == "Atmel-ATC18"} then {set CONFIG_SYN_ATC18 1} else {set CONFIG_SYN_ATC18 0}
854
        global CONFIG_SYN_ATC18RHA
855
        if {$tmpvar_0 == "Atmel-ATC18RHA"} then {set CONFIG_SYN_ATC18RHA 1} else {set CONFIG_SYN_ATC18RHA 0}
856
        global CONFIG_SYN_CUSTOM1
857
        if {$tmpvar_0 == "Custom1"} then {set CONFIG_SYN_CUSTOM1 1} else {set CONFIG_SYN_CUSTOM1 0}
858
        global CONFIG_SYN_EASIC90
859
        if {$tmpvar_0 == "eASIC90"} then {set CONFIG_SYN_EASIC90 1} else {set CONFIG_SYN_EASIC90 0}
860
        global CONFIG_SYN_IHP25
861
        if {$tmpvar_0 == "IHP25"} then {set CONFIG_SYN_IHP25 1} else {set CONFIG_SYN_IHP25 0}
862
        global CONFIG_SYN_IHP25RH
863
        if {$tmpvar_0 == "IHP25RH"} then {set CONFIG_SYN_IHP25RH 1} else {set CONFIG_SYN_IHP25RH 0}
864
        global CONFIG_SYN_LATTICE
865
        if {$tmpvar_0 == "Lattice-EC/ECP/XP"} then {set CONFIG_SYN_LATTICE 1} else {set CONFIG_SYN_LATTICE 0}
866
        global CONFIG_SYN_ECLIPSE
867
        if {$tmpvar_0 == "Quicklogic-Eclipse"} then {set CONFIG_SYN_ECLIPSE 1} else {set CONFIG_SYN_ECLIPSE 0}
868
        global CONFIG_SYN_PEREGRINE
869
        if {$tmpvar_0 == "Peregrine"} then {set CONFIG_SYN_PEREGRINE 1} else {set CONFIG_SYN_PEREGRINE 0}
870
        global CONFIG_SYN_RH_LIB18T
871
        if {$tmpvar_0 == "RH-LIB18T"} then {set CONFIG_SYN_RH_LIB18T 1} else {set CONFIG_SYN_RH_LIB18T 0}
872
        global CONFIG_SYN_RHUMC
873
        if {$tmpvar_0 == "RH-UMC"} then {set CONFIG_SYN_RHUMC 1} else {set CONFIG_SYN_RHUMC 0}
874
        global CONFIG_SYN_SPARTAN2
875
        if {$tmpvar_0 == "Xilinx-Spartan2"} then {set CONFIG_SYN_SPARTAN2 1} else {set CONFIG_SYN_SPARTAN2 0}
876
        global CONFIG_SYN_SPARTAN3
877
        if {$tmpvar_0 == "Xilinx-Spartan3"} then {set CONFIG_SYN_SPARTAN3 1} else {set CONFIG_SYN_SPARTAN3 0}
878
        global CONFIG_SYN_SPARTAN3E
879
        if {$tmpvar_0 == "Xilinx-Spartan3E"} then {set CONFIG_SYN_SPARTAN3E 1} else {set CONFIG_SYN_SPARTAN3E 0}
880
        global CONFIG_SYN_VIRTEX
881
        if {$tmpvar_0 == "Xilinx-Virtex"} then {set CONFIG_SYN_VIRTEX 1} else {set CONFIG_SYN_VIRTEX 0}
882
        global CONFIG_SYN_VIRTEXE
883
        if {$tmpvar_0 == "Xilinx-VirtexE"} then {set CONFIG_SYN_VIRTEXE 1} else {set CONFIG_SYN_VIRTEXE 0}
884
        global CONFIG_SYN_VIRTEX2
885
        if {$tmpvar_0 == "Xilinx-Virtex2"} then {set CONFIG_SYN_VIRTEX2 1} else {set CONFIG_SYN_VIRTEX2 0}
886
        global CONFIG_SYN_VIRTEX4
887
        if {$tmpvar_0 == "Xilinx-Virtex4"} then {set CONFIG_SYN_VIRTEX4 1} else {set CONFIG_SYN_VIRTEX4 0}
888
        global CONFIG_SYN_VIRTEX5
889
        if {$tmpvar_0 == "Xilinx-Virtex5"} then {set CONFIG_SYN_VIRTEX5 1} else {set CONFIG_SYN_VIRTEX5 0}
890
        global CONFIG_SYN_UMC
891
        if {$tmpvar_0 == "UMC18"} then {set CONFIG_SYN_UMC 1} else {set CONFIG_SYN_UMC 0}
892
        global CONFIG_SYN_TSMC90
893
        if {$tmpvar_0 == "TSMC90"} then {set CONFIG_SYN_TSMC90 1} else {set CONFIG_SYN_TSMC90 0}
894
        global tmpvar_1
895
        global CONFIG_MEM_INFERRED
896
        if {$tmpvar_1 == "Inferred"} then {set CONFIG_MEM_INFERRED 1} else {set CONFIG_MEM_INFERRED 0}
897
        global CONFIG_MEM_UMC
898
        if {$tmpvar_1 == "UMC18"} then {set CONFIG_MEM_UMC 1} else {set CONFIG_MEM_UMC 0}
899
        global CONFIG_MEM_RHUMC
900
        if {$tmpvar_1 == "RH-UMC"} then {set CONFIG_MEM_RHUMC 1} else {set CONFIG_MEM_RHUMC 0}
901
        global CONFIG_MEM_ARTISAN
902
        if {$tmpvar_1 == "Artisan"} then {set CONFIG_MEM_ARTISAN 1} else {set CONFIG_MEM_ARTISAN 0}
903
        global CONFIG_MEM_CUSTOM1
904
        if {$tmpvar_1 == "Custom1"} then {set CONFIG_MEM_CUSTOM1 1} else {set CONFIG_MEM_CUSTOM1 0}
905
        global CONFIG_MEM_VIRAGE
906
        if {$tmpvar_1 == "Virage"} then {set CONFIG_MEM_VIRAGE 1} else {set CONFIG_MEM_VIRAGE 0}
907
        global CONFIG_MEM_VIRAGE90
908
        if {$tmpvar_1 == "Virage-TSMC90"} then {set CONFIG_MEM_VIRAGE90 1} else {set CONFIG_MEM_VIRAGE90 0}
909
        global CONFIG_SYN_INFER_RAM
910
        if {($CONFIG_SYN_INFERRED != 1)} then {
911
        set CONFIG_SYN_INFER_RAM [expr $CONFIG_SYN_INFER_RAM&15]} else {set CONFIG_SYN_INFER_RAM [expr $CONFIG_SYN_INFER_RAM|16]}
912
        global CONFIG_SYN_INFER_PADS
913
        if {($CONFIG_SYN_INFERRED != 1)} then {
914
        set CONFIG_SYN_INFER_PADS [expr $CONFIG_SYN_INFER_PADS&15]} else {set CONFIG_SYN_INFER_PADS [expr $CONFIG_SYN_INFER_PADS|16]}
915
}
916
 
917
 
918
menu_option menu2 2 "Clock generation"
919
proc menu2 {w title} {
920
        set oldFocus [focus]
921
        catch {destroy $w; unregister_active 2}
922
        toplevel $w -class Dialog
923
        wm withdraw $w
924
        global active_menus
925
        set active_menus [lsort -integer [linsert $active_menus end 2]]
926
        message $w.m -width 400 -aspect 300 -text \
927
                "Clock generation"  -relief raised
928
        pack $w.m -pady 10 -side top -padx 10
929
        wm title $w "Clock generation"
930
 
931
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 2; break"
932
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu3 .menu3 \"$title\""
933
        frame $w.f
934
        button $w.f.back -text "Main Menu" \
935
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 2"
936
        button $w.f.next -text "Next" -underline 0\
937
                -width 15 -command $nextscript
938
        bind all  $nextscript
939
        button $w.f.prev -text "Prev" -underline 0\
940
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu1 .menu1 \"$title\""
941
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu1 .menu1 \"$title\";break"
942
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
943
        pack $w.f -pady 10 -side bottom -anchor w -fill x
944
        frame $w.topline -relief ridge -borderwidth 2 -height 2
945
        pack $w.topline -side top -fill x
946
 
947
        frame $w.botline -relief ridge -borderwidth 2 -height 2
948
        pack $w.botline -side bottom -fill x
949
 
950
        frame $w.config
951
        pack $w.config -fill y -expand on
952
 
953
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
954
        pack $w.config.vscroll -side right -fill y
955
 
956
        canvas $w.config.canvas -height 1\
957
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
958
                -width [expr [winfo screenwidth .] * 1 / 2]
959
        frame $w.config.f
960
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
961
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
962
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
963
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
964
        bind $w  "$w.config.canvas yview moveto 0;break;"
965
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
966
        pack $w.config.canvas -side right -fill y
967
 
968
 
969
        global tmpvar_2
970
        minimenu $w.config.f 2 0 "Clock generator                     " tmpvar_2 CONFIG_CLK_INFERRED
971
        menu $w.config.f.x0.x.menu -tearoffcommand "menutitle \"Clock generator                     \""
972
        $w.config.f.x0.x.menu add radiobutton -label "Inferred" -variable tmpvar_2 -value "Inferred" -command "update_active"
973
        $w.config.f.x0.x.menu add radiobutton -label "Actel-HCLKBUF" -variable tmpvar_2 -value "Actel-HCLKBUF" -command "update_active"
974
        $w.config.f.x0.x.menu add radiobutton -label "Altera-ALTPLL" -variable tmpvar_2 -value "Altera-ALTPLL" -command "update_active"
975
        $w.config.f.x0.x.menu add radiobutton -label "Lattice-EXPLL" -variable tmpvar_2 -value "Lattice-EXPLL" -command "update_active"
976
        $w.config.f.x0.x.menu add radiobutton -label "Proasic3-PLLL" -variable tmpvar_2 -value "Proasic3-PLLL" -command "update_active"
977
        $w.config.f.x0.x.menu add radiobutton -label "RH-LIB18T-PLL" -variable tmpvar_2 -value "RH-LIB18T-PLL" -command "update_active"
978
        $w.config.f.x0.x.menu add radiobutton -label "DARE-PLL" -variable tmpvar_2 -value "DARE-PLL" -command "update_active"
979
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-CLKDLL" -variable tmpvar_2 -value "Xilinx-CLKDLL" -command "update_active"
980
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-DCM" -variable tmpvar_2 -value "Xilinx-DCM" -command "update_active"
981
        menusplit $w $w.config.f.x0.x.menu 9
982
        int $w.config.f 2 1 "Clock multiplication factor (2 - 32)" CONFIG_CLK_MUL
983
        int $w.config.f 2 2 "Clock division factor (2 - 32)" CONFIG_CLK_DIV
984
        int $w.config.f 2 3 "Outout division factor (2 - 32)" CONFIG_OCLK_DIV
985
        bool $w.config.f 2 4 "Enable Xilinx CLKDLL for PCI clock" CONFIG_PCI_CLKDLL
986
        bool $w.config.f 2 5 "Disable external feedback for SDRAM clock" CONFIG_CLK_NOFB
987
        bool $w.config.f 2 6 "Use PCI clock as system clock" CONFIG_PCI_SYSCLK
988
 
989
 
990
 
991
        focus $w
992
        update_active
993
        global winx; global winy
994
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
995
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
996
        update idletasks
997
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
998
 
999
        $w.config.canvas configure \
1000
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1001
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1002
                         [expr [winfo reqheight $w.config.f] + 1]"
1003
 
1004
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1005
        set scry [expr [winfo screenh $w] / 2]
1006
        set maxy [expr [winfo screenh $w] * 3 / 4]
1007
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1008
        if [expr $winy + $canvtotal < $maxy] {
1009
                $w.config.canvas configure -height $canvtotal
1010
        } else {
1011
                $w.config.canvas configure -height [expr $scry - $winy]
1012
                }
1013
        }
1014
        update idletasks
1015
        if {[winfo exists $w]} then {
1016
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1017
        wm minsize $w [winfo width $w] 100
1018
 
1019
        wm deiconify $w
1020
}
1021
}
1022
 
1023
proc update_menu2 {} {
1024
        global CONFIG_CLK_DCM
1025
        global CONFIG_CLK_ALTDLL
1026
        global CONFIG_CLK_LATDLL
1027
        global CONFIG_CLK_PRO3PLL
1028
        global CONFIG_CLK_CLKDLL
1029
        global CONFIG_CLK_LIB18T
1030
        global CONFIG_CLK_MUL
1031
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_PRO3PLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {.menu2.config.f.x1.x configure -state normal -foreground [ cget .ref -foreground ]; .menu2.config.f.x1.l configure -state normal; } else {.menu2.config.f.x1.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu2.config.f.x1.l configure -state disabled}
1032
        global CONFIG_CLK_DIV
1033
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_PRO3PLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {.menu2.config.f.x2.x configure -state normal -foreground [ cget .ref -foreground ]; .menu2.config.f.x2.l configure -state normal; } else {.menu2.config.f.x2.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu2.config.f.x2.l configure -state disabled}
1034
        global CONFIG_OCLK_DIV
1035
        if {($CONFIG_CLK_PRO3PLL == 1)} then {.menu2.config.f.x3.x configure -state normal -foreground [ cget .ref -foreground ]; .menu2.config.f.x3.l configure -state normal; } else {.menu2.config.f.x3.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu2.config.f.x3.l configure -state disabled}
1036
        global CONFIG_PCI_CLKDLL
1037
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {
1038
        configure_entry .menu2.config.f.x4 normal {n l y}} else {configure_entry .menu2.config.f.x4 disabled {y n l}}
1039
        global CONFIG_CLK_NOFB
1040
        if {($CONFIG_CLK_DCM == 1)} then {
1041
        configure_entry .menu2.config.f.x5 normal {n l y}} else {configure_entry .menu2.config.f.x5 disabled {y n l}}
1042
        global CONFIG_PCI_ENABLE
1043
        global CONFIG_PCI_SYSCLK
1044
        if {($CONFIG_PCI_ENABLE != 1)} then {
1045
        configure_entry .menu2.config.f.x6 normal {n l y}} else {configure_entry .menu2.config.f.x6 disabled {y n l}}
1046
}
1047
 
1048
 
1049
proc update_define_menu2 {} {
1050
        update_define_mainmenu
1051
        global CONFIG_MODULES
1052
        global tmpvar_2
1053
        global CONFIG_CLK_INFERRED
1054
        if {$tmpvar_2 == "Inferred"} then {set CONFIG_CLK_INFERRED 1} else {set CONFIG_CLK_INFERRED 0}
1055
        global CONFIG_CLK_HCLKBUF
1056
        if {$tmpvar_2 == "Actel-HCLKBUF"} then {set CONFIG_CLK_HCLKBUF 1} else {set CONFIG_CLK_HCLKBUF 0}
1057
        global CONFIG_CLK_ALTDLL
1058
        if {$tmpvar_2 == "Altera-ALTPLL"} then {set CONFIG_CLK_ALTDLL 1} else {set CONFIG_CLK_ALTDLL 0}
1059
        global CONFIG_CLK_LATDLL
1060
        if {$tmpvar_2 == "Lattice-EXPLL"} then {set CONFIG_CLK_LATDLL 1} else {set CONFIG_CLK_LATDLL 0}
1061
        global CONFIG_CLK_PRO3PLL
1062
        if {$tmpvar_2 == "Proasic3-PLLL"} then {set CONFIG_CLK_PRO3PLL 1} else {set CONFIG_CLK_PRO3PLL 0}
1063
        global CONFIG_CLK_LIB18T
1064
        if {$tmpvar_2 == "RH-LIB18T-PLL"} then {set CONFIG_CLK_LIB18T 1} else {set CONFIG_CLK_LIB18T 0}
1065
        global CONFIG_CLK_RHUMC
1066
        if {$tmpvar_2 == "DARE-PLL"} then {set CONFIG_CLK_RHUMC 1} else {set CONFIG_CLK_RHUMC 0}
1067
        global CONFIG_CLK_CLKDLL
1068
        if {$tmpvar_2 == "Xilinx-CLKDLL"} then {set CONFIG_CLK_CLKDLL 1} else {set CONFIG_CLK_CLKDLL 0}
1069
        global CONFIG_CLK_DCM
1070
        if {$tmpvar_2 == "Xilinx-DCM"} then {set CONFIG_CLK_DCM 1} else {set CONFIG_CLK_DCM 0}
1071
        global CONFIG_CLK_MUL
1072
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_PRO3PLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {validate_int CONFIG_CLK_MUL "$CONFIG_CLK_MUL" 2}
1073
        global CONFIG_CLK_DIV
1074
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_PRO3PLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {validate_int CONFIG_CLK_DIV "$CONFIG_CLK_DIV" 2}
1075
        global CONFIG_OCLK_DIV
1076
        if {($CONFIG_CLK_PRO3PLL == 1)} then {validate_int CONFIG_OCLK_DIV "$CONFIG_OCLK_DIV" 2}
1077
        global CONFIG_PCI_CLKDLL
1078
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {
1079
        set CONFIG_PCI_CLKDLL [expr $CONFIG_PCI_CLKDLL&15]} else {set CONFIG_PCI_CLKDLL [expr $CONFIG_PCI_CLKDLL|16]}
1080
        global CONFIG_CLK_NOFB
1081
        if {($CONFIG_CLK_DCM == 1)} then {
1082
        set CONFIG_CLK_NOFB [expr $CONFIG_CLK_NOFB&15]} else {set CONFIG_CLK_NOFB [expr $CONFIG_CLK_NOFB|16]}
1083
        global CONFIG_PCI_ENABLE
1084
        global CONFIG_PCI_SYSCLK
1085
        if {($CONFIG_PCI_ENABLE != 1)} then {
1086
        set CONFIG_PCI_SYSCLK [expr $CONFIG_PCI_SYSCLK&15]} else {set CONFIG_PCI_SYSCLK [expr $CONFIG_PCI_SYSCLK|16]}
1087
}
1088
 
1089
 
1090
menu_option menu3 3 "Processor            "
1091
proc menu3 {w title} {
1092
        set oldFocus [focus]
1093
        catch {destroy $w; unregister_active 3}
1094
        toplevel $w -class Dialog
1095
        wm withdraw $w
1096
        global active_menus
1097
        set active_menus [lsort -integer [linsert $active_menus end 3]]
1098
        message $w.m -width 400 -aspect 300 -text \
1099
                "Processor            "  -relief raised
1100
        pack $w.m -pady 10 -side top -padx 10
1101
        wm title $w "Processor            "
1102
 
1103
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 3; break"
1104
        set nextscript "catch {focus $oldFocus}; menu4 .menu4 \"$title\""
1105
        frame $w.f
1106
        button $w.f.back -text "Main Menu" \
1107
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 3"
1108
        button $w.f.next -text "Next" -underline 0\
1109
                -width 15 -command $nextscript
1110
        bind all  $nextscript
1111
        button $w.f.prev -text "Prev" -underline 0\
1112
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu2 .menu2 \"$title\""
1113
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu2 .menu2 \"$title\";break"
1114
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1115
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1116
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1117
        pack $w.topline -side top -fill x
1118
 
1119
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1120
        pack $w.botline -side bottom -fill x
1121
 
1122
        frame $w.config
1123
        pack $w.config -fill y -expand on
1124
 
1125
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1126
        pack $w.config.vscroll -side right -fill y
1127
 
1128
        canvas $w.config.canvas -height 1\
1129
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1130
                -width [expr [winfo screenwidth .] * 1 / 2]
1131
        frame $w.config.f
1132
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1133
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1134
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1135
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1136
        bind $w  "$w.config.canvas yview moveto 0;break;"
1137
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1138
        pack $w.config.canvas -side right -fill y
1139
 
1140
 
1141
        bool $w.config.f 3 0 "Enable LEON3 SPARC V8 Processor" CONFIG_LEON3
1142
        int $w.config.f 3 1 "Number of processors" CONFIG_PROC_NUM
1143
        submenu $w.config.f 3 2 "Integer unit                                           " 4
1144
        submenu $w.config.f 3 3 "Floating-point unit" 5
1145
        submenu $w.config.f 3 4 "Cache system" 6
1146
        submenu $w.config.f 3 5 "MMU" 7
1147
        submenu $w.config.f 3 6 "Debug Support Unit        " 8
1148
        submenu $w.config.f 3 7 "Fault-tolerance  " 9
1149
        submenu $w.config.f 3 8 "VHDL debug settings       " 10
1150
 
1151
 
1152
 
1153
        focus $w
1154
        update_active
1155
        global winx; global winy
1156
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
1157
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1158
        update idletasks
1159
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1160
 
1161
        $w.config.canvas configure \
1162
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1163
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1164
                         [expr [winfo reqheight $w.config.f] + 1]"
1165
 
1166
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1167
        set scry [expr [winfo screenh $w] / 2]
1168
        set maxy [expr [winfo screenh $w] * 3 / 4]
1169
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1170
        if [expr $winy + $canvtotal < $maxy] {
1171
                $w.config.canvas configure -height $canvtotal
1172
        } else {
1173
                $w.config.canvas configure -height [expr $scry - $winy]
1174
                }
1175
        }
1176
        update idletasks
1177
        if {[winfo exists $w]} then {
1178
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1179
        wm minsize $w [winfo width $w] 100
1180
 
1181
        wm deiconify $w
1182
}
1183
}
1184
 
1185
proc update_menu3 {} {
1186
        global CONFIG_LEON3
1187
        global CONFIG_PROC_NUM
1188
        if {($CONFIG_LEON3 == 1)} then {.menu3.config.f.x1.x configure -state normal -foreground [ cget .ref -foreground ]; .menu3.config.f.x1.l configure -state normal; } else {.menu3.config.f.x1.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu3.config.f.x1.l configure -state disabled}
1189
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x2 normal {m}} else {configure_entry .menu3.config.f.x2 disabled {m}}
1190
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x3 normal {m}} else {configure_entry .menu3.config.f.x3 disabled {m}}
1191
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x4 normal {m}} else {configure_entry .menu3.config.f.x4 disabled {m}}
1192
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x5 normal {m}} else {configure_entry .menu3.config.f.x5 disabled {m}}
1193
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x6 normal {m}} else {configure_entry .menu3.config.f.x6 disabled {m}}
1194
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x7 normal {m}} else {configure_entry .menu3.config.f.x7 disabled {m}}
1195
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu3.config.f.x8 normal {m}} else {configure_entry .menu3.config.f.x8 disabled {m}}
1196
}
1197
 
1198
 
1199
proc update_define_menu3 {} {
1200
        update_define_mainmenu
1201
        global CONFIG_MODULES
1202
        global CONFIG_LEON3
1203
        global CONFIG_PROC_NUM
1204
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_PROC_NUM "$CONFIG_PROC_NUM" 1}
1205
}
1206
 
1207
 
1208
proc menu4 {w title} {
1209
        set oldFocus [focus]
1210
        catch {focus .menu3}
1211
        catch {destroy $w; unregister_active 4}
1212
        toplevel $w -class Dialog
1213
        wm withdraw $w
1214
        global active_menus
1215
        set active_menus [lsort -integer [linsert $active_menus end 4]]
1216
        message $w.m -width 400 -aspect 300 -text \
1217
                "Integer unit                                           "  -relief raised
1218
        pack $w.m -pady 10 -side top -padx 10
1219
        wm title $w "Integer unit                                           "
1220
 
1221
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 4; break"
1222
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu5 .menu5 \"$title\""
1223
        frame $w.f
1224
        button $w.f.back -text "OK" \
1225
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 4"
1226
        button $w.f.next -text "Next" -underline 0\
1227
                -width 15 -command $nextscript
1228
        bind all  $nextscript
1229
        button $w.f.prev -text "Prev" -underline 0\
1230
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu3 .menu3 \"$title\""
1231
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu3 .menu3 \"$title\";break"
1232
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1233
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1234
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1235
        pack $w.topline -side top -fill x
1236
 
1237
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1238
        pack $w.botline -side bottom -fill x
1239
 
1240
        frame $w.config
1241
        pack $w.config -fill y -expand on
1242
 
1243
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1244
        pack $w.config.vscroll -side right -fill y
1245
 
1246
        canvas $w.config.canvas -height 1\
1247
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1248
                -width [expr [winfo screenwidth .] * 1 / 2]
1249
        frame $w.config.f
1250
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1251
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1252
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1253
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1254
        bind $w  "$w.config.canvas yview moveto 0;break;"
1255
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1256
        pack $w.config.canvas -side right -fill y
1257
 
1258
 
1259
        int $w.config.f 4 0 "SPARC register windows" CONFIG_IU_NWINDOWS
1260
        bool $w.config.f 4 1 "SPARC V8 MUL/DIV instructions" CONFIG_IU_V8MULDIV
1261
        global tmpvar_3
1262
        minimenu $w.config.f 4 2 "Hardware multiplier latency" tmpvar_3 CONFIG_IU_MUL_LATENCY_2
1263
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"Hardware multiplier latency\""
1264
        $w.config.f.x2.x.menu add radiobutton -label "2-cycles" -variable tmpvar_3 -value "2-cycles" -command "update_active"
1265
        $w.config.f.x2.x.menu add radiobutton -label "4-cycles" -variable tmpvar_3 -value "4-cycles" -command "update_active"
1266
        $w.config.f.x2.x.menu add radiobutton -label "5-cycles" -variable tmpvar_3 -value "5-cycles" -command "update_active"
1267
        menusplit $w $w.config.f.x2.x.menu 3
1268
        bool $w.config.f 4 3 "SPARC V8e SMAC/UMAC instructions     " CONFIG_IU_MUL_MAC
1269
        bool $w.config.f 4 4 "Single-vector trapping" CONFIG_IU_SVT
1270
        int $w.config.f 4 5 "Load delay" CONFIG_IU_LDELAY
1271
        int $w.config.f 4 6 "Hardware watchpoints" CONFIG_IU_WATCHPOINTS
1272
        bool $w.config.f 4 7 "Enable power-down mode " CONFIG_PWD
1273
        hex $w.config.f 4 8 " Reset start address (addr\[31:12\]) " CONFIG_IU_RSTADDR
1274
 
1275
 
1276
 
1277
        focus $w
1278
        update_active
1279
        global winx; global winy
1280
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
1281
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
1282
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1283
        update idletasks
1284
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1285
 
1286
        $w.config.canvas configure \
1287
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1288
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1289
                         [expr [winfo reqheight $w.config.f] + 1]"
1290
 
1291
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1292
        set scry [expr [winfo screenh $w] / 2]
1293
        set maxy [expr [winfo screenh $w] * 3 / 4]
1294
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1295
        if [expr $winy + $canvtotal < $maxy] {
1296
                $w.config.canvas configure -height $canvtotal
1297
        } else {
1298
                $w.config.canvas configure -height [expr $scry - $winy]
1299
                }
1300
        }
1301
        update idletasks
1302
        if {[winfo exists $w]} then {
1303
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1304
        wm minsize $w [winfo width $w] 100
1305
 
1306
        wm deiconify $w
1307
}
1308
}
1309
 
1310
proc update_menu4 {} {
1311
        global CONFIG_LEON3
1312
        global CONFIG_IU_NWINDOWS
1313
        if {($CONFIG_LEON3 == 1)} then {.menu4.config.f.x0.x configure -state normal -foreground [ cget .ref -foreground ]; .menu4.config.f.x0.l configure -state normal; } else {.menu4.config.f.x0.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu4.config.f.x0.l configure -state disabled}
1314
        global CONFIG_IU_V8MULDIV
1315
        if {($CONFIG_LEON3 == 1)} then {
1316
        configure_entry .menu4.config.f.x1 normal {n l y}} else {configure_entry .menu4.config.f.x1 disabled {y n l}}
1317
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {configure_entry .menu4.config.f.x2 normal {x l}} else {configure_entry .menu4.config.f.x2 disabled {x l}}
1318
        global CONFIG_IU_MUL_LATENCY_4
1319
        global CONFIG_IU_MUL_LATENCY_5
1320
        global CONFIG_IU_MUL_MAC
1321
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1) && ($CONFIG_IU_MUL_LATENCY_4 == 1 || $CONFIG_IU_MUL_LATENCY_5 == 1)} then {
1322
        configure_entry .menu4.config.f.x3 normal {n l y}} else {configure_entry .menu4.config.f.x3 disabled {y n l}}
1323
        global CONFIG_IU_SVT
1324
        if {($CONFIG_LEON3 == 1)} then {
1325
        configure_entry .menu4.config.f.x4 normal {n l y}} else {configure_entry .menu4.config.f.x4 disabled {y n l}}
1326
        global CONFIG_IU_LDELAY
1327
        if {($CONFIG_LEON3 == 1)} then {.menu4.config.f.x5.x configure -state normal -foreground [ cget .ref -foreground ]; .menu4.config.f.x5.l configure -state normal; } else {.menu4.config.f.x5.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu4.config.f.x5.l configure -state disabled}
1328
        global CONFIG_IU_WATCHPOINTS
1329
        if {($CONFIG_LEON3 == 1)} then {.menu4.config.f.x6.x configure -state normal -foreground [ cget .ref -foreground ]; .menu4.config.f.x6.l configure -state normal; } else {.menu4.config.f.x6.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu4.config.f.x6.l configure -state disabled}
1330
        global CONFIG_PWD
1331
        if {($CONFIG_LEON3 == 1)} then {
1332
        configure_entry .menu4.config.f.x7 normal {n l y}} else {configure_entry .menu4.config.f.x7 disabled {y n l}}
1333
        global CONFIG_IU_RSTADDR
1334
        if {($CONFIG_LEON3 == 1)} then {.menu4.config.f.x8.x configure -state normal -foreground [ cget .ref -foreground ]; .menu4.config.f.x8.l configure -state normal; } else {.menu4.config.f.x8.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu4.config.f.x8.l configure -state disabled}
1335
}
1336
 
1337
 
1338
proc update_define_menu4 {} {
1339
        update_define_mainmenu
1340
        global CONFIG_MODULES
1341
        global CONFIG_LEON3
1342
        global CONFIG_IU_NWINDOWS
1343
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_NWINDOWS "$CONFIG_IU_NWINDOWS" 8}
1344
        global CONFIG_IU_V8MULDIV
1345
        if {($CONFIG_LEON3 == 1)} then {
1346
        set CONFIG_IU_V8MULDIV [expr $CONFIG_IU_V8MULDIV&15]} else {set CONFIG_IU_V8MULDIV [expr $CONFIG_IU_V8MULDIV|16]}
1347
        global tmpvar_3
1348
        global CONFIG_IU_MUL_LATENCY_2
1349
        if {$tmpvar_3 == "2-cycles"} then {set CONFIG_IU_MUL_LATENCY_2 1} else {set CONFIG_IU_MUL_LATENCY_2 0}
1350
        global CONFIG_IU_MUL_LATENCY_4
1351
        if {$tmpvar_3 == "4-cycles"} then {set CONFIG_IU_MUL_LATENCY_4 1} else {set CONFIG_IU_MUL_LATENCY_4 0}
1352
        global CONFIG_IU_MUL_LATENCY_5
1353
        if {$tmpvar_3 == "5-cycles"} then {set CONFIG_IU_MUL_LATENCY_5 1} else {set CONFIG_IU_MUL_LATENCY_5 0}
1354
        global CONFIG_IU_MUL_MAC
1355
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1) && ($CONFIG_IU_MUL_LATENCY_4 == 1 || $CONFIG_IU_MUL_LATENCY_5 == 1)} then {
1356
        set CONFIG_IU_MUL_MAC [expr $CONFIG_IU_MUL_MAC&15]} else {set CONFIG_IU_MUL_MAC [expr $CONFIG_IU_MUL_MAC|16]}
1357
        global CONFIG_IU_SVT
1358
        if {($CONFIG_LEON3 == 1)} then {
1359
        set CONFIG_IU_SVT [expr $CONFIG_IU_SVT&15]} else {set CONFIG_IU_SVT [expr $CONFIG_IU_SVT|16]}
1360
        global CONFIG_IU_LDELAY
1361
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_LDELAY "$CONFIG_IU_LDELAY" 1}
1362
        global CONFIG_IU_WATCHPOINTS
1363
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_WATCHPOINTS "$CONFIG_IU_WATCHPOINTS" 0}
1364
        global CONFIG_PWD
1365
        if {($CONFIG_LEON3 == 1)} then {
1366
        set CONFIG_PWD [expr $CONFIG_PWD&15]} else {set CONFIG_PWD [expr $CONFIG_PWD|16]}
1367
        global CONFIG_IU_RSTADDR
1368
        if {($CONFIG_LEON3 == 1)} then {validate_hex CONFIG_IU_RSTADDR "$CONFIG_IU_RSTADDR" 00000}
1369
}
1370
 
1371
 
1372
proc menu5 {w title} {
1373
        set oldFocus [focus]
1374
        catch {focus .menu3}
1375
        catch {destroy $w; unregister_active 5}
1376
        toplevel $w -class Dialog
1377
        wm withdraw $w
1378
        global active_menus
1379
        set active_menus [lsort -integer [linsert $active_menus end 5]]
1380
        message $w.m -width 400 -aspect 300 -text \
1381
                "Floating-point unit"  -relief raised
1382
        pack $w.m -pady 10 -side top -padx 10
1383
        wm title $w "Floating-point unit"
1384
 
1385
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 5; break"
1386
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu6 .menu6 \"$title\""
1387
        frame $w.f
1388
        button $w.f.back -text "OK" \
1389
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 5"
1390
        button $w.f.next -text "Next" -underline 0\
1391
                -width 15 -command $nextscript
1392
        bind all  $nextscript
1393
        button $w.f.prev -text "Prev" -underline 0\
1394
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu4 .menu4 \"$title\""
1395
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu4 .menu4 \"$title\";break"
1396
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1397
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1398
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1399
        pack $w.topline -side top -fill x
1400
 
1401
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1402
        pack $w.botline -side bottom -fill x
1403
 
1404
        frame $w.config
1405
        pack $w.config -fill y -expand on
1406
 
1407
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1408
        pack $w.config.vscroll -side right -fill y
1409
 
1410
        canvas $w.config.canvas -height 1\
1411
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1412
                -width [expr [winfo screenwidth .] * 1 / 2]
1413
        frame $w.config.f
1414
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1415
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1416
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1417
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1418
        bind $w  "$w.config.canvas yview moveto 0;break;"
1419
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1420
        pack $w.config.canvas -side right -fill y
1421
 
1422
 
1423
        bool $w.config.f 5 0 "Enable FPU                             " CONFIG_FPU_ENABLE
1424
        global tmpvar_4
1425
        minimenu $w.config.f 5 1 "FPU core" tmpvar_4 CONFIG_FPU_GRFPU
1426
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"FPU core\""
1427
        $w.config.f.x1.x.menu add radiobutton -label "GRFPU" -variable tmpvar_4 -value "GRFPU" -command "update_active"
1428
        $w.config.f.x1.x.menu add radiobutton -label "GRFPU-LITE" -variable tmpvar_4 -value "GRFPU-LITE" -command "update_active"
1429
        $w.config.f.x1.x.menu add radiobutton -label "Meiko" -variable tmpvar_4 -value "Meiko" -command "update_active"
1430
        menusplit $w $w.config.f.x1.x.menu 3
1431
        global tmpvar_5
1432
        minimenu $w.config.f 5 2 "GRFPU multiplier" tmpvar_5 CONFIG_FPU_GRFPU_INFMUL
1433
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"GRFPU multiplier\""
1434
        $w.config.f.x2.x.menu add radiobutton -label "Inferred" -variable tmpvar_5 -value "Inferred" -command "update_active"
1435
        $w.config.f.x2.x.menu add radiobutton -label "DW" -variable tmpvar_5 -value "DW" -command "update_active"
1436
        menusplit $w $w.config.f.x2.x.menu 2
1437
        global tmpvar_6
1438
        minimenu $w.config.f 5 3 "GRFPU-LITE controller" tmpvar_6 CONFIG_FPU_GRFPC0
1439
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"GRFPU-LITE controller\""
1440
        $w.config.f.x3.x.menu add radiobutton -label "Simple" -variable tmpvar_6 -value "Simple" -command "update_active"
1441
        $w.config.f.x3.x.menu add radiobutton -label "Data-forwarding" -variable tmpvar_6 -value "Data-forwarding" -command "update_active"
1442
        $w.config.f.x3.x.menu add radiobutton -label "Non-blocking" -variable tmpvar_6 -value "Non-blocking" -command "update_active"
1443
        menusplit $w $w.config.f.x3.x.menu 3
1444
        bool $w.config.f 5 4 "Use VHDL netlist          " CONFIG_FPU_NETLIST
1445
 
1446
 
1447
 
1448
        focus $w
1449
        update_active
1450
        global winx; global winy
1451
        if {[winfo exists .menu3] == 0} then {menu3 .menu3 "Processor            "}
1452
        set winx [expr [winfo x .menu3]+30]; set winy [expr [winfo y .menu3]+30]
1453
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1454
        update idletasks
1455
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1456
 
1457
        $w.config.canvas configure \
1458
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1459
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1460
                         [expr [winfo reqheight $w.config.f] + 1]"
1461
 
1462
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1463
        set scry [expr [winfo screenh $w] / 2]
1464
        set maxy [expr [winfo screenh $w] * 3 / 4]
1465
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1466
        if [expr $winy + $canvtotal < $maxy] {
1467
                $w.config.canvas configure -height $canvtotal
1468
        } else {
1469
                $w.config.canvas configure -height [expr $scry - $winy]
1470
                }
1471
        }
1472
        update idletasks
1473
        if {[winfo exists $w]} then {
1474
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1475
        wm minsize $w [winfo width $w] 100
1476
 
1477
        wm deiconify $w
1478
}
1479
}
1480
 
1481
proc update_menu5 {} {
1482
        global CONFIG_LEON3
1483
        global CONFIG_FPU_ENABLE
1484
        if {($CONFIG_LEON3 == 1)} then {
1485
        configure_entry .menu5.config.f.x0 normal {n l y}} else {configure_entry .menu5.config.f.x0 disabled {y n l}}
1486
        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}}
1487
        global CONFIG_FPU_GRFPU
1488
        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}}
1489
        global CONFIG_FPU_GRFPULITE
1490
        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}}
1491
        global CONFIG_FPU_NETLIST
1492
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
1493
        configure_entry .menu5.config.f.x4 normal {n l y}} else {configure_entry .menu5.config.f.x4 disabled {y n l}}
1494
}
1495
 
1496
 
1497
proc update_define_menu5 {} {
1498
        update_define_mainmenu
1499
        global CONFIG_MODULES
1500
        global CONFIG_LEON3
1501
        global CONFIG_FPU_ENABLE
1502
        if {($CONFIG_LEON3 == 1)} then {
1503
        set CONFIG_FPU_ENABLE [expr $CONFIG_FPU_ENABLE&15]} else {set CONFIG_FPU_ENABLE [expr $CONFIG_FPU_ENABLE|16]}
1504
        global tmpvar_4
1505
        global CONFIG_FPU_GRFPU
1506
        if {$tmpvar_4 == "GRFPU"} then {set CONFIG_FPU_GRFPU 1} else {set CONFIG_FPU_GRFPU 0}
1507
        global CONFIG_FPU_GRFPULITE
1508
        if {$tmpvar_4 == "GRFPU-LITE"} then {set CONFIG_FPU_GRFPULITE 1} else {set CONFIG_FPU_GRFPULITE 0}
1509
        global CONFIG_FPU_MEIKO
1510
        if {$tmpvar_4 == "Meiko"} then {set CONFIG_FPU_MEIKO 1} else {set CONFIG_FPU_MEIKO 0}
1511
        global tmpvar_5
1512
        global CONFIG_FPU_GRFPU_INFMUL
1513
        if {$tmpvar_5 == "Inferred"} then {set CONFIG_FPU_GRFPU_INFMUL 1} else {set CONFIG_FPU_GRFPU_INFMUL 0}
1514
        global CONFIG_FPU_GRFPU_DWMUL
1515
        if {$tmpvar_5 == "DW"} then {set CONFIG_FPU_GRFPU_DWMUL 1} else {set CONFIG_FPU_GRFPU_DWMUL 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 controllers             " 14
2818
        submenu $w.config.f 13 1 "On-chip RAM/ROM                 " 19
2819
        submenu $w.config.f 13 2 "Ethernet             " 20
2820
        submenu $w.config.f 13 3 "UARTs, timers and irq control         " 21
2821
        submenu $w.config.f 13 4 "Serial interfaces; I2C, PS/2 and SPI  " 22
2822
        submenu $w.config.f 13 5 "LCD and VGA DAC  " 23
2823
 
2824
 
2825
 
2826
        focus $w
2827
        update_active
2828
        global winx; global winy
2829
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
2830
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2831
        update idletasks
2832
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2833
 
2834
        $w.config.canvas configure \
2835
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2836
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2837
                         [expr [winfo reqheight $w.config.f] + 1]"
2838
 
2839
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2840
        set scry [expr [winfo screenh $w] / 2]
2841
        set maxy [expr [winfo screenh $w] * 3 / 4]
2842
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2843
        if [expr $winy + $canvtotal < $maxy] {
2844
                $w.config.canvas configure -height $canvtotal
2845
        } else {
2846
                $w.config.canvas configure -height [expr $scry - $winy]
2847
                }
2848
        }
2849
        update idletasks
2850
        if {[winfo exists $w]} then {
2851
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2852
        wm minsize $w [winfo width $w] 100
2853
 
2854
        wm deiconify $w
2855
}
2856
}
2857
 
2858
proc update_menu13 {} {
2859
}
2860
 
2861
 
2862
proc update_define_menu13 {} {
2863
        update_define_mainmenu
2864
        global CONFIG_MODULES
2865
}
2866
 
2867
 
2868
proc menu14 {w title} {
2869
        set oldFocus [focus]
2870
        catch {focus .menu13}
2871
        catch {destroy $w; unregister_active 14}
2872
        toplevel $w -class Dialog
2873
        wm withdraw $w
2874
        global active_menus
2875
        set active_menus [lsort -integer [linsert $active_menus end 14]]
2876
        message $w.m -width 400 -aspect 300 -text \
2877
                "Memory controllers             "  -relief raised
2878
        pack $w.m -pady 10 -side top -padx 10
2879
        wm title $w "Memory controllers             "
2880
 
2881
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 14; break"
2882
        set nextscript "catch {focus $oldFocus}; menu15 .menu15 \"$title\""
2883
        frame $w.f
2884
        button $w.f.back -text "OK" \
2885
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 14"
2886
        button $w.f.next -text "Next" -underline 0\
2887
                -width 15 -command $nextscript
2888
        bind all  $nextscript
2889
        button $w.f.prev -text "Prev" -underline 0\
2890
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 14; menu13 .menu13 \"$title\""
2891
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 14; menu13 .menu13 \"$title\";break"
2892
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2893
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2894
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2895
        pack $w.topline -side top -fill x
2896
 
2897
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2898
        pack $w.botline -side bottom -fill x
2899
 
2900
        frame $w.config
2901
        pack $w.config -fill y -expand on
2902
 
2903
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2904
        pack $w.config.vscroll -side right -fill y
2905
 
2906
        canvas $w.config.canvas -height 1\
2907
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2908
                -width [expr [winfo screenwidth .] * 1 / 2]
2909
        frame $w.config.f
2910
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2911
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2912
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2913
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2914
        bind $w  "$w.config.canvas yview moveto 0;break;"
2915
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2916
        pack $w.config.canvas -side right -fill y
2917
 
2918
 
2919
        submenu $w.config.f 14 0 "Leon2 memory controller        " 15
2920
        submenu $w.config.f 14 1 "Synchronous SRAM controller   " 16
2921
        submenu $w.config.f 14 2 "DDR266 SDRAM controller             " 17
2922
        submenu $w.config.f 14 3 "SPI memory controller " 18
2923
 
2924
 
2925
 
2926
        focus $w
2927
        update_active
2928
        global winx; global winy
2929
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
2930
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
2931
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2932
        update idletasks
2933
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2934
 
2935
        $w.config.canvas configure \
2936
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2937
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2938
                         [expr [winfo reqheight $w.config.f] + 1]"
2939
 
2940
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2941
        set scry [expr [winfo screenh $w] / 2]
2942
        set maxy [expr [winfo screenh $w] * 3 / 4]
2943
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2944
        if [expr $winy + $canvtotal < $maxy] {
2945
                $w.config.canvas configure -height $canvtotal
2946
        } else {
2947
                $w.config.canvas configure -height [expr $scry - $winy]
2948
                }
2949
        }
2950
        update idletasks
2951
        if {[winfo exists $w]} then {
2952
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2953
        wm minsize $w [winfo width $w] 100
2954
 
2955
        wm deiconify $w
2956
}
2957
}
2958
 
2959
proc update_menu14 {} {
2960
}
2961
 
2962
 
2963
proc update_define_menu14 {} {
2964
        update_define_mainmenu
2965
        global CONFIG_MODULES
2966
}
2967
 
2968
 
2969
proc menu15 {w title} {
2970
        set oldFocus [focus]
2971
        catch {focus .menu14}
2972
        catch {destroy $w; unregister_active 15}
2973
        toplevel $w -class Dialog
2974
        wm withdraw $w
2975
        global active_menus
2976
        set active_menus [lsort -integer [linsert $active_menus end 15]]
2977
        message $w.m -width 400 -aspect 300 -text \
2978
                "Leon2 memory controller        "  -relief raised
2979
        pack $w.m -pady 10 -side top -padx 10
2980
        wm title $w "Leon2 memory controller        "
2981
 
2982
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 15; break"
2983
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 15; menu16 .menu16 \"$title\""
2984
        frame $w.f
2985
        button $w.f.back -text "OK" \
2986
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 15"
2987
        button $w.f.next -text "Next" -underline 0\
2988
                -width 15 -command $nextscript
2989
        bind all  $nextscript
2990
        button $w.f.prev -text "Prev" -underline 0\
2991
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 15; menu14 .menu14 \"$title\""
2992
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 15; menu14 .menu14 \"$title\";break"
2993
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2994
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2995
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2996
        pack $w.topline -side top -fill x
2997
 
2998
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2999
        pack $w.botline -side bottom -fill x
3000
 
3001
        frame $w.config
3002
        pack $w.config -fill y -expand on
3003
 
3004
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3005
        pack $w.config.vscroll -side right -fill y
3006
 
3007
        canvas $w.config.canvas -height 1\
3008
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3009
                -width [expr [winfo screenwidth .] * 1 / 2]
3010
        frame $w.config.f
3011
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3012
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3013
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3014
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3015
        bind $w  "$w.config.canvas yview moveto 0;break;"
3016
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3017
        pack $w.config.canvas -side right -fill y
3018
 
3019
 
3020
        bool $w.config.f 15 0 "Enable Leon2 memory controller  " CONFIG_MCTRL_LEON2
3021
        bool $w.config.f 15 1 "8-bit PROM/SRAM bus support    " CONFIG_MCTRL_8BIT
3022
        bool $w.config.f 15 2 "16-bit PROM/SRAM bus support    " CONFIG_MCTRL_16BIT
3023
        bool $w.config.f 15 3 "5th SRAM chip-select  " CONFIG_MCTRL_5CS
3024
        bool $w.config.f 15 4 "SDRAM controller       " CONFIG_MCTRL_SDRAM
3025
        bool $w.config.f 15 5 "Separate address and data buses" CONFIG_MCTRL_SDRAM_SEPBUS
3026
        bool $w.config.f 15 6 "64-bit SDRAM data bus" CONFIG_MCTRL_SDRAM_BUS64
3027
        bool $w.config.f 15 7 "Unsynchronized sdclock" CONFIG_MCTRL_SDRAM_INVCLK
3028
        bool $w.config.f 15 8 "Enable page burst operation     " CONFIG_MCTRL_PAGE
3029
        bool $w.config.f 15 9 "Enable programmable page burst " CONFIG_MCTRL_PROGPAGE
3030
 
3031
 
3032
 
3033
        focus $w
3034
        update_active
3035
        global winx; global winy
3036
        if {[winfo exists .menu14] == 0} then {menu14 .menu14 "Memory controllers             "}
3037
        set winx [expr [winfo x .menu14]+30]; set winy [expr [winfo y .menu14]+30]
3038
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3039
        update idletasks
3040
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3041
 
3042
        $w.config.canvas configure \
3043
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3044
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3045
                         [expr [winfo reqheight $w.config.f] + 1]"
3046
 
3047
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3048
        set scry [expr [winfo screenh $w] / 2]
3049
        set maxy [expr [winfo screenh $w] * 3 / 4]
3050
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3051
        if [expr $winy + $canvtotal < $maxy] {
3052
                $w.config.canvas configure -height $canvtotal
3053
        } else {
3054
                $w.config.canvas configure -height [expr $scry - $winy]
3055
                }
3056
        }
3057
        update idletasks
3058
        if {[winfo exists $w]} then {
3059
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3060
        wm minsize $w [winfo width $w] 100
3061
 
3062
        wm deiconify $w
3063
}
3064
}
3065
 
3066
proc update_menu15 {} {
3067
        global CONFIG_MCTRL_LEON2
3068
        global CONFIG_MCTRL_8BIT
3069
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3070
        configure_entry .menu15.config.f.x1 normal {n l y}} else {configure_entry .menu15.config.f.x1 disabled {y n l}}
3071
        global CONFIG_MCTRL_16BIT
3072
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3073
        configure_entry .menu15.config.f.x2 normal {n l y}} else {configure_entry .menu15.config.f.x2 disabled {y n l}}
3074
        global CONFIG_MCTRL_5CS
3075
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3076
        configure_entry .menu15.config.f.x3 normal {n l y}} else {configure_entry .menu15.config.f.x3 disabled {y n l}}
3077
        global CONFIG_MCTRL_SDRAM
3078
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3079
        configure_entry .menu15.config.f.x4 normal {n l y}} else {configure_entry .menu15.config.f.x4 disabled {y n l}}
3080
        global CONFIG_MCTRL_SDRAM_SEPBUS
3081
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {
3082
        configure_entry .menu15.config.f.x5 normal {n l y}} else {configure_entry .menu15.config.f.x5 disabled {y n l}}
3083
        global CONFIG_MCTRL_SDRAM_BUS64
3084
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_SDRAM_SEPBUS == 1)} then {
3085
        configure_entry .menu15.config.f.x6 normal {n l y}} else {configure_entry .menu15.config.f.x6 disabled {y n l}}
3086
        global CONFIG_MCTRL_SDRAM_INVCLK
3087
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_SDRAM_SEPBUS == 1)} then {
3088
        configure_entry .menu15.config.f.x7 normal {n l y}} else {configure_entry .menu15.config.f.x7 disabled {y n l}}
3089
        global CONFIG_MCTRL_PAGE
3090
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {
3091
        configure_entry .menu15.config.f.x8 normal {n l y}} else {configure_entry .menu15.config.f.x8 disabled {y n l}}
3092
        global CONFIG_MCTRL_PROGPAGE
3093
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_PAGE == 1)} then {
3094
        configure_entry .menu15.config.f.x9 normal {n l y}} else {configure_entry .menu15.config.f.x9 disabled {y n l}}
3095
}
3096
 
3097
 
3098
proc update_define_menu15 {} {
3099
        update_define_mainmenu
3100
        global CONFIG_MODULES
3101
        global CONFIG_MCTRL_LEON2
3102
        global CONFIG_MCTRL_8BIT
3103
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3104
        set CONFIG_MCTRL_8BIT [expr $CONFIG_MCTRL_8BIT&15]} else {set CONFIG_MCTRL_8BIT [expr $CONFIG_MCTRL_8BIT|16]}
3105
        global CONFIG_MCTRL_16BIT
3106
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3107
        set CONFIG_MCTRL_16BIT [expr $CONFIG_MCTRL_16BIT&15]} else {set CONFIG_MCTRL_16BIT [expr $CONFIG_MCTRL_16BIT|16]}
3108
        global CONFIG_MCTRL_5CS
3109
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3110
        set CONFIG_MCTRL_5CS [expr $CONFIG_MCTRL_5CS&15]} else {set CONFIG_MCTRL_5CS [expr $CONFIG_MCTRL_5CS|16]}
3111
        global CONFIG_MCTRL_SDRAM
3112
        if {($CONFIG_MCTRL_LEON2 == 1)} then {
3113
        set CONFIG_MCTRL_SDRAM [expr $CONFIG_MCTRL_SDRAM&15]} else {set CONFIG_MCTRL_SDRAM [expr $CONFIG_MCTRL_SDRAM|16]}
3114
        global CONFIG_MCTRL_SDRAM_SEPBUS
3115
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {
3116
        set CONFIG_MCTRL_SDRAM_SEPBUS [expr $CONFIG_MCTRL_SDRAM_SEPBUS&15]} else {set CONFIG_MCTRL_SDRAM_SEPBUS [expr $CONFIG_MCTRL_SDRAM_SEPBUS|16]}
3117
        global CONFIG_MCTRL_SDRAM_BUS64
3118
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_SDRAM_SEPBUS == 1)} then {
3119
        set CONFIG_MCTRL_SDRAM_BUS64 [expr $CONFIG_MCTRL_SDRAM_BUS64&15]} else {set CONFIG_MCTRL_SDRAM_BUS64 [expr $CONFIG_MCTRL_SDRAM_BUS64|16]}
3120
        global CONFIG_MCTRL_SDRAM_INVCLK
3121
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_SDRAM_SEPBUS == 1)} then {
3122
        set CONFIG_MCTRL_SDRAM_INVCLK [expr $CONFIG_MCTRL_SDRAM_INVCLK&15]} else {set CONFIG_MCTRL_SDRAM_INVCLK [expr $CONFIG_MCTRL_SDRAM_INVCLK|16]}
3123
        global CONFIG_MCTRL_PAGE
3124
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {
3125
        set CONFIG_MCTRL_PAGE [expr $CONFIG_MCTRL_PAGE&15]} else {set CONFIG_MCTRL_PAGE [expr $CONFIG_MCTRL_PAGE|16]}
3126
        global CONFIG_MCTRL_PROGPAGE
3127
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1) && ($CONFIG_MCTRL_PAGE == 1)} then {
3128
        set CONFIG_MCTRL_PROGPAGE [expr $CONFIG_MCTRL_PROGPAGE&15]} else {set CONFIG_MCTRL_PROGPAGE [expr $CONFIG_MCTRL_PROGPAGE|16]}
3129
}
3130
 
3131
 
3132
proc menu16 {w title} {
3133
        set oldFocus [focus]
3134
        catch {focus .menu14}
3135
        catch {destroy $w; unregister_active 16}
3136
        toplevel $w -class Dialog
3137
        wm withdraw $w
3138
        global active_menus
3139
        set active_menus [lsort -integer [linsert $active_menus end 16]]
3140
        message $w.m -width 400 -aspect 300 -text \
3141
                "Synchronous SRAM controller   "  -relief raised
3142
        pack $w.m -pady 10 -side top -padx 10
3143
        wm title $w "Synchronous SRAM controller   "
3144
 
3145
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 16; break"
3146
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 16; menu17 .menu17 \"$title\""
3147
        frame $w.f
3148
        button $w.f.back -text "OK" \
3149
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 16"
3150
        button $w.f.next -text "Next" -underline 0\
3151
                -width 15 -command $nextscript
3152
        bind all  $nextscript
3153
        button $w.f.prev -text "Prev" -underline 0\
3154
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 16; menu15 .menu15 \"$title\""
3155
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 16; menu15 .menu15 \"$title\";break"
3156
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3157
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3158
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3159
        pack $w.topline -side top -fill x
3160
 
3161
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3162
        pack $w.botline -side bottom -fill x
3163
 
3164
        frame $w.config
3165
        pack $w.config -fill y -expand on
3166
 
3167
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3168
        pack $w.config.vscroll -side right -fill y
3169
 
3170
        canvas $w.config.canvas -height 1\
3171
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3172
                -width [expr [winfo screenwidth .] * 1 / 2]
3173
        frame $w.config.f
3174
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3175
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3176
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3177
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3178
        bind $w  "$w.config.canvas yview moveto 0;break;"
3179
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3180
        pack $w.config.canvas -side right -fill y
3181
 
3182
 
3183
        bool $w.config.f 16 0 "Enable Synchronous SRAM controller    " CONFIG_SSCTRL
3184
        bool $w.config.f 16 1 "Enable 16-bit PROM support            " CONFIG_SSCTRL_PROM16
3185
 
3186
 
3187
 
3188
        focus $w
3189
        update_active
3190
        global winx; global winy
3191
        if {[winfo exists .menu14] == 0} then {menu14 .menu14 "Memory controllers             "}
3192
        set winx [expr [winfo x .menu14]+30]; set winy [expr [winfo y .menu14]+30]
3193
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3194
        update idletasks
3195
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3196
 
3197
        $w.config.canvas configure \
3198
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3199
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3200
                         [expr [winfo reqheight $w.config.f] + 1]"
3201
 
3202
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3203
        set scry [expr [winfo screenh $w] / 2]
3204
        set maxy [expr [winfo screenh $w] * 3 / 4]
3205
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3206
        if [expr $winy + $canvtotal < $maxy] {
3207
                $w.config.canvas configure -height $canvtotal
3208
        } else {
3209
                $w.config.canvas configure -height [expr $scry - $winy]
3210
                }
3211
        }
3212
        update idletasks
3213
        if {[winfo exists $w]} then {
3214
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3215
        wm minsize $w [winfo width $w] 100
3216
 
3217
        wm deiconify $w
3218
}
3219
}
3220
 
3221
proc update_menu16 {} {
3222
        global CONFIG_SSCTRL
3223
        global CONFIG_SSCTRL_PROM16
3224
        if {($CONFIG_SSCTRL == 1)} then {
3225
        configure_entry .menu16.config.f.x1 normal {n l y}} else {configure_entry .menu16.config.f.x1 disabled {y n l}}
3226
}
3227
 
3228
 
3229
proc update_define_menu16 {} {
3230
        update_define_mainmenu
3231
        global CONFIG_MODULES
3232
        global CONFIG_SSCTRL
3233
        global CONFIG_SSCTRL_PROM16
3234
        if {($CONFIG_SSCTRL == 1)} then {
3235
        set CONFIG_SSCTRL_PROM16 [expr $CONFIG_SSCTRL_PROM16&15]} else {set CONFIG_SSCTRL_PROM16 [expr $CONFIG_SSCTRL_PROM16|16]}
3236
}
3237
 
3238
 
3239
proc menu17 {w title} {
3240
        set oldFocus [focus]
3241
        catch {focus .menu14}
3242
        catch {destroy $w; unregister_active 17}
3243
        toplevel $w -class Dialog
3244
        wm withdraw $w
3245
        global active_menus
3246
        set active_menus [lsort -integer [linsert $active_menus end 17]]
3247
        message $w.m -width 400 -aspect 300 -text \
3248
                "DDR266 SDRAM controller             "  -relief raised
3249
        pack $w.m -pady 10 -side top -padx 10
3250
        wm title $w "DDR266 SDRAM controller             "
3251
 
3252
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 17; break"
3253
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 17; menu18 .menu18 \"$title\""
3254
        frame $w.f
3255
        button $w.f.back -text "OK" \
3256
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 17"
3257
        button $w.f.next -text "Next" -underline 0\
3258
                -width 15 -command $nextscript
3259
        bind all  $nextscript
3260
        button $w.f.prev -text "Prev" -underline 0\
3261
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 17; menu16 .menu16 \"$title\""
3262
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 17; menu16 .menu16 \"$title\";break"
3263
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3264
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3265
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3266
        pack $w.topline -side top -fill x
3267
 
3268
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3269
        pack $w.botline -side bottom -fill x
3270
 
3271
        frame $w.config
3272
        pack $w.config -fill y -expand on
3273
 
3274
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3275
        pack $w.config.vscroll -side right -fill y
3276
 
3277
        canvas $w.config.canvas -height 1\
3278
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3279
                -width [expr [winfo screenwidth .] * 1 / 2]
3280
        frame $w.config.f
3281
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3282
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3283
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3284
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3285
        bind $w  "$w.config.canvas yview moveto 0;break;"
3286
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3287
        pack $w.config.canvas -side right -fill y
3288
 
3289
 
3290
        bool $w.config.f 17 0 "Enable DDR266 SDRAM controller       " CONFIG_DDRSP
3291
        bool $w.config.f 17 1 "Enable power-on initialization       " CONFIG_DDRSP_INIT
3292
        int $w.config.f 17 2 "Memory frequency (MHz)  " CONFIG_DDRSP_FREQ
3293
        int $w.config.f 17 3 "Column address bits (9 - 12)  " CONFIG_DDRSP_COL
3294
        int $w.config.f 17 4 "Chip select bank size (Mbyte) " CONFIG_DDRSP_MBYTE
3295
        int $w.config.f 17 5 "Read clock phase shift        " CONFIG_DDRSP_RSKEW
3296
 
3297
 
3298
 
3299
        focus $w
3300
        update_active
3301
        global winx; global winy
3302
        if {[winfo exists .menu14] == 0} then {menu14 .menu14 "Memory controllers             "}
3303
        set winx [expr [winfo x .menu14]+30]; set winy [expr [winfo y .menu14]+30]
3304
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3305
        update idletasks
3306
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3307
 
3308
        $w.config.canvas configure \
3309
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3310
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3311
                         [expr [winfo reqheight $w.config.f] + 1]"
3312
 
3313
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3314
        set scry [expr [winfo screenh $w] / 2]
3315
        set maxy [expr [winfo screenh $w] * 3 / 4]
3316
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3317
        if [expr $winy + $canvtotal < $maxy] {
3318
                $w.config.canvas configure -height $canvtotal
3319
        } else {
3320
                $w.config.canvas configure -height [expr $scry - $winy]
3321
                }
3322
        }
3323
        update idletasks
3324
        if {[winfo exists $w]} then {
3325
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3326
        wm minsize $w [winfo width $w] 100
3327
 
3328
        wm deiconify $w
3329
}
3330
}
3331
 
3332
proc update_menu17 {} {
3333
        global CONFIG_DDRSP
3334
        global CONFIG_DDRSP_INIT
3335
        if {($CONFIG_DDRSP == 1)} then {
3336
        configure_entry .menu17.config.f.x1 normal {n l y}} else {configure_entry .menu17.config.f.x1 disabled {y n l}}
3337
        global CONFIG_DDRSP_FREQ
3338
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {.menu17.config.f.x2.x configure -state normal -foreground [ cget .ref -foreground ]; .menu17.config.f.x2.l configure -state normal; } else {.menu17.config.f.x2.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu17.config.f.x2.l configure -state disabled}
3339
        global CONFIG_DDRSP_COL
3340
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {.menu17.config.f.x3.x configure -state normal -foreground [ cget .ref -foreground ]; .menu17.config.f.x3.l configure -state normal; } else {.menu17.config.f.x3.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu17.config.f.x3.l configure -state disabled}
3341
        global CONFIG_DDRSP_MBYTE
3342
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {.menu17.config.f.x4.x configure -state normal -foreground [ cget .ref -foreground ]; .menu17.config.f.x4.l configure -state normal; } else {.menu17.config.f.x4.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu17.config.f.x4.l configure -state disabled}
3343
        global CONFIG_SYN_VIRTEX2
3344
        global CONFIG_SYN_VIRTEX4
3345
        global CONFIG_SYN_SPARTAN3
3346
        global CONFIG_SYN_VIRTEX5
3347
        global CONFIG_SYN_SPARTAN3E
3348
        global CONFIG_SYN_CYCLONEIII
3349
        global CONFIG_DDRSP_RSKEW
3350
        if {($CONFIG_DDRSP == 1) && ($CONFIG_SYN_VIRTEX2 == 1 || $CONFIG_SYN_VIRTEX4 == 1 || $CONFIG_SYN_SPARTAN3 == 1 || $CONFIG_SYN_VIRTEX5 == 1 || $CONFIG_SYN_SPARTAN3E == 1 || $CONFIG_SYN_CYCLONEIII == 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}
3351
}
3352
 
3353
 
3354
proc update_define_menu17 {} {
3355
        update_define_mainmenu
3356
        global CONFIG_MODULES
3357
        global CONFIG_DDRSP
3358
        global CONFIG_DDRSP_INIT
3359
        if {($CONFIG_DDRSP == 1)} then {
3360
        set CONFIG_DDRSP_INIT [expr $CONFIG_DDRSP_INIT&15]} else {set CONFIG_DDRSP_INIT [expr $CONFIG_DDRSP_INIT|16]}
3361
        global CONFIG_DDRSP_FREQ
3362
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {validate_int CONFIG_DDRSP_FREQ "$CONFIG_DDRSP_FREQ" 100}
3363
        global CONFIG_DDRSP_COL
3364
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {validate_int CONFIG_DDRSP_COL "$CONFIG_DDRSP_COL" 9}
3365
        global CONFIG_DDRSP_MBYTE
3366
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {validate_int CONFIG_DDRSP_MBYTE "$CONFIG_DDRSP_MBYTE" 16}
3367
        global CONFIG_SYN_VIRTEX2
3368
        global CONFIG_SYN_VIRTEX4
3369
        global CONFIG_SYN_SPARTAN3
3370
        global CONFIG_SYN_VIRTEX5
3371
        global CONFIG_SYN_SPARTAN3E
3372
        global CONFIG_SYN_CYCLONEIII
3373
        global CONFIG_DDRSP_RSKEW
3374
        if {($CONFIG_DDRSP == 1) && ($CONFIG_SYN_VIRTEX2 == 1 || $CONFIG_SYN_VIRTEX4 == 1 || $CONFIG_SYN_SPARTAN3 == 1 || $CONFIG_SYN_VIRTEX5 == 1 || $CONFIG_SYN_SPARTAN3E == 1 || $CONFIG_SYN_CYCLONEIII == 1)} then {validate_int CONFIG_DDRSP_RSKEW "$CONFIG_DDRSP_RSKEW" 0}
3375
}
3376
 
3377
 
3378
proc menu18 {w title} {
3379
        set oldFocus [focus]
3380
        catch {focus .menu14}
3381
        catch {destroy $w; unregister_active 18}
3382
        toplevel $w -class Dialog
3383
        wm withdraw $w
3384
        global active_menus
3385
        set active_menus [lsort -integer [linsert $active_menus end 18]]
3386
        message $w.m -width 400 -aspect 300 -text \
3387
                "SPI memory controller "  -relief raised
3388
        pack $w.m -pady 10 -side top -padx 10
3389
        wm title $w "SPI memory controller "
3390
 
3391
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 18; break"
3392
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 18; catch {destroy .menu14}; unregister_active 14; menu19 .menu19 \"$title\""
3393
        frame $w.f
3394
        button $w.f.back -text "OK" \
3395
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 18"
3396
        button $w.f.next -text "Next" -underline 0\
3397
                -width 15 -command $nextscript
3398
        bind all  $nextscript
3399
        button $w.f.prev -text "Prev" -underline 0\
3400
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 18; menu17 .menu17 \"$title\""
3401
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 18; menu17 .menu17 \"$title\";break"
3402
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3403
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3404
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3405
        pack $w.topline -side top -fill x
3406
 
3407
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3408
        pack $w.botline -side bottom -fill x
3409
 
3410
        frame $w.config
3411
        pack $w.config -fill y -expand on
3412
 
3413
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3414
        pack $w.config.vscroll -side right -fill y
3415
 
3416
        canvas $w.config.canvas -height 1\
3417
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3418
                -width [expr [winfo screenwidth .] * 1 / 2]
3419
        frame $w.config.f
3420
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3421
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3422
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3423
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3424
        bind $w  "$w.config.canvas yview moveto 0;break;"
3425
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3426
        pack $w.config.canvas -side right -fill y
3427
 
3428
 
3429
        bool $w.config.f 18 0 "Enable SPI memory controller    " CONFIG_SPIMCTRL
3430
        bool $w.config.f 18 1 "Enable SD card support    " CONFIG_SPIMCTRL_SDCARD
3431
        hex $w.config.f 18 2 "Read instruction    " CONFIG_SPIMCTRL_READCMD
3432
        bool $w.config.f 18 3 "Read instruction requires dummy byte  " CONFIG_SPIMCTRL_DUMMYBYTE
3433
        bool $w.config.f 18 4 "Enable dual output for reads  " CONFIG_SPIMCTRL_DUALOUTPUT
3434
        int $w.config.f 18 5 "Clock divisor for device clock" CONFIG_SPIMCTRL_SCALER
3435
        int $w.config.f 18 6 "Clock divisor for alt. device clock" CONFIG_SPIMCTRL_ASCALER
3436
        int $w.config.f 18 7 "Number of clock cycles to idle after power up  " CONFIG_SPIMCTRL_PWRUPCNT
3437
 
3438
 
3439
 
3440
        focus $w
3441
        update_active
3442
        global winx; global winy
3443
        if {[winfo exists .menu14] == 0} then {menu14 .menu14 "Memory controllers             "}
3444
        set winx [expr [winfo x .menu14]+30]; set winy [expr [winfo y .menu14]+30]
3445
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3446
        update idletasks
3447
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3448
 
3449
        $w.config.canvas configure \
3450
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3451
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3452
                         [expr [winfo reqheight $w.config.f] + 1]"
3453
 
3454
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3455
        set scry [expr [winfo screenh $w] / 2]
3456
        set maxy [expr [winfo screenh $w] * 3 / 4]
3457
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3458
        if [expr $winy + $canvtotal < $maxy] {
3459
                $w.config.canvas configure -height $canvtotal
3460
        } else {
3461
                $w.config.canvas configure -height [expr $scry - $winy]
3462
                }
3463
        }
3464
        update idletasks
3465
        if {[winfo exists $w]} then {
3466
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3467
        wm minsize $w [winfo width $w] 100
3468
 
3469
        wm deiconify $w
3470
}
3471
}
3472
 
3473
proc update_menu18 {} {
3474
        global CONFIG_SPIMCTRL
3475
        global CONFIG_SPIMCTRL_SDCARD
3476
        if {($CONFIG_SPIMCTRL == 1)} then {
3477
        configure_entry .menu18.config.f.x1 normal {n l y}} else {configure_entry .menu18.config.f.x1 disabled {y n l}}
3478
        global CONFIG_SPIMCTRL_READCMD
3479
        if {($CONFIG_SPIMCTRL == 1) && ($CONFIG_SPIMCTRL_SDCARD != 1)} then {.menu18.config.f.x2.x configure -state normal -foreground [ cget .ref -foreground ]; .menu18.config.f.x2.l configure -state normal; } else {.menu18.config.f.x2.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu18.config.f.x2.l configure -state disabled}
3480
        global CONFIG_SPIMCTRL_DUMMYBYTE
3481
        if {($CONFIG_SPIMCTRL == 1) && ($CONFIG_SPIMCTRL_SDCARD != 1)} then {
3482
        configure_entry .menu18.config.f.x3 normal {n l y}} else {configure_entry .menu18.config.f.x3 disabled {y n l}}
3483
        global CONFIG_SPIMCTRL_DUALOUTPUT
3484
        if {($CONFIG_SPIMCTRL == 1) && ($CONFIG_SPIMCTRL_SDCARD != 1)} then {
3485
        configure_entry .menu18.config.f.x4 normal {n l y}} else {configure_entry .menu18.config.f.x4 disabled {y n l}}
3486
        global CONFIG_SPIMCTRL_SCALER
3487
        if {($CONFIG_SPIMCTRL == 1)} then {.menu18.config.f.x5.x configure -state normal -foreground [ cget .ref -foreground ]; .menu18.config.f.x5.l configure -state normal; } else {.menu18.config.f.x5.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu18.config.f.x5.l configure -state disabled}
3488
        global CONFIG_SPIMCTRL_ASCALER
3489
        if {($CONFIG_SPIMCTRL == 1)} then {.menu18.config.f.x6.x configure -state normal -foreground [ cget .ref -foreground ]; .menu18.config.f.x6.l configure -state normal; } else {.menu18.config.f.x6.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu18.config.f.x6.l configure -state disabled}
3490
        global CONFIG_SPIMCTRL_PWRUPCNT
3491
        if {($CONFIG_SPIMCTRL == 1)} then {.menu18.config.f.x7.x configure -state normal -foreground [ cget .ref -foreground ]; .menu18.config.f.x7.l configure -state normal; } else {.menu18.config.f.x7.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu18.config.f.x7.l configure -state disabled}
3492
}
3493
 
3494
 
3495
proc update_define_menu18 {} {
3496
        update_define_mainmenu
3497
        global CONFIG_MODULES
3498
        global CONFIG_SPIMCTRL
3499
        global CONFIG_SPIMCTRL_SDCARD
3500
        if {($CONFIG_SPIMCTRL == 1)} then {
3501
        set CONFIG_SPIMCTRL_SDCARD [expr $CONFIG_SPIMCTRL_SDCARD&15]} else {set CONFIG_SPIMCTRL_SDCARD [expr $CONFIG_SPIMCTRL_SDCARD|16]}
3502
        global CONFIG_SPIMCTRL_READCMD
3503
        if {($CONFIG_SPIMCTRL == 1) && ($CONFIG_SPIMCTRL_SDCARD != 1)} then {validate_hex CONFIG_SPIMCTRL_READCMD "$CONFIG_SPIMCTRL_READCMD" 0B}
3504
        global CONFIG_SPIMCTRL_DUMMYBYTE
3505
        if {($CONFIG_SPIMCTRL == 1) && ($CONFIG_SPIMCTRL_SDCARD != 1)} then {
3506
        set CONFIG_SPIMCTRL_DUMMYBYTE [expr $CONFIG_SPIMCTRL_DUMMYBYTE&15]} else {set CONFIG_SPIMCTRL_DUMMYBYTE [expr $CONFIG_SPIMCTRL_DUMMYBYTE|16]}
3507
        global CONFIG_SPIMCTRL_DUALOUTPUT
3508
        if {($CONFIG_SPIMCTRL == 1) && ($CONFIG_SPIMCTRL_SDCARD != 1)} then {
3509
        set CONFIG_SPIMCTRL_DUALOUTPUT [expr $CONFIG_SPIMCTRL_DUALOUTPUT&15]} else {set CONFIG_SPIMCTRL_DUALOUTPUT [expr $CONFIG_SPIMCTRL_DUALOUTPUT|16]}
3510
        global CONFIG_SPIMCTRL_SCALER
3511
        if {($CONFIG_SPIMCTRL == 1)} then {validate_int CONFIG_SPIMCTRL_SCALER "$CONFIG_SPIMCTRL_SCALER" 1}
3512
        global CONFIG_SPIMCTRL_ASCALER
3513
        if {($CONFIG_SPIMCTRL == 1)} then {validate_int CONFIG_SPIMCTRL_ASCALER "$CONFIG_SPIMCTRL_ASCALER" 8}
3514
        global CONFIG_SPIMCTRL_PWRUPCNT
3515
        if {($CONFIG_SPIMCTRL == 1)} then {validate_int CONFIG_SPIMCTRL_PWRUPCNT "$CONFIG_SPIMCTRL_PWRUPCNT" 0}
3516
}
3517
 
3518
 
3519
proc menu19 {w title} {
3520
        set oldFocus [focus]
3521
        catch {focus .menu13}
3522
        catch {destroy $w; unregister_active 19}
3523
        toplevel $w -class Dialog
3524
        wm withdraw $w
3525
        global active_menus
3526
        set active_menus [lsort -integer [linsert $active_menus end 19]]
3527
        message $w.m -width 400 -aspect 300 -text \
3528
                "On-chip RAM/ROM                 "  -relief raised
3529
        pack $w.m -pady 10 -side top -padx 10
3530
        wm title $w "On-chip RAM/ROM                 "
3531
 
3532
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 19; break"
3533
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 19; menu20 .menu20 \"$title\""
3534
        frame $w.f
3535
        button $w.f.back -text "OK" \
3536
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 19"
3537
        button $w.f.next -text "Next" -underline 0\
3538
                -width 15 -command $nextscript
3539
        bind all  $nextscript
3540
        button $w.f.prev -text "Prev" -underline 0\
3541
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 19; menu18 .menu18 \"$title\""
3542
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 19; menu18 .menu18 \"$title\";break"
3543
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3544
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3545
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3546
        pack $w.topline -side top -fill x
3547
 
3548
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3549
        pack $w.botline -side bottom -fill x
3550
 
3551
        frame $w.config
3552
        pack $w.config -fill y -expand on
3553
 
3554
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3555
        pack $w.config.vscroll -side right -fill y
3556
 
3557
        canvas $w.config.canvas -height 1\
3558
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3559
                -width [expr [winfo screenwidth .] * 1 / 2]
3560
        frame $w.config.f
3561
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3562
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3563
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3564
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3565
        bind $w  "$w.config.canvas yview moveto 0;break;"
3566
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3567
        pack $w.config.canvas -side right -fill y
3568
 
3569
 
3570
        bool $w.config.f 19 0 "On-chip AHB ROM                   " CONFIG_AHBROM_ENABLE
3571
        hex $w.config.f 19 1 "ROM start address (haddr\[31:20\]) " CONFIG_AHBROM_START
3572
        bool $w.config.f 19 2 "Pipelined ROM access              " CONFIG_AHBROM_PIPE
3573
        bool $w.config.f 19 3 "On-chip AHB RAM                   " CONFIG_AHBRAM_ENABLE
3574
        global tmpvar_25
3575
        minimenu $w.config.f 19 4 "AHB RAM size (Kbyte)" tmpvar_25 CONFIG_AHBRAM_SZ1
3576
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"AHB RAM size (Kbyte)\""
3577
        $w.config.f.x4.x.menu add radiobutton -label "1" -variable tmpvar_25 -value "1" -command "update_active"
3578
        $w.config.f.x4.x.menu add radiobutton -label "2" -variable tmpvar_25 -value "2" -command "update_active"
3579
        $w.config.f.x4.x.menu add radiobutton -label "4" -variable tmpvar_25 -value "4" -command "update_active"
3580
        $w.config.f.x4.x.menu add radiobutton -label "8" -variable tmpvar_25 -value "8" -command "update_active"
3581
        $w.config.f.x4.x.menu add radiobutton -label "16" -variable tmpvar_25 -value "16" -command "update_active"
3582
        $w.config.f.x4.x.menu add radiobutton -label "32" -variable tmpvar_25 -value "32" -command "update_active"
3583
        $w.config.f.x4.x.menu add radiobutton -label "64" -variable tmpvar_25 -value "64" -command "update_active"
3584
        menusplit $w $w.config.f.x4.x.menu 7
3585
        hex $w.config.f 19 5 "RAM start address (haddr\[31:20\]) " CONFIG_AHBRAM_START
3586
 
3587
 
3588
 
3589
        focus $w
3590
        update_active
3591
        global winx; global winy
3592
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
3593
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
3594
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3595
        update idletasks
3596
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3597
 
3598
        $w.config.canvas configure \
3599
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3600
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3601
                         [expr [winfo reqheight $w.config.f] + 1]"
3602
 
3603
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3604
        set scry [expr [winfo screenh $w] / 2]
3605
        set maxy [expr [winfo screenh $w] * 3 / 4]
3606
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3607
        if [expr $winy + $canvtotal < $maxy] {
3608
                $w.config.canvas configure -height $canvtotal
3609
        } else {
3610
                $w.config.canvas configure -height [expr $scry - $winy]
3611
                }
3612
        }
3613
        update idletasks
3614
        if {[winfo exists $w]} then {
3615
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3616
        wm minsize $w [winfo width $w] 100
3617
 
3618
        wm deiconify $w
3619
}
3620
}
3621
 
3622
proc update_menu19 {} {
3623
        global CONFIG_AHBROM_ENABLE
3624
        global CONFIG_AHBROM_START
3625
        if {($CONFIG_AHBROM_ENABLE == 1)} then {.menu19.config.f.x1.x configure -state normal -foreground [ cget .ref -foreground ]; .menu19.config.f.x1.l configure -state normal; } else {.menu19.config.f.x1.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu19.config.f.x1.l configure -state disabled}
3626
        global CONFIG_AHBROM_PIPE
3627
        if {($CONFIG_AHBROM_ENABLE == 1)} then {
3628
        configure_entry .menu19.config.f.x2 normal {n l y}} else {configure_entry .menu19.config.f.x2 disabled {y n l}}
3629
        global CONFIG_AHBRAM_ENABLE
3630
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {configure_entry .menu19.config.f.x4 normal {x l}} else {configure_entry .menu19.config.f.x4 disabled {x l}}
3631
        global CONFIG_AHBRAM_START
3632
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {.menu19.config.f.x5.x configure -state normal -foreground [ cget .ref -foreground ]; .menu19.config.f.x5.l configure -state normal; } else {.menu19.config.f.x5.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu19.config.f.x5.l configure -state disabled}
3633
}
3634
 
3635
 
3636
proc update_define_menu19 {} {
3637
        update_define_mainmenu
3638
        global CONFIG_MODULES
3639
        global CONFIG_AHBROM_ENABLE
3640
        global CONFIG_AHBROM_START
3641
        if {($CONFIG_AHBROM_ENABLE == 1)} then {validate_hex CONFIG_AHBROM_START "$CONFIG_AHBROM_START" 000}
3642
        global CONFIG_AHBROM_PIPE
3643
        if {($CONFIG_AHBROM_ENABLE == 1)} then {
3644
        set CONFIG_AHBROM_PIPE [expr $CONFIG_AHBROM_PIPE&15]} else {set CONFIG_AHBROM_PIPE [expr $CONFIG_AHBROM_PIPE|16]}
3645
        global tmpvar_25
3646
        global CONFIG_AHBRAM_SZ1
3647
        if {$tmpvar_25 == "1"} then {set CONFIG_AHBRAM_SZ1 1} else {set CONFIG_AHBRAM_SZ1 0}
3648
        global CONFIG_AHBRAM_SZ2
3649
        if {$tmpvar_25 == "2"} then {set CONFIG_AHBRAM_SZ2 1} else {set CONFIG_AHBRAM_SZ2 0}
3650
        global CONFIG_AHBRAM_SZ4
3651
        if {$tmpvar_25 == "4"} then {set CONFIG_AHBRAM_SZ4 1} else {set CONFIG_AHBRAM_SZ4 0}
3652
        global CONFIG_AHBRAM_SZ8
3653
        if {$tmpvar_25 == "8"} then {set CONFIG_AHBRAM_SZ8 1} else {set CONFIG_AHBRAM_SZ8 0}
3654
        global CONFIG_AHBRAM_SZ16
3655
        if {$tmpvar_25 == "16"} then {set CONFIG_AHBRAM_SZ16 1} else {set CONFIG_AHBRAM_SZ16 0}
3656
        global CONFIG_AHBRAM_SZ32
3657
        if {$tmpvar_25 == "32"} then {set CONFIG_AHBRAM_SZ32 1} else {set CONFIG_AHBRAM_SZ32 0}
3658
        global CONFIG_AHBRAM_SZ64
3659
        if {$tmpvar_25 == "64"} then {set CONFIG_AHBRAM_SZ64 1} else {set CONFIG_AHBRAM_SZ64 0}
3660
        global CONFIG_AHBRAM_ENABLE
3661
        global CONFIG_AHBRAM_START
3662
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {validate_hex CONFIG_AHBRAM_START "$CONFIG_AHBRAM_START" A00}
3663
}
3664
 
3665
 
3666
proc menu20 {w title} {
3667
        set oldFocus [focus]
3668
        catch {focus .menu13}
3669
        catch {destroy $w; unregister_active 20}
3670
        toplevel $w -class Dialog
3671
        wm withdraw $w
3672
        global active_menus
3673
        set active_menus [lsort -integer [linsert $active_menus end 20]]
3674
        message $w.m -width 400 -aspect 300 -text \
3675
                "Ethernet             "  -relief raised
3676
        pack $w.m -pady 10 -side top -padx 10
3677
        wm title $w "Ethernet             "
3678
 
3679
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 20; break"
3680
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 20; menu21 .menu21 \"$title\""
3681
        frame $w.f
3682
        button $w.f.back -text "OK" \
3683
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 20"
3684
        button $w.f.next -text "Next" -underline 0\
3685
                -width 15 -command $nextscript
3686
        bind all  $nextscript
3687
        button $w.f.prev -text "Prev" -underline 0\
3688
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 20; menu19 .menu19 \"$title\""
3689
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 20; menu19 .menu19 \"$title\";break"
3690
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3691
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3692
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3693
        pack $w.topline -side top -fill x
3694
 
3695
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3696
        pack $w.botline -side bottom -fill x
3697
 
3698
        frame $w.config
3699
        pack $w.config -fill y -expand on
3700
 
3701
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3702
        pack $w.config.vscroll -side right -fill y
3703
 
3704
        canvas $w.config.canvas -height 1\
3705
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3706
                -width [expr [winfo screenwidth .] * 1 / 2]
3707
        frame $w.config.f
3708
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3709
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3710
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3711
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3712
        bind $w  "$w.config.canvas yview moveto 0;break;"
3713
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3714
        pack $w.config.canvas -side right -fill y
3715
 
3716
 
3717
        bool $w.config.f 20 0 "Gaisler Research 10/100/1000 Mbit Ethernet MAC " CONFIG_GRETH_ENABLE
3718
        bool $w.config.f 20 1 "Enable 1000 Mbit support    " CONFIG_GRETH_GIGA
3719
        global tmpvar_26
3720
        minimenu $w.config.f 20 2 "AHB FIFO size (words)            " tmpvar_26 CONFIG_GRETH_FIFO4
3721
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"AHB FIFO size (words)            \""
3722
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_26 -value "4" -command "update_active"
3723
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_26 -value "8" -command "update_active"
3724
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_26 -value "16" -command "update_active"
3725
        $w.config.f.x2.x.menu add radiobutton -label "32" -variable tmpvar_26 -value "32" -command "update_active"
3726
        $w.config.f.x2.x.menu add radiobutton -label "64" -variable tmpvar_26 -value "64" -command "update_active"
3727
        menusplit $w $w.config.f.x2.x.menu 5
3728
 
3729
 
3730
 
3731
        focus $w
3732
        update_active
3733
        global winx; global winy
3734
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
3735
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
3736
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3737
        update idletasks
3738
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3739
 
3740
        $w.config.canvas configure \
3741
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3742
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3743
                         [expr [winfo reqheight $w.config.f] + 1]"
3744
 
3745
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3746
        set scry [expr [winfo screenh $w] / 2]
3747
        set maxy [expr [winfo screenh $w] * 3 / 4]
3748
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3749
        if [expr $winy + $canvtotal < $maxy] {
3750
                $w.config.canvas configure -height $canvtotal
3751
        } else {
3752
                $w.config.canvas configure -height [expr $scry - $winy]
3753
                }
3754
        }
3755
        update idletasks
3756
        if {[winfo exists $w]} then {
3757
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3758
        wm minsize $w [winfo width $w] 100
3759
 
3760
        wm deiconify $w
3761
}
3762
}
3763
 
3764
proc update_menu20 {} {
3765
        global CONFIG_GRETH_ENABLE
3766
        global CONFIG_GRETH_GIGA
3767
        if {($CONFIG_GRETH_ENABLE == 1)} then {
3768
        configure_entry .menu20.config.f.x1 normal {n l y}} else {configure_entry .menu20.config.f.x1 disabled {y n l}}
3769
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_GRETH_GIGA == 0)} then {configure_entry .menu20.config.f.x2 normal {x l}} else {configure_entry .menu20.config.f.x2 disabled {x l}}
3770
}
3771
 
3772
 
3773
proc update_define_menu20 {} {
3774
        update_define_mainmenu
3775
        global CONFIG_MODULES
3776
        global CONFIG_GRETH_ENABLE
3777
        global CONFIG_GRETH_GIGA
3778
        if {($CONFIG_GRETH_ENABLE == 1)} then {
3779
        set CONFIG_GRETH_GIGA [expr $CONFIG_GRETH_GIGA&15]} else {set CONFIG_GRETH_GIGA [expr $CONFIG_GRETH_GIGA|16]}
3780
        global tmpvar_26
3781
        global CONFIG_GRETH_FIFO4
3782
        if {$tmpvar_26 == "4"} then {set CONFIG_GRETH_FIFO4 1} else {set CONFIG_GRETH_FIFO4 0}
3783
        global CONFIG_GRETH_FIFO8
3784
        if {$tmpvar_26 == "8"} then {set CONFIG_GRETH_FIFO8 1} else {set CONFIG_GRETH_FIFO8 0}
3785
        global CONFIG_GRETH_FIFO16
3786
        if {$tmpvar_26 == "16"} then {set CONFIG_GRETH_FIFO16 1} else {set CONFIG_GRETH_FIFO16 0}
3787
        global CONFIG_GRETH_FIFO32
3788
        if {$tmpvar_26 == "32"} then {set CONFIG_GRETH_FIFO32 1} else {set CONFIG_GRETH_FIFO32 0}
3789
        global CONFIG_GRETH_FIFO64
3790
        if {$tmpvar_26 == "64"} then {set CONFIG_GRETH_FIFO64 1} else {set CONFIG_GRETH_FIFO64 0}
3791
}
3792
 
3793
 
3794
proc menu21 {w title} {
3795
        set oldFocus [focus]
3796
        catch {focus .menu13}
3797
        catch {destroy $w; unregister_active 21}
3798
        toplevel $w -class Dialog
3799
        wm withdraw $w
3800
        global active_menus
3801
        set active_menus [lsort -integer [linsert $active_menus end 21]]
3802
        message $w.m -width 400 -aspect 300 -text \
3803
                "UARTs, timers and irq control         "  -relief raised
3804
        pack $w.m -pady 10 -side top -padx 10
3805
        wm title $w "UARTs, timers and irq control         "
3806
 
3807
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 21; break"
3808
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 21; menu22 .menu22 \"$title\""
3809
        frame $w.f
3810
        button $w.f.back -text "OK" \
3811
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 21"
3812
        button $w.f.next -text "Next" -underline 0\
3813
                -width 15 -command $nextscript
3814
        bind all  $nextscript
3815
        button $w.f.prev -text "Prev" -underline 0\
3816
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 21; menu20 .menu20 \"$title\""
3817
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 21; menu20 .menu20 \"$title\";break"
3818
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
3819
        pack $w.f -pady 10 -side bottom -anchor w -fill x
3820
        frame $w.topline -relief ridge -borderwidth 2 -height 2
3821
        pack $w.topline -side top -fill x
3822
 
3823
        frame $w.botline -relief ridge -borderwidth 2 -height 2
3824
        pack $w.botline -side bottom -fill x
3825
 
3826
        frame $w.config
3827
        pack $w.config -fill y -expand on
3828
 
3829
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
3830
        pack $w.config.vscroll -side right -fill y
3831
 
3832
        canvas $w.config.canvas -height 1\
3833
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
3834
                -width [expr [winfo screenwidth .] * 1 / 2]
3835
        frame $w.config.f
3836
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
3837
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
3838
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
3839
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
3840
        bind $w  "$w.config.canvas yview moveto 0;break;"
3841
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
3842
        pack $w.config.canvas -side right -fill y
3843
 
3844
 
3845
        bool $w.config.f 21 0 "Enable console UART                  " CONFIG_UART1_ENABLE
3846
        global tmpvar_27
3847
        minimenu $w.config.f 21 1 "UART1 FIFO depth" tmpvar_27 CONFIG_UA1_FIFO1
3848
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"UART1 FIFO depth\""
3849
        $w.config.f.x1.x.menu add radiobutton -label "1" -variable tmpvar_27 -value "1" -command "update_active"
3850
        $w.config.f.x1.x.menu add radiobutton -label "2" -variable tmpvar_27 -value "2" -command "update_active"
3851
        $w.config.f.x1.x.menu add radiobutton -label "4" -variable tmpvar_27 -value "4" -command "update_active"
3852
        $w.config.f.x1.x.menu add radiobutton -label "8" -variable tmpvar_27 -value "8" -command "update_active"
3853
        $w.config.f.x1.x.menu add radiobutton -label "16" -variable tmpvar_27 -value "16" -command "update_active"
3854
        $w.config.f.x1.x.menu add radiobutton -label "32" -variable tmpvar_27 -value "32" -command "update_active"
3855
        menusplit $w $w.config.f.x1.x.menu 6
3856
        bool $w.config.f 21 2 "Enable LEON3 interrupt controller    " CONFIG_IRQ3_ENABLE
3857
        bool $w.config.f 21 3 "Enable secondary interrupts           " CONFIG_IRQ3_SEC
3858
        int $w.config.f 21 4 "Secondary interrupt number (1 - 15)    " CONFIG_IRQ3_NSEC
3859
        bool $w.config.f 21 5 "Enable Timer Unit                    " CONFIG_GPT_ENABLE
3860
        int $w.config.f 21 6 "Number of timers (1 - 7)              " CONFIG_GPT_NTIM
3861
        int $w.config.f 21 7 "Scaler width (2 - 16)                 " CONFIG_GPT_SW
3862
        int $w.config.f 21 8 "Timer width (2 - 32)                  " CONFIG_GPT_TW
3863
        int $w.config.f 21 9 "Timer unit interrupt                  " CONFIG_GPT_IRQ
3864
        bool $w.config.f 21 10 "Separate interrupts                  " CONFIG_GPT_SEPIRQ
3865
        bool $w.config.f 21 11 "Watchdog enable                      " CONFIG_GPT_WDOGEN
3866
        hex $w.config.f 21 12 "Initial watchdog time-out value       " CONFIG_GPT_WDOG
3867
        bool $w.config.f 21 13 "Enable generic GPIO port              " CONFIG_GRGPIO_ENABLE
3868
        int $w.config.f 21 14 "GPIO width            " CONFIG_GRGPIO_WIDTH
3869
        hex $w.config.f 21 15 "GPIO interrupt mask   " CONFIG_GRGPIO_IMASK
3870
 
3871
 
3872
 
3873
        focus $w
3874
        update_active
3875
        global winx; global winy
3876
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
3877
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
3878
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
3879
        update idletasks
3880
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
3881
 
3882
        $w.config.canvas configure \
3883
                -width [expr [winfo reqwidth $w.config.f] + 1]\
3884
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
3885
                         [expr [winfo reqheight $w.config.f] + 1]"
3886
 
3887
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
3888
        set scry [expr [winfo screenh $w] / 2]
3889
        set maxy [expr [winfo screenh $w] * 3 / 4]
3890
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
3891
        if [expr $winy + $canvtotal < $maxy] {
3892
                $w.config.canvas configure -height $canvtotal
3893
        } else {
3894
                $w.config.canvas configure -height [expr $scry - $winy]
3895
                }
3896
        }
3897
        update idletasks
3898
        if {[winfo exists $w]} then {
3899
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
3900
        wm minsize $w [winfo width $w] 100
3901
 
3902
        wm deiconify $w
3903
}
3904
}
3905
 
3906
proc update_menu21 {} {
3907
        global CONFIG_UART1_ENABLE
3908
        if {($CONFIG_UART1_ENABLE == 1)} then {configure_entry .menu21.config.f.x1 normal {x l}} else {configure_entry .menu21.config.f.x1 disabled {x l}}
3909
        global CONFIG_IRQ3_ENABLE
3910
        global CONFIG_IRQ3_SEC
3911
        if {($CONFIG_IRQ3_ENABLE == 1)} then {
3912
        configure_entry .menu21.config.f.x3 normal {n l y}} else {configure_entry .menu21.config.f.x3 disabled {y n l}}
3913
        global CONFIG_IRQ3_NSEC
3914
        if {($CONFIG_IRQ3_ENABLE == 1) && ($CONFIG_IRQ3_SEC == 1)} then {.menu21.config.f.x4.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x4.l configure -state normal; } else {.menu21.config.f.x4.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x4.l configure -state disabled}
3915
        global CONFIG_GPT_ENABLE
3916
        global CONFIG_GPT_NTIM
3917
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu21.config.f.x6.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x6.l configure -state normal; } else {.menu21.config.f.x6.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x6.l configure -state disabled}
3918
        global CONFIG_GPT_SW
3919
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu21.config.f.x7.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x7.l configure -state normal; } else {.menu21.config.f.x7.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x7.l configure -state disabled}
3920
        global CONFIG_GPT_TW
3921
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu21.config.f.x8.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x8.l configure -state normal; } else {.menu21.config.f.x8.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x8.l configure -state disabled}
3922
        global CONFIG_GPT_IRQ
3923
        if {($CONFIG_GPT_ENABLE == 1)} then {.menu21.config.f.x9.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x9.l configure -state normal; } else {.menu21.config.f.x9.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x9.l configure -state disabled}
3924
        global CONFIG_GPT_SEPIRQ
3925
        if {($CONFIG_GPT_ENABLE == 1)} then {
3926
        configure_entry .menu21.config.f.x10 normal {n l y}} else {configure_entry .menu21.config.f.x10 disabled {y n l}}
3927
        global CONFIG_GPT_WDOGEN
3928
        if {($CONFIG_GPT_ENABLE == 1)} then {
3929
        configure_entry .menu21.config.f.x11 normal {n l y}} else {configure_entry .menu21.config.f.x11 disabled {y n l}}
3930
        global CONFIG_GPT_WDOG
3931
        if {($CONFIG_GPT_ENABLE == 1) && ($CONFIG_GPT_WDOGEN == 1)} then {.menu21.config.f.x12.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x12.l configure -state normal; } else {.menu21.config.f.x12.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x12.l configure -state disabled}
3932
        global CONFIG_GRGPIO_ENABLE
3933
        global CONFIG_GRGPIO_WIDTH
3934
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {.menu21.config.f.x14.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x14.l configure -state normal; } else {.menu21.config.f.x14.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x14.l configure -state disabled}
3935
        global CONFIG_GRGPIO_IMASK
3936
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {.menu21.config.f.x15.x configure -state normal -foreground [ cget .ref -foreground ]; .menu21.config.f.x15.l configure -state normal; } else {.menu21.config.f.x15.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu21.config.f.x15.l configure -state disabled}
3937
}
3938
 
3939
 
3940
proc update_define_menu21 {} {
3941
        update_define_mainmenu
3942
        global CONFIG_MODULES
3943
        global tmpvar_27
3944
        global CONFIG_UA1_FIFO1
3945
        if {$tmpvar_27 == "1"} then {set CONFIG_UA1_FIFO1 1} else {set CONFIG_UA1_FIFO1 0}
3946
        global CONFIG_UA1_FIFO2
3947
        if {$tmpvar_27 == "2"} then {set CONFIG_UA1_FIFO2 1} else {set CONFIG_UA1_FIFO2 0}
3948
        global CONFIG_UA1_FIFO4
3949
        if {$tmpvar_27 == "4"} then {set CONFIG_UA1_FIFO4 1} else {set CONFIG_UA1_FIFO4 0}
3950
        global CONFIG_UA1_FIFO8
3951
        if {$tmpvar_27 == "8"} then {set CONFIG_UA1_FIFO8 1} else {set CONFIG_UA1_FIFO8 0}
3952
        global CONFIG_UA1_FIFO16
3953
        if {$tmpvar_27 == "16"} then {set CONFIG_UA1_FIFO16 1} else {set CONFIG_UA1_FIFO16 0}
3954
        global CONFIG_UA1_FIFO32
3955
        if {$tmpvar_27 == "32"} then {set CONFIG_UA1_FIFO32 1} else {set CONFIG_UA1_FIFO32 0}
3956
        global CONFIG_IRQ3_ENABLE
3957
        global CONFIG_IRQ3_SEC
3958
        if {($CONFIG_IRQ3_ENABLE == 1)} then {
3959
        set CONFIG_IRQ3_SEC [expr $CONFIG_IRQ3_SEC&15]} else {set CONFIG_IRQ3_SEC [expr $CONFIG_IRQ3_SEC|16]}
3960
        global CONFIG_IRQ3_NSEC
3961
        if {($CONFIG_IRQ3_ENABLE == 1) && ($CONFIG_IRQ3_SEC == 1)} then {validate_int CONFIG_IRQ3_NSEC "$CONFIG_IRQ3_NSEC" 12}
3962
        global CONFIG_GPT_ENABLE
3963
        global CONFIG_GPT_NTIM
3964
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_NTIM "$CONFIG_GPT_NTIM" 2}
3965
        global CONFIG_GPT_SW
3966
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_SW "$CONFIG_GPT_SW" 8}
3967
        global CONFIG_GPT_TW
3968
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_TW "$CONFIG_GPT_TW" 32}
3969
        global CONFIG_GPT_IRQ
3970
        if {($CONFIG_GPT_ENABLE == 1)} then {validate_int CONFIG_GPT_IRQ "$CONFIG_GPT_IRQ" 8}
3971
        global CONFIG_GPT_SEPIRQ
3972
        if {($CONFIG_GPT_ENABLE == 1)} then {
3973
        set CONFIG_GPT_SEPIRQ [expr $CONFIG_GPT_SEPIRQ&15]} else {set CONFIG_GPT_SEPIRQ [expr $CONFIG_GPT_SEPIRQ|16]}
3974
        global CONFIG_GPT_WDOGEN
3975
        if {($CONFIG_GPT_ENABLE == 1)} then {
3976
        set CONFIG_GPT_WDOGEN [expr $CONFIG_GPT_WDOGEN&15]} else {set CONFIG_GPT_WDOGEN [expr $CONFIG_GPT_WDOGEN|16]}
3977
        global CONFIG_GPT_WDOG
3978
        if {($CONFIG_GPT_ENABLE == 1) && ($CONFIG_GPT_WDOGEN == 1)} then {validate_hex CONFIG_GPT_WDOG "$CONFIG_GPT_WDOG" FFFF}
3979
        global CONFIG_GRGPIO_ENABLE
3980
        global CONFIG_GRGPIO_WIDTH
3981
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {validate_int CONFIG_GRGPIO_WIDTH "$CONFIG_GRGPIO_WIDTH" 8}
3982
        global CONFIG_GRGPIO_IMASK
3983
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {validate_hex CONFIG_GRGPIO_IMASK "$CONFIG_GRGPIO_IMASK" 0000}
3984
}
3985
 
3986
 
3987
proc menu22 {w title} {
3988
        set oldFocus [focus]
3989
        catch {focus .menu13}
3990
        catch {destroy $w; unregister_active 22}
3991
        toplevel $w -class Dialog
3992
        wm withdraw $w
3993
        global active_menus
3994
        set active_menus [lsort -integer [linsert $active_menus end 22]]
3995
        message $w.m -width 400 -aspect 300 -text \
3996
                "Serial interfaces; I2C, PS/2 and SPI  "  -relief raised
3997
        pack $w.m -pady 10 -side top -padx 10
3998
        wm title $w "Serial interfaces; I2C, PS/2 and SPI  "
3999
 
4000
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 22; break"
4001
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 22; menu23 .menu23 \"$title\""
4002
        frame $w.f
4003
        button $w.f.back -text "OK" \
4004
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 22"
4005
        button $w.f.next -text "Next" -underline 0\
4006
                -width 15 -command $nextscript
4007
        bind all  $nextscript
4008
        button $w.f.prev -text "Prev" -underline 0\
4009
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 22; menu21 .menu21 \"$title\""
4010
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 22; menu21 .menu21 \"$title\";break"
4011
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
4012
        pack $w.f -pady 10 -side bottom -anchor w -fill x
4013
        frame $w.topline -relief ridge -borderwidth 2 -height 2
4014
        pack $w.topline -side top -fill x
4015
 
4016
        frame $w.botline -relief ridge -borderwidth 2 -height 2
4017
        pack $w.botline -side bottom -fill x
4018
 
4019
        frame $w.config
4020
        pack $w.config -fill y -expand on
4021
 
4022
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
4023
        pack $w.config.vscroll -side right -fill y
4024
 
4025
        canvas $w.config.canvas -height 1\
4026
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
4027
                -width [expr [winfo screenwidth .] * 1 / 2]
4028
        frame $w.config.f
4029
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
4030
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
4031
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
4032
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
4033
        bind $w  "$w.config.canvas yview moveto 0;break;"
4034
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
4035
        pack $w.config.canvas -side right -fill y
4036
 
4037
 
4038
        bool $w.config.f 22 0 "Enable I2C master " CONFIG_I2C_ENABLE
4039
        bool $w.config.f 22 1 "Keyboard/mouse (PS2) interface  " CONFIG_PS2_ENABLE
4040
        bool $w.config.f 22 2 "Enable SPI controller " CONFIG_SPICTRL_ENABLE
4041
        int $w.config.f 22 3 "Slave select lines    " CONFIG_SPICTRL_SLVS
4042
        int $w.config.f 22 4 "FIFO depth (2^N)      " CONFIG_SPICTRL_FIFO
4043
        bool $w.config.f 22 5 "Enable slave select registers" CONFIG_SPICTRL_SLVREG
4044
 
4045
 
4046
 
4047
        focus $w
4048
        update_active
4049
        global winx; global winy
4050
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
4051
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
4052
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
4053
        update idletasks
4054
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
4055
 
4056
        $w.config.canvas configure \
4057
                -width [expr [winfo reqwidth $w.config.f] + 1]\
4058
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
4059
                         [expr [winfo reqheight $w.config.f] + 1]"
4060
 
4061
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
4062
        set scry [expr [winfo screenh $w] / 2]
4063
        set maxy [expr [winfo screenh $w] * 3 / 4]
4064
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
4065
        if [expr $winy + $canvtotal < $maxy] {
4066
                $w.config.canvas configure -height $canvtotal
4067
        } else {
4068
                $w.config.canvas configure -height [expr $scry - $winy]
4069
                }
4070
        }
4071
        update idletasks
4072
        if {[winfo exists $w]} then {
4073
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
4074
        wm minsize $w [winfo width $w] 100
4075
 
4076
        wm deiconify $w
4077
}
4078
}
4079
 
4080
proc update_menu22 {} {
4081
        global CONFIG_SPICTRL_ENABLE
4082
        global CONFIG_SPICTRL_SLVS
4083
        if {($CONFIG_SPICTRL_ENABLE == 1)} then {.menu22.config.f.x3.x configure -state normal -foreground [ cget .ref -foreground ]; .menu22.config.f.x3.l configure -state normal; } else {.menu22.config.f.x3.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu22.config.f.x3.l configure -state disabled}
4084
        global CONFIG_SPICTRL_FIFO
4085
        if {($CONFIG_SPICTRL_ENABLE == 1)} then {.menu22.config.f.x4.x configure -state normal -foreground [ cget .ref -foreground ]; .menu22.config.f.x4.l configure -state normal; } else {.menu22.config.f.x4.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu22.config.f.x4.l configure -state disabled}
4086
        global CONFIG_SPICTRL_SLVREG
4087
        if {($CONFIG_SPICTRL_ENABLE == 1)} then {
4088
        configure_entry .menu22.config.f.x5 normal {n l y}} else {configure_entry .menu22.config.f.x5 disabled {y n l}}
4089
}
4090
 
4091
 
4092
proc update_define_menu22 {} {
4093
        update_define_mainmenu
4094
        global CONFIG_MODULES
4095
        global CONFIG_SPICTRL_ENABLE
4096
        global CONFIG_SPICTRL_SLVS
4097
        if {($CONFIG_SPICTRL_ENABLE == 1)} then {validate_int CONFIG_SPICTRL_SLVS "$CONFIG_SPICTRL_SLVS" 1}
4098
        global CONFIG_SPICTRL_FIFO
4099
        if {($CONFIG_SPICTRL_ENABLE == 1)} then {validate_int CONFIG_SPICTRL_FIFO "$CONFIG_SPICTRL_FIFO" 1}
4100
        global CONFIG_SPICTRL_SLVREG
4101
        if {($CONFIG_SPICTRL_ENABLE == 1)} then {
4102
        set CONFIG_SPICTRL_SLVREG [expr $CONFIG_SPICTRL_SLVREG&15]} else {set CONFIG_SPICTRL_SLVREG [expr $CONFIG_SPICTRL_SLVREG|16]}
4103
}
4104
 
4105
 
4106
proc menu23 {w title} {
4107
        set oldFocus [focus]
4108
        catch {focus .menu13}
4109
        catch {destroy $w; unregister_active 23}
4110
        toplevel $w -class Dialog
4111
        wm withdraw $w
4112
        global active_menus
4113
        set active_menus [lsort -integer [linsert $active_menus end 23]]
4114
        message $w.m -width 400 -aspect 300 -text \
4115
                "LCD and VGA DAC  "  -relief raised
4116
        pack $w.m -pady 10 -side top -padx 10
4117
        wm title $w "LCD and VGA DAC  "
4118
 
4119
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 23; break"
4120
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 23; catch {destroy .menu13}; unregister_active 13; menu24 .menu24 \"$title\""
4121
        frame $w.f
4122
        button $w.f.back -text "OK" \
4123
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 23"
4124
        button $w.f.next -text "Next" -underline 0\
4125
                -width 15 -command $nextscript
4126
        bind all  $nextscript
4127
        button $w.f.prev -text "Prev" -underline 0\
4128
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 23; menu22 .menu22 \"$title\""
4129
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 23; menu22 .menu22 \"$title\";break"
4130
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
4131
        pack $w.f -pady 10 -side bottom -anchor w -fill x
4132
        frame $w.topline -relief ridge -borderwidth 2 -height 2
4133
        pack $w.topline -side top -fill x
4134
 
4135
        frame $w.botline -relief ridge -borderwidth 2 -height 2
4136
        pack $w.botline -side bottom -fill x
4137
 
4138
        frame $w.config
4139
        pack $w.config -fill y -expand on
4140
 
4141
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
4142
        pack $w.config.vscroll -side right -fill y
4143
 
4144
        canvas $w.config.canvas -height 1\
4145
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
4146
                -width [expr [winfo screenwidth .] * 1 / 2]
4147
        frame $w.config.f
4148
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
4149
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
4150
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
4151
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
4152
        bind $w  "$w.config.canvas yview moveto 0;break;"
4153
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
4154
        pack $w.config.canvas -side right -fill y
4155
 
4156
 
4157
        bool $w.config.f 23 0 "LCD graphical frame buffer  " CONFIG_LCD_ENABLE
4158
        bool $w.config.f 23 1 "LCD 3-wire and touch panel  " CONFIG_LCD3T_ENABLE
4159
        bool $w.config.f 23 2 "SVGA graphical frame buffer  " CONFIG_SVGA_ENABLE
4160
 
4161
 
4162
 
4163
        focus $w
4164
        update_active
4165
        global winx; global winy
4166
        if {[winfo exists .menu13] == 0} then {menu13 .menu13 "Peripherals             "}
4167
        set winx [expr [winfo x .menu13]+30]; set winy [expr [winfo y .menu13]+30]
4168
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
4169
        update idletasks
4170
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
4171
 
4172
        $w.config.canvas configure \
4173
                -width [expr [winfo reqwidth $w.config.f] + 1]\
4174
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
4175
                         [expr [winfo reqheight $w.config.f] + 1]"
4176
 
4177
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
4178
        set scry [expr [winfo screenh $w] / 2]
4179
        set maxy [expr [winfo screenh $w] * 3 / 4]
4180
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
4181
        if [expr $winy + $canvtotal < $maxy] {
4182
                $w.config.canvas configure -height $canvtotal
4183
        } else {
4184
                $w.config.canvas configure -height [expr $scry - $winy]
4185
                }
4186
        }
4187
        update idletasks
4188
        if {[winfo exists $w]} then {
4189
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
4190
        wm minsize $w [winfo width $w] 100
4191
 
4192
        wm deiconify $w
4193
}
4194
}
4195
 
4196
proc update_menu23 {} {
4197
}
4198
 
4199
 
4200
proc update_define_menu23 {} {
4201
        update_define_mainmenu
4202
        global CONFIG_MODULES
4203
}
4204
 
4205
 
4206
menu_option menu24 24 "VHDL Debugging        "
4207
proc menu24 {w title} {
4208
        set oldFocus [focus]
4209
        catch {destroy $w; unregister_active 24}
4210
        toplevel $w -class Dialog
4211
        wm withdraw $w
4212
        global active_menus
4213
        set active_menus [lsort -integer [linsert $active_menus end 24]]
4214
        message $w.m -width 400 -aspect 300 -text \
4215
                "VHDL Debugging        "  -relief raised
4216
        pack $w.m -pady 10 -side top -padx 10
4217
        wm title $w "VHDL Debugging        "
4218
 
4219
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 24; break"
4220
        set nextscript "catch {focus $oldFocus}; menu25 .menu25 \"$title\""
4221
        frame $w.f
4222
        button $w.f.back -text "Main Menu" \
4223
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 24"
4224
        button $w.f.next -text "Next" -underline 0\
4225
                -width 15 -command $nextscript
4226
        $w.f.next configure -state disabled
4227
        bind all  "puts \"no more menus\" "
4228
        button $w.f.prev -text "Prev" -underline 0\
4229
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 24; menu23 .menu23 \"$title\""
4230
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 24; menu23 .menu23 \"$title\";break"
4231
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
4232
        pack $w.f -pady 10 -side bottom -anchor w -fill x
4233
        frame $w.topline -relief ridge -borderwidth 2 -height 2
4234
        pack $w.topline -side top -fill x
4235
 
4236
        frame $w.botline -relief ridge -borderwidth 2 -height 2
4237
        pack $w.botline -side bottom -fill x
4238
 
4239
        frame $w.config
4240
        pack $w.config -fill y -expand on
4241
 
4242
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
4243
        pack $w.config.vscroll -side right -fill y
4244
 
4245
        canvas $w.config.canvas -height 1\
4246
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
4247
                -width [expr [winfo screenwidth .] * 1 / 2]
4248
        frame $w.config.f
4249
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
4250
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
4251
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
4252
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
4253
        bind $w  "$w.config.canvas yview moveto 0;break;"
4254
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
4255
        pack $w.config.canvas -side right -fill y
4256
 
4257
 
4258
        bool $w.config.f 24 0 "Accelerated UART tracing       " CONFIG_DEBUG_UART
4259
 
4260
 
4261
 
4262
        focus $w
4263
        update_active
4264
        global winx; global winy
4265
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
4266
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
4267
        update idletasks
4268
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
4269
 
4270
        $w.config.canvas configure \
4271
                -width [expr [winfo reqwidth $w.config.f] + 1]\
4272
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
4273
                         [expr [winfo reqheight $w.config.f] + 1]"
4274
 
4275
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
4276
        set scry [expr [winfo screenh $w] / 2]
4277
        set maxy [expr [winfo screenh $w] * 3 / 4]
4278
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
4279
        if [expr $winy + $canvtotal < $maxy] {
4280
                $w.config.canvas configure -height $canvtotal
4281
        } else {
4282
                $w.config.canvas configure -height [expr $scry - $winy]
4283
                }
4284
        }
4285
        update idletasks
4286
        if {[winfo exists $w]} then {
4287
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
4288
        wm minsize $w [winfo width $w] 100
4289
 
4290
        wm deiconify $w
4291
}
4292
}
4293
 
4294
proc update_menu24 {} {
4295
}
4296
 
4297
 
4298
proc update_define_menu24 {} {
4299
        update_define_mainmenu
4300
        global CONFIG_MODULES
4301
}
4302
 
4303
 
4304
proc update_mainmenu {}  {
4305
}
4306
 
4307
 
4308
set tmpvar_0 "(not set)"
4309
set CONFIG_SYN_INFERRED 0
4310
set CONFIG_SYN_STRATIX 0
4311
set CONFIG_SYN_STRATIXII 0
4312
set CONFIG_SYN_STRATIXIII 0
4313
set CONFIG_SYN_CYCLONEIII 0
4314
set CONFIG_SYN_ALTERA 0
4315
set CONFIG_SYN_AXCEL 0
4316
set CONFIG_SYN_PROASIC 0
4317
set CONFIG_SYN_PROASICPLUS 0
4318
set CONFIG_SYN_PROASIC3 0
4319
set CONFIG_SYN_UT025CRH 0
4320
set CONFIG_SYN_ATC18 0
4321
set CONFIG_SYN_ATC18RHA 0
4322
set CONFIG_SYN_CUSTOM1 0
4323
set CONFIG_SYN_EASIC90 0
4324
set CONFIG_SYN_IHP25 0
4325
set CONFIG_SYN_IHP25RH 0
4326
set CONFIG_SYN_LATTICE 0
4327
set CONFIG_SYN_ECLIPSE 0
4328
set CONFIG_SYN_PEREGRINE 0
4329
set CONFIG_SYN_RH_LIB18T 0
4330
set CONFIG_SYN_RHUMC 0
4331
set CONFIG_SYN_SPARTAN2 0
4332
set CONFIG_SYN_SPARTAN3 0
4333
set CONFIG_SYN_SPARTAN3E 0
4334
set CONFIG_SYN_VIRTEX 0
4335
set CONFIG_SYN_VIRTEXE 0
4336
set CONFIG_SYN_VIRTEX2 0
4337
set CONFIG_SYN_VIRTEX4 0
4338
set CONFIG_SYN_VIRTEX5 0
4339
set CONFIG_SYN_UMC 0
4340
set CONFIG_SYN_TSMC90 0
4341
set tmpvar_1 "(not set)"
4342
set CONFIG_MEM_INFERRED 0
4343
set CONFIG_MEM_UMC 0
4344
set CONFIG_MEM_RHUMC 0
4345
set CONFIG_MEM_ARTISAN 0
4346
set CONFIG_MEM_CUSTOM1 0
4347
set CONFIG_MEM_VIRAGE 0
4348
set CONFIG_MEM_VIRAGE90 0
4349
set CONFIG_SYN_INFER_RAM 0
4350
set CONFIG_SYN_INFER_PADS 0
4351
set CONFIG_SYN_NO_ASYNC 0
4352
set CONFIG_SYN_SCAN 0
4353
set tmpvar_2 "(not set)"
4354
set CONFIG_CLK_INFERRED 0
4355
set CONFIG_CLK_HCLKBUF 0
4356
set CONFIG_CLK_ALTDLL 0
4357
set CONFIG_CLK_LATDLL 0
4358
set CONFIG_CLK_PRO3PLL 0
4359
set CONFIG_CLK_LIB18T 0
4360
set CONFIG_CLK_RHUMC 0
4361
set CONFIG_CLK_CLKDLL 0
4362
set CONFIG_CLK_DCM 0
4363
set CONFIG_CLK_MUL 2
4364
set CONFIG_CLK_DIV 2
4365
set CONFIG_OCLK_DIV 2
4366
set CONFIG_PCI_CLKDLL 0
4367
set CONFIG_CLK_NOFB 0
4368
set CONFIG_PCI_SYSCLK 0
4369
set CONFIG_LEON3 0
4370
set CONFIG_PROC_NUM 1
4371
set CONFIG_IU_NWINDOWS 8
4372
set CONFIG_IU_V8MULDIV 0
4373
set tmpvar_3 "(not set)"
4374
set CONFIG_IU_MUL_LATENCY_2 0
4375
set CONFIG_IU_MUL_LATENCY_4 0
4376
set CONFIG_IU_MUL_LATENCY_5 0
4377
set CONFIG_IU_MUL_MAC 0
4378
set CONFIG_IU_SVT 0
4379
set CONFIG_IU_LDELAY 1
4380
set CONFIG_IU_WATCHPOINTS 0
4381
set CONFIG_PWD 0
4382
set CONFIG_IU_RSTADDR 00000
4383
set CONFIG_FPU_ENABLE 0
4384
set tmpvar_4 "(not set)"
4385
set CONFIG_FPU_GRFPU 0
4386
set CONFIG_FPU_GRFPULITE 0
4387
set CONFIG_FPU_MEIKO 0
4388
set tmpvar_5 "(not set)"
4389
set CONFIG_FPU_GRFPU_INFMUL 0
4390
set CONFIG_FPU_GRFPU_DWMUL 0
4391
set tmpvar_6 "(not set)"
4392
set CONFIG_FPU_GRFPC0 0
4393
set CONFIG_FPU_GRFPC1 0
4394
set CONFIG_FPU_GRFPC2 0
4395
set CONFIG_FPU_NETLIST 0
4396
set CONFIG_ICACHE_ENABLE 0
4397
set tmpvar_7 "(not set)"
4398
set CONFIG_ICACHE_ASSO1 0
4399
set CONFIG_ICACHE_ASSO2 0
4400
set CONFIG_ICACHE_ASSO3 0
4401
set CONFIG_ICACHE_ASSO4 0
4402
set tmpvar_8 "(not set)"
4403
set CONFIG_ICACHE_SZ1 0
4404
set CONFIG_ICACHE_SZ2 0
4405
set CONFIG_ICACHE_SZ4 0
4406
set CONFIG_ICACHE_SZ8 0
4407
set CONFIG_ICACHE_SZ16 0
4408
set CONFIG_ICACHE_SZ32 0
4409
set CONFIG_ICACHE_SZ64 0
4410
set CONFIG_ICACHE_SZ128 0
4411
set CONFIG_ICACHE_SZ256 0
4412
set tmpvar_9 "(not set)"
4413
set CONFIG_ICACHE_LZ16 0
4414
set CONFIG_ICACHE_LZ32 0
4415
set tmpvar_10 "(not set)"
4416
set CONFIG_ICACHE_ALGORND 0
4417
set CONFIG_ICACHE_ALGOLRR 0
4418
set CONFIG_ICACHE_ALGOLRU 0
4419
set CONFIG_ICACHE_LOCK 0
4420
set CONFIG_ICACHE_LRAM 0
4421
set tmpvar_11 "(not set)"
4422
set CONFIG_ICACHE_LRAM_SZ1 0
4423
set CONFIG_ICACHE_LRAM_SZ2 0
4424
set CONFIG_ICACHE_LRAM_SZ4 0
4425
set CONFIG_ICACHE_LRAM_SZ8 0
4426
set CONFIG_ICACHE_LRAM_SZ16 0
4427
set CONFIG_ICACHE_LRAM_SZ32 0
4428
set CONFIG_ICACHE_LRAM_SZ64 0
4429
set CONFIG_ICACHE_LRAM_SZ128 0
4430
set CONFIG_ICACHE_LRAM_SZ256 0
4431
set CONFIG_ICACHE_LRSTART 8e
4432
set CONFIG_DCACHE_ENABLE 0
4433
set tmpvar_12 "(not set)"
4434
set CONFIG_DCACHE_ASSO1 0
4435
set CONFIG_DCACHE_ASSO2 0
4436
set CONFIG_DCACHE_ASSO3 0
4437
set CONFIG_DCACHE_ASSO4 0
4438
set tmpvar_13 "(not set)"
4439
set CONFIG_DCACHE_SZ1 0
4440
set CONFIG_DCACHE_SZ2 0
4441
set CONFIG_DCACHE_SZ4 0
4442
set CONFIG_DCACHE_SZ8 0
4443
set CONFIG_DCACHE_SZ16 0
4444
set CONFIG_DCACHE_SZ32 0
4445
set CONFIG_DCACHE_SZ64 0
4446
set CONFIG_DCACHE_SZ128 0
4447
set CONFIG_DCACHE_SZ256 0
4448
set tmpvar_14 "(not set)"
4449
set CONFIG_DCACHE_LZ16 0
4450
set CONFIG_DCACHE_LZ32 0
4451
set tmpvar_15 "(not set)"
4452
set CONFIG_DCACHE_ALGORND 0
4453
set CONFIG_DCACHE_ALGOLRR 0
4454
set CONFIG_DCACHE_ALGOLRU 0
4455
set CONFIG_DCACHE_LOCK 0
4456
set CONFIG_DCACHE_SNOOP 0
4457
set CONFIG_DCACHE_SNOOP_FAST 0
4458
set CONFIG_DCACHE_SNOOP_SEPTAG 0
4459
set CONFIG_CACHE_FIXED 0
4460
set CONFIG_DCACHE_LRAM 0
4461
set tmpvar_16 "(not set)"
4462
set CONFIG_DCACHE_LRAM_SZ1 0
4463
set CONFIG_DCACHE_LRAM_SZ2 0
4464
set CONFIG_DCACHE_LRAM_SZ4 0
4465
set CONFIG_DCACHE_LRAM_SZ8 0
4466
set CONFIG_DCACHE_LRAM_SZ16 0
4467
set CONFIG_DCACHE_LRAM_SZ32 0
4468
set CONFIG_DCACHE_LRAM_SZ64 0
4469
set CONFIG_DCACHE_LRAM_SZ128 0
4470
set CONFIG_DCACHE_LRAM_SZ256 0
4471
set CONFIG_DCACHE_LRSTART 8f
4472
set CONFIG_MMU_ENABLE 0
4473
set tmpvar_17 "(not set)"
4474
set CONFIG_MMU_COMBINED 0
4475
set CONFIG_MMU_SPLIT 0
4476
set tmpvar_18 "(not set)"
4477
set CONFIG_MMU_REPARRAY 0
4478
set CONFIG_MMU_REPINCREMENT 0
4479
set tmpvar_19 "(not set)"
4480
set CONFIG_MMU_I2 0
4481
set CONFIG_MMU_I4 0
4482
set CONFIG_MMU_I8 0
4483
set CONFIG_MMU_I16 0
4484
set CONFIG_MMU_I32 0
4485
set tmpvar_20 "(not set)"
4486
set CONFIG_MMU_D2 0
4487
set CONFIG_MMU_D4 0
4488
set CONFIG_MMU_D8 0
4489
set CONFIG_MMU_D16 0
4490
set CONFIG_MMU_D32 0
4491
set CONFIG_MMU_FASTWB 0
4492
set CONFIG_DSU_ENABLE 0
4493
set CONFIG_DSU_ITRACE 0
4494
set tmpvar_21 "(not set)"
4495
set CONFIG_DSU_ITRACESZ1 0
4496
set CONFIG_DSU_ITRACESZ2 0
4497
set CONFIG_DSU_ITRACESZ4 0
4498
set CONFIG_DSU_ITRACESZ8 0
4499
set CONFIG_DSU_ITRACESZ16 0
4500
set CONFIG_DSU_ATRACE 0
4501
set tmpvar_22 "(not set)"
4502
set CONFIG_DSU_ATRACESZ1 0
4503
set CONFIG_DSU_ATRACESZ2 0
4504
set CONFIG_DSU_ATRACESZ4 0
4505
set CONFIG_DSU_ATRACESZ8 0
4506
set CONFIG_DSU_ATRACESZ16 0
4507
set CONFIG_IU_DISAS 0
4508
set CONFIG_IU_DISAS_NET 0
4509
set CONFIG_DEBUG_PC32 0
4510
set CONFIG_AHB_DEFMST 0
4511
set CONFIG_AHB_RROBIN 0
4512
set CONFIG_AHB_SPLIT 0
4513
set CONFIG_AHB_IOADDR FFF
4514
set CONFIG_APB_HADDR 800
4515
set CONFIG_AHB_MON 0
4516
set CONFIG_AHB_MONERR 0
4517
set CONFIG_AHB_MONWAR 0
4518
set CONFIG_DSU_UART 0
4519
set CONFIG_DSU_JTAG 0
4520
set CONFIG_DSU_ETH 0
4521
set tmpvar_24 "(not set)"
4522
set CONFIG_DSU_ETHSZ1 0
4523
set CONFIG_DSU_ETHSZ2 0
4524
set CONFIG_DSU_ETHSZ4 0
4525
set CONFIG_DSU_ETHSZ8 0
4526
set CONFIG_DSU_ETHSZ16 0
4527
set CONFIG_DSU_IPMSB C0A8
4528
set CONFIG_DSU_IPLSB 0033
4529
set CONFIG_DSU_ETHMSB 00007A
4530
set CONFIG_DSU_ETHLSB CC0001
4531
set CONFIG_DSU_ETH_PROG 0
4532
set CONFIG_MCTRL_LEON2 0
4533
set CONFIG_MCTRL_8BIT 0
4534
set CONFIG_MCTRL_16BIT 0
4535
set CONFIG_MCTRL_5CS 0
4536
set CONFIG_MCTRL_SDRAM 0
4537
set CONFIG_MCTRL_SDRAM_SEPBUS 0
4538
set CONFIG_MCTRL_SDRAM_BUS64 0
4539
set CONFIG_MCTRL_SDRAM_INVCLK 0
4540
set CONFIG_MCTRL_PAGE 0
4541
set CONFIG_MCTRL_PROGPAGE 0
4542
set CONFIG_SSCTRL 0
4543
set CONFIG_SSCTRL_PROM16 0
4544
set CONFIG_DDRSP 0
4545
set CONFIG_DDRSP_INIT 0
4546
set CONFIG_DDRSP_FREQ 100
4547
set CONFIG_DDRSP_COL 9
4548
set CONFIG_DDRSP_MBYTE 16
4549
set CONFIG_DDRSP_RSKEW 0
4550
set CONFIG_SPIMCTRL 0
4551
set CONFIG_SPIMCTRL_SDCARD 0
4552
set CONFIG_SPIMCTRL_READCMD 0B
4553
set CONFIG_SPIMCTRL_DUMMYBYTE 0
4554
set CONFIG_SPIMCTRL_DUALOUTPUT 0
4555
set CONFIG_SPIMCTRL_SCALER 1
4556
set CONFIG_SPIMCTRL_ASCALER 8
4557
set CONFIG_SPIMCTRL_PWRUPCNT 0
4558
set CONFIG_AHBROM_ENABLE 0
4559
set CONFIG_AHBROM_START 000
4560
set CONFIG_AHBROM_PIPE 0
4561
set CONFIG_AHBRAM_ENABLE 0
4562
set tmpvar_25 "(not set)"
4563
set CONFIG_AHBRAM_SZ1 0
4564
set CONFIG_AHBRAM_SZ2 0
4565
set CONFIG_AHBRAM_SZ4 0
4566
set CONFIG_AHBRAM_SZ8 0
4567
set CONFIG_AHBRAM_SZ16 0
4568
set CONFIG_AHBRAM_SZ32 0
4569
set CONFIG_AHBRAM_SZ64 0
4570
set CONFIG_AHBRAM_START A00
4571
set CONFIG_GRETH_ENABLE 0
4572
set CONFIG_GRETH_GIGA 0
4573
set tmpvar_26 "(not set)"
4574
set CONFIG_GRETH_FIFO4 0
4575
set CONFIG_GRETH_FIFO8 0
4576
set CONFIG_GRETH_FIFO16 0
4577
set CONFIG_GRETH_FIFO32 0
4578
set CONFIG_GRETH_FIFO64 0
4579
set CONFIG_UART1_ENABLE 0
4580
set tmpvar_27 "(not set)"
4581
set CONFIG_UA1_FIFO1 0
4582
set CONFIG_UA1_FIFO2 0
4583
set CONFIG_UA1_FIFO4 0
4584
set CONFIG_UA1_FIFO8 0
4585
set CONFIG_UA1_FIFO16 0
4586
set CONFIG_UA1_FIFO32 0
4587
set CONFIG_IRQ3_ENABLE 0
4588
set CONFIG_IRQ3_SEC 0
4589
set CONFIG_IRQ3_NSEC 12
4590
set CONFIG_GPT_ENABLE 0
4591
set CONFIG_GPT_NTIM 2
4592
set CONFIG_GPT_SW 8
4593
set CONFIG_GPT_TW 32
4594
set CONFIG_GPT_IRQ 8
4595
set CONFIG_GPT_SEPIRQ 0
4596
set CONFIG_GPT_WDOGEN 0
4597
set CONFIG_GPT_WDOG FFFF
4598
set CONFIG_GRGPIO_ENABLE 0
4599
set CONFIG_GRGPIO_WIDTH 8
4600
set CONFIG_GRGPIO_IMASK 0000
4601
set CONFIG_I2C_ENABLE 0
4602
set CONFIG_PS2_ENABLE 0
4603
set CONFIG_SPICTRL_ENABLE 0
4604
set CONFIG_SPICTRL_SLVS 1
4605
set CONFIG_SPICTRL_FIFO 1
4606
set CONFIG_SPICTRL_SLVREG 0
4607
set CONFIG_LCD_ENABLE 0
4608
set CONFIG_LCD3T_ENABLE 0
4609
set CONFIG_SVGA_ENABLE 0
4610
set CONFIG_DEBUG_UART 0
4611
set CONFIG_SYN_ARTISAN 4
4612
set CONFIG_PCI_ENABLE 4
4613
set CONFIG_HAS_SHARED_GRFPU 4
4614
set CONFIG_FPU_GRFPU_SH 4
4615
set CONFIG_LEON3FT_PRESENT 4
4616
set CONFIG_LEON3FT_EN 4
4617
set CONFIG_IUFT_NONE 4
4618
set CONFIG_IUFT_PAR 4
4619
set CONFIG_IUFT_DMR 4
4620
set CONFIG_IUFT_BCH 4
4621
set CONFIG_IUFT_TMR 4
4622
set CONFIG_FPUFT_EN 4
4623
set CONFIG_RF_ERRINJ 4
4624
set CONFIG_CACHE_FT_EN 4
4625
set CONFIG_CACHE_ERRINJ 4
4626
set CONFIG_LEON3_NETLIST 4
4627
set CONFIG_MODULES 4
4628
proc writeconfig {file1 file2} {
4629
        set cfg [open $file1 w]
4630
        set autocfg [open $file2 w]
4631
        set notmod 1
4632
        set notset 0
4633
        puts $cfg "#"
4634
        puts $cfg "# Automatically generated make config: don't edit"
4635
        puts $cfg "#"
4636
        puts $autocfg "/*"
4637
        puts $autocfg " * Automatically generated C config: don't edit"
4638
        puts $autocfg " */"
4639
        puts $autocfg "#define AUTOCONF_INCLUDED"
4640
        write_comment $cfg $autocfg "Synthesis      "
4641
        global tmpvar_0
4642
 
4643
        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 }
4644
        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 }
4645
        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 }
4646
        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 }
4647
        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 }
4648
        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 }
4649
        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 }
4650
        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 }
4651
        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 }
4652
        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 }
4653
        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 }
4654
        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 }
4655
        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 }
4656
        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 }
4657
        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 }
4658
        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 }
4659
        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 }
4660
        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 }
4661
        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 }
4662
        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 }
4663
        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 }
4664
        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 }
4665
        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 }
4666
        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 }
4667
        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 }
4668
        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 }
4669
        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 }
4670
        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 }
4671
        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 }
4672
        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 }
4673
        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 }
4674
        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 }
4675
        global tmpvar_1
4676
        global CONFIG_SYN_INFERRED
4677
        global CONFIG_SYN_CUSTOM1
4678
        global CONFIG_SYN_ATC18
4679
        global CONFIG_SYN_TSMC90
4680
        global CONFIG_SYN_UMC
4681
        global CONFIG_SYN_RHUMC
4682
        global CONFIG_SYN_ARTISAN
4683
        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 {
4684
        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 }
4685
        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 }
4686
        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 }
4687
        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 }
4688
        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 }
4689
        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 }
4690
        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 }}
4691
        global CONFIG_SYN_INFER_RAM
4692
        if {($CONFIG_SYN_INFERRED != 1)} then {write_tristate $cfg $autocfg CONFIG_SYN_INFER_RAM $CONFIG_SYN_INFER_RAM [list $notmod] 2 }
4693
        global CONFIG_SYN_INFER_PADS
4694
        if {($CONFIG_SYN_INFERRED != 1)} then {write_tristate $cfg $autocfg CONFIG_SYN_INFER_PADS $CONFIG_SYN_INFER_PADS [list $notmod] 2 }
4695
        global CONFIG_SYN_NO_ASYNC
4696
        write_tristate $cfg $autocfg CONFIG_SYN_NO_ASYNC $CONFIG_SYN_NO_ASYNC [list $notmod] 2
4697
        global CONFIG_SYN_SCAN
4698
        write_tristate $cfg $autocfg CONFIG_SYN_SCAN $CONFIG_SYN_SCAN [list $notmod] 2
4699
        write_comment $cfg $autocfg "Clock generation"
4700
        global tmpvar_2
4701
 
4702
        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 }
4703
        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 }
4704
        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 }
4705
        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 }
4706
        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 }
4707
        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 }
4708
        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 }
4709
        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 }
4710
        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 }
4711
        global CONFIG_CLK_MUL
4712
        global CONFIG_CLK_DCM
4713
        global CONFIG_CLK_ALTDLL
4714
        global CONFIG_CLK_LATDLL
4715
        global CONFIG_CLK_PRO3PLL
4716
        global CONFIG_CLK_CLKDLL
4717
        global CONFIG_CLK_LIB18T
4718
        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 }
4719
        global CONFIG_CLK_DIV
4720
        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 }
4721
        global CONFIG_OCLK_DIV
4722
        if {($CONFIG_CLK_PRO3PLL == 1)} then {write_int $cfg $autocfg CONFIG_OCLK_DIV $CONFIG_OCLK_DIV $notmod }
4723
        global CONFIG_PCI_CLKDLL
4724
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_CLKDLL $CONFIG_PCI_CLKDLL [list $notmod] 2 }
4725
        global CONFIG_CLK_NOFB
4726
        if {($CONFIG_CLK_DCM == 1)} then {write_tristate $cfg $autocfg CONFIG_CLK_NOFB $CONFIG_CLK_NOFB [list $notmod] 2 }
4727
        global CONFIG_PCI_SYSCLK
4728
        global CONFIG_PCI_ENABLE
4729
        if {($CONFIG_PCI_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_SYSCLK $CONFIG_PCI_SYSCLK [list $notmod] 2 }
4730
        global CONFIG_LEON3
4731
        write_tristate $cfg $autocfg CONFIG_LEON3 $CONFIG_LEON3 [list $notmod] 2
4732
        global CONFIG_PROC_NUM
4733
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_PROC_NUM $CONFIG_PROC_NUM $notmod }
4734
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Processor            "}
4735
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Integer unit                                           "}
4736
        global CONFIG_IU_NWINDOWS
4737
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_NWINDOWS $CONFIG_IU_NWINDOWS $notmod }
4738
        global CONFIG_IU_V8MULDIV
4739
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_V8MULDIV $CONFIG_IU_V8MULDIV [list $notmod] 2 }
4740
        global tmpvar_3
4741
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {
4742
        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 }
4743
        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 }
4744
        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 }}
4745
        global CONFIG_IU_MUL_MAC
4746
        global CONFIG_IU_MUL_LATENCY_4
4747
        global CONFIG_IU_MUL_LATENCY_5
4748
        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 }
4749
        global CONFIG_IU_SVT
4750
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_SVT $CONFIG_IU_SVT [list $notmod] 2 }
4751
        global CONFIG_IU_LDELAY
4752
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_LDELAY $CONFIG_IU_LDELAY $notmod }
4753
        global CONFIG_IU_WATCHPOINTS
4754
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_WATCHPOINTS $CONFIG_IU_WATCHPOINTS $notmod }
4755
        global CONFIG_PWD
4756
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_PWD $CONFIG_PWD [list $notmod] 2 }
4757
        global CONFIG_IU_RSTADDR
4758
        if {($CONFIG_LEON3 == 1)} then {write_hex $cfg $autocfg CONFIG_IU_RSTADDR $CONFIG_IU_RSTADDR $notmod }
4759
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Floating-point unit"}
4760
        global CONFIG_FPU_ENABLE
4761
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_FPU_ENABLE $CONFIG_FPU_ENABLE [list $notmod] 2 }
4762
        global tmpvar_4
4763
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
4764
        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 }
4765
        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 }
4766
        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 }}
4767
        global tmpvar_5
4768
        global CONFIG_FPU_GRFPU
4769
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPU == 1)} then {
4770
        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 }
4771
        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 }}
4772
        global tmpvar_6
4773
        global CONFIG_FPU_GRFPULITE
4774
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPULITE == 1)} then {
4775
        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 }
4776
        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 }
4777
        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 }}
4778
        global CONFIG_FPU_NETLIST
4779
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_FPU_NETLIST $CONFIG_FPU_NETLIST [list $notmod] 2 }
4780
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Cache system"}
4781
        global CONFIG_ICACHE_ENABLE
4782
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_ICACHE_ENABLE $CONFIG_ICACHE_ENABLE [list $notmod] 2 }
4783
        global tmpvar_7
4784
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
4785
        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 }
4786
        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 }
4787
        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 }
4788
        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 }}
4789
        global tmpvar_8
4790
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
4791
        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 }
4792
        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 }
4793
        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 }
4794
        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 }
4795
        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 }
4796
        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 }
4797
        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 }
4798
        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 }
4799
        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 }}
4800
        global tmpvar_9
4801
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
4802
        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 }
4803
        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 }}
4804
        global tmpvar_10
4805
        global CONFIG_ICACHE_ASSO1
4806
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {
4807
        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 }
4808
        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 }
4809
        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 }}
4810
        global CONFIG_ICACHE_LOCK
4811
        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 }
4812
        global CONFIG_ICACHE_LRAM
4813
        global CONFIG_MMU_ENABLE
4814
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM $CONFIG_ICACHE_LRAM [list $notmod] 2 }
4815
        global tmpvar_11
4816
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {
4817
        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 }
4818
        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 }
4819
        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 }
4820
        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 }
4821
        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 }
4822
        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 }
4823
        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 }
4824
        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 }
4825
        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 }}
4826
        global CONFIG_ICACHE_LRSTART
4827
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {write_hex $cfg $autocfg CONFIG_ICACHE_LRSTART $CONFIG_ICACHE_LRSTART $notmod }
4828
        global CONFIG_DCACHE_ENABLE
4829
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_ENABLE $CONFIG_DCACHE_ENABLE [list $notmod] 2 }
4830
        global tmpvar_12
4831
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
4832
        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 }
4833
        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 }
4834
        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 }
4835
        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 }}
4836
        global tmpvar_13
4837
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
4838
        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 }
4839
        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 }
4840
        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 }
4841
        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 }
4842
        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 }
4843
        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 }
4844
        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 }
4845
        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 }
4846
        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 }}
4847
        global tmpvar_14
4848
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
4849
        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 }
4850
        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 }}
4851
        global tmpvar_15
4852
        global CONFIG_DCACHE_ASSO1
4853
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {
4854
        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 }
4855
        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 }
4856
        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 }}
4857
        global CONFIG_DCACHE_LOCK
4858
        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 }
4859
        global CONFIG_DCACHE_SNOOP
4860
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_SNOOP $CONFIG_DCACHE_SNOOP [list $notmod] 2 }
4861
        global CONFIG_DCACHE_SNOOP_FAST
4862
        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 }
4863
        global CONFIG_DCACHE_SNOOP_SEPTAG
4864
        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 }
4865
        global CONFIG_CACHE_FIXED
4866
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1 || $CONFIG_DCACHE_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_CACHE_FIXED $CONFIG_CACHE_FIXED $notmod }
4867
        global CONFIG_DCACHE_LRAM
4868
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM $CONFIG_DCACHE_LRAM [list $notmod] 2 }
4869
        global tmpvar_16
4870
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {
4871
        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 }
4872
        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 }
4873
        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 }
4874
        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 }
4875
        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 }
4876
        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 }
4877
        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 }
4878
        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 }
4879
        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 }}
4880
        global CONFIG_DCACHE_LRSTART
4881
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {write_hex $cfg $autocfg CONFIG_DCACHE_LRSTART $CONFIG_DCACHE_LRSTART $notmod }
4882
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "MMU"}
4883
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_MMU_ENABLE $CONFIG_MMU_ENABLE [list $notmod] 2 }
4884
        global tmpvar_17
4885
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
4886
        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 }
4887
        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 }}
4888
        global tmpvar_18
4889
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
4890
        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 }
4891
        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 }}
4892
        global tmpvar_19
4893
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
4894
        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 }
4895
        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 }
4896
        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 }
4897
        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 }
4898
        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 }}
4899
        global tmpvar_20
4900
        global CONFIG_MMU_SPLIT
4901
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {
4902
        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 }
4903
        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 }
4904
        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 }
4905
        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 }
4906
        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 }}
4907
        global CONFIG_MMU_FASTWB
4908
        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 }
4909
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Debug Support Unit        "}
4910
        global CONFIG_DSU_ENABLE
4911
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ENABLE $CONFIG_DSU_ENABLE [list $notmod] 2 }
4912
        global CONFIG_DSU_ITRACE
4913
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ITRACE $CONFIG_DSU_ITRACE [list $notmod] 2 }
4914
        global tmpvar_21
4915
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ITRACE == 1)} then {
4916
        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 }
4917
        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 }
4918
        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 }
4919
        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 }
4920
        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 }}
4921
        global CONFIG_DSU_ATRACE
4922
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ATRACE $CONFIG_DSU_ATRACE [list $notmod] 2 }
4923
        global tmpvar_22
4924
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ATRACE == 1)} then {
4925
        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 }
4926
        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 }
4927
        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 }
4928
        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 }
4929
        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 }}
4930
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Fault-tolerance  "}
4931
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "VHDL debug settings       "}
4932
        global CONFIG_IU_DISAS
4933
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_DISAS $CONFIG_IU_DISAS [list $notmod] 2 }
4934
        global CONFIG_IU_DISAS_NET
4935
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_DISAS == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_DISAS_NET $CONFIG_IU_DISAS_NET [list $notmod] 2 }
4936
        global CONFIG_DEBUG_PC32
4937
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DEBUG_PC32 $CONFIG_DEBUG_PC32 [list $notmod] 2 }
4938
        write_comment $cfg $autocfg "AMBA configuration"
4939
        global CONFIG_AHB_DEFMST
4940
        write_int $cfg $autocfg CONFIG_AHB_DEFMST $CONFIG_AHB_DEFMST $notmod
4941
        global CONFIG_AHB_RROBIN
4942
        write_tristate $cfg $autocfg CONFIG_AHB_RROBIN $CONFIG_AHB_RROBIN [list $notmod] 2
4943
        global CONFIG_AHB_SPLIT
4944
        write_tristate $cfg $autocfg CONFIG_AHB_SPLIT $CONFIG_AHB_SPLIT [list $notmod] 2
4945
        global CONFIG_AHB_IOADDR
4946
        write_hex $cfg $autocfg CONFIG_AHB_IOADDR $CONFIG_AHB_IOADDR $notmod
4947
        global CONFIG_APB_HADDR
4948
        write_hex $cfg $autocfg CONFIG_APB_HADDR $CONFIG_APB_HADDR $notmod
4949
        global CONFIG_AHB_MON
4950
        write_tristate $cfg $autocfg CONFIG_AHB_MON $CONFIG_AHB_MON [list $notmod] 2
4951
        global CONFIG_AHB_MONERR
4952
        if {($CONFIG_AHB_MON == 1)} then {write_tristate $cfg $autocfg CONFIG_AHB_MONERR $CONFIG_AHB_MONERR [list $notmod] 2 }
4953
        global CONFIG_AHB_MONWAR
4954
        if {($CONFIG_AHB_MON == 1)} then {write_tristate $cfg $autocfg CONFIG_AHB_MONWAR $CONFIG_AHB_MONWAR [list $notmod] 2 }
4955
        write_comment $cfg $autocfg "Debug Link           "
4956
        global CONFIG_DSU_UART
4957
        write_tristate $cfg $autocfg CONFIG_DSU_UART $CONFIG_DSU_UART [list $notmod] 2
4958
        global CONFIG_DSU_JTAG
4959
        write_tristate $cfg $autocfg CONFIG_DSU_JTAG $CONFIG_DSU_JTAG [list $notmod] 2
4960
        global CONFIG_DSU_ETH
4961
        global CONFIG_GRETH_ENABLE
4962
        if {($CONFIG_GRETH_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ETH $CONFIG_DSU_ETH [list $notmod] 2 }
4963
        global tmpvar_24
4964
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {
4965
        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 }
4966
        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 }
4967
        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 }
4968
        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 }
4969
        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 }}
4970
        global CONFIG_DSU_IPMSB
4971
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_IPMSB $CONFIG_DSU_IPMSB $notmod }
4972
        global CONFIG_DSU_IPLSB
4973
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_IPLSB $CONFIG_DSU_IPLSB $notmod }
4974
        global CONFIG_DSU_ETHMSB
4975
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_ETHMSB $CONFIG_DSU_ETHMSB $notmod }
4976
        global CONFIG_DSU_ETHLSB
4977
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_DSU_ETH == 1)} then {write_hex $cfg $autocfg CONFIG_DSU_ETHLSB $CONFIG_DSU_ETHLSB $notmod }
4978
        global CONFIG_DSU_ETH_PROG
4979
        global CONFIG_GRETH_GIGA
4980
        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 }
4981
        write_comment $cfg $autocfg "Peripherals             "
4982
        write_comment $cfg $autocfg "Memory controllers             "
4983
        write_comment $cfg $autocfg "Leon2 memory controller        "
4984
        global CONFIG_MCTRL_LEON2
4985
        write_tristate $cfg $autocfg CONFIG_MCTRL_LEON2 $CONFIG_MCTRL_LEON2 [list $notmod] 2
4986
        global CONFIG_MCTRL_8BIT
4987
        if {($CONFIG_MCTRL_LEON2 == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_8BIT $CONFIG_MCTRL_8BIT [list $notmod] 2 }
4988
        global CONFIG_MCTRL_16BIT
4989
        if {($CONFIG_MCTRL_LEON2 == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_16BIT $CONFIG_MCTRL_16BIT [list $notmod] 2 }
4990
        global CONFIG_MCTRL_5CS
4991
        if {($CONFIG_MCTRL_LEON2 == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_5CS $CONFIG_MCTRL_5CS [list $notmod] 2 }
4992
        global CONFIG_MCTRL_SDRAM
4993
        if {($CONFIG_MCTRL_LEON2 == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_SDRAM $CONFIG_MCTRL_SDRAM [list $notmod] 2 }
4994
        global CONFIG_MCTRL_SDRAM_SEPBUS
4995
        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 }
4996
        global CONFIG_MCTRL_SDRAM_BUS64
4997
        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 }
4998
        global CONFIG_MCTRL_SDRAM_INVCLK
4999
        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 }
5000
        global CONFIG_MCTRL_PAGE
5001
        if {($CONFIG_MCTRL_LEON2 == 1) && ($CONFIG_MCTRL_SDRAM == 1)} then {write_tristate $cfg $autocfg CONFIG_MCTRL_PAGE $CONFIG_MCTRL_PAGE [list $notmod] 2 }
5002
        global CONFIG_MCTRL_PROGPAGE
5003
        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 }
5004
        write_comment $cfg $autocfg "Synchronous SRAM controller   "
5005
        global CONFIG_SSCTRL
5006
        write_tristate $cfg $autocfg CONFIG_SSCTRL $CONFIG_SSCTRL [list $notmod] 2
5007
        global CONFIG_SSCTRL_PROM16
5008
        if {($CONFIG_SSCTRL == 1)} then {write_tristate $cfg $autocfg CONFIG_SSCTRL_PROM16 $CONFIG_SSCTRL_PROM16 [list $notmod] 2 }
5009
        write_comment $cfg $autocfg "DDR266 SDRAM controller             "
5010
        global CONFIG_DDRSP
5011
        write_tristate $cfg $autocfg CONFIG_DDRSP $CONFIG_DDRSP [list $notmod] 2
5012
        global CONFIG_DDRSP_INIT
5013
        if {($CONFIG_DDRSP == 1)} then {write_tristate $cfg $autocfg CONFIG_DDRSP_INIT $CONFIG_DDRSP_INIT [list $notmod] 2 }
5014
        global CONFIG_DDRSP_FREQ
5015
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {write_int $cfg $autocfg CONFIG_DDRSP_FREQ $CONFIG_DDRSP_FREQ $notmod }
5016
        global CONFIG_DDRSP_COL
5017
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {write_int $cfg $autocfg CONFIG_DDRSP_COL $CONFIG_DDRSP_COL $notmod }
5018
        global CONFIG_DDRSP_MBYTE
5019
        if {($CONFIG_DDRSP == 1) && ($CONFIG_DDRSP_INIT == 1)} then {write_int $cfg $autocfg CONFIG_DDRSP_MBYTE $CONFIG_DDRSP_MBYTE $notmod }
5020
        global CONFIG_DDRSP_RSKEW
5021
        global CONFIG_SYN_VIRTEX2
5022
        global CONFIG_SYN_VIRTEX4
5023
        global CONFIG_SYN_SPARTAN3
5024
        global CONFIG_SYN_VIRTEX5
5025
        global CONFIG_SYN_SPARTAN3E
5026
        global CONFIG_SYN_CYCLONEIII
5027
        if {($CONFIG_DDRSP == 1) && ($CONFIG_SYN_VIRTEX2 == 1 || $CONFIG_SYN_VIRTEX4 == 1 || $CONFIG_SYN_SPARTAN3 == 1 || $CONFIG_SYN_VIRTEX5 == 1 || $CONFIG_SYN_SPARTAN3E == 1 || $CONFIG_SYN_CYCLONEIII == 1)} then {write_int $cfg $autocfg CONFIG_DDRSP_RSKEW $CONFIG_DDRSP_RSKEW $notmod }
5028
        write_comment $cfg $autocfg "SPI memory controller "
5029
        global CONFIG_SPIMCTRL
5030
        write_tristate $cfg $autocfg CONFIG_SPIMCTRL $CONFIG_SPIMCTRL [list $notmod] 2
5031
        global CONFIG_SPIMCTRL_SDCARD
5032
        if {($CONFIG_SPIMCTRL == 1)} then {write_tristate $cfg $autocfg CONFIG_SPIMCTRL_SDCARD $CONFIG_SPIMCTRL_SDCARD [list $notmod] 2 }
5033
        global CONFIG_SPIMCTRL_READCMD
5034
        if {($CONFIG_SPIMCTRL == 1) && ($CONFIG_SPIMCTRL_SDCARD != 1)} then {write_hex $cfg $autocfg CONFIG_SPIMCTRL_READCMD $CONFIG_SPIMCTRL_READCMD $notmod }
5035
        global CONFIG_SPIMCTRL_DUMMYBYTE
5036
        if {($CONFIG_SPIMCTRL == 1) && ($CONFIG_SPIMCTRL_SDCARD != 1)} then {write_tristate $cfg $autocfg CONFIG_SPIMCTRL_DUMMYBYTE $CONFIG_SPIMCTRL_DUMMYBYTE [list $notmod] 2 }
5037
        global CONFIG_SPIMCTRL_DUALOUTPUT
5038
        if {($CONFIG_SPIMCTRL == 1) && ($CONFIG_SPIMCTRL_SDCARD != 1)} then {write_tristate $cfg $autocfg CONFIG_SPIMCTRL_DUALOUTPUT $CONFIG_SPIMCTRL_DUALOUTPUT [list $notmod] 2 }
5039
        global CONFIG_SPIMCTRL_SCALER
5040
        if {($CONFIG_SPIMCTRL == 1)} then {write_int $cfg $autocfg CONFIG_SPIMCTRL_SCALER $CONFIG_SPIMCTRL_SCALER $notmod }
5041
        global CONFIG_SPIMCTRL_ASCALER
5042
        if {($CONFIG_SPIMCTRL == 1)} then {write_int $cfg $autocfg CONFIG_SPIMCTRL_ASCALER $CONFIG_SPIMCTRL_ASCALER $notmod }
5043
        global CONFIG_SPIMCTRL_PWRUPCNT
5044
        if {($CONFIG_SPIMCTRL == 1)} then {write_int $cfg $autocfg CONFIG_SPIMCTRL_PWRUPCNT $CONFIG_SPIMCTRL_PWRUPCNT $notmod }
5045
        write_comment $cfg $autocfg "On-chip RAM/ROM                 "
5046
        global CONFIG_AHBROM_ENABLE
5047
        write_tristate $cfg $autocfg CONFIG_AHBROM_ENABLE $CONFIG_AHBROM_ENABLE [list $notmod] 2
5048
        global CONFIG_AHBROM_START
5049
        if {($CONFIG_AHBROM_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_AHBROM_START $CONFIG_AHBROM_START $notmod }
5050
        global CONFIG_AHBROM_PIPE
5051
        if {($CONFIG_AHBROM_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_AHBROM_PIPE $CONFIG_AHBROM_PIPE [list $notmod] 2 }
5052
        global CONFIG_AHBRAM_ENABLE
5053
        write_tristate $cfg $autocfg CONFIG_AHBRAM_ENABLE $CONFIG_AHBRAM_ENABLE [list $notmod] 2
5054
        global tmpvar_25
5055
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {
5056
        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 }
5057
        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 }
5058
        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 }
5059
        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 }
5060
        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 }
5061
        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 }
5062
        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 }}
5063
        global CONFIG_AHBRAM_START
5064
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_AHBRAM_START $CONFIG_AHBRAM_START $notmod }
5065
        write_comment $cfg $autocfg "Ethernet             "
5066
        write_tristate $cfg $autocfg CONFIG_GRETH_ENABLE $CONFIG_GRETH_ENABLE [list $notmod] 2
5067
        if {($CONFIG_GRETH_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_GRETH_GIGA $CONFIG_GRETH_GIGA [list $notmod] 2 }
5068
        global tmpvar_26
5069
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_GRETH_GIGA == 0)} then {
5070
        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 }
5071
        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 }
5072
        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 }
5073
        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 }
5074
        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 }}
5075
        write_comment $cfg $autocfg "UARTs, timers and irq control         "
5076
        global CONFIG_UART1_ENABLE
5077
        write_tristate $cfg $autocfg CONFIG_UART1_ENABLE $CONFIG_UART1_ENABLE [list $notmod] 2
5078
        global tmpvar_27
5079
        if {($CONFIG_UART1_ENABLE == 1)} then {
5080
        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 }
5081
        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 }
5082
        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 }
5083
        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 }
5084
        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 }
5085
        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 }}
5086
        global CONFIG_IRQ3_ENABLE
5087
        write_tristate $cfg $autocfg CONFIG_IRQ3_ENABLE $CONFIG_IRQ3_ENABLE [list $notmod] 2
5088
        global CONFIG_IRQ3_SEC
5089
        if {($CONFIG_IRQ3_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_IRQ3_SEC $CONFIG_IRQ3_SEC [list $notmod] 2 }
5090
        global CONFIG_IRQ3_NSEC
5091
        if {($CONFIG_IRQ3_ENABLE == 1) && ($CONFIG_IRQ3_SEC == 1)} then {write_int $cfg $autocfg CONFIG_IRQ3_NSEC $CONFIG_IRQ3_NSEC $notmod }
5092
        global CONFIG_GPT_ENABLE
5093
        write_tristate $cfg $autocfg CONFIG_GPT_ENABLE $CONFIG_GPT_ENABLE [list $notmod] 2
5094
        global CONFIG_GPT_NTIM
5095
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_NTIM $CONFIG_GPT_NTIM $notmod }
5096
        global CONFIG_GPT_SW
5097
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_SW $CONFIG_GPT_SW $notmod }
5098
        global CONFIG_GPT_TW
5099
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_TW $CONFIG_GPT_TW $notmod }
5100
        global CONFIG_GPT_IRQ
5101
        if {($CONFIG_GPT_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GPT_IRQ $CONFIG_GPT_IRQ $notmod }
5102
        global CONFIG_GPT_SEPIRQ
5103
        if {($CONFIG_GPT_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_GPT_SEPIRQ $CONFIG_GPT_SEPIRQ [list $notmod] 2 }
5104
        global CONFIG_GPT_WDOGEN
5105
        if {($CONFIG_GPT_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_GPT_WDOGEN $CONFIG_GPT_WDOGEN [list $notmod] 2 }
5106
        global CONFIG_GPT_WDOG
5107
        if {($CONFIG_GPT_ENABLE == 1) && ($CONFIG_GPT_WDOGEN == 1)} then {write_hex $cfg $autocfg CONFIG_GPT_WDOG $CONFIG_GPT_WDOG $notmod }
5108
        global CONFIG_GRGPIO_ENABLE
5109
        write_tristate $cfg $autocfg CONFIG_GRGPIO_ENABLE $CONFIG_GRGPIO_ENABLE [list $notmod] 2
5110
        global CONFIG_GRGPIO_WIDTH
5111
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_GRGPIO_WIDTH $CONFIG_GRGPIO_WIDTH $notmod }
5112
        global CONFIG_GRGPIO_IMASK
5113
        if {($CONFIG_GRGPIO_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_GRGPIO_IMASK $CONFIG_GRGPIO_IMASK $notmod }
5114
        write_comment $cfg $autocfg "Serial interfaces; I2C, PS/2 and SPI  "
5115
        global CONFIG_I2C_ENABLE
5116
        write_tristate $cfg $autocfg CONFIG_I2C_ENABLE $CONFIG_I2C_ENABLE [list $notmod] 2
5117
        global CONFIG_PS2_ENABLE
5118
        write_tristate $cfg $autocfg CONFIG_PS2_ENABLE $CONFIG_PS2_ENABLE [list $notmod] 2
5119
        global CONFIG_SPICTRL_ENABLE
5120
        write_tristate $cfg $autocfg CONFIG_SPICTRL_ENABLE $CONFIG_SPICTRL_ENABLE [list $notmod] 2
5121
        global CONFIG_SPICTRL_SLVS
5122
        if {($CONFIG_SPICTRL_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_SPICTRL_SLVS $CONFIG_SPICTRL_SLVS $notmod }
5123
        global CONFIG_SPICTRL_FIFO
5124
        if {($CONFIG_SPICTRL_ENABLE == 1)} then {write_int $cfg $autocfg CONFIG_SPICTRL_FIFO $CONFIG_SPICTRL_FIFO $notmod }
5125
        global CONFIG_SPICTRL_SLVREG
5126
        if {($CONFIG_SPICTRL_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_SPICTRL_SLVREG $CONFIG_SPICTRL_SLVREG [list $notmod] 2 }
5127
        write_comment $cfg $autocfg "LCD and VGA DAC  "
5128
        global CONFIG_LCD_ENABLE
5129
        write_tristate $cfg $autocfg CONFIG_LCD_ENABLE $CONFIG_LCD_ENABLE [list $notmod] 2
5130
        global CONFIG_LCD3T_ENABLE
5131
        write_tristate $cfg $autocfg CONFIG_LCD3T_ENABLE $CONFIG_LCD3T_ENABLE [list $notmod] 2
5132
        global CONFIG_SVGA_ENABLE
5133
        write_tristate $cfg $autocfg CONFIG_SVGA_ENABLE $CONFIG_SVGA_ENABLE [list $notmod] 2
5134
        write_comment $cfg $autocfg "VHDL Debugging        "
5135
        global CONFIG_DEBUG_UART
5136
        write_tristate $cfg $autocfg CONFIG_DEBUG_UART $CONFIG_DEBUG_UART [list $notmod] 2
5137
        close $cfg
5138
        close $autocfg
5139
}
5140
 
5141
 
5142
proc clear_choices { } {
5143
        global CONFIG_SYN_INFERRED; set CONFIG_SYN_INFERRED 0
5144
        global CONFIG_SYN_STRATIX; set CONFIG_SYN_STRATIX 0
5145
        global CONFIG_SYN_STRATIXII; set CONFIG_SYN_STRATIXII 0
5146
        global CONFIG_SYN_STRATIXIII; set CONFIG_SYN_STRATIXIII 0
5147
        global CONFIG_SYN_CYCLONEIII; set CONFIG_SYN_CYCLONEIII 0
5148
        global CONFIG_SYN_ALTERA; set CONFIG_SYN_ALTERA 0
5149
        global CONFIG_SYN_AXCEL; set CONFIG_SYN_AXCEL 0
5150
        global CONFIG_SYN_PROASIC; set CONFIG_SYN_PROASIC 0
5151
        global CONFIG_SYN_PROASICPLUS; set CONFIG_SYN_PROASICPLUS 0
5152
        global CONFIG_SYN_PROASIC3; set CONFIG_SYN_PROASIC3 0
5153
        global CONFIG_SYN_UT025CRH; set CONFIG_SYN_UT025CRH 0
5154
        global CONFIG_SYN_ATC18; set CONFIG_SYN_ATC18 0
5155
        global CONFIG_SYN_ATC18RHA; set CONFIG_SYN_ATC18RHA 0
5156
        global CONFIG_SYN_CUSTOM1; set CONFIG_SYN_CUSTOM1 0
5157
        global CONFIG_SYN_EASIC90; set CONFIG_SYN_EASIC90 0
5158
        global CONFIG_SYN_IHP25; set CONFIG_SYN_IHP25 0
5159
        global CONFIG_SYN_IHP25RH; set CONFIG_SYN_IHP25RH 0
5160
        global CONFIG_SYN_LATTICE; set CONFIG_SYN_LATTICE 0
5161
        global CONFIG_SYN_ECLIPSE; set CONFIG_SYN_ECLIPSE 0
5162
        global CONFIG_SYN_PEREGRINE; set CONFIG_SYN_PEREGRINE 0
5163
        global CONFIG_SYN_RH_LIB18T; set CONFIG_SYN_RH_LIB18T 0
5164
        global CONFIG_SYN_RHUMC; set CONFIG_SYN_RHUMC 0
5165
        global CONFIG_SYN_SPARTAN2; set CONFIG_SYN_SPARTAN2 0
5166
        global CONFIG_SYN_SPARTAN3; set CONFIG_SYN_SPARTAN3 0
5167
        global CONFIG_SYN_SPARTAN3E; set CONFIG_SYN_SPARTAN3E 0
5168
        global CONFIG_SYN_VIRTEX; set CONFIG_SYN_VIRTEX 0
5169
        global CONFIG_SYN_VIRTEXE; set CONFIG_SYN_VIRTEXE 0
5170
        global CONFIG_SYN_VIRTEX2; set CONFIG_SYN_VIRTEX2 0
5171
        global CONFIG_SYN_VIRTEX4; set CONFIG_SYN_VIRTEX4 0
5172
        global CONFIG_SYN_VIRTEX5; set CONFIG_SYN_VIRTEX5 0
5173
        global CONFIG_SYN_UMC; set CONFIG_SYN_UMC 0
5174
        global CONFIG_SYN_TSMC90; set CONFIG_SYN_TSMC90 0
5175
        global CONFIG_MEM_INFERRED; set CONFIG_MEM_INFERRED 0
5176
        global CONFIG_MEM_UMC; set CONFIG_MEM_UMC 0
5177
        global CONFIG_MEM_RHUMC; set CONFIG_MEM_RHUMC 0
5178
        global CONFIG_MEM_ARTISAN; set CONFIG_MEM_ARTISAN 0
5179
        global CONFIG_MEM_CUSTOM1; set CONFIG_MEM_CUSTOM1 0
5180
        global CONFIG_MEM_VIRAGE; set CONFIG_MEM_VIRAGE 0
5181
        global CONFIG_MEM_VIRAGE90; set CONFIG_MEM_VIRAGE90 0
5182
        global CONFIG_CLK_INFERRED; set CONFIG_CLK_INFERRED 0
5183
        global CONFIG_CLK_HCLKBUF; set CONFIG_CLK_HCLKBUF 0
5184
        global CONFIG_CLK_ALTDLL; set CONFIG_CLK_ALTDLL 0
5185
        global CONFIG_CLK_LATDLL; set CONFIG_CLK_LATDLL 0
5186
        global CONFIG_CLK_PRO3PLL; set CONFIG_CLK_PRO3PLL 0
5187
        global CONFIG_CLK_LIB18T; set CONFIG_CLK_LIB18T 0
5188
        global CONFIG_CLK_RHUMC; set CONFIG_CLK_RHUMC 0
5189
        global CONFIG_CLK_CLKDLL; set CONFIG_CLK_CLKDLL 0
5190
        global CONFIG_CLK_DCM; set CONFIG_CLK_DCM 0
5191
        global CONFIG_IU_MUL_LATENCY_2; set CONFIG_IU_MUL_LATENCY_2 0
5192
        global CONFIG_IU_MUL_LATENCY_4; set CONFIG_IU_MUL_LATENCY_4 0
5193
        global CONFIG_IU_MUL_LATENCY_5; set CONFIG_IU_MUL_LATENCY_5 0
5194
        global CONFIG_FPU_GRFPU; set CONFIG_FPU_GRFPU 0
5195
        global CONFIG_FPU_GRFPULITE; set CONFIG_FPU_GRFPULITE 0
5196
        global CONFIG_FPU_MEIKO; set CONFIG_FPU_MEIKO 0
5197
        global CONFIG_FPU_GRFPU_INFMUL; set CONFIG_FPU_GRFPU_INFMUL 0
5198
        global CONFIG_FPU_GRFPU_DWMUL; set CONFIG_FPU_GRFPU_DWMUL 0
5199
        global CONFIG_FPU_GRFPC0; set CONFIG_FPU_GRFPC0 0
5200
        global CONFIG_FPU_GRFPC1; set CONFIG_FPU_GRFPC1 0
5201
        global CONFIG_FPU_GRFPC2; set CONFIG_FPU_GRFPC2 0
5202
        global CONFIG_ICACHE_ASSO1; set CONFIG_ICACHE_ASSO1 0
5203
        global CONFIG_ICACHE_ASSO2; set CONFIG_ICACHE_ASSO2 0
5204
        global CONFIG_ICACHE_ASSO3; set CONFIG_ICACHE_ASSO3 0
5205
        global CONFIG_ICACHE_ASSO4; set CONFIG_ICACHE_ASSO4 0
5206
        global CONFIG_ICACHE_SZ1; set CONFIG_ICACHE_SZ1 0
5207
        global CONFIG_ICACHE_SZ2; set CONFIG_ICACHE_SZ2 0
5208
        global CONFIG_ICACHE_SZ4; set CONFIG_ICACHE_SZ4 0
5209
        global CONFIG_ICACHE_SZ8; set CONFIG_ICACHE_SZ8 0
5210
        global CONFIG_ICACHE_SZ16; set CONFIG_ICACHE_SZ16 0
5211
        global CONFIG_ICACHE_SZ32; set CONFIG_ICACHE_SZ32 0
5212
        global CONFIG_ICACHE_SZ64; set CONFIG_ICACHE_SZ64 0
5213
        global CONFIG_ICACHE_SZ128; set CONFIG_ICACHE_SZ128 0
5214
        global CONFIG_ICACHE_SZ256; set CONFIG_ICACHE_SZ256 0
5215
        global CONFIG_ICACHE_LZ16; set CONFIG_ICACHE_LZ16 0
5216
        global CONFIG_ICACHE_LZ32; set CONFIG_ICACHE_LZ32 0
5217
        global CONFIG_ICACHE_ALGORND; set CONFIG_ICACHE_ALGORND 0
5218
        global CONFIG_ICACHE_ALGOLRR; set CONFIG_ICACHE_ALGOLRR 0
5219
        global CONFIG_ICACHE_ALGOLRU; set CONFIG_ICACHE_ALGOLRU 0
5220
        global CONFIG_ICACHE_LRAM_SZ1; set CONFIG_ICACHE_LRAM_SZ1 0
5221
        global CONFIG_ICACHE_LRAM_SZ2; set CONFIG_ICACHE_LRAM_SZ2 0
5222
        global CONFIG_ICACHE_LRAM_SZ4; set CONFIG_ICACHE_LRAM_SZ4 0
5223
        global CONFIG_ICACHE_LRAM_SZ8; set CONFIG_ICACHE_LRAM_SZ8 0
5224
        global CONFIG_ICACHE_LRAM_SZ16; set CONFIG_ICACHE_LRAM_SZ16 0
5225
        global CONFIG_ICACHE_LRAM_SZ32; set CONFIG_ICACHE_LRAM_SZ32 0
5226
        global CONFIG_ICACHE_LRAM_SZ64; set CONFIG_ICACHE_LRAM_SZ64 0
5227
        global CONFIG_ICACHE_LRAM_SZ128; set CONFIG_ICACHE_LRAM_SZ128 0
5228
        global CONFIG_ICACHE_LRAM_SZ256; set CONFIG_ICACHE_LRAM_SZ256 0
5229
        global CONFIG_DCACHE_ASSO1; set CONFIG_DCACHE_ASSO1 0
5230
        global CONFIG_DCACHE_ASSO2; set CONFIG_DCACHE_ASSO2 0
5231
        global CONFIG_DCACHE_ASSO3; set CONFIG_DCACHE_ASSO3 0
5232
        global CONFIG_DCACHE_ASSO4; set CONFIG_DCACHE_ASSO4 0
5233
        global CONFIG_DCACHE_SZ1; set CONFIG_DCACHE_SZ1 0
5234
        global CONFIG_DCACHE_SZ2; set CONFIG_DCACHE_SZ2 0
5235
        global CONFIG_DCACHE_SZ4; set CONFIG_DCACHE_SZ4 0
5236
        global CONFIG_DCACHE_SZ8; set CONFIG_DCACHE_SZ8 0
5237
        global CONFIG_DCACHE_SZ16; set CONFIG_DCACHE_SZ16 0
5238
        global CONFIG_DCACHE_SZ32; set CONFIG_DCACHE_SZ32 0
5239
        global CONFIG_DCACHE_SZ64; set CONFIG_DCACHE_SZ64 0
5240
        global CONFIG_DCACHE_SZ128; set CONFIG_DCACHE_SZ128 0
5241
        global CONFIG_DCACHE_SZ256; set CONFIG_DCACHE_SZ256 0
5242
        global CONFIG_DCACHE_LZ16; set CONFIG_DCACHE_LZ16 0
5243
        global CONFIG_DCACHE_LZ32; set CONFIG_DCACHE_LZ32 0
5244
        global CONFIG_DCACHE_ALGORND; set CONFIG_DCACHE_ALGORND 0
5245
        global CONFIG_DCACHE_ALGOLRR; set CONFIG_DCACHE_ALGOLRR 0
5246
        global CONFIG_DCACHE_ALGOLRU; set CONFIG_DCACHE_ALGOLRU 0
5247
        global CONFIG_DCACHE_LRAM_SZ1; set CONFIG_DCACHE_LRAM_SZ1 0
5248
        global CONFIG_DCACHE_LRAM_SZ2; set CONFIG_DCACHE_LRAM_SZ2 0
5249
        global CONFIG_DCACHE_LRAM_SZ4; set CONFIG_DCACHE_LRAM_SZ4 0
5250
        global CONFIG_DCACHE_LRAM_SZ8; set CONFIG_DCACHE_LRAM_SZ8 0
5251
        global CONFIG_DCACHE_LRAM_SZ16; set CONFIG_DCACHE_LRAM_SZ16 0
5252
        global CONFIG_DCACHE_LRAM_SZ32; set CONFIG_DCACHE_LRAM_SZ32 0
5253
        global CONFIG_DCACHE_LRAM_SZ64; set CONFIG_DCACHE_LRAM_SZ64 0
5254
        global CONFIG_DCACHE_LRAM_SZ128; set CONFIG_DCACHE_LRAM_SZ128 0
5255
        global CONFIG_DCACHE_LRAM_SZ256; set CONFIG_DCACHE_LRAM_SZ256 0
5256
        global CONFIG_MMU_COMBINED; set CONFIG_MMU_COMBINED 0
5257
        global CONFIG_MMU_SPLIT; set CONFIG_MMU_SPLIT 0
5258
        global CONFIG_MMU_REPARRAY; set CONFIG_MMU_REPARRAY 0
5259
        global CONFIG_MMU_REPINCREMENT; set CONFIG_MMU_REPINCREMENT 0
5260
        global CONFIG_MMU_I2; set CONFIG_MMU_I2 0
5261
        global CONFIG_MMU_I4; set CONFIG_MMU_I4 0
5262
        global CONFIG_MMU_I8; set CONFIG_MMU_I8 0
5263
        global CONFIG_MMU_I16; set CONFIG_MMU_I16 0
5264
        global CONFIG_MMU_I32; set CONFIG_MMU_I32 0
5265
        global CONFIG_MMU_D2; set CONFIG_MMU_D2 0
5266
        global CONFIG_MMU_D4; set CONFIG_MMU_D4 0
5267
        global CONFIG_MMU_D8; set CONFIG_MMU_D8 0
5268
        global CONFIG_MMU_D16; set CONFIG_MMU_D16 0
5269
        global CONFIG_MMU_D32; set CONFIG_MMU_D32 0
5270
        global CONFIG_DSU_ITRACESZ1; set CONFIG_DSU_ITRACESZ1 0
5271
        global CONFIG_DSU_ITRACESZ2; set CONFIG_DSU_ITRACESZ2 0
5272
        global CONFIG_DSU_ITRACESZ4; set CONFIG_DSU_ITRACESZ4 0
5273
        global CONFIG_DSU_ITRACESZ8; set CONFIG_DSU_ITRACESZ8 0
5274
        global CONFIG_DSU_ITRACESZ16; set CONFIG_DSU_ITRACESZ16 0
5275
        global CONFIG_DSU_ATRACESZ1; set CONFIG_DSU_ATRACESZ1 0
5276
        global CONFIG_DSU_ATRACESZ2; set CONFIG_DSU_ATRACESZ2 0
5277
        global CONFIG_DSU_ATRACESZ4; set CONFIG_DSU_ATRACESZ4 0
5278
        global CONFIG_DSU_ATRACESZ8; set CONFIG_DSU_ATRACESZ8 0
5279
        global CONFIG_DSU_ATRACESZ16; set CONFIG_DSU_ATRACESZ16 0
5280
        global CONFIG_DSU_ETHSZ1; set CONFIG_DSU_ETHSZ1 0
5281
        global CONFIG_DSU_ETHSZ2; set CONFIG_DSU_ETHSZ2 0
5282
        global CONFIG_DSU_ETHSZ4; set CONFIG_DSU_ETHSZ4 0
5283
        global CONFIG_DSU_ETHSZ8; set CONFIG_DSU_ETHSZ8 0
5284
        global CONFIG_DSU_ETHSZ16; set CONFIG_DSU_ETHSZ16 0
5285
        global CONFIG_AHBRAM_SZ1; set CONFIG_AHBRAM_SZ1 0
5286
        global CONFIG_AHBRAM_SZ2; set CONFIG_AHBRAM_SZ2 0
5287
        global CONFIG_AHBRAM_SZ4; set CONFIG_AHBRAM_SZ4 0
5288
        global CONFIG_AHBRAM_SZ8; set CONFIG_AHBRAM_SZ8 0
5289
        global CONFIG_AHBRAM_SZ16; set CONFIG_AHBRAM_SZ16 0
5290
        global CONFIG_AHBRAM_SZ32; set CONFIG_AHBRAM_SZ32 0
5291
        global CONFIG_AHBRAM_SZ64; set CONFIG_AHBRAM_SZ64 0
5292
        global CONFIG_GRETH_FIFO4; set CONFIG_GRETH_FIFO4 0
5293
        global CONFIG_GRETH_FIFO8; set CONFIG_GRETH_FIFO8 0
5294
        global CONFIG_GRETH_FIFO16; set CONFIG_GRETH_FIFO16 0
5295
        global CONFIG_GRETH_FIFO32; set CONFIG_GRETH_FIFO32 0
5296
        global CONFIG_GRETH_FIFO64; set CONFIG_GRETH_FIFO64 0
5297
        global CONFIG_UA1_FIFO1; set CONFIG_UA1_FIFO1 0
5298
        global CONFIG_UA1_FIFO2; set CONFIG_UA1_FIFO2 0
5299
        global CONFIG_UA1_FIFO4; set CONFIG_UA1_FIFO4 0
5300
        global CONFIG_UA1_FIFO8; set CONFIG_UA1_FIFO8 0
5301
        global CONFIG_UA1_FIFO16; set CONFIG_UA1_FIFO16 0
5302
        global CONFIG_UA1_FIFO32; set CONFIG_UA1_FIFO32 0
5303
}
5304
 
5305
 
5306
proc update_choices { } {
5307
        global tmpvar_0
5308
        set tmpvar_0 "Inferred"
5309
        global CONFIG_SYN_INFERRED
5310
        if { $CONFIG_SYN_INFERRED == 1 } then { set tmpvar_0 "Inferred" }
5311
        global CONFIG_SYN_STRATIX
5312
        if { $CONFIG_SYN_STRATIX == 1 } then { set tmpvar_0 "Altera-Stratix" }
5313
        global CONFIG_SYN_STRATIXII
5314
        if { $CONFIG_SYN_STRATIXII == 1 } then { set tmpvar_0 "Altera-StratixII" }
5315
        global CONFIG_SYN_STRATIXIII
5316
        if { $CONFIG_SYN_STRATIXIII == 1 } then { set tmpvar_0 "Altera-StratixIII" }
5317
        global CONFIG_SYN_CYCLONEIII
5318
        if { $CONFIG_SYN_CYCLONEIII == 1 } then { set tmpvar_0 "Altera-CycloneIII" }
5319
        global CONFIG_SYN_ALTERA
5320
        if { $CONFIG_SYN_ALTERA == 1 } then { set tmpvar_0 "Altera-Others" }
5321
        global CONFIG_SYN_AXCEL
5322
        if { $CONFIG_SYN_AXCEL == 1 } then { set tmpvar_0 "Actel-Axcelerator" }
5323
        global CONFIG_SYN_PROASIC
5324
        if { $CONFIG_SYN_PROASIC == 1 } then { set tmpvar_0 "Actel-Proasic" }
5325
        global CONFIG_SYN_PROASICPLUS
5326
        if { $CONFIG_SYN_PROASICPLUS == 1 } then { set tmpvar_0 "Actel-ProasicPlus" }
5327
        global CONFIG_SYN_PROASIC3
5328
        if { $CONFIG_SYN_PROASIC3 == 1 } then { set tmpvar_0 "Actel-Proasic3" }
5329
        global CONFIG_SYN_UT025CRH
5330
        if { $CONFIG_SYN_UT025CRH == 1 } then { set tmpvar_0 "Aeroflex-UT025CRH" }
5331
        global CONFIG_SYN_ATC18
5332
        if { $CONFIG_SYN_ATC18 == 1 } then { set tmpvar_0 "Atmel-ATC18" }
5333
        global CONFIG_SYN_ATC18RHA
5334
        if { $CONFIG_SYN_ATC18RHA == 1 } then { set tmpvar_0 "Atmel-ATC18RHA" }
5335
        global CONFIG_SYN_CUSTOM1
5336
        if { $CONFIG_SYN_CUSTOM1 == 1 } then { set tmpvar_0 "Custom1" }
5337
        global CONFIG_SYN_EASIC90
5338
        if { $CONFIG_SYN_EASIC90 == 1 } then { set tmpvar_0 "eASIC90" }
5339
        global CONFIG_SYN_IHP25
5340
        if { $CONFIG_SYN_IHP25 == 1 } then { set tmpvar_0 "IHP25" }
5341
        global CONFIG_SYN_IHP25RH
5342
        if { $CONFIG_SYN_IHP25RH == 1 } then { set tmpvar_0 "IHP25RH" }
5343
        global CONFIG_SYN_LATTICE
5344
        if { $CONFIG_SYN_LATTICE == 1 } then { set tmpvar_0 "Lattice-EC/ECP/XP" }
5345
        global CONFIG_SYN_ECLIPSE
5346
        if { $CONFIG_SYN_ECLIPSE == 1 } then { set tmpvar_0 "Quicklogic-Eclipse" }
5347
        global CONFIG_SYN_PEREGRINE
5348
        if { $CONFIG_SYN_PEREGRINE == 1 } then { set tmpvar_0 "Peregrine" }
5349
        global CONFIG_SYN_RH_LIB18T
5350
        if { $CONFIG_SYN_RH_LIB18T == 1 } then { set tmpvar_0 "RH-LIB18T" }
5351
        global CONFIG_SYN_RHUMC
5352
        if { $CONFIG_SYN_RHUMC == 1 } then { set tmpvar_0 "RH-UMC" }
5353
        global CONFIG_SYN_SPARTAN2
5354
        if { $CONFIG_SYN_SPARTAN2 == 1 } then { set tmpvar_0 "Xilinx-Spartan2" }
5355
        global CONFIG_SYN_SPARTAN3
5356
        if { $CONFIG_SYN_SPARTAN3 == 1 } then { set tmpvar_0 "Xilinx-Spartan3" }
5357
        global CONFIG_SYN_SPARTAN3E
5358
        if { $CONFIG_SYN_SPARTAN3E == 1 } then { set tmpvar_0 "Xilinx-Spartan3E" }
5359
        global CONFIG_SYN_VIRTEX
5360
        if { $CONFIG_SYN_VIRTEX == 1 } then { set tmpvar_0 "Xilinx-Virtex" }
5361
        global CONFIG_SYN_VIRTEXE
5362
        if { $CONFIG_SYN_VIRTEXE == 1 } then { set tmpvar_0 "Xilinx-VirtexE" }
5363
        global CONFIG_SYN_VIRTEX2
5364
        if { $CONFIG_SYN_VIRTEX2 == 1 } then { set tmpvar_0 "Xilinx-Virtex2" }
5365
        global CONFIG_SYN_VIRTEX4
5366
        if { $CONFIG_SYN_VIRTEX4 == 1 } then { set tmpvar_0 "Xilinx-Virtex4" }
5367
        global CONFIG_SYN_VIRTEX5
5368
        if { $CONFIG_SYN_VIRTEX5 == 1 } then { set tmpvar_0 "Xilinx-Virtex5" }
5369
        global CONFIG_SYN_UMC
5370
        if { $CONFIG_SYN_UMC == 1 } then { set tmpvar_0 "UMC18" }
5371
        global CONFIG_SYN_TSMC90
5372
        if { $CONFIG_SYN_TSMC90 == 1 } then { set tmpvar_0 "TSMC90" }
5373
        global tmpvar_1
5374
        set tmpvar_1 "Inferred"
5375
        global CONFIG_MEM_INFERRED
5376
        if { $CONFIG_MEM_INFERRED == 1 } then { set tmpvar_1 "Inferred" }
5377
        global CONFIG_MEM_UMC
5378
        if { $CONFIG_MEM_UMC == 1 } then { set tmpvar_1 "UMC18" }
5379
        global CONFIG_MEM_RHUMC
5380
        if { $CONFIG_MEM_RHUMC == 1 } then { set tmpvar_1 "RH-UMC" }
5381
        global CONFIG_MEM_ARTISAN
5382
        if { $CONFIG_MEM_ARTISAN == 1 } then { set tmpvar_1 "Artisan" }
5383
        global CONFIG_MEM_CUSTOM1
5384
        if { $CONFIG_MEM_CUSTOM1 == 1 } then { set tmpvar_1 "Custom1" }
5385
        global CONFIG_MEM_VIRAGE
5386
        if { $CONFIG_MEM_VIRAGE == 1 } then { set tmpvar_1 "Virage" }
5387
        global CONFIG_MEM_VIRAGE90
5388
        if { $CONFIG_MEM_VIRAGE90 == 1 } then { set tmpvar_1 "Virage-TSMC90" }
5389
        global tmpvar_2
5390
        set tmpvar_2 "Inferred"
5391
        global CONFIG_CLK_INFERRED
5392
        if { $CONFIG_CLK_INFERRED == 1 } then { set tmpvar_2 "Inferred" }
5393
        global CONFIG_CLK_HCLKBUF
5394
        if { $CONFIG_CLK_HCLKBUF == 1 } then { set tmpvar_2 "Actel-HCLKBUF" }
5395
        global CONFIG_CLK_ALTDLL
5396
        if { $CONFIG_CLK_ALTDLL == 1 } then { set tmpvar_2 "Altera-ALTPLL" }
5397
        global CONFIG_CLK_LATDLL
5398
        if { $CONFIG_CLK_LATDLL == 1 } then { set tmpvar_2 "Lattice-EXPLL" }
5399
        global CONFIG_CLK_PRO3PLL
5400
        if { $CONFIG_CLK_PRO3PLL == 1 } then { set tmpvar_2 "Proasic3-PLLL" }
5401
        global CONFIG_CLK_LIB18T
5402
        if { $CONFIG_CLK_LIB18T == 1 } then { set tmpvar_2 "RH-LIB18T-PLL" }
5403
        global CONFIG_CLK_RHUMC
5404
        if { $CONFIG_CLK_RHUMC == 1 } then { set tmpvar_2 "DARE-PLL" }
5405
        global CONFIG_CLK_CLKDLL
5406
        if { $CONFIG_CLK_CLKDLL == 1 } then { set tmpvar_2 "Xilinx-CLKDLL" }
5407
        global CONFIG_CLK_DCM
5408
        if { $CONFIG_CLK_DCM == 1 } then { set tmpvar_2 "Xilinx-DCM" }
5409
        global tmpvar_3
5410
        set tmpvar_3 "5-cycles"
5411
        global CONFIG_IU_MUL_LATENCY_2
5412
        if { $CONFIG_IU_MUL_LATENCY_2 == 1 } then { set tmpvar_3 "2-cycles" }
5413
        global CONFIG_IU_MUL_LATENCY_4
5414
        if { $CONFIG_IU_MUL_LATENCY_4 == 1 } then { set tmpvar_3 "4-cycles" }
5415
        global CONFIG_IU_MUL_LATENCY_5
5416
        if { $CONFIG_IU_MUL_LATENCY_5 == 1 } then { set tmpvar_3 "5-cycles" }
5417
        global tmpvar_4
5418
        set tmpvar_4 "GRFPU"
5419
        global CONFIG_FPU_GRFPU
5420
        if { $CONFIG_FPU_GRFPU == 1 } then { set tmpvar_4 "GRFPU" }
5421
        global CONFIG_FPU_GRFPULITE
5422
        if { $CONFIG_FPU_GRFPULITE == 1 } then { set tmpvar_4 "GRFPU-LITE" }
5423
        global CONFIG_FPU_MEIKO
5424
        if { $CONFIG_FPU_MEIKO == 1 } then { set tmpvar_4 "Meiko" }
5425
        global tmpvar_5
5426
        set tmpvar_5 "Inferred"
5427
        global CONFIG_FPU_GRFPU_INFMUL
5428
        if { $CONFIG_FPU_GRFPU_INFMUL == 1 } then { set tmpvar_5 "Inferred" }
5429
        global CONFIG_FPU_GRFPU_DWMUL
5430
        if { $CONFIG_FPU_GRFPU_DWMUL == 1 } then { set tmpvar_5 "DW" }
5431
        global tmpvar_6
5432
        set tmpvar_6 "Simple"
5433
        global CONFIG_FPU_GRFPC0
5434
        if { $CONFIG_FPU_GRFPC0 == 1 } then { set tmpvar_6 "Simple" }
5435
        global CONFIG_FPU_GRFPC1
5436
        if { $CONFIG_FPU_GRFPC1 == 1 } then { set tmpvar_6 "Data-forwarding" }
5437
        global CONFIG_FPU_GRFPC2
5438
        if { $CONFIG_FPU_GRFPC2 == 1 } then { set tmpvar_6 "Non-blocking" }
5439
        global tmpvar_7
5440
        set tmpvar_7 "1"
5441
        global CONFIG_ICACHE_ASSO1
5442
        if { $CONFIG_ICACHE_ASSO1 == 1 } then { set tmpvar_7 "1" }
5443
        global CONFIG_ICACHE_ASSO2
5444
        if { $CONFIG_ICACHE_ASSO2 == 1 } then { set tmpvar_7 "2" }
5445
        global CONFIG_ICACHE_ASSO3
5446
        if { $CONFIG_ICACHE_ASSO3 == 1 } then { set tmpvar_7 "3" }
5447
        global CONFIG_ICACHE_ASSO4
5448
        if { $CONFIG_ICACHE_ASSO4 == 1 } then { set tmpvar_7 "4" }
5449
        global tmpvar_8
5450
        set tmpvar_8 "4"
5451
        global CONFIG_ICACHE_SZ1
5452
        if { $CONFIG_ICACHE_SZ1 == 1 } then { set tmpvar_8 "1" }
5453
        global CONFIG_ICACHE_SZ2
5454
        if { $CONFIG_ICACHE_SZ2 == 1 } then { set tmpvar_8 "2" }
5455
        global CONFIG_ICACHE_SZ4
5456
        if { $CONFIG_ICACHE_SZ4 == 1 } then { set tmpvar_8 "4" }
5457
        global CONFIG_ICACHE_SZ8
5458
        if { $CONFIG_ICACHE_SZ8 == 1 } then { set tmpvar_8 "8" }
5459
        global CONFIG_ICACHE_SZ16
5460
        if { $CONFIG_ICACHE_SZ16 == 1 } then { set tmpvar_8 "16" }
5461
        global CONFIG_ICACHE_SZ32
5462
        if { $CONFIG_ICACHE_SZ32 == 1 } then { set tmpvar_8 "32" }
5463
        global CONFIG_ICACHE_SZ64
5464
        if { $CONFIG_ICACHE_SZ64 == 1 } then { set tmpvar_8 "64" }
5465
        global CONFIG_ICACHE_SZ128
5466
        if { $CONFIG_ICACHE_SZ128 == 1 } then { set tmpvar_8 "128" }
5467
        global CONFIG_ICACHE_SZ256
5468
        if { $CONFIG_ICACHE_SZ256 == 1 } then { set tmpvar_8 "256" }
5469
        global tmpvar_9
5470
        set tmpvar_9 "32"
5471
        global CONFIG_ICACHE_LZ16
5472
        if { $CONFIG_ICACHE_LZ16 == 1 } then { set tmpvar_9 "16" }
5473
        global CONFIG_ICACHE_LZ32
5474
        if { $CONFIG_ICACHE_LZ32 == 1 } then { set tmpvar_9 "32" }
5475
        global tmpvar_10
5476
        set tmpvar_10 "Random"
5477
        global CONFIG_ICACHE_ALGORND
5478
        if { $CONFIG_ICACHE_ALGORND == 1 } then { set tmpvar_10 "Random" }
5479
        global CONFIG_ICACHE_ALGOLRR
5480
        if { $CONFIG_ICACHE_ALGOLRR == 1 } then { set tmpvar_10 "LRR" }
5481
        global CONFIG_ICACHE_ALGOLRU
5482
        if { $CONFIG_ICACHE_ALGOLRU == 1 } then { set tmpvar_10 "LRU" }
5483
        global tmpvar_11
5484
        set tmpvar_11 "4"
5485
        global CONFIG_ICACHE_LRAM_SZ1
5486
        if { $CONFIG_ICACHE_LRAM_SZ1 == 1 } then { set tmpvar_11 "1" }
5487
        global CONFIG_ICACHE_LRAM_SZ2
5488
        if { $CONFIG_ICACHE_LRAM_SZ2 == 1 } then { set tmpvar_11 "2" }
5489
        global CONFIG_ICACHE_LRAM_SZ4
5490
        if { $CONFIG_ICACHE_LRAM_SZ4 == 1 } then { set tmpvar_11 "4" }
5491
        global CONFIG_ICACHE_LRAM_SZ8
5492
        if { $CONFIG_ICACHE_LRAM_SZ8 == 1 } then { set tmpvar_11 "8" }
5493
        global CONFIG_ICACHE_LRAM_SZ16
5494
        if { $CONFIG_ICACHE_LRAM_SZ16 == 1 } then { set tmpvar_11 "16" }
5495
        global CONFIG_ICACHE_LRAM_SZ32
5496
        if { $CONFIG_ICACHE_LRAM_SZ32 == 1 } then { set tmpvar_11 "32" }
5497
        global CONFIG_ICACHE_LRAM_SZ64
5498
        if { $CONFIG_ICACHE_LRAM_SZ64 == 1 } then { set tmpvar_11 "64" }
5499
        global CONFIG_ICACHE_LRAM_SZ128
5500
        if { $CONFIG_ICACHE_LRAM_SZ128 == 1 } then { set tmpvar_11 "128" }
5501
        global CONFIG_ICACHE_LRAM_SZ256
5502
        if { $CONFIG_ICACHE_LRAM_SZ256 == 1 } then { set tmpvar_11 "256" }
5503
        global tmpvar_12
5504
        set tmpvar_12 "1"
5505
        global CONFIG_DCACHE_ASSO1
5506
        if { $CONFIG_DCACHE_ASSO1 == 1 } then { set tmpvar_12 "1" }
5507
        global CONFIG_DCACHE_ASSO2
5508
        if { $CONFIG_DCACHE_ASSO2 == 1 } then { set tmpvar_12 "2" }
5509
        global CONFIG_DCACHE_ASSO3
5510
        if { $CONFIG_DCACHE_ASSO3 == 1 } then { set tmpvar_12 "3" }
5511
        global CONFIG_DCACHE_ASSO4
5512
        if { $CONFIG_DCACHE_ASSO4 == 1 } then { set tmpvar_12 "4" }
5513
        global tmpvar_13
5514
        set tmpvar_13 "4"
5515
        global CONFIG_DCACHE_SZ1
5516
        if { $CONFIG_DCACHE_SZ1 == 1 } then { set tmpvar_13 "1" }
5517
        global CONFIG_DCACHE_SZ2
5518
        if { $CONFIG_DCACHE_SZ2 == 1 } then { set tmpvar_13 "2" }
5519
        global CONFIG_DCACHE_SZ4
5520
        if { $CONFIG_DCACHE_SZ4 == 1 } then { set tmpvar_13 "4" }
5521
        global CONFIG_DCACHE_SZ8
5522
        if { $CONFIG_DCACHE_SZ8 == 1 } then { set tmpvar_13 "8" }
5523
        global CONFIG_DCACHE_SZ16
5524
        if { $CONFIG_DCACHE_SZ16 == 1 } then { set tmpvar_13 "16" }
5525
        global CONFIG_DCACHE_SZ32
5526
        if { $CONFIG_DCACHE_SZ32 == 1 } then { set tmpvar_13 "32" }
5527
        global CONFIG_DCACHE_SZ64
5528
        if { $CONFIG_DCACHE_SZ64 == 1 } then { set tmpvar_13 "64" }
5529
        global CONFIG_DCACHE_SZ128
5530
        if { $CONFIG_DCACHE_SZ128 == 1 } then { set tmpvar_13 "128" }
5531
        global CONFIG_DCACHE_SZ256
5532
        if { $CONFIG_DCACHE_SZ256 == 1 } then { set tmpvar_13 "256" }
5533
        global tmpvar_14
5534
        set tmpvar_14 "32"
5535
        global CONFIG_DCACHE_LZ16
5536
        if { $CONFIG_DCACHE_LZ16 == 1 } then { set tmpvar_14 "16" }
5537
        global CONFIG_DCACHE_LZ32
5538
        if { $CONFIG_DCACHE_LZ32 == 1 } then { set tmpvar_14 "32" }
5539
        global tmpvar_15
5540
        set tmpvar_15 "Random"
5541
        global CONFIG_DCACHE_ALGORND
5542
        if { $CONFIG_DCACHE_ALGORND == 1 } then { set tmpvar_15 "Random" }
5543
        global CONFIG_DCACHE_ALGOLRR
5544
        if { $CONFIG_DCACHE_ALGOLRR == 1 } then { set tmpvar_15 "LRR" }
5545
        global CONFIG_DCACHE_ALGOLRU
5546
        if { $CONFIG_DCACHE_ALGOLRU == 1 } then { set tmpvar_15 "LRU" }
5547
        global tmpvar_16
5548
        set tmpvar_16 "4"
5549
        global CONFIG_DCACHE_LRAM_SZ1
5550
        if { $CONFIG_DCACHE_LRAM_SZ1 == 1 } then { set tmpvar_16 "1" }
5551
        global CONFIG_DCACHE_LRAM_SZ2
5552
        if { $CONFIG_DCACHE_LRAM_SZ2 == 1 } then { set tmpvar_16 "2" }
5553
        global CONFIG_DCACHE_LRAM_SZ4
5554
        if { $CONFIG_DCACHE_LRAM_SZ4 == 1 } then { set tmpvar_16 "4" }
5555
        global CONFIG_DCACHE_LRAM_SZ8
5556
        if { $CONFIG_DCACHE_LRAM_SZ8 == 1 } then { set tmpvar_16 "8" }
5557
        global CONFIG_DCACHE_LRAM_SZ16
5558
        if { $CONFIG_DCACHE_LRAM_SZ16 == 1 } then { set tmpvar_16 "16" }
5559
        global CONFIG_DCACHE_LRAM_SZ32
5560
        if { $CONFIG_DCACHE_LRAM_SZ32 == 1 } then { set tmpvar_16 "32" }
5561
        global CONFIG_DCACHE_LRAM_SZ64
5562
        if { $CONFIG_DCACHE_LRAM_SZ64 == 1 } then { set tmpvar_16 "64" }
5563
        global CONFIG_DCACHE_LRAM_SZ128
5564
        if { $CONFIG_DCACHE_LRAM_SZ128 == 1 } then { set tmpvar_16 "128" }
5565
        global CONFIG_DCACHE_LRAM_SZ256
5566
        if { $CONFIG_DCACHE_LRAM_SZ256 == 1 } then { set tmpvar_16 "256" }
5567
        global tmpvar_17
5568
        set tmpvar_17 "combined"
5569
        global CONFIG_MMU_COMBINED
5570
        if { $CONFIG_MMU_COMBINED == 1 } then { set tmpvar_17 "combined" }
5571
        global CONFIG_MMU_SPLIT
5572
        if { $CONFIG_MMU_SPLIT == 1 } then { set tmpvar_17 "split" }
5573
        global tmpvar_18
5574
        set tmpvar_18 "Increment"
5575
        global CONFIG_MMU_REPARRAY
5576
        if { $CONFIG_MMU_REPARRAY == 1 } then { set tmpvar_18 "LRU" }
5577
        global CONFIG_MMU_REPINCREMENT
5578
        if { $CONFIG_MMU_REPINCREMENT == 1 } then { set tmpvar_18 "Increment" }
5579
        global tmpvar_19
5580
        set tmpvar_19 "8"
5581
        global CONFIG_MMU_I2
5582
        if { $CONFIG_MMU_I2 == 1 } then { set tmpvar_19 "2" }
5583
        global CONFIG_MMU_I4
5584
        if { $CONFIG_MMU_I4 == 1 } then { set tmpvar_19 "4" }
5585
        global CONFIG_MMU_I8
5586
        if { $CONFIG_MMU_I8 == 1 } then { set tmpvar_19 "8" }
5587
        global CONFIG_MMU_I16
5588
        if { $CONFIG_MMU_I16 == 1 } then { set tmpvar_19 "16" }
5589
        global CONFIG_MMU_I32
5590
        if { $CONFIG_MMU_I32 == 1 } then { set tmpvar_19 "32" }
5591
        global tmpvar_20
5592
        set tmpvar_20 "8"
5593
        global CONFIG_MMU_D2
5594
        if { $CONFIG_MMU_D2 == 1 } then { set tmpvar_20 "2" }
5595
        global CONFIG_MMU_D4
5596
        if { $CONFIG_MMU_D4 == 1 } then { set tmpvar_20 "4" }
5597
        global CONFIG_MMU_D8
5598
        if { $CONFIG_MMU_D8 == 1 } then { set tmpvar_20 "8" }
5599
        global CONFIG_MMU_D16
5600
        if { $CONFIG_MMU_D16 == 1 } then { set tmpvar_20 "16" }
5601
        global CONFIG_MMU_D32
5602
        if { $CONFIG_MMU_D32 == 1 } then { set tmpvar_20 "32" }
5603
        global tmpvar_21
5604
        set tmpvar_21 "1"
5605
        global CONFIG_DSU_ITRACESZ1
5606
        if { $CONFIG_DSU_ITRACESZ1 == 1 } then { set tmpvar_21 "1" }
5607
        global CONFIG_DSU_ITRACESZ2
5608
        if { $CONFIG_DSU_ITRACESZ2 == 1 } then { set tmpvar_21 "2" }
5609
        global CONFIG_DSU_ITRACESZ4
5610
        if { $CONFIG_DSU_ITRACESZ4 == 1 } then { set tmpvar_21 "4" }
5611
        global CONFIG_DSU_ITRACESZ8
5612
        if { $CONFIG_DSU_ITRACESZ8 == 1 } then { set tmpvar_21 "8" }
5613
        global CONFIG_DSU_ITRACESZ16
5614
        if { $CONFIG_DSU_ITRACESZ16 == 1 } then { set tmpvar_21 "16" }
5615
        global tmpvar_22
5616
        set tmpvar_22 "1"
5617
        global CONFIG_DSU_ATRACESZ1
5618
        if { $CONFIG_DSU_ATRACESZ1 == 1 } then { set tmpvar_22 "1" }
5619
        global CONFIG_DSU_ATRACESZ2
5620
        if { $CONFIG_DSU_ATRACESZ2 == 1 } then { set tmpvar_22 "2" }
5621
        global CONFIG_DSU_ATRACESZ4
5622
        if { $CONFIG_DSU_ATRACESZ4 == 1 } then { set tmpvar_22 "4" }
5623
        global CONFIG_DSU_ATRACESZ8
5624
        if { $CONFIG_DSU_ATRACESZ8 == 1 } then { set tmpvar_22 "8" }
5625
        global CONFIG_DSU_ATRACESZ16
5626
        if { $CONFIG_DSU_ATRACESZ16 == 1 } then { set tmpvar_22 "16" }
5627
        global tmpvar_24
5628
        set tmpvar_24 "2"
5629
        global CONFIG_DSU_ETHSZ1
5630
        if { $CONFIG_DSU_ETHSZ1 == 1 } then { set tmpvar_24 "1" }
5631
        global CONFIG_DSU_ETHSZ2
5632
        if { $CONFIG_DSU_ETHSZ2 == 1 } then { set tmpvar_24 "2" }
5633
        global CONFIG_DSU_ETHSZ4
5634
        if { $CONFIG_DSU_ETHSZ4 == 1 } then { set tmpvar_24 "4" }
5635
        global CONFIG_DSU_ETHSZ8
5636
        if { $CONFIG_DSU_ETHSZ8 == 1 } then { set tmpvar_24 "8" }
5637
        global CONFIG_DSU_ETHSZ16
5638
        if { $CONFIG_DSU_ETHSZ16 == 1 } then { set tmpvar_24 "16" }
5639
        global tmpvar_25
5640
        set tmpvar_25 "4"
5641
        global CONFIG_AHBRAM_SZ1
5642
        if { $CONFIG_AHBRAM_SZ1 == 1 } then { set tmpvar_25 "1" }
5643
        global CONFIG_AHBRAM_SZ2
5644
        if { $CONFIG_AHBRAM_SZ2 == 1 } then { set tmpvar_25 "2" }
5645
        global CONFIG_AHBRAM_SZ4
5646
        if { $CONFIG_AHBRAM_SZ4 == 1 } then { set tmpvar_25 "4" }
5647
        global CONFIG_AHBRAM_SZ8
5648
        if { $CONFIG_AHBRAM_SZ8 == 1 } then { set tmpvar_25 "8" }
5649
        global CONFIG_AHBRAM_SZ16
5650
        if { $CONFIG_AHBRAM_SZ16 == 1 } then { set tmpvar_25 "16" }
5651
        global CONFIG_AHBRAM_SZ32
5652
        if { $CONFIG_AHBRAM_SZ32 == 1 } then { set tmpvar_25 "32" }
5653
        global CONFIG_AHBRAM_SZ64
5654
        if { $CONFIG_AHBRAM_SZ64 == 1 } then { set tmpvar_25 "64" }
5655
        global tmpvar_26
5656
        set tmpvar_26 "8"
5657
        global CONFIG_GRETH_FIFO4
5658
        if { $CONFIG_GRETH_FIFO4 == 1 } then { set tmpvar_26 "4" }
5659
        global CONFIG_GRETH_FIFO8
5660
        if { $CONFIG_GRETH_FIFO8 == 1 } then { set tmpvar_26 "8" }
5661
        global CONFIG_GRETH_FIFO16
5662
        if { $CONFIG_GRETH_FIFO16 == 1 } then { set tmpvar_26 "16" }
5663
        global CONFIG_GRETH_FIFO32
5664
        if { $CONFIG_GRETH_FIFO32 == 1 } then { set tmpvar_26 "32" }
5665
        global CONFIG_GRETH_FIFO64
5666
        if { $CONFIG_GRETH_FIFO64 == 1 } then { set tmpvar_26 "64" }
5667
        global tmpvar_27
5668
        set tmpvar_27 "1"
5669
        global CONFIG_UA1_FIFO1
5670
        if { $CONFIG_UA1_FIFO1 == 1 } then { set tmpvar_27 "1" }
5671
        global CONFIG_UA1_FIFO2
5672
        if { $CONFIG_UA1_FIFO2 == 1 } then { set tmpvar_27 "2" }
5673
        global CONFIG_UA1_FIFO4
5674
        if { $CONFIG_UA1_FIFO4 == 1 } then { set tmpvar_27 "4" }
5675
        global CONFIG_UA1_FIFO8
5676
        if { $CONFIG_UA1_FIFO8 == 1 } then { set tmpvar_27 "8" }
5677
        global CONFIG_UA1_FIFO16
5678
        if { $CONFIG_UA1_FIFO16 == 1 } then { set tmpvar_27 "16" }
5679
        global CONFIG_UA1_FIFO32
5680
        if { $CONFIG_UA1_FIFO32 == 1 } then { set tmpvar_27 "32" }
5681
}
5682
 
5683
 
5684
proc update_define_mainmenu {} {
5685
        global CONFIG_MODULES
5686
}
5687
 
5688
 
5689
# FILE: tail.tk
5690
# This file is boilerplate TCL/TK function definitions for 'make xconfig'.
5691
#
5692
# CHANGES
5693
# =======
5694
#
5695
# 8 January 1998, Michael Elizabeth Chastain, 
5696
# Arrange buttons in three columns for better screen fitting.
5697
#
5698
 
5699
#
5700
# Read the user's settings from .config.  These will override whatever is
5701
# in config.in.  Don't do this if the user specified a -D to force
5702
# the defaults.
5703
#
5704
 
5705
set defaults defconfig
5706
 
5707
if { [file readable .config] == 1} then {
5708
        if { $argc > 0 } then {
5709
                if { [lindex $argv 0] != "-D" } then {
5710
                        read_config .config
5711
                }
5712
                else
5713
                {
5714
                        read_config $defaults
5715
                }
5716
        } else {
5717
                read_config .config
5718
        }
5719
} else {
5720
        read_config $defaults
5721
}
5722
 
5723
update_define 1 $total_menus 0
5724
update_mainmenu
5725
 
5726
button .f0.right.save -anchor w -text "Save and Exit" -underline 0\
5727
    -command { catch {exec cp -f .config .config.old}; \
5728
                writeconfig .config config.h; wrapup .wrap }
5729
 
5730
button .f0.right.quit -anchor w -text "Quit Without Saving" -underline 0\
5731
    -command { maybe_exit .maybe }
5732
 
5733
button .f0.right.load -anchor w -text "Load Configuration from File" \
5734
    -command { load_configfile .load "Load Configuration from file" read_config_file
5735
}
5736
 
5737
button .f0.right.store -anchor w -text "Store Configuration to File" \
5738
    -command { load_configfile .load "Store Configuration to file" write_config_file }
5739
 
5740
#
5741
# Now pack everything.
5742
#
5743
 
5744
pack .f0.right.store .f0.right.load .f0.right.quit .f0.right.save \
5745
    -padx 0 -pady 0 -side bottom -fill x
5746
pack .f0.left .f0.middle .f0.right -side left -padx 5 -pady 0 -fill y
5747
pack .f0 -padx 5 -pady 5
5748
 
5749
update idletasks
5750
set winy [expr 10 + [winfo reqheight .f0]]
5751
set scry [lindex [wm maxsize .] 1]
5752
set winx [expr 10 + [winfo reqwidth .f0]]
5753
set scrx [lindex [wm maxsize .] 0]
5754
if {$winx < $scrx} then {set maxx -1} else {set maxx $winx}
5755
if {$winy < $scry} then {set maxy -1} else {set maxy $winy}
5756
.f0 configure -width $winx -height $winy
5757
wm maxsize . $maxx $maxy
5758
 
5759
#
5760
# If we cannot write our config files, disable the write button.
5761
#
5762
if { [file exists .config] == 1 } then {
5763
                if { [file writable .config] == 0 } then {
5764
                        .f0.right.save configure -state disabled
5765
                }
5766
        } else {
5767
                if { [file writable .] == 0 } then {
5768
                        .f0.right.save configure -state disabled
5769
                }
5770
        }
5771
 
5772
#if { [file exists include/linux/autoconf.h] == 1 } then {
5773
#               if { [file writable include/linux/autoconf.h] == 0 } then {
5774
#                       .f0.right.save configure -state disabled
5775
#               }
5776
#       } else {
5777
#               if { [file writable include/linux/] == 0 } then {
5778
#                       .f0.right.save configure -state disabled
5779
#               }
5780
#       }

powered by: WebSVN 2.1.0

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