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/] [netcard/] [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 7
648
 
649
proc toplevel_menu {num} {
650
        return $num
651
}
652
 
653
mainmenu_name "Netcard PCI/Ethernet bridge"
654
menu_option menu1 1 "Synthesis      "
655
proc menu1 {w title} {
656
        set oldFocus [focus]
657
        catch {destroy $w; unregister_active 1}
658
        toplevel $w -class Dialog
659
        wm withdraw $w
660
        global active_menus
661
        set active_menus [lsort -integer [linsert $active_menus end 1]]
662
        message $w.m -width 400 -aspect 300 -text \
663
                "Synthesis      "  -relief raised
664
        pack $w.m -pady 10 -side top -padx 10
665
        wm title $w "Synthesis      "
666
 
667
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 1; break"
668
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 1; menu2 .menu2 \"$title\""
669
        frame $w.f
670
        button $w.f.back -text "Main Menu" \
671
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 1"
672
        button $w.f.next -text "Next" -underline 0\
673
                -width 15 -command $nextscript
674
        bind all  $nextscript
675
        button $w.f.prev -text "Prev" -underline 0\
676
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 1; menu0 .menu0 \"$title\""
677
        $w.f.prev configure -state disabled
678
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
679
        pack $w.f -pady 10 -side bottom -anchor w -fill x
680
        frame $w.topline -relief ridge -borderwidth 2 -height 2
681
        pack $w.topline -side top -fill x
682
 
683
        frame $w.botline -relief ridge -borderwidth 2 -height 2
684
        pack $w.botline -side bottom -fill x
685
 
686
        frame $w.config
687
        pack $w.config -fill y -expand on
688
 
689
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
690
        pack $w.config.vscroll -side right -fill y
691
 
692
        canvas $w.config.canvas -height 1\
693
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
694
                -width [expr [winfo screenwidth .] * 1 / 2]
695
        frame $w.config.f
696
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
697
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
698
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
699
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
700
        bind $w  "$w.config.canvas yview moveto 0;break;"
701
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
702
        pack $w.config.canvas -side right -fill y
703
 
704
 
705
        global tmpvar_0
706
        minimenu $w.config.f 1 0 "Target technology                           " tmpvar_0 CONFIG_SYN_INFERRED
707
        menu $w.config.f.x0.x.menu -tearoffcommand "menutitle \"Target technology                           \""
708
        $w.config.f.x0.x.menu add radiobutton -label "Inferred" -variable tmpvar_0 -value "Inferred" -command "update_active"
709
        $w.config.f.x0.x.menu add radiobutton -label "Altera-all" -variable tmpvar_0 -value "Altera-all" -command "update_active"
710
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Axcelerator" -variable tmpvar_0 -value "Actel-Axcelerator" -command "update_active"
711
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Proasic" -variable tmpvar_0 -value "Actel-Proasic" -command "update_active"
712
        $w.config.f.x0.x.menu add radiobutton -label "Actel-ProasicPlus" -variable tmpvar_0 -value "Actel-ProasicPlus" -command "update_active"
713
        $w.config.f.x0.x.menu add radiobutton -label "Actel-Proasic3" -variable tmpvar_0 -value "Actel-Proasic3" -command "update_active"
714
        $w.config.f.x0.x.menu add radiobutton -label "Aeroflex-UT025CRH" -variable tmpvar_0 -value "Aeroflex-UT025CRH" -command "update_active"
715
        $w.config.f.x0.x.menu add radiobutton -label "Atmel-ATC18" -variable tmpvar_0 -value "Atmel-ATC18" -command "update_active"
716
        $w.config.f.x0.x.menu add radiobutton -label "Custom1" -variable tmpvar_0 -value "Custom1" -command "update_active"
717
        $w.config.f.x0.x.menu add radiobutton -label "IHP25" -variable tmpvar_0 -value "IHP25" -command "update_active"
718
        $w.config.f.x0.x.menu add radiobutton -label "IHP25RH" -variable tmpvar_0 -value "IHP25RH" -command "update_active"
719
        $w.config.f.x0.x.menu add radiobutton -label "Lattice-EC/ECP/XP" -variable tmpvar_0 -value "Lattice-EC/ECP/XP" -command "update_active"
720
        $w.config.f.x0.x.menu add radiobutton -label "Peregrine" -variable tmpvar_0 -value "Peregrine" -command "update_active"
721
        $w.config.f.x0.x.menu add radiobutton -label "RH-LIB18T" -variable tmpvar_0 -value "RH-LIB18T" -command "update_active"
722
        $w.config.f.x0.x.menu add radiobutton -label "RH-UMC" -variable tmpvar_0 -value "RH-UMC" -command "update_active"
723
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan2" -variable tmpvar_0 -value "Xilinx-Spartan2" -command "update_active"
724
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan3" -variable tmpvar_0 -value "Xilinx-Spartan3" -command "update_active"
725
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Spartan3E" -variable tmpvar_0 -value "Xilinx-Spartan3E" -command "update_active"
726
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex" -variable tmpvar_0 -value "Xilinx-Virtex" -command "update_active"
727
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-VirtexE" -variable tmpvar_0 -value "Xilinx-VirtexE" -command "update_active"
728
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex2" -variable tmpvar_0 -value "Xilinx-Virtex2" -command "update_active"
729
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex4" -variable tmpvar_0 -value "Xilinx-Virtex4" -command "update_active"
730
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-Virtex5" -variable tmpvar_0 -value "Xilinx-Virtex5" -command "update_active"
731
        menusplit $w $w.config.f.x0.x.menu 23
732
        global tmpvar_1
733
        minimenu $w.config.f 1 1 "Memory Library                           " tmpvar_1 CONFIG_MEM_INFERRED
734
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"Memory Library                           \""
735
        $w.config.f.x1.x.menu add radiobutton -label "Inferred" -variable tmpvar_1 -value "Inferred" -command "update_active"
736
        $w.config.f.x1.x.menu add radiobutton -label "RH-UMC" -variable tmpvar_1 -value "RH-UMC" -command "update_active"
737
        $w.config.f.x1.x.menu add radiobutton -label "Artisan" -variable tmpvar_1 -value "Artisan" -command "update_active"
738
        $w.config.f.x1.x.menu add radiobutton -label "Custom1" -variable tmpvar_1 -value "Custom1" -command "update_active"
739
        $w.config.f.x1.x.menu add radiobutton -label "Virage" -variable tmpvar_1 -value "Virage" -command "update_active"
740
        menusplit $w $w.config.f.x1.x.menu 5
741
        bool $w.config.f 1 2 "Infer RAM" CONFIG_SYN_INFER_RAM
742
        bool $w.config.f 1 3 "Infer pads" CONFIG_SYN_INFER_PADS
743
        bool $w.config.f 1 4 "Disable asynchronous reset" CONFIG_SYN_NO_ASYNC
744
 
745
 
746
 
747
        focus $w
748
        update_active
749
        global winx; global winy
750
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
751
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
752
        update idletasks
753
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
754
 
755
        $w.config.canvas configure \
756
                -width [expr [winfo reqwidth $w.config.f] + 1]\
757
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
758
                         [expr [winfo reqheight $w.config.f] + 1]"
759
 
760
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
761
        set scry [expr [winfo screenh $w] / 2]
762
        set maxy [expr [winfo screenh $w] * 3 / 4]
763
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
764
        if [expr $winy + $canvtotal < $maxy] {
765
                $w.config.canvas configure -height $canvtotal
766
        } else {
767
                $w.config.canvas configure -height [expr $scry - $winy]
768
                }
769
        }
770
        update idletasks
771
        if {[winfo exists $w]} then {
772
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
773
        wm minsize $w [winfo width $w] 100
774
 
775
        wm deiconify $w
776
}
777
}
778
 
779
proc update_menu1 {} {
780
        global CONFIG_SYN_INFERRED
781
        global CONFIG_SYN_CUSTOM1
782
        global CONFIG_SYN_ATC18
783
        global CONFIG_SYN_RHUMC
784
        global CONFIG_SYN_ARTISAN
785
        if {($CONFIG_SYN_INFERRED == 1 || $CONFIG_SYN_CUSTOM1 == 1 || $CONFIG_SYN_ATC18 == 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}}
786
        global CONFIG_SYN_INFER_RAM
787
        if {($CONFIG_SYN_INFERRED != 1)} then {
788
        configure_entry .menu1.config.f.x2 normal {n l y}} else {configure_entry .menu1.config.f.x2 disabled {y n l}}
789
        global CONFIG_SYN_INFER_PADS
790
        if {($CONFIG_SYN_INFERRED != 1)} then {
791
        configure_entry .menu1.config.f.x3 normal {n l y}} else {configure_entry .menu1.config.f.x3 disabled {y n l}}
792
}
793
 
794
 
795
proc update_define_menu1 {} {
796
        update_define_mainmenu
797
        global CONFIG_MODULES
798
        global tmpvar_0
799
        global CONFIG_SYN_INFERRED
800
        if {$tmpvar_0 == "Inferred"} then {set CONFIG_SYN_INFERRED 1} else {set CONFIG_SYN_INFERRED 0}
801
        global CONFIG_SYN_ALTERA
802
        if {$tmpvar_0 == "Altera-all"} then {set CONFIG_SYN_ALTERA 1} else {set CONFIG_SYN_ALTERA 0}
803
        global CONFIG_SYN_AXCEL
804
        if {$tmpvar_0 == "Actel-Axcelerator"} then {set CONFIG_SYN_AXCEL 1} else {set CONFIG_SYN_AXCEL 0}
805
        global CONFIG_SYN_PROASIC
806
        if {$tmpvar_0 == "Actel-Proasic"} then {set CONFIG_SYN_PROASIC 1} else {set CONFIG_SYN_PROASIC 0}
807
        global CONFIG_SYN_PROASICPLUS
808
        if {$tmpvar_0 == "Actel-ProasicPlus"} then {set CONFIG_SYN_PROASICPLUS 1} else {set CONFIG_SYN_PROASICPLUS 0}
809
        global CONFIG_SYN_PROASIC3
810
        if {$tmpvar_0 == "Actel-Proasic3"} then {set CONFIG_SYN_PROASIC3 1} else {set CONFIG_SYN_PROASIC3 0}
811
        global CONFIG_SYN_UT025CRH
812
        if {$tmpvar_0 == "Aeroflex-UT025CRH"} then {set CONFIG_SYN_UT025CRH 1} else {set CONFIG_SYN_UT025CRH 0}
813
        global CONFIG_SYN_ATC18
814
        if {$tmpvar_0 == "Atmel-ATC18"} then {set CONFIG_SYN_ATC18 1} else {set CONFIG_SYN_ATC18 0}
815
        global CONFIG_SYN_CUSTOM1
816
        if {$tmpvar_0 == "Custom1"} then {set CONFIG_SYN_CUSTOM1 1} else {set CONFIG_SYN_CUSTOM1 0}
817
        global CONFIG_SYN_IHP25
818
        if {$tmpvar_0 == "IHP25"} then {set CONFIG_SYN_IHP25 1} else {set CONFIG_SYN_IHP25 0}
819
        global CONFIG_SYN_IHP25RH
820
        if {$tmpvar_0 == "IHP25RH"} then {set CONFIG_SYN_IHP25RH 1} else {set CONFIG_SYN_IHP25RH 0}
821
        global CONFIG_SYN_LATTICE
822
        if {$tmpvar_0 == "Lattice-EC/ECP/XP"} then {set CONFIG_SYN_LATTICE 1} else {set CONFIG_SYN_LATTICE 0}
823
        global CONFIG_SYN_PEREGRINE
824
        if {$tmpvar_0 == "Peregrine"} then {set CONFIG_SYN_PEREGRINE 1} else {set CONFIG_SYN_PEREGRINE 0}
825
        global CONFIG_SYN_RH_LIB18T
826
        if {$tmpvar_0 == "RH-LIB18T"} then {set CONFIG_SYN_RH_LIB18T 1} else {set CONFIG_SYN_RH_LIB18T 0}
827
        global CONFIG_SYN_RHUMC
828
        if {$tmpvar_0 == "RH-UMC"} then {set CONFIG_SYN_RHUMC 1} else {set CONFIG_SYN_RHUMC 0}
829
        global CONFIG_SYN_SPARTAN2
830
        if {$tmpvar_0 == "Xilinx-Spartan2"} then {set CONFIG_SYN_SPARTAN2 1} else {set CONFIG_SYN_SPARTAN2 0}
831
        global CONFIG_SYN_SPARTAN3
832
        if {$tmpvar_0 == "Xilinx-Spartan3"} then {set CONFIG_SYN_SPARTAN3 1} else {set CONFIG_SYN_SPARTAN3 0}
833
        global CONFIG_SYN_SPARTAN3E
834
        if {$tmpvar_0 == "Xilinx-Spartan3E"} then {set CONFIG_SYN_SPARTAN3E 1} else {set CONFIG_SYN_SPARTAN3E 0}
835
        global CONFIG_SYN_VIRTEX
836
        if {$tmpvar_0 == "Xilinx-Virtex"} then {set CONFIG_SYN_VIRTEX 1} else {set CONFIG_SYN_VIRTEX 0}
837
        global CONFIG_SYN_VIRTEXE
838
        if {$tmpvar_0 == "Xilinx-VirtexE"} then {set CONFIG_SYN_VIRTEXE 1} else {set CONFIG_SYN_VIRTEXE 0}
839
        global CONFIG_SYN_VIRTEX2
840
        if {$tmpvar_0 == "Xilinx-Virtex2"} then {set CONFIG_SYN_VIRTEX2 1} else {set CONFIG_SYN_VIRTEX2 0}
841
        global CONFIG_SYN_VIRTEX4
842
        if {$tmpvar_0 == "Xilinx-Virtex4"} then {set CONFIG_SYN_VIRTEX4 1} else {set CONFIG_SYN_VIRTEX4 0}
843
        global CONFIG_SYN_VIRTEX5
844
        if {$tmpvar_0 == "Xilinx-Virtex5"} then {set CONFIG_SYN_VIRTEX5 1} else {set CONFIG_SYN_VIRTEX5 0}
845
        global tmpvar_1
846
        global CONFIG_MEM_INFERRED
847
        if {$tmpvar_1 == "Inferred"} then {set CONFIG_MEM_INFERRED 1} else {set CONFIG_MEM_INFERRED 0}
848
        global CONFIG_MEM_RHUMC
849
        if {$tmpvar_1 == "RH-UMC"} then {set CONFIG_MEM_RHUMC 1} else {set CONFIG_MEM_RHUMC 0}
850
        global CONFIG_MEM_ARTISAN
851
        if {$tmpvar_1 == "Artisan"} then {set CONFIG_MEM_ARTISAN 1} else {set CONFIG_MEM_ARTISAN 0}
852
        global CONFIG_MEM_CUSTOM1
853
        if {$tmpvar_1 == "Custom1"} then {set CONFIG_MEM_CUSTOM1 1} else {set CONFIG_MEM_CUSTOM1 0}
854
        global CONFIG_MEM_VIRAGE
855
        if {$tmpvar_1 == "Virage"} then {set CONFIG_MEM_VIRAGE 1} else {set CONFIG_MEM_VIRAGE 0}
856
        global CONFIG_SYN_INFER_RAM
857
        if {($CONFIG_SYN_INFERRED != 1)} then {
858
        set CONFIG_SYN_INFER_RAM [expr $CONFIG_SYN_INFER_RAM&15]} else {set CONFIG_SYN_INFER_RAM [expr $CONFIG_SYN_INFER_RAM|16]}
859
        global CONFIG_SYN_INFER_PADS
860
        if {($CONFIG_SYN_INFERRED != 1)} then {
861
        set CONFIG_SYN_INFER_PADS [expr $CONFIG_SYN_INFER_PADS&15]} else {set CONFIG_SYN_INFER_PADS [expr $CONFIG_SYN_INFER_PADS|16]}
862
}
863
 
864
 
865
menu_option menu2 2 "Clock generation"
866
proc menu2 {w title} {
867
        set oldFocus [focus]
868
        catch {destroy $w; unregister_active 2}
869
        toplevel $w -class Dialog
870
        wm withdraw $w
871
        global active_menus
872
        set active_menus [lsort -integer [linsert $active_menus end 2]]
873
        message $w.m -width 400 -aspect 300 -text \
874
                "Clock generation"  -relief raised
875
        pack $w.m -pady 10 -side top -padx 10
876
        wm title $w "Clock generation"
877
 
878
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 2; break"
879
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu3 .menu3 \"$title\""
880
        frame $w.f
881
        button $w.f.back -text "Main Menu" \
882
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 2"
883
        button $w.f.next -text "Next" -underline 0\
884
                -width 15 -command $nextscript
885
        bind all  $nextscript
886
        button $w.f.prev -text "Prev" -underline 0\
887
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu1 .menu1 \"$title\""
888
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 2; menu1 .menu1 \"$title\";break"
889
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
890
        pack $w.f -pady 10 -side bottom -anchor w -fill x
891
        frame $w.topline -relief ridge -borderwidth 2 -height 2
892
        pack $w.topline -side top -fill x
893
 
894
        frame $w.botline -relief ridge -borderwidth 2 -height 2
895
        pack $w.botline -side bottom -fill x
896
 
897
        frame $w.config
898
        pack $w.config -fill y -expand on
899
 
900
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
901
        pack $w.config.vscroll -side right -fill y
902
 
903
        canvas $w.config.canvas -height 1\
904
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
905
                -width [expr [winfo screenwidth .] * 1 / 2]
906
        frame $w.config.f
907
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
908
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
909
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
910
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
911
        bind $w  "$w.config.canvas yview moveto 0;break;"
912
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
913
        pack $w.config.canvas -side right -fill y
914
 
915
 
916
        global tmpvar_2
917
        minimenu $w.config.f 2 0 "Clock generator                     " tmpvar_2 CONFIG_CLK_INFERRED
918
        menu $w.config.f.x0.x.menu -tearoffcommand "menutitle \"Clock generator                     \""
919
        $w.config.f.x0.x.menu add radiobutton -label "Inferred" -variable tmpvar_2 -value "Inferred" -command "update_active"
920
        $w.config.f.x0.x.menu add radiobutton -label "Actel-HCLKBUF" -variable tmpvar_2 -value "Actel-HCLKBUF" -command "update_active"
921
        $w.config.f.x0.x.menu add radiobutton -label "Altera-ALTPLL" -variable tmpvar_2 -value "Altera-ALTPLL" -command "update_active"
922
        $w.config.f.x0.x.menu add radiobutton -label "Lattice-EXPLL" -variable tmpvar_2 -value "Lattice-EXPLL" -command "update_active"
923
        $w.config.f.x0.x.menu add radiobutton -label "RH-LIB18T-PLL" -variable tmpvar_2 -value "RH-LIB18T-PLL" -command "update_active"
924
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-CLKDLL" -variable tmpvar_2 -value "Xilinx-CLKDLL" -command "update_active"
925
        $w.config.f.x0.x.menu add radiobutton -label "Xilinx-DCM" -variable tmpvar_2 -value "Xilinx-DCM" -command "update_active"
926
        menusplit $w $w.config.f.x0.x.menu 7
927
        int $w.config.f 2 1 "Clock multiplication factor (2 - 32)" CONFIG_CLK_MUL
928
        int $w.config.f 2 2 "Clock division factor (2 - 32)" CONFIG_CLK_DIV
929
        bool $w.config.f 2 3 "Enable Xilinx CLKDLL for PCI clock" CONFIG_PCI_CLKDLL
930
        bool $w.config.f 2 4 "Disable external feedback for SDRAM clock" CONFIG_CLK_NOFB
931
        bool $w.config.f 2 5 "Use PCI clock as system clock" CONFIG_PCI_SYSCLK
932
 
933
 
934
 
935
        focus $w
936
        update_active
937
        global winx; global winy
938
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
939
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
940
        update idletasks
941
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
942
 
943
        $w.config.canvas configure \
944
                -width [expr [winfo reqwidth $w.config.f] + 1]\
945
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
946
                         [expr [winfo reqheight $w.config.f] + 1]"
947
 
948
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
949
        set scry [expr [winfo screenh $w] / 2]
950
        set maxy [expr [winfo screenh $w] * 3 / 4]
951
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
952
        if [expr $winy + $canvtotal < $maxy] {
953
                $w.config.canvas configure -height $canvtotal
954
        } else {
955
                $w.config.canvas configure -height [expr $scry - $winy]
956
                }
957
        }
958
        update idletasks
959
        if {[winfo exists $w]} then {
960
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
961
        wm minsize $w [winfo width $w] 100
962
 
963
        wm deiconify $w
964
}
965
}
966
 
967
proc update_menu2 {} {
968
        global CONFIG_CLK_DCM
969
        global CONFIG_CLK_ALTDLL
970
        global CONFIG_CLK_LATDLL
971
        global CONFIG_CLK_CLKDLL
972
        global CONFIG_CLK_LIB18T
973
        global CONFIG_CLK_MUL
974
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 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}
975
        global CONFIG_CLK_DIV
976
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 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}
977
        global CONFIG_PCI_CLKDLL
978
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {
979
        configure_entry .menu2.config.f.x3 normal {n l y}} else {configure_entry .menu2.config.f.x3 disabled {y n l}}
980
        global CONFIG_CLK_NOFB
981
        if {($CONFIG_CLK_DCM == 1)} then {
982
        configure_entry .menu2.config.f.x4 normal {n l y}} else {configure_entry .menu2.config.f.x4 disabled {y n l}}
983
        global CONFIG_PCI_ENABLE
984
        global CONFIG_PCI_SYSCLK
985
        if {($CONFIG_PCI_ENABLE != 1)} then {
986
        configure_entry .menu2.config.f.x5 normal {n l y}} else {configure_entry .menu2.config.f.x5 disabled {y n l}}
987
}
988
 
989
 
990
proc update_define_menu2 {} {
991
        update_define_mainmenu
992
        global CONFIG_MODULES
993
        global tmpvar_2
994
        global CONFIG_CLK_INFERRED
995
        if {$tmpvar_2 == "Inferred"} then {set CONFIG_CLK_INFERRED 1} else {set CONFIG_CLK_INFERRED 0}
996
        global CONFIG_CLK_HCLKBUF
997
        if {$tmpvar_2 == "Actel-HCLKBUF"} then {set CONFIG_CLK_HCLKBUF 1} else {set CONFIG_CLK_HCLKBUF 0}
998
        global CONFIG_CLK_ALTDLL
999
        if {$tmpvar_2 == "Altera-ALTPLL"} then {set CONFIG_CLK_ALTDLL 1} else {set CONFIG_CLK_ALTDLL 0}
1000
        global CONFIG_CLK_LATDLL
1001
        if {$tmpvar_2 == "Lattice-EXPLL"} then {set CONFIG_CLK_LATDLL 1} else {set CONFIG_CLK_LATDLL 0}
1002
        global CONFIG_CLK_LIB18T
1003
        if {$tmpvar_2 == "RH-LIB18T-PLL"} then {set CONFIG_CLK_LIB18T 1} else {set CONFIG_CLK_LIB18T 0}
1004
        global CONFIG_CLK_CLKDLL
1005
        if {$tmpvar_2 == "Xilinx-CLKDLL"} then {set CONFIG_CLK_CLKDLL 1} else {set CONFIG_CLK_CLKDLL 0}
1006
        global CONFIG_CLK_DCM
1007
        if {$tmpvar_2 == "Xilinx-DCM"} then {set CONFIG_CLK_DCM 1} else {set CONFIG_CLK_DCM 0}
1008
        global CONFIG_CLK_MUL
1009
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {validate_int CONFIG_CLK_MUL "$CONFIG_CLK_MUL" 2}
1010
        global CONFIG_CLK_DIV
1011
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {validate_int CONFIG_CLK_DIV "$CONFIG_CLK_DIV" 2}
1012
        global CONFIG_PCI_CLKDLL
1013
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {
1014
        set CONFIG_PCI_CLKDLL [expr $CONFIG_PCI_CLKDLL&15]} else {set CONFIG_PCI_CLKDLL [expr $CONFIG_PCI_CLKDLL|16]}
1015
        global CONFIG_CLK_NOFB
1016
        if {($CONFIG_CLK_DCM == 1)} then {
1017
        set CONFIG_CLK_NOFB [expr $CONFIG_CLK_NOFB&15]} else {set CONFIG_CLK_NOFB [expr $CONFIG_CLK_NOFB|16]}
1018
        global CONFIG_PCI_ENABLE
1019
        global CONFIG_PCI_SYSCLK
1020
        if {($CONFIG_PCI_ENABLE != 1)} then {
1021
        set CONFIG_PCI_SYSCLK [expr $CONFIG_PCI_SYSCLK&15]} else {set CONFIG_PCI_SYSCLK [expr $CONFIG_PCI_SYSCLK|16]}
1022
}
1023
 
1024
 
1025
menu_option menu3 3 "AMBA configuration"
1026
proc menu3 {w title} {
1027
        set oldFocus [focus]
1028
        catch {destroy $w; unregister_active 3}
1029
        toplevel $w -class Dialog
1030
        wm withdraw $w
1031
        global active_menus
1032
        set active_menus [lsort -integer [linsert $active_menus end 3]]
1033
        message $w.m -width 400 -aspect 300 -text \
1034
                "AMBA configuration"  -relief raised
1035
        pack $w.m -pady 10 -side top -padx 10
1036
        wm title $w "AMBA configuration"
1037
 
1038
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 3; break"
1039
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu4 .menu4 \"$title\""
1040
        frame $w.f
1041
        button $w.f.back -text "Main Menu" \
1042
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 3"
1043
        button $w.f.next -text "Next" -underline 0\
1044
                -width 15 -command $nextscript
1045
        bind all  $nextscript
1046
        button $w.f.prev -text "Prev" -underline 0\
1047
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu2 .menu2 \"$title\""
1048
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 3; menu2 .menu2 \"$title\";break"
1049
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1050
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1051
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1052
        pack $w.topline -side top -fill x
1053
 
1054
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1055
        pack $w.botline -side bottom -fill x
1056
 
1057
        frame $w.config
1058
        pack $w.config -fill y -expand on
1059
 
1060
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1061
        pack $w.config.vscroll -side right -fill y
1062
 
1063
        canvas $w.config.canvas -height 1\
1064
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1065
                -width [expr [winfo screenwidth .] * 1 / 2]
1066
        frame $w.config.f
1067
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1068
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1069
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1070
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1071
        bind $w  "$w.config.canvas yview moveto 0;break;"
1072
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1073
        pack $w.config.canvas -side right -fill y
1074
 
1075
 
1076
        int $w.config.f 3 0 "Default AHB master" CONFIG_AHB_DEFMST
1077
        bool $w.config.f 3 1 "Round-robin arbiter                       " CONFIG_AHB_RROBIN
1078
        bool $w.config.f 3 2 "AHB split-transaction support             " CONFIG_AHB_SPLIT
1079
        hex $w.config.f 3 3 "I/O area start address (haddr\[31:20\]) " CONFIG_AHB_IOADDR
1080
        hex $w.config.f 3 4 "AHB/APB bridge address (haddr\[31:20\]) " CONFIG_APB_HADDR
1081
 
1082
 
1083
 
1084
        focus $w
1085
        update_active
1086
        global winx; global winy
1087
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
1088
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1089
        update idletasks
1090
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1091
 
1092
        $w.config.canvas configure \
1093
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1094
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1095
                         [expr [winfo reqheight $w.config.f] + 1]"
1096
 
1097
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1098
        set scry [expr [winfo screenh $w] / 2]
1099
        set maxy [expr [winfo screenh $w] * 3 / 4]
1100
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1101
        if [expr $winy + $canvtotal < $maxy] {
1102
                $w.config.canvas configure -height $canvtotal
1103
        } else {
1104
                $w.config.canvas configure -height [expr $scry - $winy]
1105
                }
1106
        }
1107
        update idletasks
1108
        if {[winfo exists $w]} then {
1109
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1110
        wm minsize $w [winfo width $w] 100
1111
 
1112
        wm deiconify $w
1113
}
1114
}
1115
 
1116
proc update_menu3 {} {
1117
}
1118
 
1119
 
1120
proc update_define_menu3 {} {
1121
        update_define_mainmenu
1122
        global CONFIG_MODULES
1123
}
1124
 
1125
 
1126
menu_option menu4 4 "Debug Link           "
1127
proc menu4 {w title} {
1128
        set oldFocus [focus]
1129
        catch {destroy $w; unregister_active 4}
1130
        toplevel $w -class Dialog
1131
        wm withdraw $w
1132
        global active_menus
1133
        set active_menus [lsort -integer [linsert $active_menus end 4]]
1134
        message $w.m -width 400 -aspect 300 -text \
1135
                "Debug Link           "  -relief raised
1136
        pack $w.m -pady 10 -side top -padx 10
1137
        wm title $w "Debug Link           "
1138
 
1139
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 4; break"
1140
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu5 .menu5 \"$title\""
1141
        frame $w.f
1142
        button $w.f.back -text "Main Menu" \
1143
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 4"
1144
        button $w.f.next -text "Next" -underline 0\
1145
                -width 15 -command $nextscript
1146
        bind all  $nextscript
1147
        button $w.f.prev -text "Prev" -underline 0\
1148
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu3 .menu3 \"$title\""
1149
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 4; menu3 .menu3 \"$title\";break"
1150
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1151
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1152
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1153
        pack $w.topline -side top -fill x
1154
 
1155
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1156
        pack $w.botline -side bottom -fill x
1157
 
1158
        frame $w.config
1159
        pack $w.config -fill y -expand on
1160
 
1161
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1162
        pack $w.config.vscroll -side right -fill y
1163
 
1164
        canvas $w.config.canvas -height 1\
1165
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1166
                -width [expr [winfo screenwidth .] * 1 / 2]
1167
        frame $w.config.f
1168
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1169
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1170
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1171
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1172
        bind $w  "$w.config.canvas yview moveto 0;break;"
1173
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1174
        pack $w.config.canvas -side right -fill y
1175
 
1176
 
1177
        bool $w.config.f 4 0 "Serial Debug Link (RS232)                " CONFIG_DSU_UART
1178
        bool $w.config.f 4 1 "JTAG Debug Link" CONFIG_DSU_JTAG
1179
 
1180
 
1181
 
1182
        focus $w
1183
        update_active
1184
        global winx; global winy
1185
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
1186
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1187
        update idletasks
1188
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1189
 
1190
        $w.config.canvas configure \
1191
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1192
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1193
                         [expr [winfo reqheight $w.config.f] + 1]"
1194
 
1195
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1196
        set scry [expr [winfo screenh $w] / 2]
1197
        set maxy [expr [winfo screenh $w] * 3 / 4]
1198
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1199
        if [expr $winy + $canvtotal < $maxy] {
1200
                $w.config.canvas configure -height $canvtotal
1201
        } else {
1202
                $w.config.canvas configure -height [expr $scry - $winy]
1203
                }
1204
        }
1205
        update idletasks
1206
        if {[winfo exists $w]} then {
1207
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1208
        wm minsize $w [winfo width $w] 100
1209
 
1210
        wm deiconify $w
1211
}
1212
}
1213
 
1214
proc update_menu4 {} {
1215
}
1216
 
1217
 
1218
proc update_define_menu4 {} {
1219
        update_define_mainmenu
1220
        global CONFIG_MODULES
1221
}
1222
 
1223
 
1224
menu_option menu5 5 "On-chip RAM                 "
1225
proc menu5 {w title} {
1226
        set oldFocus [focus]
1227
        catch {destroy $w; unregister_active 5}
1228
        toplevel $w -class Dialog
1229
        wm withdraw $w
1230
        global active_menus
1231
        set active_menus [lsort -integer [linsert $active_menus end 5]]
1232
        message $w.m -width 400 -aspect 300 -text \
1233
                "On-chip RAM                 "  -relief raised
1234
        pack $w.m -pady 10 -side top -padx 10
1235
        wm title $w "On-chip RAM                 "
1236
 
1237
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 5; break"
1238
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu6 .menu6 \"$title\""
1239
        frame $w.f
1240
        button $w.f.back -text "Main Menu" \
1241
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 5"
1242
        button $w.f.next -text "Next" -underline 0\
1243
                -width 15 -command $nextscript
1244
        bind all  $nextscript
1245
        button $w.f.prev -text "Prev" -underline 0\
1246
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu4 .menu4 \"$title\""
1247
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 5; menu4 .menu4 \"$title\";break"
1248
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1249
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1250
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1251
        pack $w.topline -side top -fill x
1252
 
1253
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1254
        pack $w.botline -side bottom -fill x
1255
 
1256
        frame $w.config
1257
        pack $w.config -fill y -expand on
1258
 
1259
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1260
        pack $w.config.vscroll -side right -fill y
1261
 
1262
        canvas $w.config.canvas -height 1\
1263
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1264
                -width [expr [winfo screenwidth .] * 1 / 2]
1265
        frame $w.config.f
1266
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1267
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1268
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1269
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1270
        bind $w  "$w.config.canvas yview moveto 0;break;"
1271
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1272
        pack $w.config.canvas -side right -fill y
1273
 
1274
 
1275
        bool $w.config.f 5 0 "On-chip AHB RAM                   " CONFIG_AHBRAM_ENABLE
1276
        global tmpvar_3
1277
        minimenu $w.config.f 5 1 "AHB RAM size (Kbyte)" tmpvar_3 CONFIG_AHBRAM_SZ1
1278
        menu $w.config.f.x1.x.menu -tearoffcommand "menutitle \"AHB RAM size (Kbyte)\""
1279
        $w.config.f.x1.x.menu add radiobutton -label "1" -variable tmpvar_3 -value "1" -command "update_active"
1280
        $w.config.f.x1.x.menu add radiobutton -label "2" -variable tmpvar_3 -value "2" -command "update_active"
1281
        $w.config.f.x1.x.menu add radiobutton -label "4" -variable tmpvar_3 -value "4" -command "update_active"
1282
        $w.config.f.x1.x.menu add radiobutton -label "8" -variable tmpvar_3 -value "8" -command "update_active"
1283
        $w.config.f.x1.x.menu add radiobutton -label "16" -variable tmpvar_3 -value "16" -command "update_active"
1284
        $w.config.f.x1.x.menu add radiobutton -label "32" -variable tmpvar_3 -value "32" -command "update_active"
1285
        $w.config.f.x1.x.menu add radiobutton -label "64" -variable tmpvar_3 -value "64" -command "update_active"
1286
        menusplit $w $w.config.f.x1.x.menu 7
1287
        hex $w.config.f 5 2 "RAM start address (haddr\[31:20\]) " CONFIG_AHBRAM_START
1288
 
1289
 
1290
 
1291
        focus $w
1292
        update_active
1293
        global winx; global winy
1294
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
1295
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1296
        update idletasks
1297
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1298
 
1299
        $w.config.canvas configure \
1300
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1301
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1302
                         [expr [winfo reqheight $w.config.f] + 1]"
1303
 
1304
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1305
        set scry [expr [winfo screenh $w] / 2]
1306
        set maxy [expr [winfo screenh $w] * 3 / 4]
1307
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1308
        if [expr $winy + $canvtotal < $maxy] {
1309
                $w.config.canvas configure -height $canvtotal
1310
        } else {
1311
                $w.config.canvas configure -height [expr $scry - $winy]
1312
                }
1313
        }
1314
        update idletasks
1315
        if {[winfo exists $w]} then {
1316
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1317
        wm minsize $w [winfo width $w] 100
1318
 
1319
        wm deiconify $w
1320
}
1321
}
1322
 
1323
proc update_menu5 {} {
1324
        global CONFIG_AHBRAM_ENABLE
1325
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {configure_entry .menu5.config.f.x1 normal {x l}} else {configure_entry .menu5.config.f.x1 disabled {x l}}
1326
        global CONFIG_AHBRAM_START
1327
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {.menu5.config.f.x2.x configure -state normal -foreground [ cget .ref -foreground ]; .menu5.config.f.x2.l configure -state normal; } else {.menu5.config.f.x2.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu5.config.f.x2.l configure -state disabled}
1328
}
1329
 
1330
 
1331
proc update_define_menu5 {} {
1332
        update_define_mainmenu
1333
        global CONFIG_MODULES
1334
        global tmpvar_3
1335
        global CONFIG_AHBRAM_SZ1
1336
        if {$tmpvar_3 == "1"} then {set CONFIG_AHBRAM_SZ1 1} else {set CONFIG_AHBRAM_SZ1 0}
1337
        global CONFIG_AHBRAM_SZ2
1338
        if {$tmpvar_3 == "2"} then {set CONFIG_AHBRAM_SZ2 1} else {set CONFIG_AHBRAM_SZ2 0}
1339
        global CONFIG_AHBRAM_SZ4
1340
        if {$tmpvar_3 == "4"} then {set CONFIG_AHBRAM_SZ4 1} else {set CONFIG_AHBRAM_SZ4 0}
1341
        global CONFIG_AHBRAM_SZ8
1342
        if {$tmpvar_3 == "8"} then {set CONFIG_AHBRAM_SZ8 1} else {set CONFIG_AHBRAM_SZ8 0}
1343
        global CONFIG_AHBRAM_SZ16
1344
        if {$tmpvar_3 == "16"} then {set CONFIG_AHBRAM_SZ16 1} else {set CONFIG_AHBRAM_SZ16 0}
1345
        global CONFIG_AHBRAM_SZ32
1346
        if {$tmpvar_3 == "32"} then {set CONFIG_AHBRAM_SZ32 1} else {set CONFIG_AHBRAM_SZ32 0}
1347
        global CONFIG_AHBRAM_SZ64
1348
        if {$tmpvar_3 == "64"} then {set CONFIG_AHBRAM_SZ64 1} else {set CONFIG_AHBRAM_SZ64 0}
1349
        global CONFIG_AHBRAM_ENABLE
1350
        global CONFIG_AHBRAM_START
1351
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {validate_hex CONFIG_AHBRAM_START "$CONFIG_AHBRAM_START" A00}
1352
}
1353
 
1354
 
1355
menu_option menu6 6 "Ethernet             "
1356
proc menu6 {w title} {
1357
        set oldFocus [focus]
1358
        catch {destroy $w; unregister_active 6}
1359
        toplevel $w -class Dialog
1360
        wm withdraw $w
1361
        global active_menus
1362
        set active_menus [lsort -integer [linsert $active_menus end 6]]
1363
        message $w.m -width 400 -aspect 300 -text \
1364
                "Ethernet             "  -relief raised
1365
        pack $w.m -pady 10 -side top -padx 10
1366
        wm title $w "Ethernet             "
1367
 
1368
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 6; break"
1369
        set nextscript "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu7 .menu7 \"$title\""
1370
        frame $w.f
1371
        button $w.f.back -text "Main Menu" \
1372
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 6"
1373
        button $w.f.next -text "Next" -underline 0\
1374
                -width 15 -command $nextscript
1375
        bind all  $nextscript
1376
        button $w.f.prev -text "Prev" -underline 0\
1377
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu5 .menu5 \"$title\""
1378
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 6; menu5 .menu5 \"$title\";break"
1379
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1380
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1381
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1382
        pack $w.topline -side top -fill x
1383
 
1384
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1385
        pack $w.botline -side bottom -fill x
1386
 
1387
        frame $w.config
1388
        pack $w.config -fill y -expand on
1389
 
1390
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1391
        pack $w.config.vscroll -side right -fill y
1392
 
1393
        canvas $w.config.canvas -height 1\
1394
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1395
                -width [expr [winfo screenwidth .] * 1 / 2]
1396
        frame $w.config.f
1397
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1398
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1399
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1400
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1401
        bind $w  "$w.config.canvas yview moveto 0;break;"
1402
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1403
        pack $w.config.canvas -side right -fill y
1404
 
1405
 
1406
        bool $w.config.f 6 0 "Gaisler Research 10/100/1000 Mbit Ethernet MAC " CONFIG_GRETH_ENABLE
1407
        bool $w.config.f 6 1 "Enable 1000 Mbit support    " CONFIG_GRETH_GIGA
1408
        global tmpvar_4
1409
        minimenu $w.config.f 6 2 "AHB FIFO size (words)            " tmpvar_4 CONFIG_GRETH_FIFO4
1410
        menu $w.config.f.x2.x.menu -tearoffcommand "menutitle \"AHB FIFO size (words)            \""
1411
        $w.config.f.x2.x.menu add radiobutton -label "4" -variable tmpvar_4 -value "4" -command "update_active"
1412
        $w.config.f.x2.x.menu add radiobutton -label "8" -variable tmpvar_4 -value "8" -command "update_active"
1413
        $w.config.f.x2.x.menu add radiobutton -label "16" -variable tmpvar_4 -value "16" -command "update_active"
1414
        $w.config.f.x2.x.menu add radiobutton -label "32" -variable tmpvar_4 -value "32" -command "update_active"
1415
        $w.config.f.x2.x.menu add radiobutton -label "64" -variable tmpvar_4 -value "64" -command "update_active"
1416
        menusplit $w $w.config.f.x2.x.menu 5
1417
 
1418
 
1419
 
1420
        focus $w
1421
        update_active
1422
        global winx; global winy
1423
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
1424
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1425
        update idletasks
1426
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1427
 
1428
        $w.config.canvas configure \
1429
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1430
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1431
                         [expr [winfo reqheight $w.config.f] + 1]"
1432
 
1433
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1434
        set scry [expr [winfo screenh $w] / 2]
1435
        set maxy [expr [winfo screenh $w] * 3 / 4]
1436
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1437
        if [expr $winy + $canvtotal < $maxy] {
1438
                $w.config.canvas configure -height $canvtotal
1439
        } else {
1440
                $w.config.canvas configure -height [expr $scry - $winy]
1441
                }
1442
        }
1443
        update idletasks
1444
        if {[winfo exists $w]} then {
1445
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1446
        wm minsize $w [winfo width $w] 100
1447
 
1448
        wm deiconify $w
1449
}
1450
}
1451
 
1452
proc update_menu6 {} {
1453
        global CONFIG_GRETH_ENABLE
1454
        global CONFIG_GRETH_GIGA
1455
        if {($CONFIG_GRETH_ENABLE == 1)} then {
1456
        configure_entry .menu6.config.f.x1 normal {n l y}} else {configure_entry .menu6.config.f.x1 disabled {y n l}}
1457
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_GRETH_GIGA == 0)} then {configure_entry .menu6.config.f.x2 normal {x l}} else {configure_entry .menu6.config.f.x2 disabled {x l}}
1458
}
1459
 
1460
 
1461
proc update_define_menu6 {} {
1462
        update_define_mainmenu
1463
        global CONFIG_MODULES
1464
        global CONFIG_GRETH_ENABLE
1465
        global CONFIG_GRETH_GIGA
1466
        if {($CONFIG_GRETH_ENABLE == 1)} then {
1467
        set CONFIG_GRETH_GIGA [expr $CONFIG_GRETH_GIGA&15]} else {set CONFIG_GRETH_GIGA [expr $CONFIG_GRETH_GIGA|16]}
1468
        global tmpvar_4
1469
        global CONFIG_GRETH_FIFO4
1470
        if {$tmpvar_4 == "4"} then {set CONFIG_GRETH_FIFO4 1} else {set CONFIG_GRETH_FIFO4 0}
1471
        global CONFIG_GRETH_FIFO8
1472
        if {$tmpvar_4 == "8"} then {set CONFIG_GRETH_FIFO8 1} else {set CONFIG_GRETH_FIFO8 0}
1473
        global CONFIG_GRETH_FIFO16
1474
        if {$tmpvar_4 == "16"} then {set CONFIG_GRETH_FIFO16 1} else {set CONFIG_GRETH_FIFO16 0}
1475
        global CONFIG_GRETH_FIFO32
1476
        if {$tmpvar_4 == "32"} then {set CONFIG_GRETH_FIFO32 1} else {set CONFIG_GRETH_FIFO32 0}
1477
        global CONFIG_GRETH_FIFO64
1478
        if {$tmpvar_4 == "64"} then {set CONFIG_GRETH_FIFO64 1} else {set CONFIG_GRETH_FIFO64 0}
1479
}
1480
 
1481
 
1482
menu_option menu7 7 "PCI              "
1483
proc menu7 {w title} {
1484
        set oldFocus [focus]
1485
        catch {destroy $w; unregister_active 7}
1486
        toplevel $w -class Dialog
1487
        wm withdraw $w
1488
        global active_menus
1489
        set active_menus [lsort -integer [linsert $active_menus end 7]]
1490
        message $w.m -width 400 -aspect 300 -text \
1491
                "PCI              "  -relief raised
1492
        pack $w.m -pady 10 -side top -padx 10
1493
        wm title $w "PCI              "
1494
 
1495
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 7; break"
1496
        set nextscript "catch {focus $oldFocus}; menu8 .menu8 \"$title\""
1497
        frame $w.f
1498
        button $w.f.back -text "Main Menu" \
1499
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 7"
1500
        button $w.f.next -text "Next" -underline 0\
1501
                -width 15 -command $nextscript
1502
        $w.f.next configure -state disabled
1503
        bind all  "puts \"no more menus\" "
1504
        button $w.f.prev -text "Prev" -underline 0\
1505
                -width 15 -command "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu6 .menu6 \"$title\""
1506
        bind $w  "catch {focus $oldFocus}; destroy $w; unregister_active 7; menu6 .menu6 \"$title\";break"
1507
        pack $w.f.back $w.f.next $w.f.prev -side left -expand on
1508
        pack $w.f -pady 10 -side bottom -anchor w -fill x
1509
        frame $w.topline -relief ridge -borderwidth 2 -height 2
1510
        pack $w.topline -side top -fill x
1511
 
1512
        frame $w.botline -relief ridge -borderwidth 2 -height 2
1513
        pack $w.botline -side bottom -fill x
1514
 
1515
        frame $w.config
1516
        pack $w.config -fill y -expand on
1517
 
1518
        scrollbar $w.config.vscroll -command "$w.config.canvas yview"
1519
        pack $w.config.vscroll -side right -fill y
1520
 
1521
        canvas $w.config.canvas -height 1\
1522
                -relief flat -borderwidth 0 -yscrollcommand "$w.config.vscroll set" \
1523
                -width [expr [winfo screenwidth .] * 1 / 2]
1524
        frame $w.config.f
1525
        bind $w  "$w.config.canvas yview scroll  1 unit;break;"
1526
        bind $w  "$w.config.canvas yview scroll  -1 unit;break;"
1527
        bind $w  "$w.config.canvas yview scroll  1 page;break;"
1528
        bind $w  "$w.config.canvas yview scroll  -1 page;break;"
1529
        bind $w  "$w.config.canvas yview moveto 0;break;"
1530
        bind $w  "$w.config.canvas yview moveto 1 ;break;"
1531
        pack $w.config.canvas -side right -fill y
1532
 
1533
 
1534
        bool $w.config.f 7 0 "PCI interface, target-only     " CONFIG_PCI_SIMPLE_TARGET
1535
        bool $w.config.f 7 1 "PCI interface, master-target     " CONFIG_PCI_MASTER_TARGET
1536
        bool $w.config.f 7 2 "PCI DMA controller               " CONFIG_PCI_MASTER_TARGET_DMA
1537
        hex $w.config.f 7 3 "PCI vendor ID" CONFIG_PCI_VENDORID
1538
        hex $w.config.f 7 4 "PCI device ID" CONFIG_PCI_DEVICEID
1539
        global tmpvar_5
1540
        minimenu $w.config.f 7 5 "PCI FIFO depth" tmpvar_5 CONFIG_PCI_FIFO0
1541
        menu $w.config.f.x5.x.menu -tearoffcommand "menutitle \"PCI FIFO depth\""
1542
        $w.config.f.x5.x.menu add radiobutton -label "None" -variable tmpvar_5 -value "None" -command "update_active"
1543
        $w.config.f.x5.x.menu add radiobutton -label "8" -variable tmpvar_5 -value "8" -command "update_active"
1544
        $w.config.f.x5.x.menu add radiobutton -label "16" -variable tmpvar_5 -value "16" -command "update_active"
1545
        $w.config.f.x5.x.menu add radiobutton -label "32" -variable tmpvar_5 -value "32" -command "update_active"
1546
        $w.config.f.x5.x.menu add radiobutton -label "64" -variable tmpvar_5 -value "64" -command "update_active"
1547
        $w.config.f.x5.x.menu add radiobutton -label "128" -variable tmpvar_5 -value "128" -command "update_active"
1548
        menusplit $w $w.config.f.x5.x.menu 6
1549
        hex $w.config.f 7 6 "PCI initiator address (haddr\[31:20\]) " CONFIG_PCI_HADDR
1550
        bool $w.config.f 7 7 "Enable PCI trace buffer              " CONFIG_PCI_TRACE
1551
        global tmpvar_6
1552
        minimenu $w.config.f 7 8 "PCI trace buffer depth" tmpvar_6 CONFIG_PCI_TRACE256
1553
        menu $w.config.f.x8.x.menu -tearoffcommand "menutitle \"PCI trace buffer depth\""
1554
        $w.config.f.x8.x.menu add radiobutton -label "256" -variable tmpvar_6 -value "256" -command "update_active"
1555
        $w.config.f.x8.x.menu add radiobutton -label "512" -variable tmpvar_6 -value "512" -command "update_active"
1556
        $w.config.f.x8.x.menu add radiobutton -label "1024" -variable tmpvar_6 -value "1024" -command "update_active"
1557
        $w.config.f.x8.x.menu add radiobutton -label "2048" -variable tmpvar_6 -value "2048" -command "update_active"
1558
        $w.config.f.x8.x.menu add radiobutton -label "4096" -variable tmpvar_6 -value "4096" -command "update_active"
1559
        menusplit $w $w.config.f.x8.x.menu 5
1560
 
1561
 
1562
 
1563
        focus $w
1564
        update_active
1565
        global winx; global winy
1566
        set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
1567
        if {[winfo exists $w]} then {wm geometry $w +$winx+$winy}
1568
        update idletasks
1569
        if {[winfo exists $w]} then  {$w.config.canvas create window 0 0 -anchor nw -window $w.config.f
1570
 
1571
        $w.config.canvas configure \
1572
                -width [expr [winfo reqwidth $w.config.f] + 1]\
1573
                -scrollregion "-1 -1 [expr [winfo reqwidth $w.config.f] + 1] \
1574
                         [expr [winfo reqheight $w.config.f] + 1]"
1575
 
1576
        set winy [expr [winfo reqh $w] - [winfo reqh $w.config.canvas]]
1577
        set scry [expr [winfo screenh $w] / 2]
1578
        set maxy [expr [winfo screenh $w] * 3 / 4]
1579
        set canvtotal [expr [winfo reqh $w.config.f] + 2]
1580
        if [expr $winy + $canvtotal < $maxy] {
1581
                $w.config.canvas configure -height $canvtotal
1582
        } else {
1583
                $w.config.canvas configure -height [expr $scry - $winy]
1584
                }
1585
        }
1586
        update idletasks
1587
        if {[winfo exists $w]} then {
1588
        wm maxsize $w [winfo width $w] [winfo screenheight $w]
1589
        wm minsize $w [winfo width $w] 100
1590
 
1591
        wm deiconify $w
1592
}
1593
}
1594
 
1595
proc update_menu7 {} {
1596
        global CONFIG_PCI_ACTEL
1597
        global CONFIG_PCI_SIMPLE_TARGET
1598
        if {($CONFIG_PCI_ACTEL != 1)} then {
1599
        configure_entry .menu7.config.f.x0 normal {n l y}} else {configure_entry .menu7.config.f.x0 disabled {y n l}}
1600
        global CONFIG_PCI_MASTER_TARGET
1601
        if {($CONFIG_PCI_SIMPLE_TARGET != 1 && $CONFIG_PCI_ACTEL != 1)} then {
1602
        configure_entry .menu7.config.f.x1 normal {n l y}} else {configure_entry .menu7.config.f.x1 disabled {y n l}}
1603
        global CONFIG_PCI_MASTER_TARGET_DMA
1604
        if {($CONFIG_PCI_MASTER_TARGET == 1)} then {
1605
        configure_entry .menu7.config.f.x2 normal {n l y}} else {configure_entry .menu7.config.f.x2 disabled {y n l}}
1606
        global CONFIG_PCI_VENDORID
1607
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {.menu7.config.f.x3.x configure -state normal -foreground [ cget .ref -foreground ]; .menu7.config.f.x3.l configure -state normal; } else {.menu7.config.f.x3.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu7.config.f.x3.l configure -state disabled}
1608
        global CONFIG_PCI_DEVICEID
1609
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {.menu7.config.f.x4.x configure -state normal -foreground [ cget .ref -foreground ]; .menu7.config.f.x4.l configure -state normal; } else {.menu7.config.f.x4.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu7.config.f.x4.l configure -state disabled}
1610
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1) && ($CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {configure_entry .menu7.config.f.x5 normal {x l}} else {configure_entry .menu7.config.f.x5 disabled {x l}}
1611
        global CONFIG_PCI_HADDR
1612
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1) && ($CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {.menu7.config.f.x6.x configure -state normal -foreground [ cget .ref -foreground ]; .menu7.config.f.x6.l configure -state normal; } else {.menu7.config.f.x6.x configure -state disabled -foreground [ cget .ref -disabledforeground ]; .menu7.config.f.x6.l configure -state disabled}
1613
        global CONFIG_PCI_TRACE
1614
        if {($CONFIG_PCI_TRACE == 1)} then {configure_entry .menu7.config.f.x8 normal {x l}} else {configure_entry .menu7.config.f.x8 disabled {x l}}
1615
}
1616
 
1617
 
1618
proc update_define_menu7 {} {
1619
        update_define_mainmenu
1620
        global CONFIG_MODULES
1621
        global CONFIG_PCI_ACTEL
1622
        global CONFIG_PCI_SIMPLE_TARGET
1623
        if {($CONFIG_PCI_ACTEL != 1)} then {
1624
        set CONFIG_PCI_SIMPLE_TARGET [expr $CONFIG_PCI_SIMPLE_TARGET&15]} else {set CONFIG_PCI_SIMPLE_TARGET [expr $CONFIG_PCI_SIMPLE_TARGET|16]}
1625
        global CONFIG_PCI_MASTER_TARGET
1626
        if {($CONFIG_PCI_SIMPLE_TARGET != 1 && $CONFIG_PCI_ACTEL != 1)} then {
1627
        set CONFIG_PCI_MASTER_TARGET [expr $CONFIG_PCI_MASTER_TARGET&15]} else {set CONFIG_PCI_MASTER_TARGET [expr $CONFIG_PCI_MASTER_TARGET|16]}
1628
        global CONFIG_PCI_MASTER_TARGET_DMA
1629
        if {($CONFIG_PCI_MASTER_TARGET == 1)} then {
1630
        set CONFIG_PCI_MASTER_TARGET_DMA [expr $CONFIG_PCI_MASTER_TARGET_DMA&15]} else {set CONFIG_PCI_MASTER_TARGET_DMA [expr $CONFIG_PCI_MASTER_TARGET_DMA|16]}
1631
        global CONFIG_PCI_VENDORID
1632
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {validate_hex CONFIG_PCI_VENDORID "$CONFIG_PCI_VENDORID" 16E3}
1633
        global CONFIG_PCI_DEVICEID
1634
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {validate_hex CONFIG_PCI_DEVICEID "$CONFIG_PCI_DEVICEID" 0210}
1635
        global tmpvar_5
1636
        global CONFIG_PCI_FIFO0
1637
        if {$tmpvar_5 == "None"} then {set CONFIG_PCI_FIFO0 1} else {set CONFIG_PCI_FIFO0 0}
1638
        global CONFIG_PCI_FIFO8
1639
        if {$tmpvar_5 == "8"} then {set CONFIG_PCI_FIFO8 1} else {set CONFIG_PCI_FIFO8 0}
1640
        global CONFIG_PCI_FIFO16
1641
        if {$tmpvar_5 == "16"} then {set CONFIG_PCI_FIFO16 1} else {set CONFIG_PCI_FIFO16 0}
1642
        global CONFIG_PCI_FIFO32
1643
        if {$tmpvar_5 == "32"} then {set CONFIG_PCI_FIFO32 1} else {set CONFIG_PCI_FIFO32 0}
1644
        global CONFIG_PCI_FIFO64
1645
        if {$tmpvar_5 == "64"} then {set CONFIG_PCI_FIFO64 1} else {set CONFIG_PCI_FIFO64 0}
1646
        global CONFIG_PCI_FIFO128
1647
        if {$tmpvar_5 == "128"} then {set CONFIG_PCI_FIFO128 1} else {set CONFIG_PCI_FIFO128 0}
1648
        global CONFIG_PCI_HADDR
1649
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1) && ($CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {validate_hex CONFIG_PCI_HADDR "$CONFIG_PCI_HADDR" E00}
1650
        global tmpvar_6
1651
        global CONFIG_PCI_TRACE256
1652
        if {$tmpvar_6 == "256"} then {set CONFIG_PCI_TRACE256 1} else {set CONFIG_PCI_TRACE256 0}
1653
        global CONFIG_PCI_TRACE512
1654
        if {$tmpvar_6 == "512"} then {set CONFIG_PCI_TRACE512 1} else {set CONFIG_PCI_TRACE512 0}
1655
        global CONFIG_PCI_TRACE1024
1656
        if {$tmpvar_6 == "1024"} then {set CONFIG_PCI_TRACE1024 1} else {set CONFIG_PCI_TRACE1024 0}
1657
        global CONFIG_PCI_TRACE2048
1658
        if {$tmpvar_6 == "2048"} then {set CONFIG_PCI_TRACE2048 1} else {set CONFIG_PCI_TRACE2048 0}
1659
        global CONFIG_PCI_TRACE4096
1660
        if {$tmpvar_6 == "4096"} then {set CONFIG_PCI_TRACE4096 1} else {set CONFIG_PCI_TRACE4096 0}
1661
}
1662
 
1663
 
1664
proc update_mainmenu {}  {
1665
}
1666
 
1667
 
1668
set tmpvar_0 "(not set)"
1669
set CONFIG_SYN_INFERRED 0
1670
set CONFIG_SYN_ALTERA 0
1671
set CONFIG_SYN_AXCEL 0
1672
set CONFIG_SYN_PROASIC 0
1673
set CONFIG_SYN_PROASICPLUS 0
1674
set CONFIG_SYN_PROASIC3 0
1675
set CONFIG_SYN_UT025CRH 0
1676
set CONFIG_SYN_ATC18 0
1677
set CONFIG_SYN_CUSTOM1 0
1678
set CONFIG_SYN_IHP25 0
1679
set CONFIG_SYN_IHP25RH 0
1680
set CONFIG_SYN_LATTICE 0
1681
set CONFIG_SYN_PEREGRINE 0
1682
set CONFIG_SYN_RH_LIB18T 0
1683
set CONFIG_SYN_RHUMC 0
1684
set CONFIG_SYN_SPARTAN2 0
1685
set CONFIG_SYN_SPARTAN3 0
1686
set CONFIG_SYN_SPARTAN3E 0
1687
set CONFIG_SYN_VIRTEX 0
1688
set CONFIG_SYN_VIRTEXE 0
1689
set CONFIG_SYN_VIRTEX2 0
1690
set CONFIG_SYN_VIRTEX4 0
1691
set CONFIG_SYN_VIRTEX5 0
1692
set tmpvar_1 "(not set)"
1693
set CONFIG_MEM_INFERRED 0
1694
set CONFIG_MEM_RHUMC 0
1695
set CONFIG_MEM_ARTISAN 0
1696
set CONFIG_MEM_CUSTOM1 0
1697
set CONFIG_MEM_VIRAGE 0
1698
set CONFIG_SYN_INFER_RAM 0
1699
set CONFIG_SYN_INFER_PADS 0
1700
set CONFIG_SYN_NO_ASYNC 0
1701
set tmpvar_2 "(not set)"
1702
set CONFIG_CLK_INFERRED 0
1703
set CONFIG_CLK_HCLKBUF 0
1704
set CONFIG_CLK_ALTDLL 0
1705
set CONFIG_CLK_LATDLL 0
1706
set CONFIG_CLK_LIB18T 0
1707
set CONFIG_CLK_CLKDLL 0
1708
set CONFIG_CLK_DCM 0
1709
set CONFIG_CLK_MUL 2
1710
set CONFIG_CLK_DIV 2
1711
set CONFIG_PCI_CLKDLL 0
1712
set CONFIG_CLK_NOFB 0
1713
set CONFIG_PCI_SYSCLK 0
1714
set CONFIG_AHB_DEFMST 0
1715
set CONFIG_AHB_RROBIN 0
1716
set CONFIG_AHB_SPLIT 0
1717
set CONFIG_AHB_IOADDR FFF
1718
set CONFIG_APB_HADDR 800
1719
set CONFIG_DSU_UART 0
1720
set CONFIG_DSU_JTAG 0
1721
set CONFIG_AHBRAM_ENABLE 0
1722
set tmpvar_3 "(not set)"
1723
set CONFIG_AHBRAM_SZ1 0
1724
set CONFIG_AHBRAM_SZ2 0
1725
set CONFIG_AHBRAM_SZ4 0
1726
set CONFIG_AHBRAM_SZ8 0
1727
set CONFIG_AHBRAM_SZ16 0
1728
set CONFIG_AHBRAM_SZ32 0
1729
set CONFIG_AHBRAM_SZ64 0
1730
set CONFIG_AHBRAM_START A00
1731
set CONFIG_GRETH_ENABLE 0
1732
set CONFIG_GRETH_GIGA 0
1733
set tmpvar_4 "(not set)"
1734
set CONFIG_GRETH_FIFO4 0
1735
set CONFIG_GRETH_FIFO8 0
1736
set CONFIG_GRETH_FIFO16 0
1737
set CONFIG_GRETH_FIFO32 0
1738
set CONFIG_GRETH_FIFO64 0
1739
set CONFIG_PCI_SIMPLE_TARGET 0
1740
set CONFIG_PCI_MASTER_TARGET 0
1741
set CONFIG_PCI_MASTER_TARGET_DMA 0
1742
set CONFIG_PCI_VENDORID 16E3
1743
set CONFIG_PCI_DEVICEID 0210
1744
set tmpvar_5 "(not set)"
1745
set CONFIG_PCI_FIFO0 0
1746
set CONFIG_PCI_FIFO8 0
1747
set CONFIG_PCI_FIFO16 0
1748
set CONFIG_PCI_FIFO32 0
1749
set CONFIG_PCI_FIFO64 0
1750
set CONFIG_PCI_FIFO128 0
1751
set CONFIG_PCI_HADDR E00
1752
set CONFIG_PCI_TRACE 0
1753
set tmpvar_6 "(not set)"
1754
set CONFIG_PCI_TRACE256 0
1755
set CONFIG_PCI_TRACE512 0
1756
set CONFIG_PCI_TRACE1024 0
1757
set CONFIG_PCI_TRACE2048 0
1758
set CONFIG_PCI_TRACE4096 0
1759
set CONFIG_SYN_ARTISAN 4
1760
set CONFIG_PCI_ENABLE 4
1761
set CONFIG_PCI_ACTEL 4
1762
set CONFIG_MODULES 4
1763
proc writeconfig {file1 file2} {
1764
        set cfg [open $file1 w]
1765
        set autocfg [open $file2 w]
1766
        set notmod 1
1767
        set notset 0
1768
        puts $cfg "#"
1769
        puts $cfg "# Automatically generated make config: don't edit"
1770
        puts $cfg "#"
1771
        puts $autocfg "/*"
1772
        puts $autocfg " * Automatically generated C config: don't edit"
1773
        puts $autocfg " */"
1774
        puts $autocfg "#define AUTOCONF_INCLUDED"
1775
        write_comment $cfg $autocfg "Synthesis      "
1776
        global tmpvar_0
1777
 
1778
        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 }
1779
        if { $tmpvar_0 == "Altera-all" } then { write_tristate $cfg $autocfg CONFIG_SYN_ALTERA 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_SYN_ALTERA 0 [list $notmod] 2 }
1780
        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 }
1781
        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 }
1782
        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 }
1783
        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 }
1784
        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 }
1785
        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 }
1786
        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 }
1787
        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 }
1788
        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 }
1789
        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 }
1790
        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 }
1791
        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 }
1792
        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 }
1793
        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 }
1794
        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 }
1795
        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 }
1796
        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 }
1797
        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 }
1798
        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 }
1799
        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 }
1800
        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 }
1801
        global tmpvar_1
1802
        global CONFIG_SYN_INFERRED
1803
        global CONFIG_SYN_CUSTOM1
1804
        global CONFIG_SYN_ATC18
1805
        global CONFIG_SYN_RHUMC
1806
        global CONFIG_SYN_ARTISAN
1807
        if {($CONFIG_SYN_INFERRED == 1 || $CONFIG_SYN_CUSTOM1 == 1 || $CONFIG_SYN_ATC18 == 1 || $CONFIG_SYN_RHUMC == 1 || $CONFIG_SYN_ARTISAN == 1)} then {
1808
        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 }
1809
        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 }
1810
        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 }
1811
        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 }
1812
        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 }}
1813
        global CONFIG_SYN_INFER_RAM
1814
        if {($CONFIG_SYN_INFERRED != 1)} then {write_tristate $cfg $autocfg CONFIG_SYN_INFER_RAM $CONFIG_SYN_INFER_RAM [list $notmod] 2 }
1815
        global CONFIG_SYN_INFER_PADS
1816
        if {($CONFIG_SYN_INFERRED != 1)} then {write_tristate $cfg $autocfg CONFIG_SYN_INFER_PADS $CONFIG_SYN_INFER_PADS [list $notmod] 2 }
1817
        global CONFIG_SYN_NO_ASYNC
1818
        write_tristate $cfg $autocfg CONFIG_SYN_NO_ASYNC $CONFIG_SYN_NO_ASYNC [list $notmod] 2
1819
        write_comment $cfg $autocfg "Clock generation"
1820
        global tmpvar_2
1821
 
1822
        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 }
1823
        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 }
1824
        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 }
1825
        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 }
1826
        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 }
1827
        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 }
1828
        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 }
1829
        global CONFIG_CLK_MUL
1830
        global CONFIG_CLK_DCM
1831
        global CONFIG_CLK_ALTDLL
1832
        global CONFIG_CLK_LATDLL
1833
        global CONFIG_CLK_CLKDLL
1834
        global CONFIG_CLK_LIB18T
1835
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {write_int $cfg $autocfg CONFIG_CLK_MUL $CONFIG_CLK_MUL $notmod }
1836
        global CONFIG_CLK_DIV
1837
        if {($CONFIG_CLK_DCM == 1 || $CONFIG_CLK_ALTDLL == 1 || $CONFIG_CLK_LATDLL == 1 || $CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_LIB18T == 1)} then {write_int $cfg $autocfg CONFIG_CLK_DIV $CONFIG_CLK_DIV $notmod }
1838
        global CONFIG_PCI_CLKDLL
1839
        if {($CONFIG_CLK_CLKDLL == 1 || $CONFIG_CLK_DCM == 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_CLKDLL $CONFIG_PCI_CLKDLL [list $notmod] 2 }
1840
        global CONFIG_CLK_NOFB
1841
        if {($CONFIG_CLK_DCM == 1)} then {write_tristate $cfg $autocfg CONFIG_CLK_NOFB $CONFIG_CLK_NOFB [list $notmod] 2 }
1842
        global CONFIG_PCI_SYSCLK
1843
        global CONFIG_PCI_ENABLE
1844
        if {($CONFIG_PCI_ENABLE != 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_SYSCLK $CONFIG_PCI_SYSCLK [list $notmod] 2 }
1845
        write_comment $cfg $autocfg "AMBA configuration"
1846
        global CONFIG_AHB_DEFMST
1847
        write_int $cfg $autocfg CONFIG_AHB_DEFMST $CONFIG_AHB_DEFMST $notmod
1848
        global CONFIG_AHB_RROBIN
1849
        write_tristate $cfg $autocfg CONFIG_AHB_RROBIN $CONFIG_AHB_RROBIN [list $notmod] 2
1850
        global CONFIG_AHB_SPLIT
1851
        write_tristate $cfg $autocfg CONFIG_AHB_SPLIT $CONFIG_AHB_SPLIT [list $notmod] 2
1852
        global CONFIG_AHB_IOADDR
1853
        write_hex $cfg $autocfg CONFIG_AHB_IOADDR $CONFIG_AHB_IOADDR $notmod
1854
        global CONFIG_APB_HADDR
1855
        write_hex $cfg $autocfg CONFIG_APB_HADDR $CONFIG_APB_HADDR $notmod
1856
        write_comment $cfg $autocfg "Debug Link           "
1857
        global CONFIG_DSU_UART
1858
        write_tristate $cfg $autocfg CONFIG_DSU_UART $CONFIG_DSU_UART [list $notmod] 2
1859
        global CONFIG_DSU_JTAG
1860
        write_tristate $cfg $autocfg CONFIG_DSU_JTAG $CONFIG_DSU_JTAG [list $notmod] 2
1861
        write_comment $cfg $autocfg "On-chip RAM                 "
1862
        global CONFIG_AHBRAM_ENABLE
1863
        write_tristate $cfg $autocfg CONFIG_AHBRAM_ENABLE $CONFIG_AHBRAM_ENABLE [list $notmod] 2
1864
        global tmpvar_3
1865
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {
1866
        if { $tmpvar_3 == "1" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ1 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ1 0 [list $notmod] 2 }
1867
        if { $tmpvar_3 == "2" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ2 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ2 0 [list $notmod] 2 }
1868
        if { $tmpvar_3 == "4" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ4 0 [list $notmod] 2 }
1869
        if { $tmpvar_3 == "8" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ8 0 [list $notmod] 2 }
1870
        if { $tmpvar_3 == "16" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ16 0 [list $notmod] 2 }
1871
        if { $tmpvar_3 == "32" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ32 0 [list $notmod] 2 }
1872
        if { $tmpvar_3 == "64" } then { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_AHBRAM_SZ64 0 [list $notmod] 2 }}
1873
        global CONFIG_AHBRAM_START
1874
        if {($CONFIG_AHBRAM_ENABLE == 1)} then {write_hex $cfg $autocfg CONFIG_AHBRAM_START $CONFIG_AHBRAM_START $notmod }
1875
        write_comment $cfg $autocfg "Ethernet             "
1876
        global CONFIG_GRETH_ENABLE
1877
        write_tristate $cfg $autocfg CONFIG_GRETH_ENABLE $CONFIG_GRETH_ENABLE [list $notmod] 2
1878
        global CONFIG_GRETH_GIGA
1879
        if {($CONFIG_GRETH_ENABLE == 1)} then {write_tristate $cfg $autocfg CONFIG_GRETH_GIGA $CONFIG_GRETH_GIGA [list $notmod] 2 }
1880
        global tmpvar_4
1881
        if {($CONFIG_GRETH_ENABLE == 1) && ($CONFIG_GRETH_GIGA == 0)} then {
1882
        if { $tmpvar_4 == "4" } then { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO4 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO4 0 [list $notmod] 2 }
1883
        if { $tmpvar_4 == "8" } then { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO8 0 [list $notmod] 2 }
1884
        if { $tmpvar_4 == "16" } then { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO16 0 [list $notmod] 2 }
1885
        if { $tmpvar_4 == "32" } then { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO32 0 [list $notmod] 2 }
1886
        if { $tmpvar_4 == "64" } then { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_GRETH_FIFO64 0 [list $notmod] 2 }}
1887
        write_comment $cfg $autocfg "PCI              "
1888
        global CONFIG_PCI_SIMPLE_TARGET
1889
        global CONFIG_PCI_ACTEL
1890
        if {($CONFIG_PCI_ACTEL != 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_SIMPLE_TARGET $CONFIG_PCI_SIMPLE_TARGET [list $notmod] 2 }
1891
        global CONFIG_PCI_MASTER_TARGET
1892
        if {($CONFIG_PCI_SIMPLE_TARGET != 1 && $CONFIG_PCI_ACTEL != 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_MASTER_TARGET $CONFIG_PCI_MASTER_TARGET [list $notmod] 2 }
1893
        global CONFIG_PCI_MASTER_TARGET_DMA
1894
        if {($CONFIG_PCI_MASTER_TARGET == 1)} then {write_tristate $cfg $autocfg CONFIG_PCI_MASTER_TARGET_DMA $CONFIG_PCI_MASTER_TARGET_DMA [list $notmod] 2 }
1895
        global CONFIG_PCI_VENDORID
1896
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {write_hex $cfg $autocfg CONFIG_PCI_VENDORID $CONFIG_PCI_VENDORID $notmod }
1897
        global CONFIG_PCI_DEVICEID
1898
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {write_hex $cfg $autocfg CONFIG_PCI_DEVICEID $CONFIG_PCI_DEVICEID $notmod }
1899
        global tmpvar_5
1900
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1) && ($CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {
1901
        if { $tmpvar_5 == "None" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO0 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO0 0 [list $notmod] 2 }
1902
        if { $tmpvar_5 == "8" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO8 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO8 0 [list $notmod] 2 }
1903
        if { $tmpvar_5 == "16" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO16 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO16 0 [list $notmod] 2 }
1904
        if { $tmpvar_5 == "32" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO32 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO32 0 [list $notmod] 2 }
1905
        if { $tmpvar_5 == "64" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO64 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO64 0 [list $notmod] 2 }
1906
        if { $tmpvar_5 == "128" } then { write_tristate $cfg $autocfg CONFIG_PCI_FIFO128 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_FIFO128 0 [list $notmod] 2 }}
1907
        global CONFIG_PCI_HADDR
1908
        if {($CONFIG_PCI_SIMPLE_TARGET == 1 || $CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1) && ($CONFIG_PCI_MASTER_TARGET == 1 || $CONFIG_PCI_ACTEL == 1)} then {write_hex $cfg $autocfg CONFIG_PCI_HADDR $CONFIG_PCI_HADDR $notmod }
1909
        global CONFIG_PCI_TRACE
1910
        write_tristate $cfg $autocfg CONFIG_PCI_TRACE $CONFIG_PCI_TRACE [list $notmod] 2
1911
        global tmpvar_6
1912
        if {($CONFIG_PCI_TRACE == 1)} then {
1913
        if { $tmpvar_6 == "256" } then { write_tristate $cfg $autocfg CONFIG_PCI_TRACE256 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_TRACE256 0 [list $notmod] 2 }
1914
        if { $tmpvar_6 == "512" } then { write_tristate $cfg $autocfg CONFIG_PCI_TRACE512 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_TRACE512 0 [list $notmod] 2 }
1915
        if { $tmpvar_6 == "1024" } then { write_tristate $cfg $autocfg CONFIG_PCI_TRACE1024 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_TRACE1024 0 [list $notmod] 2 }
1916
        if { $tmpvar_6 == "2048" } then { write_tristate $cfg $autocfg CONFIG_PCI_TRACE2048 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_TRACE2048 0 [list $notmod] 2 }
1917
        if { $tmpvar_6 == "4096" } then { write_tristate $cfg $autocfg CONFIG_PCI_TRACE4096 1 [list $notmod] 2 } else { write_tristate $cfg $autocfg CONFIG_PCI_TRACE4096 0 [list $notmod] 2 }}
1918
        close $cfg
1919
        close $autocfg
1920
}
1921
 
1922
 
1923
proc clear_choices { } {
1924
        global CONFIG_SYN_INFERRED; set CONFIG_SYN_INFERRED 0
1925
        global CONFIG_SYN_ALTERA; set CONFIG_SYN_ALTERA 0
1926
        global CONFIG_SYN_AXCEL; set CONFIG_SYN_AXCEL 0
1927
        global CONFIG_SYN_PROASIC; set CONFIG_SYN_PROASIC 0
1928
        global CONFIG_SYN_PROASICPLUS; set CONFIG_SYN_PROASICPLUS 0
1929
        global CONFIG_SYN_PROASIC3; set CONFIG_SYN_PROASIC3 0
1930
        global CONFIG_SYN_UT025CRH; set CONFIG_SYN_UT025CRH 0
1931
        global CONFIG_SYN_ATC18; set CONFIG_SYN_ATC18 0
1932
        global CONFIG_SYN_CUSTOM1; set CONFIG_SYN_CUSTOM1 0
1933
        global CONFIG_SYN_IHP25; set CONFIG_SYN_IHP25 0
1934
        global CONFIG_SYN_IHP25RH; set CONFIG_SYN_IHP25RH 0
1935
        global CONFIG_SYN_LATTICE; set CONFIG_SYN_LATTICE 0
1936
        global CONFIG_SYN_PEREGRINE; set CONFIG_SYN_PEREGRINE 0
1937
        global CONFIG_SYN_RH_LIB18T; set CONFIG_SYN_RH_LIB18T 0
1938
        global CONFIG_SYN_RHUMC; set CONFIG_SYN_RHUMC 0
1939
        global CONFIG_SYN_SPARTAN2; set CONFIG_SYN_SPARTAN2 0
1940
        global CONFIG_SYN_SPARTAN3; set CONFIG_SYN_SPARTAN3 0
1941
        global CONFIG_SYN_SPARTAN3E; set CONFIG_SYN_SPARTAN3E 0
1942
        global CONFIG_SYN_VIRTEX; set CONFIG_SYN_VIRTEX 0
1943
        global CONFIG_SYN_VIRTEXE; set CONFIG_SYN_VIRTEXE 0
1944
        global CONFIG_SYN_VIRTEX2; set CONFIG_SYN_VIRTEX2 0
1945
        global CONFIG_SYN_VIRTEX4; set CONFIG_SYN_VIRTEX4 0
1946
        global CONFIG_SYN_VIRTEX5; set CONFIG_SYN_VIRTEX5 0
1947
        global CONFIG_MEM_INFERRED; set CONFIG_MEM_INFERRED 0
1948
        global CONFIG_MEM_RHUMC; set CONFIG_MEM_RHUMC 0
1949
        global CONFIG_MEM_ARTISAN; set CONFIG_MEM_ARTISAN 0
1950
        global CONFIG_MEM_CUSTOM1; set CONFIG_MEM_CUSTOM1 0
1951
        global CONFIG_MEM_VIRAGE; set CONFIG_MEM_VIRAGE 0
1952
        global CONFIG_CLK_INFERRED; set CONFIG_CLK_INFERRED 0
1953
        global CONFIG_CLK_HCLKBUF; set CONFIG_CLK_HCLKBUF 0
1954
        global CONFIG_CLK_ALTDLL; set CONFIG_CLK_ALTDLL 0
1955
        global CONFIG_CLK_LATDLL; set CONFIG_CLK_LATDLL 0
1956
        global CONFIG_CLK_LIB18T; set CONFIG_CLK_LIB18T 0
1957
        global CONFIG_CLK_CLKDLL; set CONFIG_CLK_CLKDLL 0
1958
        global CONFIG_CLK_DCM; set CONFIG_CLK_DCM 0
1959
        global CONFIG_AHBRAM_SZ1; set CONFIG_AHBRAM_SZ1 0
1960
        global CONFIG_AHBRAM_SZ2; set CONFIG_AHBRAM_SZ2 0
1961
        global CONFIG_AHBRAM_SZ4; set CONFIG_AHBRAM_SZ4 0
1962
        global CONFIG_AHBRAM_SZ8; set CONFIG_AHBRAM_SZ8 0
1963
        global CONFIG_AHBRAM_SZ16; set CONFIG_AHBRAM_SZ16 0
1964
        global CONFIG_AHBRAM_SZ32; set CONFIG_AHBRAM_SZ32 0
1965
        global CONFIG_AHBRAM_SZ64; set CONFIG_AHBRAM_SZ64 0
1966
        global CONFIG_GRETH_FIFO4; set CONFIG_GRETH_FIFO4 0
1967
        global CONFIG_GRETH_FIFO8; set CONFIG_GRETH_FIFO8 0
1968
        global CONFIG_GRETH_FIFO16; set CONFIG_GRETH_FIFO16 0
1969
        global CONFIG_GRETH_FIFO32; set CONFIG_GRETH_FIFO32 0
1970
        global CONFIG_GRETH_FIFO64; set CONFIG_GRETH_FIFO64 0
1971
        global CONFIG_PCI_FIFO0; set CONFIG_PCI_FIFO0 0
1972
        global CONFIG_PCI_FIFO8; set CONFIG_PCI_FIFO8 0
1973
        global CONFIG_PCI_FIFO16; set CONFIG_PCI_FIFO16 0
1974
        global CONFIG_PCI_FIFO32; set CONFIG_PCI_FIFO32 0
1975
        global CONFIG_PCI_FIFO64; set CONFIG_PCI_FIFO64 0
1976
        global CONFIG_PCI_FIFO128; set CONFIG_PCI_FIFO128 0
1977
        global CONFIG_PCI_TRACE256; set CONFIG_PCI_TRACE256 0
1978
        global CONFIG_PCI_TRACE512; set CONFIG_PCI_TRACE512 0
1979
        global CONFIG_PCI_TRACE1024; set CONFIG_PCI_TRACE1024 0
1980
        global CONFIG_PCI_TRACE2048; set CONFIG_PCI_TRACE2048 0
1981
        global CONFIG_PCI_TRACE4096; set CONFIG_PCI_TRACE4096 0
1982
}
1983
 
1984
 
1985
proc update_choices { } {
1986
        global tmpvar_0
1987
        set tmpvar_0 "Inferred"
1988
        global CONFIG_SYN_INFERRED
1989
        if { $CONFIG_SYN_INFERRED == 1 } then { set tmpvar_0 "Inferred" }
1990
        global CONFIG_SYN_ALTERA
1991
        if { $CONFIG_SYN_ALTERA == 1 } then { set tmpvar_0 "Altera-all" }
1992
        global CONFIG_SYN_AXCEL
1993
        if { $CONFIG_SYN_AXCEL == 1 } then { set tmpvar_0 "Actel-Axcelerator" }
1994
        global CONFIG_SYN_PROASIC
1995
        if { $CONFIG_SYN_PROASIC == 1 } then { set tmpvar_0 "Actel-Proasic" }
1996
        global CONFIG_SYN_PROASICPLUS
1997
        if { $CONFIG_SYN_PROASICPLUS == 1 } then { set tmpvar_0 "Actel-ProasicPlus" }
1998
        global CONFIG_SYN_PROASIC3
1999
        if { $CONFIG_SYN_PROASIC3 == 1 } then { set tmpvar_0 "Actel-Proasic3" }
2000
        global CONFIG_SYN_UT025CRH
2001
        if { $CONFIG_SYN_UT025CRH == 1 } then { set tmpvar_0 "Aeroflex-UT025CRH" }
2002
        global CONFIG_SYN_ATC18
2003
        if { $CONFIG_SYN_ATC18 == 1 } then { set tmpvar_0 "Atmel-ATC18" }
2004
        global CONFIG_SYN_CUSTOM1
2005
        if { $CONFIG_SYN_CUSTOM1 == 1 } then { set tmpvar_0 "Custom1" }
2006
        global CONFIG_SYN_IHP25
2007
        if { $CONFIG_SYN_IHP25 == 1 } then { set tmpvar_0 "IHP25" }
2008
        global CONFIG_SYN_IHP25RH
2009
        if { $CONFIG_SYN_IHP25RH == 1 } then { set tmpvar_0 "IHP25RH" }
2010
        global CONFIG_SYN_LATTICE
2011
        if { $CONFIG_SYN_LATTICE == 1 } then { set tmpvar_0 "Lattice-EC/ECP/XP" }
2012
        global CONFIG_SYN_PEREGRINE
2013
        if { $CONFIG_SYN_PEREGRINE == 1 } then { set tmpvar_0 "Peregrine" }
2014
        global CONFIG_SYN_RH_LIB18T
2015
        if { $CONFIG_SYN_RH_LIB18T == 1 } then { set tmpvar_0 "RH-LIB18T" }
2016
        global CONFIG_SYN_RHUMC
2017
        if { $CONFIG_SYN_RHUMC == 1 } then { set tmpvar_0 "RH-UMC" }
2018
        global CONFIG_SYN_SPARTAN2
2019
        if { $CONFIG_SYN_SPARTAN2 == 1 } then { set tmpvar_0 "Xilinx-Spartan2" }
2020
        global CONFIG_SYN_SPARTAN3
2021
        if { $CONFIG_SYN_SPARTAN3 == 1 } then { set tmpvar_0 "Xilinx-Spartan3" }
2022
        global CONFIG_SYN_SPARTAN3E
2023
        if { $CONFIG_SYN_SPARTAN3E == 1 } then { set tmpvar_0 "Xilinx-Spartan3E" }
2024
        global CONFIG_SYN_VIRTEX
2025
        if { $CONFIG_SYN_VIRTEX == 1 } then { set tmpvar_0 "Xilinx-Virtex" }
2026
        global CONFIG_SYN_VIRTEXE
2027
        if { $CONFIG_SYN_VIRTEXE == 1 } then { set tmpvar_0 "Xilinx-VirtexE" }
2028
        global CONFIG_SYN_VIRTEX2
2029
        if { $CONFIG_SYN_VIRTEX2 == 1 } then { set tmpvar_0 "Xilinx-Virtex2" }
2030
        global CONFIG_SYN_VIRTEX4
2031
        if { $CONFIG_SYN_VIRTEX4 == 1 } then { set tmpvar_0 "Xilinx-Virtex4" }
2032
        global CONFIG_SYN_VIRTEX5
2033
        if { $CONFIG_SYN_VIRTEX5 == 1 } then { set tmpvar_0 "Xilinx-Virtex5" }
2034
        global tmpvar_1
2035
        set tmpvar_1 "Inferred"
2036
        global CONFIG_MEM_INFERRED
2037
        if { $CONFIG_MEM_INFERRED == 1 } then { set tmpvar_1 "Inferred" }
2038
        global CONFIG_MEM_RHUMC
2039
        if { $CONFIG_MEM_RHUMC == 1 } then { set tmpvar_1 "RH-UMC" }
2040
        global CONFIG_MEM_ARTISAN
2041
        if { $CONFIG_MEM_ARTISAN == 1 } then { set tmpvar_1 "Artisan" }
2042
        global CONFIG_MEM_CUSTOM1
2043
        if { $CONFIG_MEM_CUSTOM1 == 1 } then { set tmpvar_1 "Custom1" }
2044
        global CONFIG_MEM_VIRAGE
2045
        if { $CONFIG_MEM_VIRAGE == 1 } then { set tmpvar_1 "Virage" }
2046
        global tmpvar_2
2047
        set tmpvar_2 "Inferred"
2048
        global CONFIG_CLK_INFERRED
2049
        if { $CONFIG_CLK_INFERRED == 1 } then { set tmpvar_2 "Inferred" }
2050
        global CONFIG_CLK_HCLKBUF
2051
        if { $CONFIG_CLK_HCLKBUF == 1 } then { set tmpvar_2 "Actel-HCLKBUF" }
2052
        global CONFIG_CLK_ALTDLL
2053
        if { $CONFIG_CLK_ALTDLL == 1 } then { set tmpvar_2 "Altera-ALTPLL" }
2054
        global CONFIG_CLK_LATDLL
2055
        if { $CONFIG_CLK_LATDLL == 1 } then { set tmpvar_2 "Lattice-EXPLL" }
2056
        global CONFIG_CLK_LIB18T
2057
        if { $CONFIG_CLK_LIB18T == 1 } then { set tmpvar_2 "RH-LIB18T-PLL" }
2058
        global CONFIG_CLK_CLKDLL
2059
        if { $CONFIG_CLK_CLKDLL == 1 } then { set tmpvar_2 "Xilinx-CLKDLL" }
2060
        global CONFIG_CLK_DCM
2061
        if { $CONFIG_CLK_DCM == 1 } then { set tmpvar_2 "Xilinx-DCM" }
2062
        global tmpvar_3
2063
        set tmpvar_3 "4"
2064
        global CONFIG_AHBRAM_SZ1
2065
        if { $CONFIG_AHBRAM_SZ1 == 1 } then { set tmpvar_3 "1" }
2066
        global CONFIG_AHBRAM_SZ2
2067
        if { $CONFIG_AHBRAM_SZ2 == 1 } then { set tmpvar_3 "2" }
2068
        global CONFIG_AHBRAM_SZ4
2069
        if { $CONFIG_AHBRAM_SZ4 == 1 } then { set tmpvar_3 "4" }
2070
        global CONFIG_AHBRAM_SZ8
2071
        if { $CONFIG_AHBRAM_SZ8 == 1 } then { set tmpvar_3 "8" }
2072
        global CONFIG_AHBRAM_SZ16
2073
        if { $CONFIG_AHBRAM_SZ16 == 1 } then { set tmpvar_3 "16" }
2074
        global CONFIG_AHBRAM_SZ32
2075
        if { $CONFIG_AHBRAM_SZ32 == 1 } then { set tmpvar_3 "32" }
2076
        global CONFIG_AHBRAM_SZ64
2077
        if { $CONFIG_AHBRAM_SZ64 == 1 } then { set tmpvar_3 "64" }
2078
        global tmpvar_4
2079
        set tmpvar_4 "8"
2080
        global CONFIG_GRETH_FIFO4
2081
        if { $CONFIG_GRETH_FIFO4 == 1 } then { set tmpvar_4 "4" }
2082
        global CONFIG_GRETH_FIFO8
2083
        if { $CONFIG_GRETH_FIFO8 == 1 } then { set tmpvar_4 "8" }
2084
        global CONFIG_GRETH_FIFO16
2085
        if { $CONFIG_GRETH_FIFO16 == 1 } then { set tmpvar_4 "16" }
2086
        global CONFIG_GRETH_FIFO32
2087
        if { $CONFIG_GRETH_FIFO32 == 1 } then { set tmpvar_4 "32" }
2088
        global CONFIG_GRETH_FIFO64
2089
        if { $CONFIG_GRETH_FIFO64 == 1 } then { set tmpvar_4 "64" }
2090
        global tmpvar_5
2091
        set tmpvar_5 "8"
2092
        global CONFIG_PCI_FIFO0
2093
        if { $CONFIG_PCI_FIFO0 == 1 } then { set tmpvar_5 "None" }
2094
        global CONFIG_PCI_FIFO8
2095
        if { $CONFIG_PCI_FIFO8 == 1 } then { set tmpvar_5 "8" }
2096
        global CONFIG_PCI_FIFO16
2097
        if { $CONFIG_PCI_FIFO16 == 1 } then { set tmpvar_5 "16" }
2098
        global CONFIG_PCI_FIFO32
2099
        if { $CONFIG_PCI_FIFO32 == 1 } then { set tmpvar_5 "32" }
2100
        global CONFIG_PCI_FIFO64
2101
        if { $CONFIG_PCI_FIFO64 == 1 } then { set tmpvar_5 "64" }
2102
        global CONFIG_PCI_FIFO128
2103
        if { $CONFIG_PCI_FIFO128 == 1 } then { set tmpvar_5 "128" }
2104
        global tmpvar_6
2105
        set tmpvar_6 "256"
2106
        global CONFIG_PCI_TRACE256
2107
        if { $CONFIG_PCI_TRACE256 == 1 } then { set tmpvar_6 "256" }
2108
        global CONFIG_PCI_TRACE512
2109
        if { $CONFIG_PCI_TRACE512 == 1 } then { set tmpvar_6 "512" }
2110
        global CONFIG_PCI_TRACE1024
2111
        if { $CONFIG_PCI_TRACE1024 == 1 } then { set tmpvar_6 "1024" }
2112
        global CONFIG_PCI_TRACE2048
2113
        if { $CONFIG_PCI_TRACE2048 == 1 } then { set tmpvar_6 "2048" }
2114
        global CONFIG_PCI_TRACE4096
2115
        if { $CONFIG_PCI_TRACE4096 == 1 } then { set tmpvar_6 "4096" }
2116
}
2117
 
2118
 
2119
proc update_define_mainmenu {} {
2120
        global CONFIG_MODULES
2121
}
2122
 
2123
 
2124
# FILE: tail.tk
2125
# This file is boilerplate TCL/TK function definitions for 'make xconfig'.
2126
#
2127
# CHANGES
2128
# =======
2129
#
2130
# 8 January 1998, Michael Elizabeth Chastain, 
2131
# Arrange buttons in three columns for better screen fitting.
2132
#
2133
 
2134
#
2135
# Read the user's settings from .config.  These will override whatever is
2136
# in config.in.  Don't do this if the user specified a -D to force
2137
# the defaults.
2138
#
2139
 
2140
set defaults defconfig
2141
 
2142
if { [file readable .config] == 1} then {
2143
        if { $argc > 0 } then {
2144
                if { [lindex $argv 0] != "-D" } then {
2145
                        read_config .config
2146
                }
2147
                else
2148
                {
2149
                        read_config $defaults
2150
                }
2151
        } else {
2152
                read_config .config
2153
        }
2154
} else {
2155
        read_config $defaults
2156
}
2157
 
2158
update_define 1 $total_menus 0
2159
update_mainmenu
2160
 
2161
button .f0.right.save -anchor w -text "Save and Exit" -underline 0\
2162
    -command { catch {exec cp -f .config .config.old}; \
2163
                writeconfig .config config.h; wrapup .wrap }
2164
 
2165
button .f0.right.quit -anchor w -text "Quit Without Saving" -underline 0\
2166
    -command { maybe_exit .maybe }
2167
 
2168
button .f0.right.load -anchor w -text "Load Configuration from File" \
2169
    -command { load_configfile .load "Load Configuration from file" read_config_file
2170
}
2171
 
2172
button .f0.right.store -anchor w -text "Store Configuration to File" \
2173
    -command { load_configfile .load "Store Configuration to file" write_config_file }
2174
 
2175
#
2176
# Now pack everything.
2177
#
2178
 
2179
pack .f0.right.store .f0.right.load .f0.right.quit .f0.right.save \
2180
    -padx 0 -pady 0 -side bottom -fill x
2181
pack .f0.left .f0.middle .f0.right -side left -padx 5 -pady 0 -fill y
2182
pack .f0 -padx 5 -pady 5
2183
 
2184
update idletasks
2185
set winy [expr 10 + [winfo reqheight .f0]]
2186
set scry [lindex [wm maxsize .] 1]
2187
set winx [expr 10 + [winfo reqwidth .f0]]
2188
set scrx [lindex [wm maxsize .] 0]
2189
if {$winx < $scrx} then {set maxx -1} else {set maxx $winx}
2190
if {$winy < $scry} then {set maxy -1} else {set maxy $winy}
2191
.f0 configure -width $winx -height $winy
2192
wm maxsize . $maxx $maxy
2193
 
2194
#
2195
# If we cannot write our config files, disable the write button.
2196
#
2197
if { [file exists .config] == 1 } then {
2198
                if { [file writable .config] == 0 } then {
2199
                        .f0.right.save configure -state disabled
2200
                }
2201
        } else {
2202
                if { [file writable .] == 0 } then {
2203
                        .f0.right.save configure -state disabled
2204
                }
2205
        }
2206
 
2207
#if { [file exists include/linux/autoconf.h] == 1 } then {
2208
#               if { [file writable include/linux/autoconf.h] == 0 } then {
2209
#                       .f0.right.save configure -state disabled
2210
#               }
2211
#       } else {
2212
#               if { [file writable include/linux/] == 0 } then {
2213
#                       .f0.right.save configure -state disabled
2214
#               }
2215
#       }

powered by: WebSVN 2.1.0

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