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

powered by: WebSVN 2.1.0

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