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

powered by: WebSVN 2.1.0

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