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

Subversion Repositories ethernet_tri_mode

[/] [ethernet_tri_mode/] [trunk/] [start.tcl] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 maverickis
variable MAC_SOURCE_REPLACE_EN
2
variable MAC_TARGET_CHECK_EN
3
variable MAC_BROADCAST_FILTER_EN
4
variable MAC_TX_FF_DEPTH
5
variable MAC_RX_FF_DEPTH
6
variable header_data
7
 
8
source sim/rtl_sim/ncsim_sim/script/run_proc.tcl
9
 
10
frame .f1
11
frame .f2
12 16 maverickis
text .f1.t1 -width 60 -height 20
13
button .f2.b1 -text "Quit" -width 5 -command {exit}
14
button .f2.b2 -text "Next" -width 5 -command {module_conf}
15 7 maverickis
 
16
pack .f1 .f2
17
pack .f1.t1
18
pack .f2.b1 .f2.b2 -side left
19
 
20
set strings \
21
{Hi guys,
22
    Thanks for your interest about this tri-speed ethernet MAC controller.
23 17 maverickis
Since this project was created at 25-Nov-2005,I put almost all my free time
24 7 maverickis
on this project.I am exhausted for this two month's extra work.If you think
25
this project is useful,let me know that and i will feel much better.
26
 
27
    To increase the flexibility, some optional modules can be removed from
28
the design to reduce area.
29
 
30
    Any problem or bug report please contact me by email:
31
    gaojon@yahoo.com
32
 
33
 
34
 
35
 
36
 
37
 
38
                                                                jon
39
                                                                18-Jan-2006
40
}
41
 
42
.f1.t1 insert end $strings
43
 
44
proc module_conf {} {
45
    global MAC_SOURCE_REPLACE_EN
46
    global MAC_TARGET_CHECK_EN
47
    global MAC_BROADCAST_FILTER_EN
48
    global MAC_TX_FF_DEPTH
49
    global MAC_RX_FF_DEPTH
50
    global header_data
51
 
52
    if {[catch {open ./rtl/verilog/header.v r} fileid]} {
53
        puts "Failed open ./rtl/verilog/header.v file\n"
54
    } else {
55
        gets $fileid line
56
        if {[lindex $line 0]=="//"} {
57
            set line [lreplace $line 0 0]
58
            set MAC_SOURCE_REPLACE_EN 0
59
        } else {
60
            set MAC_SOURCE_REPLACE_EN 1
61
        }
62
        lappend header_data $line
63
        gets $fileid line
64
        if {[lindex $line 0]=="//"} {
65
            set line [lreplace $line 0 0]
66
            set MAC_TARGET_CHECK_EN 0
67
        } else {
68
            set MAC_TARGET_CHECK_EN 1
69
        }
70
        lappend header_data $line
71
        gets $fileid line
72
        if {[lindex $line 0]=="//"} {
73
            set line [lreplace $line 0 0]
74
            set MAC_BROADCAST_FILTER_EN 0
75
        } else {
76
            set MAC_BROADCAST_FILTER_EN 1
77
        }
78
        lappend header_data $line
79
        gets $fileid line
80
        set MAC_TX_FF_DEPTH [lindex $line 2]
81
        lappend header_data $line
82
        gets $fileid line
83
        set MAC_RX_FF_DEPTH [lindex $line 2]
84
        lappend header_data $line
85
        close $fileid
86
     }
87
 
88
    destroy .f1 .f2
89
    frame .f1
90
    frame .f2
91
    frame .f1.f1
92
    frame .f1.f2
93
    frame .f1.f3
94
    frame .f1.f4
95
    frame .f1.f5
96
    frame .f1.f6
97
 
98
    pack .f1 .f2
99
    pack .f1.f1 .f1.f2 .f1.f3 .f1.f4 .f1.f5 .f1.f6
100
    label       .f1.f1.lb -text "enable source MAC replace module" -width 30
101
    checkbutton .f1.f1.cb -variable MAC_SOURCE_REPLACE_EN
102
    label       .f1.f2.lb -text "enable target MAC check module " -width 30
103
    checkbutton .f1.f2.cb -variable MAC_TARGET_CHECK_EN
104
    label       .f1.f3.lb -text "enable broadcast packet filter module" -width 30
105
    checkbutton .f1.f3.cb -variable MAC_BROADCAST_FILTER_EN
106
 
107
    label       .f1.f4.lb -text "MAC_TX_FF_DEPTH" -width 30
108
    entry       .f1.f4.en -textvariable MAC_TX_FF_DEPTH -width 5
109
    label       .f1.f5.lb -text "MAC_RX_FF_DEPTH" -width 30
110
    entry       .f1.f5.en -textvariable MAC_RX_FF_DEPTH -width 5
111
 
112 16 maverickis
    button .f2.b1 -width 10 -text "Save"            -command {save_header}
113
    button .f2.b2 -width 10 -text "Verify"          -command {run_sim}
114
    button .f2.b4 -width 10 -text "Exit"            -command {exit}
115 7 maverickis
 
116
    pack .f1.f1.cb .f1.f1.lb -side right
117
    pack .f1.f2.cb .f1.f2.lb -side right
118
    pack .f1.f3.cb .f1.f3.lb -side right
119
    pack .f1.f4.en .f1.f4.lb -side right
120
    pack .f1.f5.en .f1.f5.lb -side right
121
 
122
    pack .f2.b1 .f2.b2 .f2.b4 -side left
123
 
124
}
125
 
126
proc save_header {} {
127
    global MAC_SOURCE_REPLACE_EN
128
    global MAC_TARGET_CHECK_EN
129
    global MAC_BROADCAST_FILTER_EN
130
    global MAC_TX_FF_DEPTH
131
    global MAC_RX_FF_DEPTH
132
    global header_data
133
    if {[catch {open ./rtl/verilog/header.v w} fileid]} {
134
        puts "Failed open ./rtl/verilog/header.v file\n"
135
    } else {
136
        set line [lindex $header_data 0]
137
        if {$MAC_SOURCE_REPLACE_EN==0} {
138
            set line [linsert $line 0 "//"]
139
        }
140
        puts $fileid $line
141
 
142
        set line [lindex $header_data 1]
143
        if {$MAC_TARGET_CHECK_EN==0} {
144
            set line [linsert $line 0 "//"]
145
        }
146
        puts $fileid $line
147
 
148
        set line [lindex $header_data 2]
149
        if {$MAC_BROADCAST_FILTER_EN==0} {
150
            set line [linsert $line 0 "//"]
151
        }
152
        puts $fileid $line
153
 
154
        set line [lindex $header_data 3]
155
        set line [lreplace $line 2 2 $MAC_TX_FF_DEPTH]
156
        puts $fileid $line
157
 
158
        set line [lindex $header_data 4]
159
        set line [lreplace $line 2 2 $MAC_RX_FF_DEPTH]
160
        puts $fileid $line
161
 
162
        close $fileid
163
     }
164
 
165
}
166
 
167
proc start_verify {} {
168 24 maverickis
    cd sim/rtl_sim/modsim_sim/script
169 7 maverickis
    vish run.tcl
170
}
171
 
172
proc start_syn {} {
173
    cd syn
174
    synplify_pro syn.prj
175
}
176
 
177
proc run_sim {} {
178 24 maverickis
    cd sim/rtl_sim/modsim_sim/script/
179 7 maverickis
    run_proc
180
}

powered by: WebSVN 2.1.0

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