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

powered by: WebSVN 2.1.0

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