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

powered by: WebSVN 2.1.0

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