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

powered by: WebSVN 2.1.0

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