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

powered by: WebSVN 2.1.0

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