OpenCores
URL https://opencores.org/ocsvn/mips_enhanced/mips_enhanced/trunk

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [designs/] [leon3-xilinx-ml505/] [lconfig.tk] - Blame information for rev 2

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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