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-cpci-xc4v/] [lconfig.tk] - Blame information for rev 2

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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