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

powered by: WebSVN 2.1.0

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