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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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