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

powered by: WebSVN 2.1.0

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