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-altera-ep3c25/] [lconfig.tk] - Blame information for rev 2

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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