OpenCores
URL https://opencores.org/ocsvn/mips_enhanced/mips_enhanced/trunk

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [designs/] [leon3-avnet-eval-xc4vlx60/] [lconfig.tk] - Blame information for rev 2

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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