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-gr-xc3s-1500/] [lconfig.tk] - Blame information for rev 2

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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