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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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