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

Subversion Repositories mips_enhanced

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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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