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-wildcard-xcv300e/] [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 2
647
set total_menus 9
648
 
649
proc toplevel_menu {num} {
650
        if {$num == 2} then {return 1}
651
        if {$num == 3} then {return 1}
652
        if {$num == 4} then {return 1}
653
        if {$num == 5} then {return 1}
654
        if {$num == 6} then {return 1}
655
        if {$num == 7} then {return 1}
656
        if {$num == 8} then {return 1}
657
        return $num
658
}
659
 
660
mainmenu_name "LEON3 WildCard Design Configuration"
661
menu_option menu1 1 "Processor            "
662
proc menu1 {w title} {
663
        set oldFocus [focus]
664
        catch {destroy $w; unregister_active 1}
665
        toplevel $w -class Dialog
666
        wm withdraw $w
667
        global active_menus
668
        set active_menus [lsort -integer [linsert $active_menus end 1]]
669
        message $w.m -width 400 -aspect 300 -text \
670
                "Processor            "  -relief raised
671
        pack $w.m -pady 10 -side top -padx 10
672
        wm title $w "Processor            "
673
 
674
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 1; break"
675
        set nextscript "catch {focus $oldFocus}; menu2 .menu2 \"$title\""
676
        frame $w.f
677
        button $w.f.back -text "Main Menu" \
678
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 1"
679
        button $w.f.next -text "Next" -underline 0\
680
                -width 15 -command $nextscript
681
        bind all  $nextscript
682
        button $w.f.prev -text "Prev" -underline 0\
683
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 1; menu0 .menu0 \"$title\""
684
        $w.f.prev configure -state disabled
685
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
686
        pack $w.f -pady 10 -side bottom -anchor w -fill x
687
        frame $w.topline -relief ridge -borderwidth 2 -height 2
688
        pack $w.topline -side top -fill x
689
 
690
        frame $w.botline -relief ridge -borderwidth 2 -height 2
691
        pack $w.botline -side bottom -fill x
692
 
693
        frame $w.config
694
        pack $w.config -fill y -expand on
695
 
696
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
697
        pack $w.config.vscroll -side right -fill y
698
 
699
        canvas $w.config.canvas -height 1\
700
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
701
                -width [expr [winfo screenwidth .] * 1 / 2]
702
        frame $w.config.f
703
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
704
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
705
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
706
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
707
        bind $w  "$w.config.canvas yview moveto 0;break;"
708
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
709
        pack $w.config.canvas -side right -fill y
710
 
711
 
712
        bool $w.config.f 1 0 "Enable LEON3 SPARC V8 Processor" CONFIG_LEON3
713
        int $w.config.f 1 1 "Number of processors" CONFIG_PROC_NUM
714
        submenu $w.config.f 1 2 "Integer unit                                           " 2
715
        submenu $w.config.f 1 3 "Floating-point unit" 3
716
        submenu $w.config.f 1 4 "Cache system" 4
717
        submenu $w.config.f 1 5 "MMU" 5
718
        submenu $w.config.f 1 6 "Debug Support Unit        " 6
719
        submenu $w.config.f 1 7 "Fault-tolerance  " 7
720
        submenu $w.config.f 1 8 "VHDL debug settings       " 8
721
 
722
 
723
 
724
        focus $w
725
        update_active
726
        global winx; global winy
727
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
728
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
729
        update idletasks
730
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
731
 
732
        $w.config.canvas configure \
733
                -width [expr [winfo reqwidth $w.config.f] + 1]\
734
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
735
                         [expr [winfo reqheight $w.config.f] + 1]"
736
 
737
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
738
        set scry [expr [winfo screenh $w] / 2]
739
        set maxy [expr [winfo screenh $w] * 3 / 4]
740
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
741
        if [expr $winy + $canvtotal < $maxy] {
742
                $w.config.canvas configure -height $canvtotal
743
        } else {
744
                $w.config.canvas configure -height [expr $scry - $winy]
745
                }
746
        }
747
        update idletasks
748
        if {[winfo exists $w]} then {
749
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
750
        wm minsize $w [winfo width $w] 100
751
 
752
        wm deiconify $w
753
}
754
}
755
 
756
proc update_menu1 {} {
757
        global CONFIG_LEON3
758
        global CONFIG_PROC_NUM
759
        if {($CONFIG_LEON3 == 1)} then {.menu1.config.f.x1.x configure -state normal -foreground [ cget .ref -foreground ]; .menu1.config.f.x1.l configure -state normal; } else {.menu1.config.f.x1.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu1.config.f.x1.l configure -state disabled}
760
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu1.config.f.x2 normal {m}} else {configure_entry .menu1.config.f.x2 disabled {m}}
761
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu1.config.f.x3 normal {m}} else {configure_entry .menu1.config.f.x3 disabled {m}}
762
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu1.config.f.x4 normal {m}} else {configure_entry .menu1.config.f.x4 disabled {m}}
763
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu1.config.f.x5 normal {m}} else {configure_entry .menu1.config.f.x5 disabled {m}}
764
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu1.config.f.x6 normal {m}} else {configure_entry .menu1.config.f.x6 disabled {m}}
765
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu1.config.f.x7 normal {m}} else {configure_entry .menu1.config.f.x7 disabled {m}}
766
        if {($CONFIG_LEON3 == 1)} then {configure_entry .menu1.config.f.x8 normal {m}} else {configure_entry .menu1.config.f.x8 disabled {m}}
767
}
768
 
769
 
770
proc update_define_menu1 {} {
771
        update_define_mainmenu
772
        global CONFIG_MODULES
773
        global CONFIG_LEON3
774
        global CONFIG_PROC_NUM
775
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_PROC_NUM "$CONFIG_PROC_NUM" 1}
776
}
777
 
778
 
779
proc menu2 {w title} {
780
        set oldFocus [focus]
781
        catch {focus .menu1}
782
        catch {destroy $w; unregister_active 2}
783
        toplevel $w -class Dialog
784
        wm withdraw $w
785
        global active_menus
786
        set active_menus [lsort -integer [linsert $active_menus end 2]]
787
        message $w.m -width 400 -aspect 300 -text \
788
                "Integer unit                                           "  -relief raised
789
        pack $w.m -pady 10 -side top -padx 10
790
        wm title $w "Integer unit                                           "
791
 
792
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 2; break"
793
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu3 .menu3 \"$title\""
794
        frame $w.f
795
        button $w.f.back -text "OK" \
796
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 2"
797
        button $w.f.next -text "Next" -underline 0\
798
                -width 15 -command $nextscript
799
        bind all  $nextscript
800
        button $w.f.prev -text "Prev" -underline 0\
801
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu1 .menu1 \"$title\""
802
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu1 .menu1 \"$title\";break"
803
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
804
        pack $w.f -pady 10 -side bottom -anchor w -fill x
805
        frame $w.topline -relief ridge -borderwidth 2 -height 2
806
        pack $w.topline -side top -fill x
807
 
808
        frame $w.botline -relief ridge -borderwidth 2 -height 2
809
        pack $w.botline -side bottom -fill x
810
 
811
        frame $w.config
812
        pack $w.config -fill y -expand on
813
 
814
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
815
        pack $w.config.vscroll -side right -fill y
816
 
817
        canvas $w.config.canvas -height 1\
818
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
819
                -width [expr [winfo screenwidth .] * 1 / 2]
820
        frame $w.config.f
821
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
822
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
823
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
824
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
825
        bind $w  "$w.config.canvas yview moveto 0;break;"
826
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
827
        pack $w.config.canvas -side right -fill y
828
 
829
 
830
        int $w.config.f 2 0 "SPARC register windows" CONFIG_IU_NWINDOWS
831
        bool $w.config.f 2 1 "SPARC V8 MUL/DIV instructions" CONFIG_IU_V8MULDIV
832
        global tmpvar_0
833
        minimenu $w.config.f 2 2 "Hardware multiplier latency" tmpvar_0 CONFIG_IU_MUL_LATENCY_4
834
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"Hardware multiplier latency\""
835
        $w.config.f.x2.x.menu add radiobutton -label "4-cycles" -variable tmpvar_0 -value "4-cycles" -command "update_active"
836
        $w.config.f.x2.x.menu add radiobutton -label "5-cycles" -variable tmpvar_0 -value "5-cycles" -command "update_active"
837
        menusplit $w $w.config.f.x2.x.menu 2
838
        bool $w.config.f 2 3 "SPARC V8e SMAC/UMAC instructions     " CONFIG_IU_MUL_MAC
839
        bool $w.config.f 2 4 "Single-vector trapping" CONFIG_IU_SVT
840
        int $w.config.f 2 5 "Load delay" CONFIG_IU_LDELAY
841
        int $w.config.f 2 6 "Hardware watchpoints" CONFIG_IU_WATCHPOINTS
842
        bool $w.config.f 2 7 "Enable power-down mode " CONFIG_PWD
843
        hex $w.config.f 2 8 " Reset start address (addr\[31:12\]) " CONFIG_IU_RSTADDR
844
 
845
 
846
 
847
        focus $w
848
        update_active
849
        global winx; global winy
850
        if {[winfo exists .menu1] == 0} then {menu1 .menu1 "Processor            "}
851
        set winx [expr [winfo x .menu1]+30]; set winy [expr [winfo y .menu1]+30]
852
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
853
        update idletasks
854
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
855
 
856
        $w.config.canvas configure \
857
                -width [expr [winfo reqwidth $w.config.f] + 1]\
858
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
859
                         [expr [winfo reqheight $w.config.f] + 1]"
860
 
861
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
862
        set scry [expr [winfo screenh $w] / 2]
863
        set maxy [expr [winfo screenh $w] * 3 / 4]
864
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
865
        if [expr $winy + $canvtotal < $maxy] {
866
                $w.config.canvas configure -height $canvtotal
867
        } else {
868
                $w.config.canvas configure -height [expr $scry - $winy]
869
                }
870
        }
871
        update idletasks
872
        if {[winfo exists $w]} then {
873
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
874
        wm minsize $w [winfo width $w] 100
875
 
876
        wm deiconify $w
877
}
878
}
879
 
880
proc update_menu2 {} {
881
        global CONFIG_LEON3
882
        global CONFIG_IU_NWINDOWS
883
        if {($CONFIG_LEON3 == 1)} then {.menu2.config.f.x0.x configure -state normal -foreground [ cget .ref -foreground ]; .menu2.config.f.x0.l configure -state normal; } else {.menu2.config.f.x0.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu2.config.f.x0.l configure -state disabled}
884
        global CONFIG_IU_V8MULDIV
885
        if {($CONFIG_LEON3 == 1)} then {
886
        configure_entry .menu2.config.f.x1 normal {n l y}} else {configure_entry .menu2.config.f.x1 disabled {y n l}}
887
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {configure_entry .menu2.config.f.x2 normal {x l}} else {configure_entry .menu2.config.f.x2 disabled {x l}}
888
        global CONFIG_IU_MUL_MAC
889
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {
890
        configure_entry .menu2.config.f.x3 normal {n l y}} else {configure_entry .menu2.config.f.x3 disabled {y n l}}
891
        global CONFIG_IU_SVT
892
        if {($CONFIG_LEON3 == 1)} then {
893
        configure_entry .menu2.config.f.x4 normal {n l y}} else {configure_entry .menu2.config.f.x4 disabled {y n l}}
894
        global CONFIG_IU_LDELAY
895
        if {($CONFIG_LEON3 == 1)} then {.menu2.config.f.x5.x configure -state normal -foreground [ cget .ref -foreground ]; .menu2.config.f.x5.l configure -state normal; } else {.menu2.config.f.x5.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu2.config.f.x5.l configure -state disabled}
896
        global CONFIG_IU_WATCHPOINTS
897
        if {($CONFIG_LEON3 == 1)} then {.menu2.config.f.x6.x configure -state normal -foreground [ cget .ref -foreground ]; .menu2.config.f.x6.l configure -state normal; } else {.menu2.config.f.x6.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu2.config.f.x6.l configure -state disabled}
898
        global CONFIG_PWD
899
        if {($CONFIG_LEON3 == 1)} then {
900
        configure_entry .menu2.config.f.x7 normal {n l y}} else {configure_entry .menu2.config.f.x7 disabled {y n l}}
901
        global CONFIG_IU_RSTADDR
902
        if {($CONFIG_LEON3 == 1)} then {.menu2.config.f.x8.x configure -state normal -foreground [ cget .ref -foreground ]; .menu2.config.f.x8.l configure -state normal; } else {.menu2.config.f.x8.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu2.config.f.x8.l configure -state disabled}
903
}
904
 
905
 
906
proc update_define_menu2 {} {
907
        update_define_mainmenu
908
        global CONFIG_MODULES
909
        global CONFIG_LEON3
910
        global CONFIG_IU_NWINDOWS
911
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_NWINDOWS "$CONFIG_IU_NWINDOWS" 8}
912
        global CONFIG_IU_V8MULDIV
913
        if {($CONFIG_LEON3 == 1)} then {
914
        set CONFIG_IU_V8MULDIV [expr $CONFIG_IU_V8MULDIV&15]} else {set CONFIG_IU_V8MULDIV [expr $CONFIG_IU_V8MULDIV|16]}
915
        global tmpvar_0
916
        global CONFIG_IU_MUL_LATENCY_4
917
        if {$tmpvar_0 == "4-cycles"} then {set CONFIG_IU_MUL_LATENCY_4 1} else {set CONFIG_IU_MUL_LATENCY_4 0}
918
        global CONFIG_IU_MUL_LATENCY_5
919
        if {$tmpvar_0 == "5-cycles"} then {set CONFIG_IU_MUL_LATENCY_5 1} else {set CONFIG_IU_MUL_LATENCY_5 0}
920
        global CONFIG_IU_MUL_MAC
921
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {
922
        set CONFIG_IU_MUL_MAC [expr $CONFIG_IU_MUL_MAC&15]} else {set CONFIG_IU_MUL_MAC [expr $CONFIG_IU_MUL_MAC|16]}
923
        global CONFIG_IU_SVT
924
        if {($CONFIG_LEON3 == 1)} then {
925
        set CONFIG_IU_SVT [expr $CONFIG_IU_SVT&15]} else {set CONFIG_IU_SVT [expr $CONFIG_IU_SVT|16]}
926
        global CONFIG_IU_LDELAY
927
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_LDELAY "$CONFIG_IU_LDELAY" 1}
928
        global CONFIG_IU_WATCHPOINTS
929
        if {($CONFIG_LEON3 == 1)} then {validate_int CONFIG_IU_WATCHPOINTS "$CONFIG_IU_WATCHPOINTS" 0}
930
        global CONFIG_PWD
931
        if {($CONFIG_LEON3 == 1)} then {
932
        set CONFIG_PWD [expr $CONFIG_PWD&15]} else {set CONFIG_PWD [expr $CONFIG_PWD|16]}
933
        global CONFIG_IU_RSTADDR
934
        if {($CONFIG_LEON3 == 1)} then {validate_hex CONFIG_IU_RSTADDR "$CONFIG_IU_RSTADDR" 00000}
935
}
936
 
937
 
938
proc menu3 {w title} {
939
        set oldFocus [focus]
940
        catch {focus .menu1}
941
        catch {destroy $w; unregister_active 3}
942
        toplevel $w -class Dialog
943
        wm withdraw $w
944
        global active_menus
945
        set active_menus [lsort -integer [linsert $active_menus end 3]]
946
        message $w.m -width 400 -aspect 300 -text \
947
                "Floating-point unit"  -relief raised
948
        pack $w.m -pady 10 -side top -padx 10
949
        wm title $w "Floating-point unit"
950
 
951
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 3; break"
952
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu4 .menu4 \"$title\""
953
        frame $w.f
954
        button $w.f.back -text "OK" \
955
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 3"
956
        button $w.f.next -text "Next" -underline 0\
957
                -width 15 -command $nextscript
958
        bind all  $nextscript
959
        button $w.f.prev -text "Prev" -underline 0\
960
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu2 .menu2 \"$title\""
961
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu2 .menu2 \"$title\";break"
962
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
963
        pack $w.f -pady 10 -side bottom -anchor w -fill x
964
        frame $w.topline -relief ridge -borderwidth 2 -height 2
965
        pack $w.topline -side top -fill x
966
 
967
        frame $w.botline -relief ridge -borderwidth 2 -height 2
968
        pack $w.botline -side bottom -fill x
969
 
970
        frame $w.config
971
        pack $w.config -fill y -expand on
972
 
973
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
974
        pack $w.config.vscroll -side right -fill y
975
 
976
        canvas $w.config.canvas -height 1\
977
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
978
                -width [expr [winfo screenwidth .] * 1 / 2]
979
        frame $w.config.f
980
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
981
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
982
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
983
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
984
        bind $w  "$w.config.canvas yview moveto 0;break;"
985
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
986
        pack $w.config.canvas -side right -fill y
987
 
988
 
989
        bool $w.config.f 3 0 "Enable FPU                             " CONFIG_FPU_ENABLE
990
        global tmpvar_1
991
        minimenu $w.config.f 3 1 "FPU core" tmpvar_1 CONFIG_FPU_GRFPU
992
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"FPU core\""
993
        $w.config.f.x1.x.menu add radiobutton -label "GRFPU" -variable tmpvar_1 -value "GRFPU" -command "update_active"
994
        $w.config.f.x1.x.menu add radiobutton -label "GRFPU-LITE" -variable tmpvar_1 -value "GRFPU-LITE" -command "update_active"
995
        $w.config.f.x1.x.menu add radiobutton -label "Meiko" -variable tmpvar_1 -value "Meiko" -command "update_active"
996
        menusplit $w $w.config.f.x1.x.menu 3
997
        global tmpvar_2
998
        minimenu $w.config.f 3 2 "GRFPU multiplier" tmpvar_2 CONFIG_FPU_GRFPU_INFMUL
999
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"GRFPU multiplier\""
1000
        $w.config.f.x2.x.menu add radiobutton -label "Inferred" -variable tmpvar_2 -value "Inferred" -command "update_active"
1001
        $w.config.f.x2.x.menu add radiobutton -label "DW" -variable tmpvar_2 -value "DW" -command "update_active"
1002
        menusplit $w $w.config.f.x2.x.menu 2
1003
        global tmpvar_3
1004
        minimenu $w.config.f 3 3 "GRFPU-LITE controller" tmpvar_3 CONFIG_FPU_GRFPC0
1005
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"GRFPU-LITE controller\""
1006
        $w.config.f.x3.x.menu add radiobutton -label "Simple" -variable tmpvar_3 -value "Simple" -command "update_active"
1007
        $w.config.f.x3.x.menu add radiobutton -label "Data-forwarding" -variable tmpvar_3 -value "Data-forwarding" -command "update_active"
1008
        $w.config.f.x3.x.menu add radiobutton -label "Non-blocking" -variable tmpvar_3 -value "Non-blocking" -command "update_active"
1009
        menusplit $w $w.config.f.x3.x.menu 3
1010
        bool $w.config.f 3 4 "Use VHDL netlist          " CONFIG_FPU_NETLIST
1011
 
1012
 
1013
 
1014
        focus $w
1015
        update_active
1016
        global winx; global winy
1017
        if {[winfo exists .menu1] == 0} then {menu1 .menu1 "Processor            "}
1018
        set winx [expr [winfo x .menu1]+30]; set winy [expr [winfo y .menu1]+30]
1019
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1020
        update idletasks
1021
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1022
 
1023
        $w.config.canvas configure \
1024
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1025
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1026
                         [expr [winfo reqheight $w.config.f] + 1]"
1027
 
1028
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1029
        set scry [expr [winfo screenh $w] / 2]
1030
        set maxy [expr [winfo screenh $w] * 3 / 4]
1031
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1032
        if [expr $winy + $canvtotal < $maxy] {
1033
                $w.config.canvas configure -height $canvtotal
1034
        } else {
1035
                $w.config.canvas configure -height [expr $scry - $winy]
1036
                }
1037
        }
1038
        update idletasks
1039
        if {[winfo exists $w]} then {
1040
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1041
        wm minsize $w [winfo width $w] 100
1042
 
1043
        wm deiconify $w
1044
}
1045
}
1046
 
1047
proc update_menu3 {} {
1048
        global CONFIG_LEON3
1049
        global CONFIG_FPU_ENABLE
1050
        if {($CONFIG_LEON3 == 1)} then {
1051
        configure_entry .menu3.config.f.x0 normal {n l y}} else {configure_entry .menu3.config.f.x0 disabled {y n l}}
1052
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {configure_entry .menu3.config.f.x1 normal {x l}} else {configure_entry .menu3.config.f.x1 disabled {x l}}
1053
        global CONFIG_FPU_GRFPU
1054
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPU == 1)} then {configure_entry .menu3.config.f.x2 normal {x l}} else {configure_entry .menu3.config.f.x2 disabled {x l}}
1055
        global CONFIG_FPU_GRFPULITE
1056
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPULITE == 1)} then {configure_entry .menu3.config.f.x3 normal {x l}} else {configure_entry .menu3.config.f.x3 disabled {x l}}
1057
        global CONFIG_FPU_NETLIST
1058
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
1059
        configure_entry .menu3.config.f.x4 normal {n l y}} else {configure_entry .menu3.config.f.x4 disabled {y n l}}
1060
}
1061
 
1062
 
1063
proc update_define_menu3 {} {
1064
        update_define_mainmenu
1065
        global CONFIG_MODULES
1066
        global CONFIG_LEON3
1067
        global CONFIG_FPU_ENABLE
1068
        if {($CONFIG_LEON3 == 1)} then {
1069
        set CONFIG_FPU_ENABLE [expr $CONFIG_FPU_ENABLE&15]} else {set CONFIG_FPU_ENABLE [expr $CONFIG_FPU_ENABLE|16]}
1070
        global tmpvar_1
1071
        global CONFIG_FPU_GRFPU
1072
        if {$tmpvar_1 == "GRFPU"} then {set CONFIG_FPU_GRFPU 1} else {set CONFIG_FPU_GRFPU 0}
1073
        global CONFIG_FPU_GRFPULITE
1074
        if {$tmpvar_1 == "GRFPU-LITE"} then {set CONFIG_FPU_GRFPULITE 1} else {set CONFIG_FPU_GRFPULITE 0}
1075
        global CONFIG_FPU_MEIKO
1076
        if {$tmpvar_1 == "Meiko"} then {set CONFIG_FPU_MEIKO 1} else {set CONFIG_FPU_MEIKO 0}
1077
        global tmpvar_2
1078
        global CONFIG_FPU_GRFPU_INFMUL
1079
        if {$tmpvar_2 == "Inferred"} then {set CONFIG_FPU_GRFPU_INFMUL 1} else {set CONFIG_FPU_GRFPU_INFMUL 0}
1080
        global CONFIG_FPU_GRFPU_DWMUL
1081
        if {$tmpvar_2 == "DW"} then {set CONFIG_FPU_GRFPU_DWMUL 1} else {set CONFIG_FPU_GRFPU_DWMUL 0}
1082
        global tmpvar_3
1083
        global CONFIG_FPU_GRFPC0
1084
        if {$tmpvar_3 == "Simple"} then {set CONFIG_FPU_GRFPC0 1} else {set CONFIG_FPU_GRFPC0 0}
1085
        global CONFIG_FPU_GRFPC1
1086
        if {$tmpvar_3 == "Data-forwarding"} then {set CONFIG_FPU_GRFPC1 1} else {set CONFIG_FPU_GRFPC1 0}
1087
        global CONFIG_FPU_GRFPC2
1088
        if {$tmpvar_3 == "Non-blocking"} then {set CONFIG_FPU_GRFPC2 1} else {set CONFIG_FPU_GRFPC2 0}
1089
        global CONFIG_FPU_NETLIST
1090
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
1091
        set CONFIG_FPU_NETLIST [expr $CONFIG_FPU_NETLIST&15]} else {set CONFIG_FPU_NETLIST [expr $CONFIG_FPU_NETLIST|16]}
1092
}
1093
 
1094
 
1095
proc menu4 {w title} {
1096
        set oldFocus [focus]
1097
        catch {focus .menu1}
1098
        catch {destroy $w; unregister_active 4}
1099
        toplevel $w -class Dialog
1100
        wm withdraw $w
1101
        global active_menus
1102
        set active_menus [lsort -integer [linsert $active_menus end 4]]
1103
        message $w.m -width 400 -aspect 300 -text \
1104
                "Cache system"  -relief raised
1105
        pack $w.m -pady 10 -side top -padx 10
1106
        wm title $w "Cache system"
1107
 
1108
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 4; break"
1109
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu5 .menu5 \"$title\""
1110
        frame $w.f
1111
        button $w.f.back -text "OK" \
1112
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 4"
1113
        button $w.f.next -text "Next" -underline 0\
1114
                -width 15 -command $nextscript
1115
        bind all  $nextscript
1116
        button $w.f.prev -text "Prev" -underline 0\
1117
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu3 .menu3 \"$title\""
1118
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu3 .menu3 \"$title\";break"
1119
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1120
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1121
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1122
        pack $w.topline -side top -fill x
1123
 
1124
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1125
        pack $w.botline -side bottom -fill x
1126
 
1127
        frame $w.config
1128
        pack $w.config -fill y -expand on
1129
 
1130
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1131
        pack $w.config.vscroll -side right -fill y
1132
 
1133
        canvas $w.config.canvas -height 1\
1134
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1135
                -width [expr [winfo screenwidth .] * 1 / 2]
1136
        frame $w.config.f
1137
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1138
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1139
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1140
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1141
        bind $w  "$w.config.canvas yview moveto 0;break;"
1142
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1143
        pack $w.config.canvas -side right -fill y
1144
 
1145
 
1146
        bool $w.config.f 4 0 "Enable instruction cache       " CONFIG_ICACHE_ENABLE
1147
        global tmpvar_4
1148
        minimenu $w.config.f 4 1 "Associativity (sets)            " tmpvar_4 CONFIG_ICACHE_ASSO1
1149
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"Associativity (sets)            \""
1150
        $w.config.f.x1.x.menu add radiobutton -label "1" -variable tmpvar_4 -value "1" -command "update_active"
1151
        $w.config.f.x1.x.menu add radiobutton -label "2" -variable tmpvar_4 -value "2" -command "update_active"
1152
        $w.config.f.x1.x.menu add radiobutton -label "3" -variable tmpvar_4 -value "3" -command "update_active"
1153
        $w.config.f.x1.x.menu add radiobutton -label "4" -variable tmpvar_4 -value "4" -command "update_active"
1154
        menusplit $w $w.config.f.x1.x.menu 4
1155
        global tmpvar_5
1156
        minimenu $w.config.f 4 2 "Set size (kbytes/set)" tmpvar_5 CONFIG_ICACHE_SZ1
1157
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"Set size (kbytes/set)\""
1158
        $w.config.f.x2.x.menu add radiobutton -label "1" -variable tmpvar_5 -value "1" -command "update_active"
1159
        $w.config.f.x2.x.menu add radiobutton -label "2" -variable tmpvar_5 -value "2" -command "update_active"
1160
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_5 -value "4" -command "update_active"
1161
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_5 -value "8" -command "update_active"
1162
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_5 -value "16" -command "update_active"
1163
        $w.config.f.x2.x.menu add radiobutton -label "32" -variable tmpvar_5 -value "32" -command "update_active"
1164
        $w.config.f.x2.x.menu add radiobutton -label "64" -variable tmpvar_5 -value "64" -command "update_active"
1165
        $w.config.f.x2.x.menu add radiobutton -label "128" -variable tmpvar_5 -value "128" -command "update_active"
1166
        $w.config.f.x2.x.menu add radiobutton -label "256" -variable tmpvar_5 -value "256" -command "update_active"
1167
        menusplit $w $w.config.f.x2.x.menu 9
1168
        global tmpvar_6
1169
        minimenu $w.config.f 4 3 "Line size (bytes/line)" tmpvar_6 CONFIG_ICACHE_LZ16
1170
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"Line size (bytes/line)\""
1171
        $w.config.f.x3.x.menu add radiobutton -label "16" -variable tmpvar_6 -value "16" -command "update_active"
1172
        $w.config.f.x3.x.menu add radiobutton -label "32" -variable tmpvar_6 -value "32" -command "update_active"
1173
        menusplit $w $w.config.f.x3.x.menu 2
1174
        global tmpvar_7
1175
        minimenu $w.config.f 4 4 "Replacement alorithm" tmpvar_7 CONFIG_ICACHE_ALGORND
1176
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"Replacement alorithm\""
1177
        $w.config.f.x4.x.menu add radiobutton -label "Random" -variable tmpvar_7 -value "Random" -command "update_active"
1178
        $w.config.f.x4.x.menu add radiobutton -label "LRR" -variable tmpvar_7 -value "LRR" -command "update_active"
1179
        $w.config.f.x4.x.menu add radiobutton -label "LRU" -variable tmpvar_7 -value "LRU" -command "update_active"
1180
        menusplit $w $w.config.f.x4.x.menu 3
1181
        bool $w.config.f 4 5 "Cache locking      " CONFIG_ICACHE_LOCK
1182
        bool $w.config.f 4 6 "Enable local instruction RAM            " CONFIG_ICACHE_LRAM
1183
        global tmpvar_8
1184
        minimenu $w.config.f 4 7 "Local data RAM size (kbytes)" tmpvar_8 CONFIG_ICACHE_LRAM_SZ1
1185
        menu $w.config.f.x7.x.menu -tearoffcommand "menutitle \"Local data RAM size (kbytes)\""
1186
        $w.config.f.x7.x.menu add radiobutton -label "1" -variable tmpvar_8 -value "1" -command "update_active"
1187
        $w.config.f.x7.x.menu add radiobutton -label "2" -variable tmpvar_8 -value "2" -command "update_active"
1188
        $w.config.f.x7.x.menu add radiobutton -label "4" -variable tmpvar_8 -value "4" -command "update_active"
1189
        $w.config.f.x7.x.menu add radiobutton -label "8" -variable tmpvar_8 -value "8" -command "update_active"
1190
        $w.config.f.x7.x.menu add radiobutton -label "16" -variable tmpvar_8 -value "16" -command "update_active"
1191
        $w.config.f.x7.x.menu add radiobutton -label "32" -variable tmpvar_8 -value "32" -command "update_active"
1192
        $w.config.f.x7.x.menu add radiobutton -label "64" -variable tmpvar_8 -value "64" -command "update_active"
1193
        $w.config.f.x7.x.menu add radiobutton -label "128" -variable tmpvar_8 -value "128" -command "update_active"
1194
        $w.config.f.x7.x.menu add radiobutton -label "256" -variable tmpvar_8 -value "256" -command "update_active"
1195
        menusplit $w $w.config.f.x7.x.menu 9
1196
        hex $w.config.f 4 8 " Local instruction RAM start address (8 MSB) " CONFIG_ICACHE_LRSTART
1197
        bool $w.config.f 4 9 "Enable data cache       " CONFIG_DCACHE_ENABLE
1198
        global tmpvar_9
1199
        minimenu $w.config.f 4 10 "Associativity (sets)" tmpvar_9 CONFIG_DCACHE_ASSO1
1200
        menu $w.config.f.x10.x.menu -tearoffcommand "menutitle \"Associativity (sets)\""
1201
        $w.config.f.x10.x.menu add radiobutton -label "1" -variable tmpvar_9 -value "1" -command "update_active"
1202
        $w.config.f.x10.x.menu add radiobutton -label "2" -variable tmpvar_9 -value "2" -command "update_active"
1203
        $w.config.f.x10.x.menu add radiobutton -label "3" -variable tmpvar_9 -value "3" -command "update_active"
1204
        $w.config.f.x10.x.menu add radiobutton -label "4" -variable tmpvar_9 -value "4" -command "update_active"
1205
        menusplit $w $w.config.f.x10.x.menu 4
1206
        global tmpvar_10
1207
        minimenu $w.config.f 4 11 "Set size (kbytes/set)" tmpvar_10 CONFIG_DCACHE_SZ1
1208
        menu $w.config.f.x11.x.menu -tearoffcommand "menutitle \"Set size (kbytes/set)\""
1209
        $w.config.f.x11.x.menu add radiobutton -label "1" -variable tmpvar_10 -value "1" -command "update_active"
1210
        $w.config.f.x11.x.menu add radiobutton -label "2" -variable tmpvar_10 -value "2" -command "update_active"
1211
        $w.config.f.x11.x.menu add radiobutton -label "4" -variable tmpvar_10 -value "4" -command "update_active"
1212
        $w.config.f.x11.x.menu add radiobutton -label "8" -variable tmpvar_10 -value "8" -command "update_active"
1213
        $w.config.f.x11.x.menu add radiobutton -label "16" -variable tmpvar_10 -value "16" -command "update_active"
1214
        $w.config.f.x11.x.menu add radiobutton -label "32" -variable tmpvar_10 -value "32" -command "update_active"
1215
        $w.config.f.x11.x.menu add radiobutton -label "64" -variable tmpvar_10 -value "64" -command "update_active"
1216
        $w.config.f.x11.x.menu add radiobutton -label "128" -variable tmpvar_10 -value "128" -command "update_active"
1217
        $w.config.f.x11.x.menu add radiobutton -label "256" -variable tmpvar_10 -value "256" -command "update_active"
1218
        menusplit $w $w.config.f.x11.x.menu 9
1219
        global tmpvar_11
1220
        minimenu $w.config.f 4 12 "Line size (bytes/line)" tmpvar_11 CONFIG_DCACHE_LZ16
1221
        menu $w.config.f.x12.x.menu -tearoffcommand "menutitle \"Line size (bytes/line)\""
1222
        $w.config.f.x12.x.menu add radiobutton -label "16" -variable tmpvar_11 -value "16" -command "update_active"
1223
        $w.config.f.x12.x.menu add radiobutton -label "32" -variable tmpvar_11 -value "32" -command "update_active"
1224
        menusplit $w $w.config.f.x12.x.menu 2
1225
        global tmpvar_12
1226
        minimenu $w.config.f 4 13 "Replacement alorithm" tmpvar_12 CONFIG_DCACHE_ALGORND
1227
        menu $w.config.f.x13.x.menu -tearoffcommand "menutitle \"Replacement alorithm\""
1228
        $w.config.f.x13.x.menu add radiobutton -label "Random" -variable tmpvar_12 -value "Random" -command "update_active"
1229
        $w.config.f.x13.x.menu add radiobutton -label "LRR" -variable tmpvar_12 -value "LRR" -command "update_active"
1230
        $w.config.f.x13.x.menu add radiobutton -label "LRU" -variable tmpvar_12 -value "LRU" -command "update_active"
1231
        menusplit $w $w.config.f.x13.x.menu 3
1232
        bool $w.config.f 4 14 "Cache locking      " CONFIG_DCACHE_LOCK
1233
        bool $w.config.f 4 15 "AHB snooping       " CONFIG_DCACHE_SNOOP
1234
        bool $w.config.f 4 16 "Fast snooping       " CONFIG_DCACHE_SNOOP_FAST
1235
        bool $w.config.f 4 17 "Separate snoop tags  " CONFIG_DCACHE_SNOOP_SEPTAG
1236
        hex $w.config.f 4 18 "Fixed cacheability map  " CONFIG_CACHE_FIXED
1237
        bool $w.config.f 4 19 "Enable local data RAM            " CONFIG_DCACHE_LRAM
1238
        global tmpvar_13
1239
        minimenu $w.config.f 4 20 "Local data RAM size (kbytes)" tmpvar_13 CONFIG_DCACHE_LRAM_SZ1
1240
        menu $w.config.f.x20.x.menu -tearoffcommand "menutitle \"Local data RAM size (kbytes)\""
1241
        $w.config.f.x20.x.menu add radiobutton -label "1" -variable tmpvar_13 -value "1" -command "update_active"
1242
        $w.config.f.x20.x.menu add radiobutton -label "2" -variable tmpvar_13 -value "2" -command "update_active"
1243
        $w.config.f.x20.x.menu add radiobutton -label "4" -variable tmpvar_13 -value "4" -command "update_active"
1244
        $w.config.f.x20.x.menu add radiobutton -label "8" -variable tmpvar_13 -value "8" -command "update_active"
1245
        $w.config.f.x20.x.menu add radiobutton -label "16" -variable tmpvar_13 -value "16" -command "update_active"
1246
        $w.config.f.x20.x.menu add radiobutton -label "32" -variable tmpvar_13 -value "32" -command "update_active"
1247
        $w.config.f.x20.x.menu add radiobutton -label "64" -variable tmpvar_13 -value "64" -command "update_active"
1248
        $w.config.f.x20.x.menu add radiobutton -label "128" -variable tmpvar_13 -value "128" -command "update_active"
1249
        $w.config.f.x20.x.menu add radiobutton -label "256" -variable tmpvar_13 -value "256" -command "update_active"
1250
        menusplit $w $w.config.f.x20.x.menu 9
1251
        hex $w.config.f 4 21 " Local data RAM start address (8 MSB) " CONFIG_DCACHE_LRSTART
1252
 
1253
 
1254
 
1255
        focus $w
1256
        update_active
1257
        global winx; global winy
1258
        if {[winfo exists .menu1] == 0} then {menu1 .menu1 "Processor            "}
1259
        set winx [expr [winfo x .menu1]+30]; set winy [expr [winfo y .menu1]+30]
1260
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1261
        update idletasks
1262
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1263
 
1264
        $w.config.canvas configure \
1265
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1266
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1267
                         [expr [winfo reqheight $w.config.f] + 1]"
1268
 
1269
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1270
        set scry [expr [winfo screenh $w] / 2]
1271
        set maxy [expr [winfo screenh $w] * 3 / 4]
1272
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1273
        if [expr $winy + $canvtotal < $maxy] {
1274
                $w.config.canvas configure -height $canvtotal
1275
        } else {
1276
                $w.config.canvas configure -height [expr $scry - $winy]
1277
                }
1278
        }
1279
        update idletasks
1280
        if {[winfo exists $w]} then {
1281
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1282
        wm minsize $w [winfo width $w] 100
1283
 
1284
        wm deiconify $w
1285
}
1286
}
1287
 
1288
proc update_menu4 {} {
1289
        global CONFIG_LEON3
1290
        global CONFIG_ICACHE_ENABLE
1291
        if {($CONFIG_LEON3 == 1)} then {
1292
        configure_entry .menu4.config.f.x0 normal {n l y}} else {configure_entry .menu4.config.f.x0 disabled {y n l}}
1293
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {configure_entry .menu4.config.f.x1 normal {x l}} else {configure_entry .menu4.config.f.x1 disabled {x l}}
1294
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {configure_entry .menu4.config.f.x2 normal {x l}} else {configure_entry .menu4.config.f.x2 disabled {x l}}
1295
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {configure_entry .menu4.config.f.x3 normal {x l}} else {configure_entry .menu4.config.f.x3 disabled {x l}}
1296
        global CONFIG_ICACHE_ASSO1
1297
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {configure_entry .menu4.config.f.x4 normal {x l}} else {configure_entry .menu4.config.f.x4 disabled {x l}}
1298
        global CONFIG_ICACHE_LOCK
1299
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {
1300
        configure_entry .menu4.config.f.x5 normal {n l y}} else {configure_entry .menu4.config.f.x5 disabled {y n l}}
1301
        global CONFIG_MMU_ENABLE
1302
        global CONFIG_ICACHE_LRAM
1303
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1304
        configure_entry .menu4.config.f.x6 normal {n l y}} else {configure_entry .menu4.config.f.x6 disabled {y n l}}
1305
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {configure_entry .menu4.config.f.x7 normal {x l}} else {configure_entry .menu4.config.f.x7 disabled {x l}}
1306
        global CONFIG_ICACHE_LRSTART
1307
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 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}
1308
        global CONFIG_DCACHE_ENABLE
1309
        if {($CONFIG_LEON3 == 1)} then {
1310
        configure_entry .menu4.config.f.x9 normal {n l y}} else {configure_entry .menu4.config.f.x9 disabled {y n l}}
1311
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {configure_entry .menu4.config.f.x10 normal {x l}} else {configure_entry .menu4.config.f.x10 disabled {x l}}
1312
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {configure_entry .menu4.config.f.x11 normal {x l}} else {configure_entry .menu4.config.f.x11 disabled {x l}}
1313
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {configure_entry .menu4.config.f.x12 normal {x l}} else {configure_entry .menu4.config.f.x12 disabled {x l}}
1314
        global CONFIG_DCACHE_ASSO1
1315
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {configure_entry .menu4.config.f.x13 normal {x l}} else {configure_entry .menu4.config.f.x13 disabled {x l}}
1316
        global CONFIG_DCACHE_LOCK
1317
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {
1318
        configure_entry .menu4.config.f.x14 normal {n l y}} else {configure_entry .menu4.config.f.x14 disabled {y n l}}
1319
        global CONFIG_DCACHE_SNOOP
1320
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
1321
        configure_entry .menu4.config.f.x15 normal {n l y}} else {configure_entry .menu4.config.f.x15 disabled {y n l}}
1322
        global CONFIG_DCACHE_SNOOP_FAST
1323
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1324
        configure_entry .menu4.config.f.x16 normal {n l y}} else {configure_entry .menu4.config.f.x16 disabled {y n l}}
1325
        global CONFIG_DCACHE_SNOOP_SEPTAG
1326
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1327
        configure_entry .menu4.config.f.x17 normal {n l y}} else {configure_entry .menu4.config.f.x17 disabled {y n l}}
1328
        global CONFIG_CACHE_FIXED
1329
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1 || $CONFIG_DCACHE_ENABLE == 1)} then {.menu4.config.f.x18.x configure -state normal -foreground [ cget .ref -foreground ]; .menu4.config.f.x18.l configure -state normal; } else {.menu4.config.f.x18.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu4.config.f.x18.l configure -state disabled}
1330
        global CONFIG_DCACHE_LRAM
1331
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1332
        configure_entry .menu4.config.f.x19 normal {n l y}} else {configure_entry .menu4.config.f.x19 disabled {y n l}}
1333
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {configure_entry .menu4.config.f.x20 normal {x l}} else {configure_entry .menu4.config.f.x20 disabled {x l}}
1334
        global CONFIG_DCACHE_LRSTART
1335
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {.menu4.config.f.x21.x configure -state normal -foreground [ cget .ref -foreground ]; .menu4.config.f.x21.l configure -state normal; } else {.menu4.config.f.x21.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu4.config.f.x21.l configure -state disabled}
1336
}
1337
 
1338
 
1339
proc update_define_menu4 {} {
1340
        update_define_mainmenu
1341
        global CONFIG_MODULES
1342
        global CONFIG_LEON3
1343
        global CONFIG_ICACHE_ENABLE
1344
        if {($CONFIG_LEON3 == 1)} then {
1345
        set CONFIG_ICACHE_ENABLE [expr $CONFIG_ICACHE_ENABLE&15]} else {set CONFIG_ICACHE_ENABLE [expr $CONFIG_ICACHE_ENABLE|16]}
1346
        global tmpvar_4
1347
        global CONFIG_ICACHE_ASSO1
1348
        if {$tmpvar_4 == "1"} then {set CONFIG_ICACHE_ASSO1 1} else {set CONFIG_ICACHE_ASSO1 0}
1349
        global CONFIG_ICACHE_ASSO2
1350
        if {$tmpvar_4 == "2"} then {set CONFIG_ICACHE_ASSO2 1} else {set CONFIG_ICACHE_ASSO2 0}
1351
        global CONFIG_ICACHE_ASSO3
1352
        if {$tmpvar_4 == "3"} then {set CONFIG_ICACHE_ASSO3 1} else {set CONFIG_ICACHE_ASSO3 0}
1353
        global CONFIG_ICACHE_ASSO4
1354
        if {$tmpvar_4 == "4"} then {set CONFIG_ICACHE_ASSO4 1} else {set CONFIG_ICACHE_ASSO4 0}
1355
        global tmpvar_5
1356
        global CONFIG_ICACHE_SZ1
1357
        if {$tmpvar_5 == "1"} then {set CONFIG_ICACHE_SZ1 1} else {set CONFIG_ICACHE_SZ1 0}
1358
        global CONFIG_ICACHE_SZ2
1359
        if {$tmpvar_5 == "2"} then {set CONFIG_ICACHE_SZ2 1} else {set CONFIG_ICACHE_SZ2 0}
1360
        global CONFIG_ICACHE_SZ4
1361
        if {$tmpvar_5 == "4"} then {set CONFIG_ICACHE_SZ4 1} else {set CONFIG_ICACHE_SZ4 0}
1362
        global CONFIG_ICACHE_SZ8
1363
        if {$tmpvar_5 == "8"} then {set CONFIG_ICACHE_SZ8 1} else {set CONFIG_ICACHE_SZ8 0}
1364
        global CONFIG_ICACHE_SZ16
1365
        if {$tmpvar_5 == "16"} then {set CONFIG_ICACHE_SZ16 1} else {set CONFIG_ICACHE_SZ16 0}
1366
        global CONFIG_ICACHE_SZ32
1367
        if {$tmpvar_5 == "32"} then {set CONFIG_ICACHE_SZ32 1} else {set CONFIG_ICACHE_SZ32 0}
1368
        global CONFIG_ICACHE_SZ64
1369
        if {$tmpvar_5 == "64"} then {set CONFIG_ICACHE_SZ64 1} else {set CONFIG_ICACHE_SZ64 0}
1370
        global CONFIG_ICACHE_SZ128
1371
        if {$tmpvar_5 == "128"} then {set CONFIG_ICACHE_SZ128 1} else {set CONFIG_ICACHE_SZ128 0}
1372
        global CONFIG_ICACHE_SZ256
1373
        if {$tmpvar_5 == "256"} then {set CONFIG_ICACHE_SZ256 1} else {set CONFIG_ICACHE_SZ256 0}
1374
        global tmpvar_6
1375
        global CONFIG_ICACHE_LZ16
1376
        if {$tmpvar_6 == "16"} then {set CONFIG_ICACHE_LZ16 1} else {set CONFIG_ICACHE_LZ16 0}
1377
        global CONFIG_ICACHE_LZ32
1378
        if {$tmpvar_6 == "32"} then {set CONFIG_ICACHE_LZ32 1} else {set CONFIG_ICACHE_LZ32 0}
1379
        global tmpvar_7
1380
        global CONFIG_ICACHE_ALGORND
1381
        if {$tmpvar_7 == "Random"} then {set CONFIG_ICACHE_ALGORND 1} else {set CONFIG_ICACHE_ALGORND 0}
1382
        global CONFIG_ICACHE_ALGOLRR
1383
        if {$tmpvar_7 == "LRR"} then {set CONFIG_ICACHE_ALGOLRR 1} else {set CONFIG_ICACHE_ALGOLRR 0}
1384
        global CONFIG_ICACHE_ALGOLRU
1385
        if {$tmpvar_7 == "LRU"} then {set CONFIG_ICACHE_ALGOLRU 1} else {set CONFIG_ICACHE_ALGOLRU 0}
1386
        global CONFIG_ICACHE_LOCK
1387
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {
1388
        set CONFIG_ICACHE_LOCK [expr $CONFIG_ICACHE_LOCK&15]} else {set CONFIG_ICACHE_LOCK [expr $CONFIG_ICACHE_LOCK|16]}
1389
        global CONFIG_MMU_ENABLE
1390
        global CONFIG_ICACHE_LRAM
1391
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1392
        set CONFIG_ICACHE_LRAM [expr $CONFIG_ICACHE_LRAM&15]} else {set CONFIG_ICACHE_LRAM [expr $CONFIG_ICACHE_LRAM|16]}
1393
        global tmpvar_8
1394
        global CONFIG_ICACHE_LRAM_SZ1
1395
        if {$tmpvar_8 == "1"} then {set CONFIG_ICACHE_LRAM_SZ1 1} else {set CONFIG_ICACHE_LRAM_SZ1 0}
1396
        global CONFIG_ICACHE_LRAM_SZ2
1397
        if {$tmpvar_8 == "2"} then {set CONFIG_ICACHE_LRAM_SZ2 1} else {set CONFIG_ICACHE_LRAM_SZ2 0}
1398
        global CONFIG_ICACHE_LRAM_SZ4
1399
        if {$tmpvar_8 == "4"} then {set CONFIG_ICACHE_LRAM_SZ4 1} else {set CONFIG_ICACHE_LRAM_SZ4 0}
1400
        global CONFIG_ICACHE_LRAM_SZ8
1401
        if {$tmpvar_8 == "8"} then {set CONFIG_ICACHE_LRAM_SZ8 1} else {set CONFIG_ICACHE_LRAM_SZ8 0}
1402
        global CONFIG_ICACHE_LRAM_SZ16
1403
        if {$tmpvar_8 == "16"} then {set CONFIG_ICACHE_LRAM_SZ16 1} else {set CONFIG_ICACHE_LRAM_SZ16 0}
1404
        global CONFIG_ICACHE_LRAM_SZ32
1405
        if {$tmpvar_8 == "32"} then {set CONFIG_ICACHE_LRAM_SZ32 1} else {set CONFIG_ICACHE_LRAM_SZ32 0}
1406
        global CONFIG_ICACHE_LRAM_SZ64
1407
        if {$tmpvar_8 == "64"} then {set CONFIG_ICACHE_LRAM_SZ64 1} else {set CONFIG_ICACHE_LRAM_SZ64 0}
1408
        global CONFIG_ICACHE_LRAM_SZ128
1409
        if {$tmpvar_8 == "128"} then {set CONFIG_ICACHE_LRAM_SZ128 1} else {set CONFIG_ICACHE_LRAM_SZ128 0}
1410
        global CONFIG_ICACHE_LRAM_SZ256
1411
        if {$tmpvar_8 == "256"} then {set CONFIG_ICACHE_LRAM_SZ256 1} else {set CONFIG_ICACHE_LRAM_SZ256 0}
1412
        global CONFIG_ICACHE_LRSTART
1413
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {validate_hex CONFIG_ICACHE_LRSTART "$CONFIG_ICACHE_LRSTART" 8e}
1414
        global CONFIG_DCACHE_ENABLE
1415
        if {($CONFIG_LEON3 == 1)} then {
1416
        set CONFIG_DCACHE_ENABLE [expr $CONFIG_DCACHE_ENABLE&15]} else {set CONFIG_DCACHE_ENABLE [expr $CONFIG_DCACHE_ENABLE|16]}
1417
        global tmpvar_9
1418
        global CONFIG_DCACHE_ASSO1
1419
        if {$tmpvar_9 == "1"} then {set CONFIG_DCACHE_ASSO1 1} else {set CONFIG_DCACHE_ASSO1 0}
1420
        global CONFIG_DCACHE_ASSO2
1421
        if {$tmpvar_9 == "2"} then {set CONFIG_DCACHE_ASSO2 1} else {set CONFIG_DCACHE_ASSO2 0}
1422
        global CONFIG_DCACHE_ASSO3
1423
        if {$tmpvar_9 == "3"} then {set CONFIG_DCACHE_ASSO3 1} else {set CONFIG_DCACHE_ASSO3 0}
1424
        global CONFIG_DCACHE_ASSO4
1425
        if {$tmpvar_9 == "4"} then {set CONFIG_DCACHE_ASSO4 1} else {set CONFIG_DCACHE_ASSO4 0}
1426
        global tmpvar_10
1427
        global CONFIG_DCACHE_SZ1
1428
        if {$tmpvar_10 == "1"} then {set CONFIG_DCACHE_SZ1 1} else {set CONFIG_DCACHE_SZ1 0}
1429
        global CONFIG_DCACHE_SZ2
1430
        if {$tmpvar_10 == "2"} then {set CONFIG_DCACHE_SZ2 1} else {set CONFIG_DCACHE_SZ2 0}
1431
        global CONFIG_DCACHE_SZ4
1432
        if {$tmpvar_10 == "4"} then {set CONFIG_DCACHE_SZ4 1} else {set CONFIG_DCACHE_SZ4 0}
1433
        global CONFIG_DCACHE_SZ8
1434
        if {$tmpvar_10 == "8"} then {set CONFIG_DCACHE_SZ8 1} else {set CONFIG_DCACHE_SZ8 0}
1435
        global CONFIG_DCACHE_SZ16
1436
        if {$tmpvar_10 == "16"} then {set CONFIG_DCACHE_SZ16 1} else {set CONFIG_DCACHE_SZ16 0}
1437
        global CONFIG_DCACHE_SZ32
1438
        if {$tmpvar_10 == "32"} then {set CONFIG_DCACHE_SZ32 1} else {set CONFIG_DCACHE_SZ32 0}
1439
        global CONFIG_DCACHE_SZ64
1440
        if {$tmpvar_10 == "64"} then {set CONFIG_DCACHE_SZ64 1} else {set CONFIG_DCACHE_SZ64 0}
1441
        global CONFIG_DCACHE_SZ128
1442
        if {$tmpvar_10 == "128"} then {set CONFIG_DCACHE_SZ128 1} else {set CONFIG_DCACHE_SZ128 0}
1443
        global CONFIG_DCACHE_SZ256
1444
        if {$tmpvar_10 == "256"} then {set CONFIG_DCACHE_SZ256 1} else {set CONFIG_DCACHE_SZ256 0}
1445
        global tmpvar_11
1446
        global CONFIG_DCACHE_LZ16
1447
        if {$tmpvar_11 == "16"} then {set CONFIG_DCACHE_LZ16 1} else {set CONFIG_DCACHE_LZ16 0}
1448
        global CONFIG_DCACHE_LZ32
1449
        if {$tmpvar_11 == "32"} then {set CONFIG_DCACHE_LZ32 1} else {set CONFIG_DCACHE_LZ32 0}
1450
        global tmpvar_12
1451
        global CONFIG_DCACHE_ALGORND
1452
        if {$tmpvar_12 == "Random"} then {set CONFIG_DCACHE_ALGORND 1} else {set CONFIG_DCACHE_ALGORND 0}
1453
        global CONFIG_DCACHE_ALGOLRR
1454
        if {$tmpvar_12 == "LRR"} then {set CONFIG_DCACHE_ALGOLRR 1} else {set CONFIG_DCACHE_ALGOLRR 0}
1455
        global CONFIG_DCACHE_ALGOLRU
1456
        if {$tmpvar_12 == "LRU"} then {set CONFIG_DCACHE_ALGOLRU 1} else {set CONFIG_DCACHE_ALGOLRU 0}
1457
        global CONFIG_DCACHE_LOCK
1458
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {
1459
        set CONFIG_DCACHE_LOCK [expr $CONFIG_DCACHE_LOCK&15]} else {set CONFIG_DCACHE_LOCK [expr $CONFIG_DCACHE_LOCK|16]}
1460
        global CONFIG_DCACHE_SNOOP
1461
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
1462
        set CONFIG_DCACHE_SNOOP [expr $CONFIG_DCACHE_SNOOP&15]} else {set CONFIG_DCACHE_SNOOP [expr $CONFIG_DCACHE_SNOOP|16]}
1463
        global CONFIG_DCACHE_SNOOP_FAST
1464
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1465
        set CONFIG_DCACHE_SNOOP_FAST [expr $CONFIG_DCACHE_SNOOP_FAST&15]} else {set CONFIG_DCACHE_SNOOP_FAST [expr $CONFIG_DCACHE_SNOOP_FAST|16]}
1466
        global CONFIG_DCACHE_SNOOP_SEPTAG
1467
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_SNOOP == 1)} then {
1468
        set CONFIG_DCACHE_SNOOP_SEPTAG [expr $CONFIG_DCACHE_SNOOP_SEPTAG&15]} else {set CONFIG_DCACHE_SNOOP_SEPTAG [expr $CONFIG_DCACHE_SNOOP_SEPTAG|16]}
1469
        global CONFIG_CACHE_FIXED
1470
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1 || $CONFIG_DCACHE_ENABLE == 1)} then {validate_hex CONFIG_CACHE_FIXED "$CONFIG_CACHE_FIXED" 0}
1471
        global CONFIG_DCACHE_LRAM
1472
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {
1473
        set CONFIG_DCACHE_LRAM [expr $CONFIG_DCACHE_LRAM&15]} else {set CONFIG_DCACHE_LRAM [expr $CONFIG_DCACHE_LRAM|16]}
1474
        global tmpvar_13
1475
        global CONFIG_DCACHE_LRAM_SZ1
1476
        if {$tmpvar_13 == "1"} then {set CONFIG_DCACHE_LRAM_SZ1 1} else {set CONFIG_DCACHE_LRAM_SZ1 0}
1477
        global CONFIG_DCACHE_LRAM_SZ2
1478
        if {$tmpvar_13 == "2"} then {set CONFIG_DCACHE_LRAM_SZ2 1} else {set CONFIG_DCACHE_LRAM_SZ2 0}
1479
        global CONFIG_DCACHE_LRAM_SZ4
1480
        if {$tmpvar_13 == "4"} then {set CONFIG_DCACHE_LRAM_SZ4 1} else {set CONFIG_DCACHE_LRAM_SZ4 0}
1481
        global CONFIG_DCACHE_LRAM_SZ8
1482
        if {$tmpvar_13 == "8"} then {set CONFIG_DCACHE_LRAM_SZ8 1} else {set CONFIG_DCACHE_LRAM_SZ8 0}
1483
        global CONFIG_DCACHE_LRAM_SZ16
1484
        if {$tmpvar_13 == "16"} then {set CONFIG_DCACHE_LRAM_SZ16 1} else {set CONFIG_DCACHE_LRAM_SZ16 0}
1485
        global CONFIG_DCACHE_LRAM_SZ32
1486
        if {$tmpvar_13 == "32"} then {set CONFIG_DCACHE_LRAM_SZ32 1} else {set CONFIG_DCACHE_LRAM_SZ32 0}
1487
        global CONFIG_DCACHE_LRAM_SZ64
1488
        if {$tmpvar_13 == "64"} then {set CONFIG_DCACHE_LRAM_SZ64 1} else {set CONFIG_DCACHE_LRAM_SZ64 0}
1489
        global CONFIG_DCACHE_LRAM_SZ128
1490
        if {$tmpvar_13 == "128"} then {set CONFIG_DCACHE_LRAM_SZ128 1} else {set CONFIG_DCACHE_LRAM_SZ128 0}
1491
        global CONFIG_DCACHE_LRAM_SZ256
1492
        if {$tmpvar_13 == "256"} then {set CONFIG_DCACHE_LRAM_SZ256 1} else {set CONFIG_DCACHE_LRAM_SZ256 0}
1493
        global CONFIG_DCACHE_LRSTART
1494
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {validate_hex CONFIG_DCACHE_LRSTART "$CONFIG_DCACHE_LRSTART" 8f}
1495
}
1496
 
1497
 
1498
proc menu5 {w title} {
1499
        set oldFocus [focus]
1500
        catch {focus .menu1}
1501
        catch {destroy $w; unregister_active 5}
1502
        toplevel $w -class Dialog
1503
        wm withdraw $w
1504
        global active_menus
1505
        set active_menus [lsort -integer [linsert $active_menus end 5]]
1506
        message $w.m -width 400 -aspect 300 -text \
1507
                "MMU"  -relief raised
1508
        pack $w.m -pady 10 -side top -padx 10
1509
        wm title $w "MMU"
1510
 
1511
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 5; break"
1512
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu6 .menu6 \"$title\""
1513
        frame $w.f
1514
        button $w.f.back -text "OK" \
1515
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 5"
1516
        button $w.f.next -text "Next" -underline 0\
1517
                -width 15 -command $nextscript
1518
        bind all  $nextscript
1519
        button $w.f.prev -text "Prev" -underline 0\
1520
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu4 .menu4 \"$title\""
1521
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu4 .menu4 \"$title\";break"
1522
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1523
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1524
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1525
        pack $w.topline -side top -fill x
1526
 
1527
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1528
        pack $w.botline -side bottom -fill x
1529
 
1530
        frame $w.config
1531
        pack $w.config -fill y -expand on
1532
 
1533
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1534
        pack $w.config.vscroll -side right -fill y
1535
 
1536
        canvas $w.config.canvas -height 1\
1537
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1538
                -width [expr [winfo screenwidth .] * 1 / 2]
1539
        frame $w.config.f
1540
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1541
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1542
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1543
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1544
        bind $w  "$w.config.canvas yview moveto 0;break;"
1545
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1546
        pack $w.config.canvas -side right -fill y
1547
 
1548
 
1549
        bool $w.config.f 5 0 "Enable MMU       " CONFIG_MMU_ENABLE
1550
        global tmpvar_14
1551
        minimenu $w.config.f 5 1 "MMU type              " tmpvar_14 CONFIG_MMU_COMBINED
1552
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"MMU type              \""
1553
        $w.config.f.x1.x.menu add radiobutton -label "combined" -variable tmpvar_14 -value "combined" -command "update_active"
1554
        $w.config.f.x1.x.menu add radiobutton -label "split" -variable tmpvar_14 -value "split" -command "update_active"
1555
        menusplit $w $w.config.f.x1.x.menu 2
1556
        global tmpvar_15
1557
        minimenu $w.config.f 5 2 "TLB replacement sheme              " tmpvar_15 CONFIG_MMU_REPARRAY
1558
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"TLB replacement sheme              \""
1559
        $w.config.f.x2.x.menu add radiobutton -label "LRU" -variable tmpvar_15 -value "LRU" -command "update_active"
1560
        $w.config.f.x2.x.menu add radiobutton -label "Increment" -variable tmpvar_15 -value "Increment" -command "update_active"
1561
        menusplit $w $w.config.f.x2.x.menu 2
1562
        global tmpvar_16
1563
        minimenu $w.config.f 5 3 "Instruction (or combined) TLB entries" tmpvar_16 CONFIG_MMU_I2
1564
        menu $w.config.f.x3.x.menu -tearoffcommand "menutitle \"Instruction (or combined) TLB entries\""
1565
        $w.config.f.x3.x.menu add radiobutton -label "2" -variable tmpvar_16 -value "2" -command "update_active"
1566
        $w.config.f.x3.x.menu add radiobutton -label "4" -variable tmpvar_16 -value "4" -command "update_active"
1567
        $w.config.f.x3.x.menu add radiobutton -label "8" -variable tmpvar_16 -value "8" -command "update_active"
1568
        $w.config.f.x3.x.menu add radiobutton -label "16" -variable tmpvar_16 -value "16" -command "update_active"
1569
        $w.config.f.x3.x.menu add radiobutton -label "32" -variable tmpvar_16 -value "32" -command "update_active"
1570
        menusplit $w $w.config.f.x3.x.menu 5
1571
        global tmpvar_17
1572
        minimenu $w.config.f 5 4 "Data TLB entries" tmpvar_17 CONFIG_MMU_D2
1573
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"Data TLB entries\""
1574
        $w.config.f.x4.x.menu add radiobutton -label "2" -variable tmpvar_17 -value "2" -command "update_active"
1575
        $w.config.f.x4.x.menu add radiobutton -label "4" -variable tmpvar_17 -value "4" -command "update_active"
1576
        $w.config.f.x4.x.menu add radiobutton -label "8" -variable tmpvar_17 -value "8" -command "update_active"
1577
        $w.config.f.x4.x.menu add radiobutton -label "16" -variable tmpvar_17 -value "16" -command "update_active"
1578
        $w.config.f.x4.x.menu add radiobutton -label "32" -variable tmpvar_17 -value "32" -command "update_active"
1579
        menusplit $w $w.config.f.x4.x.menu 5
1580
        bool $w.config.f 5 5 "Fast writebuffer       " CONFIG_MMU_FASTWB
1581
 
1582
 
1583
 
1584
        focus $w
1585
        update_active
1586
        global winx; global winy
1587
        if {[winfo exists .menu1] == 0} then {menu1 .menu1 "Processor            "}
1588
        set winx [expr [winfo x .menu1]+30]; set winy [expr [winfo y .menu1]+30]
1589
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1590
        update idletasks
1591
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1592
 
1593
        $w.config.canvas configure \
1594
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1595
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1596
                         [expr [winfo reqheight $w.config.f] + 1]"
1597
 
1598
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1599
        set scry [expr [winfo screenh $w] / 2]
1600
        set maxy [expr [winfo screenh $w] * 3 / 4]
1601
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1602
        if [expr $winy + $canvtotal < $maxy] {
1603
                $w.config.canvas configure -height $canvtotal
1604
        } else {
1605
                $w.config.canvas configure -height [expr $scry - $winy]
1606
                }
1607
        }
1608
        update idletasks
1609
        if {[winfo exists $w]} then {
1610
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1611
        wm minsize $w [winfo width $w] 100
1612
 
1613
        wm deiconify $w
1614
}
1615
}
1616
 
1617
proc update_menu5 {} {
1618
        global CONFIG_LEON3
1619
        global CONFIG_MMU_ENABLE
1620
        if {($CONFIG_LEON3 == 1)} then {
1621
        configure_entry .menu5.config.f.x0 normal {n l y}} else {configure_entry .menu5.config.f.x0 disabled {y n l}}
1622
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {configure_entry .menu5.config.f.x1 normal {x l}} else {configure_entry .menu5.config.f.x1 disabled {x l}}
1623
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {configure_entry .menu5.config.f.x2 normal {x l}} else {configure_entry .menu5.config.f.x2 disabled {x l}}
1624
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {configure_entry .menu5.config.f.x3 normal {x l}} else {configure_entry .menu5.config.f.x3 disabled {x l}}
1625
        global CONFIG_MMU_SPLIT
1626
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {configure_entry .menu5.config.f.x4 normal {x l}} else {configure_entry .menu5.config.f.x4 disabled {x l}}
1627
        global CONFIG_MMU_FASTWB
1628
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {
1629
        configure_entry .menu5.config.f.x5 normal {n l y}} else {configure_entry .menu5.config.f.x5 disabled {y n l}}
1630
}
1631
 
1632
 
1633
proc update_define_menu5 {} {
1634
        update_define_mainmenu
1635
        global CONFIG_MODULES
1636
        global CONFIG_LEON3
1637
        global CONFIG_MMU_ENABLE
1638
        if {($CONFIG_LEON3 == 1)} then {
1639
        set CONFIG_MMU_ENABLE [expr $CONFIG_MMU_ENABLE&15]} else {set CONFIG_MMU_ENABLE [expr $CONFIG_MMU_ENABLE|16]}
1640
        global tmpvar_14
1641
        global CONFIG_MMU_COMBINED
1642
        if {$tmpvar_14 == "combined"} then {set CONFIG_MMU_COMBINED 1} else {set CONFIG_MMU_COMBINED 0}
1643
        global CONFIG_MMU_SPLIT
1644
        if {$tmpvar_14 == "split"} then {set CONFIG_MMU_SPLIT 1} else {set CONFIG_MMU_SPLIT 0}
1645
        global tmpvar_15
1646
        global CONFIG_MMU_REPARRAY
1647
        if {$tmpvar_15 == "LRU"} then {set CONFIG_MMU_REPARRAY 1} else {set CONFIG_MMU_REPARRAY 0}
1648
        global CONFIG_MMU_REPINCREMENT
1649
        if {$tmpvar_15 == "Increment"} then {set CONFIG_MMU_REPINCREMENT 1} else {set CONFIG_MMU_REPINCREMENT 0}
1650
        global tmpvar_16
1651
        global CONFIG_MMU_I2
1652
        if {$tmpvar_16 == "2"} then {set CONFIG_MMU_I2 1} else {set CONFIG_MMU_I2 0}
1653
        global CONFIG_MMU_I4
1654
        if {$tmpvar_16 == "4"} then {set CONFIG_MMU_I4 1} else {set CONFIG_MMU_I4 0}
1655
        global CONFIG_MMU_I8
1656
        if {$tmpvar_16 == "8"} then {set CONFIG_MMU_I8 1} else {set CONFIG_MMU_I8 0}
1657
        global CONFIG_MMU_I16
1658
        if {$tmpvar_16 == "16"} then {set CONFIG_MMU_I16 1} else {set CONFIG_MMU_I16 0}
1659
        global CONFIG_MMU_I32
1660
        if {$tmpvar_16 == "32"} then {set CONFIG_MMU_I32 1} else {set CONFIG_MMU_I32 0}
1661
        global tmpvar_17
1662
        global CONFIG_MMU_D2
1663
        if {$tmpvar_17 == "2"} then {set CONFIG_MMU_D2 1} else {set CONFIG_MMU_D2 0}
1664
        global CONFIG_MMU_D4
1665
        if {$tmpvar_17 == "4"} then {set CONFIG_MMU_D4 1} else {set CONFIG_MMU_D4 0}
1666
        global CONFIG_MMU_D8
1667
        if {$tmpvar_17 == "8"} then {set CONFIG_MMU_D8 1} else {set CONFIG_MMU_D8 0}
1668
        global CONFIG_MMU_D16
1669
        if {$tmpvar_17 == "16"} then {set CONFIG_MMU_D16 1} else {set CONFIG_MMU_D16 0}
1670
        global CONFIG_MMU_D32
1671
        if {$tmpvar_17 == "32"} then {set CONFIG_MMU_D32 1} else {set CONFIG_MMU_D32 0}
1672
        global CONFIG_MMU_FASTWB
1673
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {
1674
        set CONFIG_MMU_FASTWB [expr $CONFIG_MMU_FASTWB&15]} else {set CONFIG_MMU_FASTWB [expr $CONFIG_MMU_FASTWB|16]}
1675
}
1676
 
1677
 
1678
proc menu6 {w title} {
1679
        set oldFocus [focus]
1680
        catch {focus .menu1}
1681
        catch {destroy $w; unregister_active 6}
1682
        toplevel $w -class Dialog
1683
        wm withdraw $w
1684
        global active_menus
1685
        set active_menus [lsort -integer [linsert $active_menus end 6]]
1686
        message $w.m -width 400 -aspect 300 -text \
1687
                "Debug Support Unit        "  -relief raised
1688
        pack $w.m -pady 10 -side top -padx 10
1689
        wm title $w "Debug Support Unit        "
1690
 
1691
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 6; break"
1692
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu7 .menu7 \"$title\""
1693
        frame $w.f
1694
        button $w.f.back -text "OK" \
1695
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 6"
1696
        button $w.f.next -text "Next" -underline 0\
1697
                -width 15 -command $nextscript
1698
        bind all  $nextscript
1699
        button $w.f.prev -text "Prev" -underline 0\
1700
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu5 .menu5 \"$title\""
1701
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu5 .menu5 \"$title\";break"
1702
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1703
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1704
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1705
        pack $w.topline -side top -fill x
1706
 
1707
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1708
        pack $w.botline -side bottom -fill x
1709
 
1710
        frame $w.config
1711
        pack $w.config -fill y -expand on
1712
 
1713
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1714
        pack $w.config.vscroll -side right -fill y
1715
 
1716
        canvas $w.config.canvas -height 1\
1717
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1718
                -width [expr [winfo screenwidth .] * 1 / 2]
1719
        frame $w.config.f
1720
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1721
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1722
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1723
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1724
        bind $w  "$w.config.canvas yview moveto 0;break;"
1725
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1726
        pack $w.config.canvas -side right -fill y
1727
 
1728
 
1729
        bool $w.config.f 6 0 "Enable LEON3 Debug support unit    " CONFIG_DSU_ENABLE
1730
        bool $w.config.f 6 1 "Instruction trace buffer" CONFIG_DSU_ITRACE
1731
        global tmpvar_18
1732
        minimenu $w.config.f 6 2 "Instruction trace buffer size (kbytes)" tmpvar_18 CONFIG_DSU_ITRACESZ1
1733
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"Instruction trace buffer size (kbytes)\""
1734
        $w.config.f.x2.x.menu add radiobutton -label "1" -variable tmpvar_18 -value "1" -command "update_active"
1735
        $w.config.f.x2.x.menu add radiobutton -label "2" -variable tmpvar_18 -value "2" -command "update_active"
1736
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_18 -value "4" -command "update_active"
1737
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_18 -value "8" -command "update_active"
1738
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_18 -value "16" -command "update_active"
1739
        menusplit $w $w.config.f.x2.x.menu 5
1740
        bool $w.config.f 6 3 "AHB trace buffer" CONFIG_DSU_ATRACE
1741
        global tmpvar_19
1742
        minimenu $w.config.f 6 4 "AHB trace buffer size (kbytes)" tmpvar_19 CONFIG_DSU_ATRACESZ1
1743
        menu $w.config.f.x4.x.menu -tearoffcommand "menutitle \"AHB trace buffer size (kbytes)\""
1744
        $w.config.f.x4.x.menu add radiobutton -label "1" -variable tmpvar_19 -value "1" -command "update_active"
1745
        $w.config.f.x4.x.menu add radiobutton -label "2" -variable tmpvar_19 -value "2" -command "update_active"
1746
        $w.config.f.x4.x.menu add radiobutton -label "4" -variable tmpvar_19 -value "4" -command "update_active"
1747
        $w.config.f.x4.x.menu add radiobutton -label "8" -variable tmpvar_19 -value "8" -command "update_active"
1748
        $w.config.f.x4.x.menu add radiobutton -label "16" -variable tmpvar_19 -value "16" -command "update_active"
1749
        menusplit $w $w.config.f.x4.x.menu 5
1750
 
1751
 
1752
 
1753
        focus $w
1754
        update_active
1755
        global winx; global winy
1756
        if {[winfo exists .menu1] == 0} then {menu1 .menu1 "Processor            "}
1757
        set winx [expr [winfo x .menu1]+30]; set winy [expr [winfo y .menu1]+30]
1758
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1759
        update idletasks
1760
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1761
 
1762
        $w.config.canvas configure \
1763
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1764
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1765
                         [expr [winfo reqheight $w.config.f] + 1]"
1766
 
1767
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1768
        set scry [expr [winfo screenh $w] / 2]
1769
        set maxy [expr [winfo screenh $w] * 3 / 4]
1770
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1771
        if [expr $winy + $canvtotal < $maxy] {
1772
                $w.config.canvas configure -height $canvtotal
1773
        } else {
1774
                $w.config.canvas configure -height [expr $scry - $winy]
1775
                }
1776
        }
1777
        update idletasks
1778
        if {[winfo exists $w]} then {
1779
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1780
        wm minsize $w [winfo width $w] 100
1781
 
1782
        wm deiconify $w
1783
}
1784
}
1785
 
1786
proc update_menu6 {} {
1787
        global CONFIG_LEON3
1788
        global CONFIG_DSU_ENABLE
1789
        if {($CONFIG_LEON3 == 1)} then {
1790
        configure_entry .menu6.config.f.x0 normal {n l y}} else {configure_entry .menu6.config.f.x0 disabled {y n l}}
1791
        global CONFIG_DSU_ITRACE
1792
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
1793
        configure_entry .menu6.config.f.x1 normal {n l y}} else {configure_entry .menu6.config.f.x1 disabled {y n l}}
1794
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ITRACE == 1)} then {configure_entry .menu6.config.f.x2 normal {x l}} else {configure_entry .menu6.config.f.x2 disabled {x l}}
1795
        global CONFIG_DSU_ATRACE
1796
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
1797
        configure_entry .menu6.config.f.x3 normal {n l y}} else {configure_entry .menu6.config.f.x3 disabled {y n l}}
1798
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ATRACE == 1)} then {configure_entry .menu6.config.f.x4 normal {x l}} else {configure_entry .menu6.config.f.x4 disabled {x l}}
1799
}
1800
 
1801
 
1802
proc update_define_menu6 {} {
1803
        update_define_mainmenu
1804
        global CONFIG_MODULES
1805
        global CONFIG_LEON3
1806
        global CONFIG_DSU_ENABLE
1807
        if {($CONFIG_LEON3 == 1)} then {
1808
        set CONFIG_DSU_ENABLE [expr $CONFIG_DSU_ENABLE&15]} else {set CONFIG_DSU_ENABLE [expr $CONFIG_DSU_ENABLE|16]}
1809
        global CONFIG_DSU_ITRACE
1810
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
1811
        set CONFIG_DSU_ITRACE [expr $CONFIG_DSU_ITRACE&15]} else {set CONFIG_DSU_ITRACE [expr $CONFIG_DSU_ITRACE|16]}
1812
        global tmpvar_18
1813
        global CONFIG_DSU_ITRACESZ1
1814
        if {$tmpvar_18 == "1"} then {set CONFIG_DSU_ITRACESZ1 1} else {set CONFIG_DSU_ITRACESZ1 0}
1815
        global CONFIG_DSU_ITRACESZ2
1816
        if {$tmpvar_18 == "2"} then {set CONFIG_DSU_ITRACESZ2 1} else {set CONFIG_DSU_ITRACESZ2 0}
1817
        global CONFIG_DSU_ITRACESZ4
1818
        if {$tmpvar_18 == "4"} then {set CONFIG_DSU_ITRACESZ4 1} else {set CONFIG_DSU_ITRACESZ4 0}
1819
        global CONFIG_DSU_ITRACESZ8
1820
        if {$tmpvar_18 == "8"} then {set CONFIG_DSU_ITRACESZ8 1} else {set CONFIG_DSU_ITRACESZ8 0}
1821
        global CONFIG_DSU_ITRACESZ16
1822
        if {$tmpvar_18 == "16"} then {set CONFIG_DSU_ITRACESZ16 1} else {set CONFIG_DSU_ITRACESZ16 0}
1823
        global CONFIG_DSU_ATRACE
1824
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {
1825
        set CONFIG_DSU_ATRACE [expr $CONFIG_DSU_ATRACE&15]} else {set CONFIG_DSU_ATRACE [expr $CONFIG_DSU_ATRACE|16]}
1826
        global tmpvar_19
1827
        global CONFIG_DSU_ATRACESZ1
1828
        if {$tmpvar_19 == "1"} then {set CONFIG_DSU_ATRACESZ1 1} else {set CONFIG_DSU_ATRACESZ1 0}
1829
        global CONFIG_DSU_ATRACESZ2
1830
        if {$tmpvar_19 == "2"} then {set CONFIG_DSU_ATRACESZ2 1} else {set CONFIG_DSU_ATRACESZ2 0}
1831
        global CONFIG_DSU_ATRACESZ4
1832
        if {$tmpvar_19 == "4"} then {set CONFIG_DSU_ATRACESZ4 1} else {set CONFIG_DSU_ATRACESZ4 0}
1833
        global CONFIG_DSU_ATRACESZ8
1834
        if {$tmpvar_19 == "8"} then {set CONFIG_DSU_ATRACESZ8 1} else {set CONFIG_DSU_ATRACESZ8 0}
1835
        global CONFIG_DSU_ATRACESZ16
1836
        if {$tmpvar_19 == "16"} then {set CONFIG_DSU_ATRACESZ16 1} else {set CONFIG_DSU_ATRACESZ16 0}
1837
}
1838
 
1839
 
1840
proc menu7 {w title} {
1841
        set oldFocus [focus]
1842
        catch {focus .menu1}
1843
        catch {destroy $w; unregister_active 7}
1844
        toplevel $w -class Dialog
1845
        wm withdraw $w
1846
        global active_menus
1847
        set active_menus [lsort -integer [linsert $active_menus end 7]]
1848
        message $w.m -width 400 -aspect 300 -text \
1849
                "Fault-tolerance  "  -relief raised
1850
        pack $w.m -pady 10 -side top -padx 10
1851
        wm title $w "Fault-tolerance  "
1852
 
1853
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 7; break"
1854
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu8 .menu8 \"$title\""
1855
        frame $w.f
1856
        button $w.f.back -text "OK" \
1857
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 7"
1858
        button $w.f.next -text "Next" -underline 0\
1859
                -width 15 -command $nextscript
1860
        bind all  $nextscript
1861
        button $w.f.prev -text "Prev" -underline 0\
1862
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu6 .menu6 \"$title\""
1863
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu6 .menu6 \"$title\";break"
1864
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1865
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1866
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1867
        pack $w.topline -side top -fill x
1868
 
1869
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1870
        pack $w.botline -side bottom -fill x
1871
 
1872
        frame $w.config
1873
        pack $w.config -fill y -expand on
1874
 
1875
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1876
        pack $w.config.vscroll -side right -fill y
1877
 
1878
        canvas $w.config.canvas -height 1\
1879
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1880
                -width [expr [winfo screenwidth .] * 1 / 2]
1881
        frame $w.config.f
1882
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1883
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1884
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1885
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1886
        bind $w  "$w.config.canvas yview moveto 0;break;"
1887
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1888
        pack $w.config.canvas -side right -fill y
1889
 
1890
 
1891
 
1892
 
1893
 
1894
        focus $w
1895
        update_active
1896
        global winx; global winy
1897
        if {[winfo exists .menu1] == 0} then {menu1 .menu1 "Processor            "}
1898
        set winx [expr [winfo x .menu1]+30]; set winy [expr [winfo y .menu1]+30]
1899
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1900
        update idletasks
1901
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1902
 
1903
        $w.config.canvas configure \
1904
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1905
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1906
                         [expr [winfo reqheight $w.config.f] + 1]"
1907
 
1908
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1909
        set scry [expr [winfo screenh $w] / 2]
1910
        set maxy [expr [winfo screenh $w] * 3 / 4]
1911
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1912
        if [expr $winy + $canvtotal < $maxy] {
1913
                $w.config.canvas configure -height $canvtotal
1914
        } else {
1915
                $w.config.canvas configure -height [expr $scry - $winy]
1916
                }
1917
        }
1918
        update idletasks
1919
        if {[winfo exists $w]} then {
1920
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1921
        wm minsize $w [winfo width $w] 100
1922
 
1923
        wm deiconify $w
1924
}
1925
}
1926
 
1927
proc update_menu7 {} {
1928
}
1929
 
1930
 
1931
proc update_define_menu7 {} {
1932
        update_define_mainmenu
1933
        global CONFIG_MODULES
1934
}
1935
 
1936
 
1937
proc menu8 {w title} {
1938
        set oldFocus [focus]
1939
        catch {focus .menu1}
1940
        catch {destroy $w; unregister_active 8}
1941
        toplevel $w -class Dialog
1942
        wm withdraw $w
1943
        global active_menus
1944
        set active_menus [lsort -integer [linsert $active_menus end 8]]
1945
        message $w.m -width 400 -aspect 300 -text \
1946
                "VHDL debug settings       "  -relief raised
1947
        pack $w.m -pady 10 -side top -padx 10
1948
        wm title $w "VHDL debug settings       "
1949
 
1950
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 8; break"
1951
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 8; catch {destroy .menu1}; unregister_active 1; menu9 .menu9 \"$title\""
1952
        frame $w.f
1953
        button $w.f.back -text "OK" \
1954
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 8"
1955
        button $w.f.next -text "Next" -underline 0\
1956
                -width 15 -command $nextscript
1957
        bind all  $nextscript
1958
        button $w.f.prev -text "Prev" -underline 0\
1959
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 8; menu7 .menu7 \"$title\""
1960
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 8; menu7 .menu7 \"$title\";break"
1961
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1962
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1963
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1964
        pack $w.topline -side top -fill x
1965
 
1966
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1967
        pack $w.botline -side bottom -fill x
1968
 
1969
        frame $w.config
1970
        pack $w.config -fill y -expand on
1971
 
1972
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1973
        pack $w.config.vscroll -side right -fill y
1974
 
1975
        canvas $w.config.canvas -height 1\
1976
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1977
                -width [expr [winfo screenwidth .] * 1 / 2]
1978
        frame $w.config.f
1979
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1980
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1981
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1982
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1983
        bind $w  "$w.config.canvas yview moveto 0;break;"
1984
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1985
        pack $w.config.canvas -side right -fill y
1986
 
1987
 
1988
        bool $w.config.f 8 0 "Processor disassembly to console         " CONFIG_IU_DISAS
1989
        bool $w.config.f 8 1 "Processor disassembly in netlist         " CONFIG_IU_DISAS_NET
1990
        bool $w.config.f 8 2 "32-bit program counters       " CONFIG_DEBUG_PC32
1991
 
1992
 
1993
 
1994
        focus $w
1995
        update_active
1996
        global winx; global winy
1997
        if {[winfo exists .menu1] == 0} then {menu1 .menu1 "Processor            "}
1998
        set winx [expr [winfo x .menu1]+30]; set winy [expr [winfo y .menu1]+30]
1999
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2000
        update idletasks
2001
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2002
 
2003
        $w.config.canvas configure \
2004
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2005
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2006
                         [expr [winfo reqheight $w.config.f] + 1]"
2007
 
2008
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2009
        set scry [expr [winfo screenh $w] / 2]
2010
        set maxy [expr [winfo screenh $w] * 3 / 4]
2011
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2012
        if [expr $winy + $canvtotal < $maxy] {
2013
                $w.config.canvas configure -height $canvtotal
2014
        } else {
2015
                $w.config.canvas configure -height [expr $scry - $winy]
2016
                }
2017
        }
2018
        update idletasks
2019
        if {[winfo exists $w]} then {
2020
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2021
        wm minsize $w [winfo width $w] 100
2022
 
2023
        wm deiconify $w
2024
}
2025
}
2026
 
2027
proc update_menu8 {} {
2028
        global CONFIG_LEON3
2029
        global CONFIG_IU_DISAS
2030
        if {($CONFIG_LEON3 == 1)} then {
2031
        configure_entry .menu8.config.f.x0 normal {n l y}} else {configure_entry .menu8.config.f.x0 disabled {y n l}}
2032
        global CONFIG_IU_DISAS_NET
2033
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_DISAS == 1)} then {
2034
        configure_entry .menu8.config.f.x1 normal {n l y}} else {configure_entry .menu8.config.f.x1 disabled {y n l}}
2035
        global CONFIG_DEBUG_PC32
2036
        if {($CONFIG_LEON3 == 1)} then {
2037
        configure_entry .menu8.config.f.x2 normal {n l y}} else {configure_entry .menu8.config.f.x2 disabled {y n l}}
2038
}
2039
 
2040
 
2041
proc update_define_menu8 {} {
2042
        update_define_mainmenu
2043
        global CONFIG_MODULES
2044
        global CONFIG_LEON3
2045
        global CONFIG_IU_DISAS
2046
        if {($CONFIG_LEON3 == 1)} then {
2047
        set CONFIG_IU_DISAS [expr $CONFIG_IU_DISAS&15]} else {set CONFIG_IU_DISAS [expr $CONFIG_IU_DISAS|16]}
2048
        global CONFIG_IU_DISAS_NET
2049
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_DISAS == 1)} then {
2050
        set CONFIG_IU_DISAS_NET [expr $CONFIG_IU_DISAS_NET&15]} else {set CONFIG_IU_DISAS_NET [expr $CONFIG_IU_DISAS_NET|16]}
2051
        global CONFIG_DEBUG_PC32
2052
        if {($CONFIG_LEON3 == 1)} then {
2053
        set CONFIG_DEBUG_PC32 [expr $CONFIG_DEBUG_PC32&15]} else {set CONFIG_DEBUG_PC32 [expr $CONFIG_DEBUG_PC32|16]}
2054
}
2055
 
2056
 
2057
menu_option menu9 9 "On-chip RAM"
2058
proc menu9 {w title} {
2059
        set oldFocus [focus]
2060
        catch {destroy $w; unregister_active 9}
2061
        toplevel $w -class Dialog
2062
        wm withdraw $w
2063
        global active_menus
2064
        set active_menus [lsort -integer [linsert $active_menus end 9]]
2065
        message $w.m -width 400 -aspect 300 -text \
2066
                "On-chip RAM"  -relief raised
2067
        pack $w.m -pady 10 -side top -padx 10
2068
        wm title $w "On-chip RAM"
2069
 
2070
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 9; break"
2071
        set nextscript "catch {focus $oldFocus}; menu10 .menu10 \"$title\""
2072
        frame $w.f
2073
        button $w.f.back -text "Main Menu" \
2074
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 9"
2075
        button $w.f.next -text "Next" -underline 0\
2076
                -width 15 -command $nextscript
2077
        $w.f.next configure -state disabled
2078
        bind all  "puts \"no more menus\" "
2079
        button $w.f.prev -text "Prev" -underline 0\
2080
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 9; menu8 .menu8 \"$title\""
2081
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 9; menu8 .menu8 \"$title\";break"
2082
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
2083
        pack $w.f -pady 10 -side bottom -anchor w -fill x
2084
        frame $w.topline -relief ridge -borderwidth 2 -height 2
2085
        pack $w.topline -side top -fill x
2086
 
2087
        frame $w.botline -relief ridge -borderwidth 2 -height 2
2088
        pack $w.botline -side bottom -fill x
2089
 
2090
        frame $w.config
2091
        pack $w.config -fill y -expand on
2092
 
2093
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
2094
        pack $w.config.vscroll -side right -fill y
2095
 
2096
        canvas $w.config.canvas -height 1\
2097
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
2098
                -width [expr [winfo screenwidth .] * 1 / 2]
2099
        frame $w.config.f
2100
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
2101
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
2102
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
2103
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
2104
        bind $w  "$w.config.canvas yview moveto 0;break;"
2105
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
2106
        pack $w.config.canvas -side right -fill y
2107
 
2108
 
2109
        bool $w.config.f 9 0 "On-chip AHB RAM                   " CONFIG_AHBRAM_ENABLE
2110
        global tmpvar_21
2111
        minimenu $w.config.f 9 1 "AHB RAM size (Kbyte)" tmpvar_21 CONFIG_AHBRAM_SZ1
2112
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"AHB RAM size (Kbyte)\""
2113
        $w.config.f.x1.x.menu add radiobutton -label "1" -variable tmpvar_21 -value "1" -command "update_active"
2114
        $w.config.f.x1.x.menu add radiobutton -label "2" -variable tmpvar_21 -value "2" -command "update_active"
2115
        $w.config.f.x1.x.menu add radiobutton -label "4" -variable tmpvar_21 -value "4" -command "update_active"
2116
        $w.config.f.x1.x.menu add radiobutton -label "8" -variable tmpvar_21 -value "8" -command "update_active"
2117
        $w.config.f.x1.x.menu add radiobutton -label "16" -variable tmpvar_21 -value "16" -command "update_active"
2118
        $w.config.f.x1.x.menu add radiobutton -label "32" -variable tmpvar_21 -value "32" -command "update_active"
2119
        $w.config.f.x1.x.menu add radiobutton -label "64" -variable tmpvar_21 -value "64" -command "update_active"
2120
        menusplit $w $w.config.f.x1.x.menu 7
2121
        hex $w.config.f 9 2 "RAM start address (haddr\[31:20\]) " CONFIG_AHBRAM_START
2122
 
2123
 
2124
 
2125
        focus $w
2126
        update_active
2127
        global winx; global winy
2128
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
2129
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
2130
        update idletasks
2131
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
2132
 
2133
        $w.config.canvas configure \
2134
                -width [expr [winfo reqwidth $w.config.f] + 1]\
2135
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
2136
                         [expr [winfo reqheight $w.config.f] + 1]"
2137
 
2138
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
2139
        set scry [expr [winfo screenh $w] / 2]
2140
        set maxy [expr [winfo screenh $w] * 3 / 4]
2141
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
2142
        if [expr $winy + $canvtotal < $maxy] {
2143
                $w.config.canvas configure -height $canvtotal
2144
        } else {
2145
                $w.config.canvas configure -height [expr $scry - $winy]
2146
                }
2147
        }
2148
        update idletasks
2149
        if {[winfo exists $w]} then {
2150
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
2151
        wm minsize $w [winfo width $w] 100
2152
 
2153
        wm deiconify $w
2154
}
2155
}
2156
 
2157
proc update_menu9 {} {
2158
        global CONFIG_AHBRAM_ENABLE
2159
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {configure_entry .menu9.config.f.x1 normal {x l}} else {configure_entry .menu9.config.f.x1 disabled {x l}}
2160
        global CONFIG_AHBRAM_START
2161
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {.menu9.config.f.x2.x configure -state normal -foreground [ cget .ref -foreground ]; .menu9.config.f.x2.l configure -state normal; } else {.menu9.config.f.x2.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu9.config.f.x2.l configure -state disabled}
2162
}
2163
 
2164
 
2165
proc update_define_menu9 {} {
2166
        update_define_mainmenu
2167
        global CONFIG_MODULES
2168
        global tmpvar_21
2169
        global CONFIG_AHBRAM_SZ1
2170
        if {$tmpvar_21 == "1"} then {set CONFIG_AHBRAM_SZ1 1} else {set CONFIG_AHBRAM_SZ1 0}
2171
        global CONFIG_AHBRAM_SZ2
2172
        if {$tmpvar_21 == "2"} then {set CONFIG_AHBRAM_SZ2 1} else {set CONFIG_AHBRAM_SZ2 0}
2173
        global CONFIG_AHBRAM_SZ4
2174
        if {$tmpvar_21 == "4"} then {set CONFIG_AHBRAM_SZ4 1} else {set CONFIG_AHBRAM_SZ4 0}
2175
        global CONFIG_AHBRAM_SZ8
2176
        if {$tmpvar_21 == "8"} then {set CONFIG_AHBRAM_SZ8 1} else {set CONFIG_AHBRAM_SZ8 0}
2177
        global CONFIG_AHBRAM_SZ16
2178
        if {$tmpvar_21 == "16"} then {set CONFIG_AHBRAM_SZ16 1} else {set CONFIG_AHBRAM_SZ16 0}
2179
        global CONFIG_AHBRAM_SZ32
2180
        if {$tmpvar_21 == "32"} then {set CONFIG_AHBRAM_SZ32 1} else {set CONFIG_AHBRAM_SZ32 0}
2181
        global CONFIG_AHBRAM_SZ64
2182
        if {$tmpvar_21 == "64"} then {set CONFIG_AHBRAM_SZ64 1} else {set CONFIG_AHBRAM_SZ64 0}
2183
        global CONFIG_AHBRAM_ENABLE
2184
        global CONFIG_AHBRAM_START
2185
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {validate_hex CONFIG_AHBRAM_START "$CONFIG_AHBRAM_START" A00}
2186
}
2187
 
2188
 
2189
proc update_mainmenu {}  {
2190
}
2191
 
2192
 
2193
set CONFIG_LEON3 0
2194
set CONFIG_PROC_NUM 1
2195
set CONFIG_IU_NWINDOWS 8
2196
set CONFIG_IU_V8MULDIV 0
2197
set tmpvar_0 "(not set)"
2198
set CONFIG_IU_MUL_LATENCY_4 0
2199
set CONFIG_IU_MUL_LATENCY_5 0
2200
set CONFIG_IU_MUL_MAC 0
2201
set CONFIG_IU_SVT 0
2202
set CONFIG_IU_LDELAY 1
2203
set CONFIG_IU_WATCHPOINTS 0
2204
set CONFIG_PWD 0
2205
set CONFIG_IU_RSTADDR 00000
2206
set CONFIG_FPU_ENABLE 0
2207
set tmpvar_1 "(not set)"
2208
set CONFIG_FPU_GRFPU 0
2209
set CONFIG_FPU_GRFPULITE 0
2210
set CONFIG_FPU_MEIKO 0
2211
set tmpvar_2 "(not set)"
2212
set CONFIG_FPU_GRFPU_INFMUL 0
2213
set CONFIG_FPU_GRFPU_DWMUL 0
2214
set tmpvar_3 "(not set)"
2215
set CONFIG_FPU_GRFPC0 0
2216
set CONFIG_FPU_GRFPC1 0
2217
set CONFIG_FPU_GRFPC2 0
2218
set CONFIG_FPU_NETLIST 0
2219
set CONFIG_ICACHE_ENABLE 0
2220
set tmpvar_4 "(not set)"
2221
set CONFIG_ICACHE_ASSO1 0
2222
set CONFIG_ICACHE_ASSO2 0
2223
set CONFIG_ICACHE_ASSO3 0
2224
set CONFIG_ICACHE_ASSO4 0
2225
set tmpvar_5 "(not set)"
2226
set CONFIG_ICACHE_SZ1 0
2227
set CONFIG_ICACHE_SZ2 0
2228
set CONFIG_ICACHE_SZ4 0
2229
set CONFIG_ICACHE_SZ8 0
2230
set CONFIG_ICACHE_SZ16 0
2231
set CONFIG_ICACHE_SZ32 0
2232
set CONFIG_ICACHE_SZ64 0
2233
set CONFIG_ICACHE_SZ128 0
2234
set CONFIG_ICACHE_SZ256 0
2235
set tmpvar_6 "(not set)"
2236
set CONFIG_ICACHE_LZ16 0
2237
set CONFIG_ICACHE_LZ32 0
2238
set tmpvar_7 "(not set)"
2239
set CONFIG_ICACHE_ALGORND 0
2240
set CONFIG_ICACHE_ALGOLRR 0
2241
set CONFIG_ICACHE_ALGOLRU 0
2242
set CONFIG_ICACHE_LOCK 0
2243
set CONFIG_ICACHE_LRAM 0
2244
set tmpvar_8 "(not set)"
2245
set CONFIG_ICACHE_LRAM_SZ1 0
2246
set CONFIG_ICACHE_LRAM_SZ2 0
2247
set CONFIG_ICACHE_LRAM_SZ4 0
2248
set CONFIG_ICACHE_LRAM_SZ8 0
2249
set CONFIG_ICACHE_LRAM_SZ16 0
2250
set CONFIG_ICACHE_LRAM_SZ32 0
2251
set CONFIG_ICACHE_LRAM_SZ64 0
2252
set CONFIG_ICACHE_LRAM_SZ128 0
2253
set CONFIG_ICACHE_LRAM_SZ256 0
2254
set CONFIG_ICACHE_LRSTART 8e
2255
set CONFIG_DCACHE_ENABLE 0
2256
set tmpvar_9 "(not set)"
2257
set CONFIG_DCACHE_ASSO1 0
2258
set CONFIG_DCACHE_ASSO2 0
2259
set CONFIG_DCACHE_ASSO3 0
2260
set CONFIG_DCACHE_ASSO4 0
2261
set tmpvar_10 "(not set)"
2262
set CONFIG_DCACHE_SZ1 0
2263
set CONFIG_DCACHE_SZ2 0
2264
set CONFIG_DCACHE_SZ4 0
2265
set CONFIG_DCACHE_SZ8 0
2266
set CONFIG_DCACHE_SZ16 0
2267
set CONFIG_DCACHE_SZ32 0
2268
set CONFIG_DCACHE_SZ64 0
2269
set CONFIG_DCACHE_SZ128 0
2270
set CONFIG_DCACHE_SZ256 0
2271
set tmpvar_11 "(not set)"
2272
set CONFIG_DCACHE_LZ16 0
2273
set CONFIG_DCACHE_LZ32 0
2274
set tmpvar_12 "(not set)"
2275
set CONFIG_DCACHE_ALGORND 0
2276
set CONFIG_DCACHE_ALGOLRR 0
2277
set CONFIG_DCACHE_ALGOLRU 0
2278
set CONFIG_DCACHE_LOCK 0
2279
set CONFIG_DCACHE_SNOOP 0
2280
set CONFIG_DCACHE_SNOOP_FAST 0
2281
set CONFIG_DCACHE_SNOOP_SEPTAG 0
2282
set CONFIG_CACHE_FIXED 0
2283
set CONFIG_DCACHE_LRAM 0
2284
set tmpvar_13 "(not set)"
2285
set CONFIG_DCACHE_LRAM_SZ1 0
2286
set CONFIG_DCACHE_LRAM_SZ2 0
2287
set CONFIG_DCACHE_LRAM_SZ4 0
2288
set CONFIG_DCACHE_LRAM_SZ8 0
2289
set CONFIG_DCACHE_LRAM_SZ16 0
2290
set CONFIG_DCACHE_LRAM_SZ32 0
2291
set CONFIG_DCACHE_LRAM_SZ64 0
2292
set CONFIG_DCACHE_LRAM_SZ128 0
2293
set CONFIG_DCACHE_LRAM_SZ256 0
2294
set CONFIG_DCACHE_LRSTART 8f
2295
set CONFIG_MMU_ENABLE 0
2296
set tmpvar_14 "(not set)"
2297
set CONFIG_MMU_COMBINED 0
2298
set CONFIG_MMU_SPLIT 0
2299
set tmpvar_15 "(not set)"
2300
set CONFIG_MMU_REPARRAY 0
2301
set CONFIG_MMU_REPINCREMENT 0
2302
set tmpvar_16 "(not set)"
2303
set CONFIG_MMU_I2 0
2304
set CONFIG_MMU_I4 0
2305
set CONFIG_MMU_I8 0
2306
set CONFIG_MMU_I16 0
2307
set CONFIG_MMU_I32 0
2308
set tmpvar_17 "(not set)"
2309
set CONFIG_MMU_D2 0
2310
set CONFIG_MMU_D4 0
2311
set CONFIG_MMU_D8 0
2312
set CONFIG_MMU_D16 0
2313
set CONFIG_MMU_D32 0
2314
set CONFIG_MMU_FASTWB 0
2315
set CONFIG_DSU_ENABLE 0
2316
set CONFIG_DSU_ITRACE 0
2317
set tmpvar_18 "(not set)"
2318
set CONFIG_DSU_ITRACESZ1 0
2319
set CONFIG_DSU_ITRACESZ2 0
2320
set CONFIG_DSU_ITRACESZ4 0
2321
set CONFIG_DSU_ITRACESZ8 0
2322
set CONFIG_DSU_ITRACESZ16 0
2323
set CONFIG_DSU_ATRACE 0
2324
set tmpvar_19 "(not set)"
2325
set CONFIG_DSU_ATRACESZ1 0
2326
set CONFIG_DSU_ATRACESZ2 0
2327
set CONFIG_DSU_ATRACESZ4 0
2328
set CONFIG_DSU_ATRACESZ8 0
2329
set CONFIG_DSU_ATRACESZ16 0
2330
set CONFIG_IU_DISAS 0
2331
set CONFIG_IU_DISAS_NET 0
2332
set CONFIG_DEBUG_PC32 0
2333
set CONFIG_AHBRAM_ENABLE 0
2334
set tmpvar_21 "(not set)"
2335
set CONFIG_AHBRAM_SZ1 0
2336
set CONFIG_AHBRAM_SZ2 0
2337
set CONFIG_AHBRAM_SZ4 0
2338
set CONFIG_AHBRAM_SZ8 0
2339
set CONFIG_AHBRAM_SZ16 0
2340
set CONFIG_AHBRAM_SZ32 0
2341
set CONFIG_AHBRAM_SZ64 0
2342
set CONFIG_AHBRAM_START A00
2343
set CONFIG_HAS_SHARED_GRFPU 4
2344
set CONFIG_FPU_GRFPU_SH 4
2345
set CONFIG_LEON3FT_PRESENT 4
2346
set CONFIG_LEON3FT_EN 4
2347
set CONFIG_IUFT_NONE 4
2348
set CONFIG_IUFT_PAR 4
2349
set CONFIG_IUFT_DMR 4
2350
set CONFIG_IUFT_BCH 4
2351
set CONFIG_IUFT_TMR 4
2352
set CONFIG_FPUFT_EN 4
2353
set CONFIG_RF_ERRINJ 4
2354
set CONFIG_CACHE_FT_EN 4
2355
set CONFIG_CACHE_ERRINJ 4
2356
set CONFIG_LEON3_NETLIST 4
2357
set CONFIG_MODULES 4
2358
proc writeconfig {file1 file2} {
2359
        set cfg [open $file1 w]
2360
        set autocfg [open $file2 w]
2361
        set notmod 1
2362
        set notset 0
2363
        puts $cfg "#"
2364
        puts $cfg "# Automatically generated make config: don't edit"
2365
        puts $cfg "#"
2366
        puts $autocfg "/*"
2367
        puts $autocfg " * Automatically generated C config: don't edit"
2368
        puts $autocfg " */"
2369
        puts $autocfg "#define AUTOCONF_INCLUDED"
2370
        global CONFIG_LEON3
2371
        write_tristate $cfg $autocfg CONFIG_LEON3 $CONFIG_LEON3 [list $notmod] 2
2372
        global CONFIG_PROC_NUM
2373
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_PROC_NUM $CONFIG_PROC_NUM $notmod }
2374
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Processor            "}
2375
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Integer unit                                           "}
2376
        global CONFIG_IU_NWINDOWS
2377
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_NWINDOWS $CONFIG_IU_NWINDOWS $notmod }
2378
        global CONFIG_IU_V8MULDIV
2379
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_V8MULDIV $CONFIG_IU_V8MULDIV [list $notmod] 2 }
2380
        global tmpvar_0
2381
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {
2382
        if { $tmpvar_0 == "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 }
2383
        if { $tmpvar_0 == "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 }}
2384
        global CONFIG_IU_MUL_MAC
2385
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_V8MULDIV == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_MUL_MAC $CONFIG_IU_MUL_MAC [list $notmod] 2 }
2386
        global CONFIG_IU_SVT
2387
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_SVT $CONFIG_IU_SVT [list $notmod] 2 }
2388
        global CONFIG_IU_LDELAY
2389
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_LDELAY $CONFIG_IU_LDELAY $notmod }
2390
        global CONFIG_IU_WATCHPOINTS
2391
        if {($CONFIG_LEON3 == 1)} then {write_int $cfg $autocfg CONFIG_IU_WATCHPOINTS $CONFIG_IU_WATCHPOINTS $notmod }
2392
        global CONFIG_PWD
2393
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_PWD $CONFIG_PWD [list $notmod] 2 }
2394
        global CONFIG_IU_RSTADDR
2395
        if {($CONFIG_LEON3 == 1)} then {write_hex $cfg $autocfg CONFIG_IU_RSTADDR $CONFIG_IU_RSTADDR $notmod }
2396
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Floating-point unit"}
2397
        global CONFIG_FPU_ENABLE
2398
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_FPU_ENABLE $CONFIG_FPU_ENABLE [list $notmod] 2 }
2399
        global tmpvar_1
2400
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {
2401
        if { $tmpvar_1 == "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 }
2402
        if { $tmpvar_1 == "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 }
2403
        if { $tmpvar_1 == "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 }}
2404
        global tmpvar_2
2405
        global CONFIG_FPU_GRFPU
2406
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPU == 1)} then {
2407
        if { $tmpvar_2 == "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 }
2408
        if { $tmpvar_2 == "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 }}
2409
        global tmpvar_3
2410
        global CONFIG_FPU_GRFPULITE
2411
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1) && ($CONFIG_FPU_GRFPULITE == 1)} then {
2412
        if { $tmpvar_3 == "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 }
2413
        if { $tmpvar_3 == "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 }
2414
        if { $tmpvar_3 == "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 }}
2415
        global CONFIG_FPU_NETLIST
2416
        if {($CONFIG_LEON3 == 1) && ($CONFIG_FPU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_FPU_NETLIST $CONFIG_FPU_NETLIST [list $notmod] 2 }
2417
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Cache system"}
2418
        global CONFIG_ICACHE_ENABLE
2419
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_ICACHE_ENABLE $CONFIG_ICACHE_ENABLE [list $notmod] 2 }
2420
        global tmpvar_4
2421
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
2422
        if { $tmpvar_4 == "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 }
2423
        if { $tmpvar_4 == "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 }
2424
        if { $tmpvar_4 == "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 }
2425
        if { $tmpvar_4 == "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 }}
2426
        global tmpvar_5
2427
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
2428
        if { $tmpvar_5 == "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 }
2429
        if { $tmpvar_5 == "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 }
2430
        if { $tmpvar_5 == "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 }
2431
        if { $tmpvar_5 == "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 }
2432
        if { $tmpvar_5 == "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 }
2433
        if { $tmpvar_5 == "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 }
2434
        if { $tmpvar_5 == "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 }
2435
        if { $tmpvar_5 == "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 }
2436
        if { $tmpvar_5 == "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 }}
2437
        global tmpvar_6
2438
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1)} then {
2439
        if { $tmpvar_6 == "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 }
2440
        if { $tmpvar_6 == "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 }}
2441
        global tmpvar_7
2442
        global CONFIG_ICACHE_ASSO1
2443
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1) && ($CONFIG_ICACHE_ASSO1 != 1)} then {
2444
        if { $tmpvar_7 == "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 }
2445
        if { $tmpvar_7 == "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 }
2446
        if { $tmpvar_7 == "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 }}
2447
        global CONFIG_ICACHE_LOCK
2448
        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 }
2449
        global CONFIG_ICACHE_LRAM
2450
        global CONFIG_MMU_ENABLE
2451
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_ICACHE_LRAM $CONFIG_ICACHE_LRAM [list $notmod] 2 }
2452
        global tmpvar_8
2453
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {
2454
        if { $tmpvar_8 == "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 }
2455
        if { $tmpvar_8 == "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 }
2456
        if { $tmpvar_8 == "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 }
2457
        if { $tmpvar_8 == "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 }
2458
        if { $tmpvar_8 == "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 }
2459
        if { $tmpvar_8 == "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 }
2460
        if { $tmpvar_8 == "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 }
2461
        if { $tmpvar_8 == "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 }
2462
        if { $tmpvar_8 == "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 }}
2463
        global CONFIG_ICACHE_LRSTART
2464
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_LRAM == 1)} then {write_hex $cfg $autocfg CONFIG_ICACHE_LRSTART $CONFIG_ICACHE_LRSTART $notmod }
2465
        global CONFIG_DCACHE_ENABLE
2466
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_ENABLE $CONFIG_DCACHE_ENABLE [list $notmod] 2 }
2467
        global tmpvar_9
2468
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
2469
        if { $tmpvar_9 == "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 }
2470
        if { $tmpvar_9 == "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 }
2471
        if { $tmpvar_9 == "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 }
2472
        if { $tmpvar_9 == "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 }}
2473
        global tmpvar_10
2474
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
2475
        if { $tmpvar_10 == "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 }
2476
        if { $tmpvar_10 == "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 }
2477
        if { $tmpvar_10 == "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 }
2478
        if { $tmpvar_10 == "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 }
2479
        if { $tmpvar_10 == "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 }
2480
        if { $tmpvar_10 == "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 }
2481
        if { $tmpvar_10 == "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 }
2482
        if { $tmpvar_10 == "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 }
2483
        if { $tmpvar_10 == "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 }}
2484
        global tmpvar_11
2485
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {
2486
        if { $tmpvar_11 == "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 }
2487
        if { $tmpvar_11 == "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 }}
2488
        global tmpvar_12
2489
        global CONFIG_DCACHE_ASSO1
2490
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1) && ($CONFIG_DCACHE_ASSO1 != 1)} then {
2491
        if { $tmpvar_12 == "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 }
2492
        if { $tmpvar_12 == "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 }
2493
        if { $tmpvar_12 == "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 }}
2494
        global CONFIG_DCACHE_LOCK
2495
        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 }
2496
        global CONFIG_DCACHE_SNOOP
2497
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_SNOOP $CONFIG_DCACHE_SNOOP [list $notmod] 2 }
2498
        global CONFIG_DCACHE_SNOOP_FAST
2499
        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 }
2500
        global CONFIG_DCACHE_SNOOP_SEPTAG
2501
        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 }
2502
        global CONFIG_CACHE_FIXED
2503
        if {($CONFIG_LEON3 == 1) && ($CONFIG_ICACHE_ENABLE == 1 || $CONFIG_DCACHE_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_CACHE_FIXED $CONFIG_CACHE_FIXED $notmod }
2504
        global CONFIG_DCACHE_LRAM
2505
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_DCACHE_LRAM $CONFIG_DCACHE_LRAM [list $notmod] 2 }
2506
        global tmpvar_13
2507
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {
2508
        if { $tmpvar_13 == "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 }
2509
        if { $tmpvar_13 == "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 }
2510
        if { $tmpvar_13 == "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 }
2511
        if { $tmpvar_13 == "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 }
2512
        if { $tmpvar_13 == "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 }
2513
        if { $tmpvar_13 == "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 }
2514
        if { $tmpvar_13 == "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 }
2515
        if { $tmpvar_13 == "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 }
2516
        if { $tmpvar_13 == "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 }}
2517
        global CONFIG_DCACHE_LRSTART
2518
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DCACHE_LRAM == 1)} then {write_hex $cfg $autocfg CONFIG_DCACHE_LRSTART $CONFIG_DCACHE_LRSTART $notmod }
2519
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "MMU"}
2520
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_MMU_ENABLE $CONFIG_MMU_ENABLE [list $notmod] 2 }
2521
        global tmpvar_14
2522
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
2523
        if { $tmpvar_14 == "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 }
2524
        if { $tmpvar_14 == "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 }}
2525
        global tmpvar_15
2526
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
2527
        if { $tmpvar_15 == "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 }
2528
        if { $tmpvar_15 == "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 }}
2529
        global tmpvar_16
2530
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1)} then {
2531
        if { $tmpvar_16 == "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 }
2532
        if { $tmpvar_16 == "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 }
2533
        if { $tmpvar_16 == "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 }
2534
        if { $tmpvar_16 == "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 }
2535
        if { $tmpvar_16 == "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 }}
2536
        global tmpvar_17
2537
        global CONFIG_MMU_SPLIT
2538
        if {($CONFIG_LEON3 == 1) && ($CONFIG_MMU_ENABLE == 1) && ($CONFIG_MMU_SPLIT == 1)} then {
2539
        if { $tmpvar_17 == "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 }
2540
        if { $tmpvar_17 == "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 }
2541
        if { $tmpvar_17 == "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 }
2542
        if { $tmpvar_17 == "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 }
2543
        if { $tmpvar_17 == "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 }}
2544
        global CONFIG_MMU_FASTWB
2545
        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 }
2546
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Debug Support Unit        "}
2547
        global CONFIG_DSU_ENABLE
2548
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ENABLE $CONFIG_DSU_ENABLE [list $notmod] 2 }
2549
        global CONFIG_DSU_ITRACE
2550
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ITRACE $CONFIG_DSU_ITRACE [list $notmod] 2 }
2551
        global tmpvar_18
2552
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ITRACE == 1)} then {
2553
        if { $tmpvar_18 == "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 }
2554
        if { $tmpvar_18 == "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 }
2555
        if { $tmpvar_18 == "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 }
2556
        if { $tmpvar_18 == "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 }
2557
        if { $tmpvar_18 == "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 }}
2558
        global CONFIG_DSU_ATRACE
2559
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_DSU_ATRACE $CONFIG_DSU_ATRACE [list $notmod] 2 }
2560
        global tmpvar_19
2561
        if {($CONFIG_LEON3 == 1) && ($CONFIG_DSU_ENABLE == 1) && ($CONFIG_DSU_ATRACE == 1)} then {
2562
        if { $tmpvar_19 == "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 }
2563
        if { $tmpvar_19 == "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 }
2564
        if { $tmpvar_19 == "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 }
2565
        if { $tmpvar_19 == "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 }
2566
        if { $tmpvar_19 == "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 }}
2567
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "Fault-tolerance  "}
2568
        if {($CONFIG_LEON3 == 1)} then {write_comment $cfg $autocfg "VHDL debug settings       "}
2569
        global CONFIG_IU_DISAS
2570
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_DISAS $CONFIG_IU_DISAS [list $notmod] 2 }
2571
        global CONFIG_IU_DISAS_NET
2572
        if {($CONFIG_LEON3 == 1) && ($CONFIG_IU_DISAS == 1)} then {write_tristate $cfg $autocfg CONFIG_IU_DISAS_NET $CONFIG_IU_DISAS_NET [list $notmod] 2 }
2573
        global CONFIG_DEBUG_PC32
2574
        if {($CONFIG_LEON3 == 1)} then {write_tristate $cfg $autocfg CONFIG_DEBUG_PC32 $CONFIG_DEBUG_PC32 [list $notmod] 2 }
2575
        write_comment $cfg $autocfg "On-chip RAM"
2576
        global CONFIG_AHBRAM_ENABLE
2577
        write_tristate $cfg $autocfg CONFIG_AHBRAM_ENABLE $CONFIG_AHBRAM_ENABLE [list $notmod] 2
2578
        global tmpvar_21
2579
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {
2580
        if { $tmpvar_21 == "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 }
2581
        if { $tmpvar_21 == "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 }
2582
        if { $tmpvar_21 == "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 }
2583
        if { $tmpvar_21 == "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 }
2584
        if { $tmpvar_21 == "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 }
2585
        if { $tmpvar_21 == "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 }
2586
        if { $tmpvar_21 == "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 }}
2587
        global CONFIG_AHBRAM_START
2588
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_AHBRAM_START $CONFIG_AHBRAM_START $notmod }
2589
        close $cfg
2590
        close $autocfg
2591
}
2592
 
2593
 
2594
proc clear_choices { } {
2595
        global CONFIG_IU_MUL_LATENCY_4; set CONFIG_IU_MUL_LATENCY_4 0
2596
        global CONFIG_IU_MUL_LATENCY_5; set CONFIG_IU_MUL_LATENCY_5 0
2597
        global CONFIG_FPU_GRFPU; set CONFIG_FPU_GRFPU 0
2598
        global CONFIG_FPU_GRFPULITE; set CONFIG_FPU_GRFPULITE 0
2599
        global CONFIG_FPU_MEIKO; set CONFIG_FPU_MEIKO 0
2600
        global CONFIG_FPU_GRFPU_INFMUL; set CONFIG_FPU_GRFPU_INFMUL 0
2601
        global CONFIG_FPU_GRFPU_DWMUL; set CONFIG_FPU_GRFPU_DWMUL 0
2602
        global CONFIG_FPU_GRFPC0; set CONFIG_FPU_GRFPC0 0
2603
        global CONFIG_FPU_GRFPC1; set CONFIG_FPU_GRFPC1 0
2604
        global CONFIG_FPU_GRFPC2; set CONFIG_FPU_GRFPC2 0
2605
        global CONFIG_ICACHE_ASSO1; set CONFIG_ICACHE_ASSO1 0
2606
        global CONFIG_ICACHE_ASSO2; set CONFIG_ICACHE_ASSO2 0
2607
        global CONFIG_ICACHE_ASSO3; set CONFIG_ICACHE_ASSO3 0
2608
        global CONFIG_ICACHE_ASSO4; set CONFIG_ICACHE_ASSO4 0
2609
        global CONFIG_ICACHE_SZ1; set CONFIG_ICACHE_SZ1 0
2610
        global CONFIG_ICACHE_SZ2; set CONFIG_ICACHE_SZ2 0
2611
        global CONFIG_ICACHE_SZ4; set CONFIG_ICACHE_SZ4 0
2612
        global CONFIG_ICACHE_SZ8; set CONFIG_ICACHE_SZ8 0
2613
        global CONFIG_ICACHE_SZ16; set CONFIG_ICACHE_SZ16 0
2614
        global CONFIG_ICACHE_SZ32; set CONFIG_ICACHE_SZ32 0
2615
        global CONFIG_ICACHE_SZ64; set CONFIG_ICACHE_SZ64 0
2616
        global CONFIG_ICACHE_SZ128; set CONFIG_ICACHE_SZ128 0
2617
        global CONFIG_ICACHE_SZ256; set CONFIG_ICACHE_SZ256 0
2618
        global CONFIG_ICACHE_LZ16; set CONFIG_ICACHE_LZ16 0
2619
        global CONFIG_ICACHE_LZ32; set CONFIG_ICACHE_LZ32 0
2620
        global CONFIG_ICACHE_ALGORND; set CONFIG_ICACHE_ALGORND 0
2621
        global CONFIG_ICACHE_ALGOLRR; set CONFIG_ICACHE_ALGOLRR 0
2622
        global CONFIG_ICACHE_ALGOLRU; set CONFIG_ICACHE_ALGOLRU 0
2623
        global CONFIG_ICACHE_LRAM_SZ1; set CONFIG_ICACHE_LRAM_SZ1 0
2624
        global CONFIG_ICACHE_LRAM_SZ2; set CONFIG_ICACHE_LRAM_SZ2 0
2625
        global CONFIG_ICACHE_LRAM_SZ4; set CONFIG_ICACHE_LRAM_SZ4 0
2626
        global CONFIG_ICACHE_LRAM_SZ8; set CONFIG_ICACHE_LRAM_SZ8 0
2627
        global CONFIG_ICACHE_LRAM_SZ16; set CONFIG_ICACHE_LRAM_SZ16 0
2628
        global CONFIG_ICACHE_LRAM_SZ32; set CONFIG_ICACHE_LRAM_SZ32 0
2629
        global CONFIG_ICACHE_LRAM_SZ64; set CONFIG_ICACHE_LRAM_SZ64 0
2630
        global CONFIG_ICACHE_LRAM_SZ128; set CONFIG_ICACHE_LRAM_SZ128 0
2631
        global CONFIG_ICACHE_LRAM_SZ256; set CONFIG_ICACHE_LRAM_SZ256 0
2632
        global CONFIG_DCACHE_ASSO1; set CONFIG_DCACHE_ASSO1 0
2633
        global CONFIG_DCACHE_ASSO2; set CONFIG_DCACHE_ASSO2 0
2634
        global CONFIG_DCACHE_ASSO3; set CONFIG_DCACHE_ASSO3 0
2635
        global CONFIG_DCACHE_ASSO4; set CONFIG_DCACHE_ASSO4 0
2636
        global CONFIG_DCACHE_SZ1; set CONFIG_DCACHE_SZ1 0
2637
        global CONFIG_DCACHE_SZ2; set CONFIG_DCACHE_SZ2 0
2638
        global CONFIG_DCACHE_SZ4; set CONFIG_DCACHE_SZ4 0
2639
        global CONFIG_DCACHE_SZ8; set CONFIG_DCACHE_SZ8 0
2640
        global CONFIG_DCACHE_SZ16; set CONFIG_DCACHE_SZ16 0
2641
        global CONFIG_DCACHE_SZ32; set CONFIG_DCACHE_SZ32 0
2642
        global CONFIG_DCACHE_SZ64; set CONFIG_DCACHE_SZ64 0
2643
        global CONFIG_DCACHE_SZ128; set CONFIG_DCACHE_SZ128 0
2644
        global CONFIG_DCACHE_SZ256; set CONFIG_DCACHE_SZ256 0
2645
        global CONFIG_DCACHE_LZ16; set CONFIG_DCACHE_LZ16 0
2646
        global CONFIG_DCACHE_LZ32; set CONFIG_DCACHE_LZ32 0
2647
        global CONFIG_DCACHE_ALGORND; set CONFIG_DCACHE_ALGORND 0
2648
        global CONFIG_DCACHE_ALGOLRR; set CONFIG_DCACHE_ALGOLRR 0
2649
        global CONFIG_DCACHE_ALGOLRU; set CONFIG_DCACHE_ALGOLRU 0
2650
        global CONFIG_DCACHE_LRAM_SZ1; set CONFIG_DCACHE_LRAM_SZ1 0
2651
        global CONFIG_DCACHE_LRAM_SZ2; set CONFIG_DCACHE_LRAM_SZ2 0
2652
        global CONFIG_DCACHE_LRAM_SZ4; set CONFIG_DCACHE_LRAM_SZ4 0
2653
        global CONFIG_DCACHE_LRAM_SZ8; set CONFIG_DCACHE_LRAM_SZ8 0
2654
        global CONFIG_DCACHE_LRAM_SZ16; set CONFIG_DCACHE_LRAM_SZ16 0
2655
        global CONFIG_DCACHE_LRAM_SZ32; set CONFIG_DCACHE_LRAM_SZ32 0
2656
        global CONFIG_DCACHE_LRAM_SZ64; set CONFIG_DCACHE_LRAM_SZ64 0
2657
        global CONFIG_DCACHE_LRAM_SZ128; set CONFIG_DCACHE_LRAM_SZ128 0
2658
        global CONFIG_DCACHE_LRAM_SZ256; set CONFIG_DCACHE_LRAM_SZ256 0
2659
        global CONFIG_MMU_COMBINED; set CONFIG_MMU_COMBINED 0
2660
        global CONFIG_MMU_SPLIT; set CONFIG_MMU_SPLIT 0
2661
        global CONFIG_MMU_REPARRAY; set CONFIG_MMU_REPARRAY 0
2662
        global CONFIG_MMU_REPINCREMENT; set CONFIG_MMU_REPINCREMENT 0
2663
        global CONFIG_MMU_I2; set CONFIG_MMU_I2 0
2664
        global CONFIG_MMU_I4; set CONFIG_MMU_I4 0
2665
        global CONFIG_MMU_I8; set CONFIG_MMU_I8 0
2666
        global CONFIG_MMU_I16; set CONFIG_MMU_I16 0
2667
        global CONFIG_MMU_I32; set CONFIG_MMU_I32 0
2668
        global CONFIG_MMU_D2; set CONFIG_MMU_D2 0
2669
        global CONFIG_MMU_D4; set CONFIG_MMU_D4 0
2670
        global CONFIG_MMU_D8; set CONFIG_MMU_D8 0
2671
        global CONFIG_MMU_D16; set CONFIG_MMU_D16 0
2672
        global CONFIG_MMU_D32; set CONFIG_MMU_D32 0
2673
        global CONFIG_DSU_ITRACESZ1; set CONFIG_DSU_ITRACESZ1 0
2674
        global CONFIG_DSU_ITRACESZ2; set CONFIG_DSU_ITRACESZ2 0
2675
        global CONFIG_DSU_ITRACESZ4; set CONFIG_DSU_ITRACESZ4 0
2676
        global CONFIG_DSU_ITRACESZ8; set CONFIG_DSU_ITRACESZ8 0
2677
        global CONFIG_DSU_ITRACESZ16; set CONFIG_DSU_ITRACESZ16 0
2678
        global CONFIG_DSU_ATRACESZ1; set CONFIG_DSU_ATRACESZ1 0
2679
        global CONFIG_DSU_ATRACESZ2; set CONFIG_DSU_ATRACESZ2 0
2680
        global CONFIG_DSU_ATRACESZ4; set CONFIG_DSU_ATRACESZ4 0
2681
        global CONFIG_DSU_ATRACESZ8; set CONFIG_DSU_ATRACESZ8 0
2682
        global CONFIG_DSU_ATRACESZ16; set CONFIG_DSU_ATRACESZ16 0
2683
        global CONFIG_AHBRAM_SZ1; set CONFIG_AHBRAM_SZ1 0
2684
        global CONFIG_AHBRAM_SZ2; set CONFIG_AHBRAM_SZ2 0
2685
        global CONFIG_AHBRAM_SZ4; set CONFIG_AHBRAM_SZ4 0
2686
        global CONFIG_AHBRAM_SZ8; set CONFIG_AHBRAM_SZ8 0
2687
        global CONFIG_AHBRAM_SZ16; set CONFIG_AHBRAM_SZ16 0
2688
        global CONFIG_AHBRAM_SZ32; set CONFIG_AHBRAM_SZ32 0
2689
        global CONFIG_AHBRAM_SZ64; set CONFIG_AHBRAM_SZ64 0
2690
}
2691
 
2692
 
2693
proc update_choices { } {
2694
        global tmpvar_0
2695
        set tmpvar_0 "5-cycles"
2696
        global CONFIG_IU_MUL_LATENCY_4
2697
        if { $CONFIG_IU_MUL_LATENCY_4 == 1 } then { set tmpvar_0 "4-cycles" }
2698
        global CONFIG_IU_MUL_LATENCY_5
2699
        if { $CONFIG_IU_MUL_LATENCY_5 == 1 } then { set tmpvar_0 "5-cycles" }
2700
        global tmpvar_1
2701
        set tmpvar_1 "GRFPU"
2702
        global CONFIG_FPU_GRFPU
2703
        if { $CONFIG_FPU_GRFPU == 1 } then { set tmpvar_1 "GRFPU" }
2704
        global CONFIG_FPU_GRFPULITE
2705
        if { $CONFIG_FPU_GRFPULITE == 1 } then { set tmpvar_1 "GRFPU-LITE" }
2706
        global CONFIG_FPU_MEIKO
2707
        if { $CONFIG_FPU_MEIKO == 1 } then { set tmpvar_1 "Meiko" }
2708
        global tmpvar_2
2709
        set tmpvar_2 "Inferred"
2710
        global CONFIG_FPU_GRFPU_INFMUL
2711
        if { $CONFIG_FPU_GRFPU_INFMUL == 1 } then { set tmpvar_2 "Inferred" }
2712
        global CONFIG_FPU_GRFPU_DWMUL
2713
        if { $CONFIG_FPU_GRFPU_DWMUL == 1 } then { set tmpvar_2 "DW" }
2714
        global tmpvar_3
2715
        set tmpvar_3 "Simple"
2716
        global CONFIG_FPU_GRFPC0
2717
        if { $CONFIG_FPU_GRFPC0 == 1 } then { set tmpvar_3 "Simple" }
2718
        global CONFIG_FPU_GRFPC1
2719
        if { $CONFIG_FPU_GRFPC1 == 1 } then { set tmpvar_3 "Data-forwarding" }
2720
        global CONFIG_FPU_GRFPC2
2721
        if { $CONFIG_FPU_GRFPC2 == 1 } then { set tmpvar_3 "Non-blocking" }
2722
        global tmpvar_4
2723
        set tmpvar_4 "1"
2724
        global CONFIG_ICACHE_ASSO1
2725
        if { $CONFIG_ICACHE_ASSO1 == 1 } then { set tmpvar_4 "1" }
2726
        global CONFIG_ICACHE_ASSO2
2727
        if { $CONFIG_ICACHE_ASSO2 == 1 } then { set tmpvar_4 "2" }
2728
        global CONFIG_ICACHE_ASSO3
2729
        if { $CONFIG_ICACHE_ASSO3 == 1 } then { set tmpvar_4 "3" }
2730
        global CONFIG_ICACHE_ASSO4
2731
        if { $CONFIG_ICACHE_ASSO4 == 1 } then { set tmpvar_4 "4" }
2732
        global tmpvar_5
2733
        set tmpvar_5 "4"
2734
        global CONFIG_ICACHE_SZ1
2735
        if { $CONFIG_ICACHE_SZ1 == 1 } then { set tmpvar_5 "1" }
2736
        global CONFIG_ICACHE_SZ2
2737
        if { $CONFIG_ICACHE_SZ2 == 1 } then { set tmpvar_5 "2" }
2738
        global CONFIG_ICACHE_SZ4
2739
        if { $CONFIG_ICACHE_SZ4 == 1 } then { set tmpvar_5 "4" }
2740
        global CONFIG_ICACHE_SZ8
2741
        if { $CONFIG_ICACHE_SZ8 == 1 } then { set tmpvar_5 "8" }
2742
        global CONFIG_ICACHE_SZ16
2743
        if { $CONFIG_ICACHE_SZ16 == 1 } then { set tmpvar_5 "16" }
2744
        global CONFIG_ICACHE_SZ32
2745
        if { $CONFIG_ICACHE_SZ32 == 1 } then { set tmpvar_5 "32" }
2746
        global CONFIG_ICACHE_SZ64
2747
        if { $CONFIG_ICACHE_SZ64 == 1 } then { set tmpvar_5 "64" }
2748
        global CONFIG_ICACHE_SZ128
2749
        if { $CONFIG_ICACHE_SZ128 == 1 } then { set tmpvar_5 "128" }
2750
        global CONFIG_ICACHE_SZ256
2751
        if { $CONFIG_ICACHE_SZ256 == 1 } then { set tmpvar_5 "256" }
2752
        global tmpvar_6
2753
        set tmpvar_6 "32"
2754
        global CONFIG_ICACHE_LZ16
2755
        if { $CONFIG_ICACHE_LZ16 == 1 } then { set tmpvar_6 "16" }
2756
        global CONFIG_ICACHE_LZ32
2757
        if { $CONFIG_ICACHE_LZ32 == 1 } then { set tmpvar_6 "32" }
2758
        global tmpvar_7
2759
        set tmpvar_7 "Random"
2760
        global CONFIG_ICACHE_ALGORND
2761
        if { $CONFIG_ICACHE_ALGORND == 1 } then { set tmpvar_7 "Random" }
2762
        global CONFIG_ICACHE_ALGOLRR
2763
        if { $CONFIG_ICACHE_ALGOLRR == 1 } then { set tmpvar_7 "LRR" }
2764
        global CONFIG_ICACHE_ALGOLRU
2765
        if { $CONFIG_ICACHE_ALGOLRU == 1 } then { set tmpvar_7 "LRU" }
2766
        global tmpvar_8
2767
        set tmpvar_8 "4"
2768
        global CONFIG_ICACHE_LRAM_SZ1
2769
        if { $CONFIG_ICACHE_LRAM_SZ1 == 1 } then { set tmpvar_8 "1" }
2770
        global CONFIG_ICACHE_LRAM_SZ2
2771
        if { $CONFIG_ICACHE_LRAM_SZ2 == 1 } then { set tmpvar_8 "2" }
2772
        global CONFIG_ICACHE_LRAM_SZ4
2773
        if { $CONFIG_ICACHE_LRAM_SZ4 == 1 } then { set tmpvar_8 "4" }
2774
        global CONFIG_ICACHE_LRAM_SZ8
2775
        if { $CONFIG_ICACHE_LRAM_SZ8 == 1 } then { set tmpvar_8 "8" }
2776
        global CONFIG_ICACHE_LRAM_SZ16
2777
        if { $CONFIG_ICACHE_LRAM_SZ16 == 1 } then { set tmpvar_8 "16" }
2778
        global CONFIG_ICACHE_LRAM_SZ32
2779
        if { $CONFIG_ICACHE_LRAM_SZ32 == 1 } then { set tmpvar_8 "32" }
2780
        global CONFIG_ICACHE_LRAM_SZ64
2781
        if { $CONFIG_ICACHE_LRAM_SZ64 == 1 } then { set tmpvar_8 "64" }
2782
        global CONFIG_ICACHE_LRAM_SZ128
2783
        if { $CONFIG_ICACHE_LRAM_SZ128 == 1 } then { set tmpvar_8 "128" }
2784
        global CONFIG_ICACHE_LRAM_SZ256
2785
        if { $CONFIG_ICACHE_LRAM_SZ256 == 1 } then { set tmpvar_8 "256" }
2786
        global tmpvar_9
2787
        set tmpvar_9 "1"
2788
        global CONFIG_DCACHE_ASSO1
2789
        if { $CONFIG_DCACHE_ASSO1 == 1 } then { set tmpvar_9 "1" }
2790
        global CONFIG_DCACHE_ASSO2
2791
        if { $CONFIG_DCACHE_ASSO2 == 1 } then { set tmpvar_9 "2" }
2792
        global CONFIG_DCACHE_ASSO3
2793
        if { $CONFIG_DCACHE_ASSO3 == 1 } then { set tmpvar_9 "3" }
2794
        global CONFIG_DCACHE_ASSO4
2795
        if { $CONFIG_DCACHE_ASSO4 == 1 } then { set tmpvar_9 "4" }
2796
        global tmpvar_10
2797
        set tmpvar_10 "4"
2798
        global CONFIG_DCACHE_SZ1
2799
        if { $CONFIG_DCACHE_SZ1 == 1 } then { set tmpvar_10 "1" }
2800
        global CONFIG_DCACHE_SZ2
2801
        if { $CONFIG_DCACHE_SZ2 == 1 } then { set tmpvar_10 "2" }
2802
        global CONFIG_DCACHE_SZ4
2803
        if { $CONFIG_DCACHE_SZ4 == 1 } then { set tmpvar_10 "4" }
2804
        global CONFIG_DCACHE_SZ8
2805
        if { $CONFIG_DCACHE_SZ8 == 1 } then { set tmpvar_10 "8" }
2806
        global CONFIG_DCACHE_SZ16
2807
        if { $CONFIG_DCACHE_SZ16 == 1 } then { set tmpvar_10 "16" }
2808
        global CONFIG_DCACHE_SZ32
2809
        if { $CONFIG_DCACHE_SZ32 == 1 } then { set tmpvar_10 "32" }
2810
        global CONFIG_DCACHE_SZ64
2811
        if { $CONFIG_DCACHE_SZ64 == 1 } then { set tmpvar_10 "64" }
2812
        global CONFIG_DCACHE_SZ128
2813
        if { $CONFIG_DCACHE_SZ128 == 1 } then { set tmpvar_10 "128" }
2814
        global CONFIG_DCACHE_SZ256
2815
        if { $CONFIG_DCACHE_SZ256 == 1 } then { set tmpvar_10 "256" }
2816
        global tmpvar_11
2817
        set tmpvar_11 "32"
2818
        global CONFIG_DCACHE_LZ16
2819
        if { $CONFIG_DCACHE_LZ16 == 1 } then { set tmpvar_11 "16" }
2820
        global CONFIG_DCACHE_LZ32
2821
        if { $CONFIG_DCACHE_LZ32 == 1 } then { set tmpvar_11 "32" }
2822
        global tmpvar_12
2823
        set tmpvar_12 "Random"
2824
        global CONFIG_DCACHE_ALGORND
2825
        if { $CONFIG_DCACHE_ALGORND == 1 } then { set tmpvar_12 "Random" }
2826
        global CONFIG_DCACHE_ALGOLRR
2827
        if { $CONFIG_DCACHE_ALGOLRR == 1 } then { set tmpvar_12 "LRR" }
2828
        global CONFIG_DCACHE_ALGOLRU
2829
        if { $CONFIG_DCACHE_ALGOLRU == 1 } then { set tmpvar_12 "LRU" }
2830
        global tmpvar_13
2831
        set tmpvar_13 "4"
2832
        global CONFIG_DCACHE_LRAM_SZ1
2833
        if { $CONFIG_DCACHE_LRAM_SZ1 == 1 } then { set tmpvar_13 "1" }
2834
        global CONFIG_DCACHE_LRAM_SZ2
2835
        if { $CONFIG_DCACHE_LRAM_SZ2 == 1 } then { set tmpvar_13 "2" }
2836
        global CONFIG_DCACHE_LRAM_SZ4
2837
        if { $CONFIG_DCACHE_LRAM_SZ4 == 1 } then { set tmpvar_13 "4" }
2838
        global CONFIG_DCACHE_LRAM_SZ8
2839
        if { $CONFIG_DCACHE_LRAM_SZ8 == 1 } then { set tmpvar_13 "8" }
2840
        global CONFIG_DCACHE_LRAM_SZ16
2841
        if { $CONFIG_DCACHE_LRAM_SZ16 == 1 } then { set tmpvar_13 "16" }
2842
        global CONFIG_DCACHE_LRAM_SZ32
2843
        if { $CONFIG_DCACHE_LRAM_SZ32 == 1 } then { set tmpvar_13 "32" }
2844
        global CONFIG_DCACHE_LRAM_SZ64
2845
        if { $CONFIG_DCACHE_LRAM_SZ64 == 1 } then { set tmpvar_13 "64" }
2846
        global CONFIG_DCACHE_LRAM_SZ128
2847
        if { $CONFIG_DCACHE_LRAM_SZ128 == 1 } then { set tmpvar_13 "128" }
2848
        global CONFIG_DCACHE_LRAM_SZ256
2849
        if { $CONFIG_DCACHE_LRAM_SZ256 == 1 } then { set tmpvar_13 "256" }
2850
        global tmpvar_14
2851
        set tmpvar_14 "combined"
2852
        global CONFIG_MMU_COMBINED
2853
        if { $CONFIG_MMU_COMBINED == 1 } then { set tmpvar_14 "combined" }
2854
        global CONFIG_MMU_SPLIT
2855
        if { $CONFIG_MMU_SPLIT == 1 } then { set tmpvar_14 "split" }
2856
        global tmpvar_15
2857
        set tmpvar_15 "Increment"
2858
        global CONFIG_MMU_REPARRAY
2859
        if { $CONFIG_MMU_REPARRAY == 1 } then { set tmpvar_15 "LRU" }
2860
        global CONFIG_MMU_REPINCREMENT
2861
        if { $CONFIG_MMU_REPINCREMENT == 1 } then { set tmpvar_15 "Increment" }
2862
        global tmpvar_16
2863
        set tmpvar_16 "8"
2864
        global CONFIG_MMU_I2
2865
        if { $CONFIG_MMU_I2 == 1 } then { set tmpvar_16 "2" }
2866
        global CONFIG_MMU_I4
2867
        if { $CONFIG_MMU_I4 == 1 } then { set tmpvar_16 "4" }
2868
        global CONFIG_MMU_I8
2869
        if { $CONFIG_MMU_I8 == 1 } then { set tmpvar_16 "8" }
2870
        global CONFIG_MMU_I16
2871
        if { $CONFIG_MMU_I16 == 1 } then { set tmpvar_16 "16" }
2872
        global CONFIG_MMU_I32
2873
        if { $CONFIG_MMU_I32 == 1 } then { set tmpvar_16 "32" }
2874
        global tmpvar_17
2875
        set tmpvar_17 "8"
2876
        global CONFIG_MMU_D2
2877
        if { $CONFIG_MMU_D2 == 1 } then { set tmpvar_17 "2" }
2878
        global CONFIG_MMU_D4
2879
        if { $CONFIG_MMU_D4 == 1 } then { set tmpvar_17 "4" }
2880
        global CONFIG_MMU_D8
2881
        if { $CONFIG_MMU_D8 == 1 } then { set tmpvar_17 "8" }
2882
        global CONFIG_MMU_D16
2883
        if { $CONFIG_MMU_D16 == 1 } then { set tmpvar_17 "16" }
2884
        global CONFIG_MMU_D32
2885
        if { $CONFIG_MMU_D32 == 1 } then { set tmpvar_17 "32" }
2886
        global tmpvar_18
2887
        set tmpvar_18 "1"
2888
        global CONFIG_DSU_ITRACESZ1
2889
        if { $CONFIG_DSU_ITRACESZ1 == 1 } then { set tmpvar_18 "1" }
2890
        global CONFIG_DSU_ITRACESZ2
2891
        if { $CONFIG_DSU_ITRACESZ2 == 1 } then { set tmpvar_18 "2" }
2892
        global CONFIG_DSU_ITRACESZ4
2893
        if { $CONFIG_DSU_ITRACESZ4 == 1 } then { set tmpvar_18 "4" }
2894
        global CONFIG_DSU_ITRACESZ8
2895
        if { $CONFIG_DSU_ITRACESZ8 == 1 } then { set tmpvar_18 "8" }
2896
        global CONFIG_DSU_ITRACESZ16
2897
        if { $CONFIG_DSU_ITRACESZ16 == 1 } then { set tmpvar_18 "16" }
2898
        global tmpvar_19
2899
        set tmpvar_19 "1"
2900
        global CONFIG_DSU_ATRACESZ1
2901
        if { $CONFIG_DSU_ATRACESZ1 == 1 } then { set tmpvar_19 "1" }
2902
        global CONFIG_DSU_ATRACESZ2
2903
        if { $CONFIG_DSU_ATRACESZ2 == 1 } then { set tmpvar_19 "2" }
2904
        global CONFIG_DSU_ATRACESZ4
2905
        if { $CONFIG_DSU_ATRACESZ4 == 1 } then { set tmpvar_19 "4" }
2906
        global CONFIG_DSU_ATRACESZ8
2907
        if { $CONFIG_DSU_ATRACESZ8 == 1 } then { set tmpvar_19 "8" }
2908
        global CONFIG_DSU_ATRACESZ16
2909
        if { $CONFIG_DSU_ATRACESZ16 == 1 } then { set tmpvar_19 "16" }
2910
        global tmpvar_21
2911
        set tmpvar_21 "4"
2912
        global CONFIG_AHBRAM_SZ1
2913
        if { $CONFIG_AHBRAM_SZ1 == 1 } then { set tmpvar_21 "1" }
2914
        global CONFIG_AHBRAM_SZ2
2915
        if { $CONFIG_AHBRAM_SZ2 == 1 } then { set tmpvar_21 "2" }
2916
        global CONFIG_AHBRAM_SZ4
2917
        if { $CONFIG_AHBRAM_SZ4 == 1 } then { set tmpvar_21 "4" }
2918
        global CONFIG_AHBRAM_SZ8
2919
        if { $CONFIG_AHBRAM_SZ8 == 1 } then { set tmpvar_21 "8" }
2920
        global CONFIG_AHBRAM_SZ16
2921
        if { $CONFIG_AHBRAM_SZ16 == 1 } then { set tmpvar_21 "16" }
2922
        global CONFIG_AHBRAM_SZ32
2923
        if { $CONFIG_AHBRAM_SZ32 == 1 } then { set tmpvar_21 "32" }
2924
        global CONFIG_AHBRAM_SZ64
2925
        if { $CONFIG_AHBRAM_SZ64 == 1 } then { set tmpvar_21 "64" }
2926
}
2927
 
2928
 
2929
proc update_define_mainmenu {} {
2930
        global CONFIG_MODULES
2931
}
2932
 
2933
 
2934
# FILE: tail.tk
2935
# This file is boilerplate TCL/TK function definitions for 'make xconfig'.
2936
#
2937
# CHANGES
2938
# =======
2939
#
2940
# 8 January 1998, Michael Elizabeth Chastain, 
2941
# Arrange buttons in three columns for better screen fitting.
2942
#
2943
 
2944
#
2945
# Read the user's settings from .config.  These will override whatever is
2946
# in config.in.  Don't do this if the user specified a -D to force
2947
# the defaults.
2948
#
2949
 
2950
set defaults defconfig
2951
 
2952
if { [file readable .config] == 1} then {
2953
        if { $argc > 0 } then {
2954
                if { [lindex $argv 0] != "-D" } then {
2955
                        read_config .config
2956
                }
2957
                else
2958
                {
2959
                        read_config $defaults
2960
                }
2961
        } else {
2962
                read_config .config
2963
        }
2964
} else {
2965
        read_config $defaults
2966
}
2967
 
2968
update_define 1 $total_menus 0
2969
update_mainmenu
2970
 
2971
button .f0.right.save -anchor w -text "Save and Exit" -underline 0\
2972
    -command { catch {exec cp -f .config .config.old}; \
2973
                writeconfig .config config.h; wrapup .wrap }
2974
 
2975
button .f0.right.quit -anchor w -text "Quit Without Saving" -underline 0\
2976
    -command { maybe_exit .maybe }
2977
 
2978
button .f0.right.load -anchor w -text "Load Configuration from File" \
2979
    -command { load_configfile .load "Load Configuration from file" read_config_file
2980
}
2981
 
2982
button .f0.right.store -anchor w -text "Store Configuration to File" \
2983
    -command { load_configfile .load "Store Configuration to file" write_config_file }
2984
 
2985
#
2986
# Now pack everything.
2987
#
2988
 
2989
pack .f0.right.store .f0.right.load .f0.right.quit .f0.right.save \
2990
    -padx 0 -pady 0 -side bottom -fill x
2991
pack .f0.left .f0.middle .f0.right -side left -padx 5 -pady 0 -fill y
2992
pack .f0 -padx 5 -pady 5
2993
 
2994
update idletasks
2995
set winy [expr 10 + [winfo reqheight .f0]]
2996
set scry [lindex [wm maxsize .] 1]
2997
set winx [expr 10 + [winfo reqwidth .f0]]
2998
set scrx [lindex [wm maxsize .] 0]
2999
if {$winx < $scrx} then {set maxx -1} else {set maxx $winx}
3000
if {$winy < $scry} then {set maxy -1} else {set maxy $winy}
3001
.f0 configure -width $winx -height $winy
3002
wm maxsize . $maxx $maxy
3003
 
3004
#
3005
# If we cannot write our config files, disable the write button.
3006
#
3007
if { [file exists .config] == 1 } then {
3008
                if { [file writable .config] == 0 } then {
3009
                        .f0.right.save configure -state disabled
3010
                }
3011
        } else {
3012
                if { [file writable .] == 0 } then {
3013
                        .f0.right.save configure -state disabled
3014
                }
3015
        }
3016
 
3017
#if { [file exists include/linux/autoconf.h] == 1 } then {
3018
#               if { [file writable include/linux/autoconf.h] == 0 } then {
3019
#                       .f0.right.save configure -state disabled
3020
#               }
3021
#       } else {
3022
#               if { [file writable include/linux/] == 0 } then {
3023
#                       .f0.right.save configure -state disabled
3024
#               }
3025
#       }

powered by: WebSVN 2.1.0

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