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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [tools/] [bin/] [openmsp430-gdbproxy.tcl] - Blame information for rev 222

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 olivier.gi
#!/usr/bin/tclsh
2
#------------------------------------------------------------------------------
3
# Copyright (C) 2001 Authors
4
#
5
# This source file may be used and distributed without restriction provided
6
# that this copyright statement is not removed from the file and that any
7
# derivative work contains the original copyright notice and the associated
8
# disclaimer.
9
#
10
# This source file is free software; you can redistribute it and/or modify
11
# it under the terms of the GNU Lesser General Public License as published
12
# by the Free Software Foundation; either version 2.1 of the License, or
13
# (at your option) any later version.
14
#
15
# This source is distributed in the hope that it will be useful, but WITHOUT
16
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18
# License for more details.
19
#
20
# You should have received a copy of the GNU Lesser General Public License
21
# along with this source; if not, write to the Free Software Foundation,
22
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23
#
24
#------------------------------------------------------------------------------
25 210 olivier.gi
#
26 2 olivier.gi
# File Name: openmsp430-gdbproxy.tcl
27 210 olivier.gi
#
28 14 olivier.gi
# Author(s):
29
#             - Olivier Girard,    olgirard@gmail.com
30
#
31 2 olivier.gi
#------------------------------------------------------------------------------
32 14 olivier.gi
# $Rev: 214 $
33
# $LastChangedBy: olivier.girard $
34
# $LastChangedDate: 2016-03-12 21:15:33 +0100 (Sat, 12 Mar 2016) $
35
#------------------------------------------------------------------------------
36 2 olivier.gi
 
37
###############################################################################
38
#                                                                             #
39
#                            SOURCE LIBRARIES                                 #
40
#                                                                             #
41
###############################################################################
42
 
43
# Get library path
44
set current_file [info script]
45
if {[file type $current_file]=="link"} {
46
    set current_file [file readlink $current_file]
47
}
48
set lib_path [file dirname $current_file]/../lib/tcl-lib
49
 
50
# Source library
51
source $lib_path/dbg_functions.tcl
52 158 olivier.gi
source $lib_path/dbg_utils.tcl
53 2 olivier.gi
 
54
# Source remaining files
55
source [file dirname $current_file]/../openmsp430-gdbproxy/server.tcl
56
source [file dirname $current_file]/../openmsp430-gdbproxy/commands.tcl
57
 
58
 
59
###############################################################################
60
#                                                                             #
61 158 olivier.gi
#                            GLOBAL VARIABLES                                 #
62
#                                                                             #
63
###############################################################################
64
 
65
global omsp_conf
66
global omsp_info
67
 
68
global omsp_nr
69
 
70 172 olivier.gi
global mem_mapping
71
 
72 158 olivier.gi
global gui_dbg_if
73
global gui_adapter
74
global clients
75
global server
76
global verbose
77
global shell
78 172 olivier.gi
global breakSelect
79 198 olivier.gi
global mspgcc_compat_mode
80 158 olivier.gi
 
81
# Initialize to default values
82 172 olivier.gi
set omsp_nr                1
83 158 olivier.gi
set omsp_conf(interface)  uart_generic
84
set omsp_conf(device)     [lindex [utils::uart_port_list] end]
85
set omsp_conf(baudrate)   [lindex [GetAllowedSpeeds] 1]
86
set omsp_conf(0,cpuaddr)  50
87
set omsp_conf(1,cpuaddr)  51
88
set omsp_conf(2,cpuaddr)  52
89
set omsp_conf(3,cpuaddr)  53
90
 
91 172 olivier.gi
set server(0,port)      2000
92
set server(1,port)      2001
93
set server(2,port)      2002
94
set server(3,port)      2003
95 158 olivier.gi
 
96 172 olivier.gi
set mem_mapping(0)         0
97
set mem_mapping(1)         0
98
set mem_mapping(2)         0
99
set mem_mapping(3)         0
100 158 olivier.gi
 
101 172 olivier.gi
set breakSelect            0
102
 
103
set shell                  0
104
set verbose                0
105 198 olivier.gi
set mspgcc_compat_mode     0
106 172 olivier.gi
 
107 158 olivier.gi
###############################################################################
108
#                                                                             #
109 2 olivier.gi
#                            PARAMETER CHECK                                  #
110
#                                                                             #
111
###############################################################################
112
 
113
proc help {} {
114
    puts ""
115 158 olivier.gi
    puts "USAGE   : openmsp430-gdbproxy.tcl \[-device   <communication port>\]"
116
    puts "                                  \[-adaptor  <adaptor type>\]"
117
    puts "                                  \[-speed    <communication speed>\]"
118
    puts "                                  \[-i2c_addr <cpu address>\]"
119 2 olivier.gi
    puts "                                  \[-port     <server port>\]"
120
    puts "                                  \[-shell]"
121
    puts "                                  \[-verbose\]"
122 198 olivier.gi
    puts "                                  \[-mspgcc_compat_mode\]"
123 2 olivier.gi
    puts "                                  \[-help\]"
124
    puts ""
125 158 olivier.gi
    puts "Examples: openmsp430-gdbproxy.tcl -device /dev/ttyUSB0 -adaptor uart_generic -speed  115200  -port 2000"
126
    puts "          openmsp430-gdbproxy.tcl -device COM2:        -adaptor i2c_usb-iss  -speed  I2C_S_100KHZ -i2c_addr 75 -port 2000"
127 2 olivier.gi
    puts ""
128
}
129
 
130
# Parse arguments
131
for {set i 0} {$i < $argc} {incr i} {
132
    switch -exact -- [lindex $argv $i] {
133 198 olivier.gi
        -device             {set omsp_conf(device)    [lindex $argv [expr $i+1]]; incr i}
134
        -adaptor            {set omsp_conf(interface) [lindex $argv [expr $i+1]]; incr i}
135
        -speed              {set omsp_conf(baudrate)  [lindex $argv [expr $i+1]]; incr i}
136
        -i2c_addr           {set omsp_conf(0,cpuaddr) [lindex $argv [expr $i+1]]; incr i}
137
        -port               {set server(0,port)       [lindex $argv [expr $i+1]]; incr i}
138
        -shell              {set shell   1}
139
        -verbose            {set verbose 1}
140
        -mspgcc_compat_mode {set mspgcc_compat_mode 1}
141
        -h                  {help; exit 0}
142
        -help               {help; exit 0}
143
        default             {}
144 2 olivier.gi
    }
145
}
146
 
147 158 olivier.gi
# Make sure the selected adptor is valid
148
if {![string eq $omsp_conf(interface) "uart_generic"] &
149
    ![string eq $omsp_conf(interface) "i2c_usb-iss"]} {
150
    puts "\nERROR: Specified adaptor is not valid (should be \"uart_generic\" or \"i2c_usb-iss\")"
151
    help
152 210 olivier.gi
    exit 1
153 158 olivier.gi
}
154
 
155
# Make sure the I2C address is an integer
156
if {![string is integer $omsp_conf(0,cpuaddr)]} {
157
    puts "\nERROR: Specified I2C address is not an integer"
158
    help
159 210 olivier.gi
    exit 1
160 158 olivier.gi
}
161
 
162
# Make sure the I2C address is valid
163
if {($omsp_conf(0,cpuaddr)<8) | ($omsp_conf(0,cpuaddr)>119)} {
164
    puts "\nERROR: Specified I2C address should lay between 7 and 120"
165
    help
166 210 olivier.gi
    exit 1
167 158 olivier.gi
}
168
 
169
# If the selected interface is a UART, make sure the selected speed is an integer
170
if {[string eq $omsp_conf(interface) "uart_generic"]} {
171
    if {![string is integer $omsp_conf(baudrate)]} {
172
        puts "\nERROR: Specified UART communication speed is not an integer"
173
        help
174 210 olivier.gi
        exit 1
175 158 olivier.gi
    }
176
} elseif {[string eq $omsp_conf(interface) "i2c_usb-iss"]} {
177
    if {[lsearch [lindex [GetAllowedSpeeds] 2] $omsp_conf(baudrate)]==-1} {
178
        puts "\nERROR: Specified I2C communication speed is not valid."
179
        puts "         Allowed values are:"
180
        foreach allowedVal [lindex [GetAllowedSpeeds] 2] {
181
            puts "                              - $allowedVal"
182
        }
183
        puts ""
184 210 olivier.gi
        exit 1
185 158 olivier.gi
    }
186
}
187
 
188 2 olivier.gi
# Source additional library for graphical interface
189
if {!$shell} {
190
    source $lib_path/combobox.tcl
191
    package require combobox 2.3
192
    catch {namespace import combobox::*}
193
}
194
 
195
# Small functions to display messages
196
proc putsLog {string {nonewline 0}} {
197
    global server
198
    global shell
199
    if {$shell} {
200 158 olivier.gi
        if {$nonewline} {
201
            puts -nonewline $string
202
        } else {
203
            puts $string
204
        }
205 2 olivier.gi
    } else {
206 158 olivier.gi
        if {$nonewline} {
207
            $server(log) insert end "$string"
208
        } else {
209
            $server(log) insert end "$string\n"
210
        }
211
        $server(log) see end
212 2 olivier.gi
    }
213
}
214
proc putsVerbose {string} {
215
    global verbose
216
    if {$verbose} {
217 158 olivier.gi
        putsLog "$string"
218 2 olivier.gi
    }
219
}
220
 
221
###############################################################################
222
#                               SHELL MODE                                    #
223
###############################################################################
224
if {$shell} {
225
 
226
    # Connect to device
227 172 olivier.gi
    if {![GetDevice 0]} {
228 198 olivier.gi
        puts "ERROR: Could not open $omsp_conf(device)"
229 158 olivier.gi
        puts "INFO:  Available serial ports are:"
230
        foreach port [utils::uart_port_list] {
231
            puts "INFO:                               -  $port"
232
        }
233
        if {[string eq $omsp_conf(interface) "i2c_usb-iss"]} {
234
            puts "\nMake sure the specified I2C device address is correct: $omsp_conf(0,cpuaddr)\n"
235
        }
236
        exit 1
237 2 olivier.gi
    }
238
 
239
    # Display info
240 172 olivier.gi
    if {$omsp_info(0,alias)==""} {
241 158 olivier.gi
        puts "INFO: Sucessfully connected with the openMSP430 target."
242 110 olivier.gi
    } else {
243 172 olivier.gi
        puts "INFO: Sucessfully connected with the openMSP430 target ($omsp_info(0,alias))."
244 110 olivier.gi
    }
245 172 olivier.gi
    set sizes [GetCPU_ID_SIZE 0]
246
    if {$omsp_info(0,asic)} {
247
        puts "INFO: CPU Version              - $omsp_info(0,cpu_ver) / ASIC"
248 110 olivier.gi
    } else {
249 172 olivier.gi
        puts "INFO: CPU Version              - $omsp_info(0,cpu_ver) / FPGA"
250 110 olivier.gi
    }
251 172 olivier.gi
    puts "INFO: User Version             - $omsp_info(0,user_ver)"
252
    if {$omsp_info(0,cpu_ver)==1} {
253 158 olivier.gi
        puts "INFO: Hardware Multiplier      - --"
254 172 olivier.gi
    } elseif {$omsp_info(0,mpy)} {
255 158 olivier.gi
        puts "INFO: Hardware Multiplier      - Yes"
256 110 olivier.gi
    } else {
257 158 olivier.gi
        puts "INFO: Hardware Multiplier      - No"
258 110 olivier.gi
    }
259 172 olivier.gi
    puts "INFO: Program Memory Size      - $omsp_info(0,pmem_size) B"
260
    puts "INFO: Data Memory Size         - $omsp_info(0,dmem_size) B"
261
    puts "INFO: Peripheral Address Space - $omsp_info(0,per_size) B"
262
    puts "INFO: $omsp_info(0,hw_break) Hardware Brea/Watch-point unit(s) detected"
263 2 olivier.gi
    puts ""
264
 
265
    # Reset & Stop CPU
266 172 olivier.gi
    ExecutePOR_Halt 0
267 2 olivier.gi
 
268
    # Start server for GDB
269 172 olivier.gi
    if {![startServer 0]} {
270 210 olivier.gi
        utils::uart_close
271 158 olivier.gi
        exit 1
272 2 olivier.gi
    }
273
 
274
    vwait forever
275
}
276
 
277 158 olivier.gi
proc getConfiguration {} {
278 2 olivier.gi
 
279 158 olivier.gi
    global gui_dbg_if
280
    global gui_adapter
281
    global omsp_conf
282
 
283
    regexp {(.+)_(.+)} $omsp_conf(interface) whole_match tmp_if tmp_adapter
284
 
285 210 olivier.gi
    set gui_dbg_if  [string toupper $tmp_if]
286 158 olivier.gi
    set gui_adapter [string toupper $tmp_adapter]
287
 
288
    return 1
289
}
290
 
291
proc updateConfiguration {{w ""} {sel ""}} {
292
 
293
    global gui_dbg_if
294
    global gui_adapter
295
    global omsp_conf
296
    global omsp_nr
297
 
298
    if {$sel=="UART"} {
299 172 olivier.gi
        eval .connect.cfg.if.config2.adapter.p2 list delete 0 end
300
        eval .connect.cfg.if.config2.adapter.p2 list insert   end [list "GENERIC"]
301
        set gui_adapter "GENERIC"
302
        set omsp_conf(interface)  uart_generic
303 158 olivier.gi
 
304
    } elseif {$sel=="I2C"} {
305
 
306 172 olivier.gi
        eval .connect.cfg.if.config2.adapter.p2 list delete 0 end
307
        eval .connect.cfg.if.config2.adapter.p2 list insert   end [list "USB-ISS"]
308
        set gui_adapter "USB-ISS"
309
        set omsp_conf(interface)  i2c_usb-iss
310 158 olivier.gi
    }
311
 
312
    if {$gui_dbg_if=="UART"} {
313 172 olivier.gi
        set omsp_nr 1
314
        .connect.cfg.ad.i2c_nr.l        configure -state disabled
315
        .connect.cfg.ad.i2c_nr.s        configure -state disabled
316
        .connect.cfg.ad.i2c_addr.l      configure -state disabled
317
        .connect.cfg.ad.i2c_addr.s0     configure -state disabled
318
        .connect.cfg.ad.i2c_addr.s1     configure -state disabled
319
        .connect.cfg.ad.i2c_addr.s2     configure -state disabled
320
        .connect.cfg.ad.i2c_addr.s3     configure -state disabled
321
        .connect.cfg.ad.arrow.l0        configure -state disabled
322
        .connect.cfg.ad.arrow.l1        configure -state disabled
323
        .connect.cfg.ad.arrow.l2        configure -state disabled
324
        .connect.cfg.ad.arrow.l3        configure -state disabled
325
        .connect.cfg.ad.server_port.p0  configure -state normal
326
        .connect.cfg.ad.server_port.p1  configure -state disabled
327
        .connect.cfg.ad.server_port.p2  configure -state disabled
328
        .connect.cfg.ad.server_port.p3  configure -state disabled
329
        .connect.cfg.ad.core_nr.l0      configure -state disabled
330
        .connect.cfg.ad.core_nr.l1      configure -state disabled
331
        .connect.cfg.ad.core_nr.l2      configure -state disabled
332
        .connect.cfg.ad.core_nr.l3      configure -state disabled
333
        .connect.cfg.ad.i2c_nr.f.soft.b configure -state disabled
334
        if {[winfo exists .omsp_sft_brk]} {
335
            updateSoftBreakpoints
336
        }
337
 
338 158 olivier.gi
    } elseif {$gui_dbg_if=="I2C"} {
339 172 olivier.gi
        .connect.cfg.ad.core_nr.l0      configure -state normal
340
        .connect.cfg.ad.i2c_nr.l        configure -state normal
341
        .connect.cfg.ad.i2c_nr.s        configure -state normal
342
        .connect.cfg.ad.i2c_addr.l      configure -state normal
343
        .connect.cfg.ad.i2c_addr.s0     configure -state normal
344
        .connect.cfg.ad.arrow.l0        configure -state normal
345
        .connect.cfg.ad.server_port.p0  configure -state normal
346 158 olivier.gi
 
347 172 olivier.gi
        if {$omsp_nr < 2} {
348
            .connect.cfg.ad.core_nr.l1      configure -state disabled
349
            .connect.cfg.ad.server_port.p1  configure -state disabled
350
            .connect.cfg.ad.arrow.l1        configure -state disabled
351
            .connect.cfg.ad.i2c_addr.s1     configure -state disabled
352
            .connect.cfg.ad.i2c_nr.f.soft.b configure -state disabled
353
        } else            {
354
            .connect.cfg.ad.core_nr.l1      configure -state normal
355
            .connect.cfg.ad.server_port.p1  configure -state normal
356
            .connect.cfg.ad.arrow.l1        configure -state normal
357
            .connect.cfg.ad.i2c_addr.s1     configure -state normal
358
            .connect.cfg.ad.i2c_nr.f.soft.b configure -state normal
359
        }
360 210 olivier.gi
 
361 172 olivier.gi
        if {$omsp_nr < 3} {
362
            .connect.cfg.ad.core_nr.l2      configure -state disabled
363
            .connect.cfg.ad.server_port.p2  configure -state disabled
364
            .connect.cfg.ad.arrow.l2        configure -state disabled
365
            .connect.cfg.ad.i2c_addr.s2     configure -state disabled
366
        } else            {
367
            .connect.cfg.ad.core_nr.l2      configure -state normal
368
            .connect.cfg.ad.server_port.p2  configure -state normal
369
            .connect.cfg.ad.arrow.l2        configure -state normal
370
            .connect.cfg.ad.i2c_addr.s2     configure -state normal
371
        }
372 210 olivier.gi
 
373 172 olivier.gi
        if {$omsp_nr < 4} {
374
            .connect.cfg.ad.core_nr.l3      configure -state disabled
375
            .connect.cfg.ad.server_port.p3  configure -state disabled
376
            .connect.cfg.ad.arrow.l3        configure -state disabled
377
            .connect.cfg.ad.i2c_addr.s3     configure -state disabled
378
        } else            {
379
            .connect.cfg.ad.core_nr.l3      configure -state normal
380
            .connect.cfg.ad.server_port.p3  configure -state normal
381
            .connect.cfg.ad.arrow.l3        configure -state normal
382
            .connect.cfg.ad.i2c_addr.s3     configure -state normal
383
        }
384
        updateSoftBreakpoints
385 158 olivier.gi
    }
386
 
387
    .connect.cfg.if.config2.serial_port.p2 configure -editable  1
388
    eval .connect.cfg.if.config2.serial_port.p2  list delete 0 end
389
    eval .connect.cfg.if.config2.serial_port.p2  list insert   end [lindex [GetAllowedSpeeds] 2]
390
    set omsp_conf(baudrate) [lindex [GetAllowedSpeeds] 1];
391
    .connect.cfg.if.config2.serial_port.p2 configure -editable  [lindex [GetAllowedSpeeds] 0];
392
 
393
}
394
 
395 2 olivier.gi
###############################################################################
396
#                                 GUI MODE                                    #
397
###############################################################################
398
 
399
####################################
400
#   CREATE & PLACE MAIN WIDGETS    #
401
####################################
402
 
403
wm title    . "openMSP430 GDB Proxy"
404
wm iconname . "openMSP430 GDB Proxy"
405
 
406 110 olivier.gi
# Create the Main Menu frame
407 2 olivier.gi
frame  .menu
408
pack   .menu   -side top -padx 10 -pady 10 -fill x
409
 
410 110 olivier.gi
# Create the Connection frame
411
frame  .connect -bd 2 -relief ridge    ;# solid
412
pack   .connect -side top -padx 10 -pady {5 0} -fill x
413 2 olivier.gi
 
414 110 olivier.gi
# Create the Info frame
415
frame  .info    -bd 2 -relief ridge    ;# solid
416
pack   .info    -side top -padx 10 -pady {10 0} -fill x
417 2 olivier.gi
 
418 110 olivier.gi
# Create the Server frame
419
frame  .server -bd 2 -relief ridge    ;# solid
420
pack   .server -side top -padx 10 -pady {10 0} -fill x
421
 
422 87 olivier.gi
# Create the TCL script field
423 110 olivier.gi
frame  .tclscript -bd 2 -relief ridge    ;# solid
424 87 olivier.gi
pack   .tclscript -side top -padx 10 -pady 10 -fill x
425 2 olivier.gi
 
426 87 olivier.gi
 
427 2 olivier.gi
####################################
428
#  CREATE THE REST                 #
429
####################################
430
 
431
# Exit button
432 210 olivier.gi
button .menu.exit -text "Exit" -command {stopAllServers; utils::uart_close; exit 0}
433 2 olivier.gi
pack   .menu.exit -side left
434
 
435 110 olivier.gi
# openMSP430 label
436
label  .menu.omsp      -text "openMSP430 GDB proxy" -anchor center -fg "\#6a5acd" -font {-weight bold -size 14}
437 210 olivier.gi
pack   .menu.omsp      -side right -padx 20
438 2 olivier.gi
 
439 110 olivier.gi
# Create the Configuration, Start & Info frames
440 158 olivier.gi
getConfiguration
441
frame  .connect.cfg
442
pack   .connect.cfg    -side left   -padx  0 -pady  0 -fill x -expand true
443
frame  .connect.cfg.if -bd 2 -relief ridge
444
pack   .connect.cfg.if -side top    -padx 10 -pady {10 0} -fill x -expand true
445
frame  .connect.cfg.ad -bd 2 -relief ridge
446
pack   .connect.cfg.ad -side top    -padx 10 -pady 10 -fill both -expand true
447 110 olivier.gi
frame  .connect.start
448 198 olivier.gi
pack   .connect.start  -side right  -padx 10 -pady 10 -fill both -expand true
449 110 olivier.gi
 
450 158 olivier.gi
frame  .connect.cfg.if.config1
451
pack   .connect.cfg.if.config1 -side left   -padx 0 -pady 0 -fill x -expand true
452
frame  .connect.cfg.if.config2
453
pack   .connect.cfg.if.config2 -side left   -padx 0 -pady 0 -fill x -expand true
454 110 olivier.gi
 
455 158 olivier.gi
# Interface & Adapter selection
456
frame    .connect.cfg.if.config1.adapter
457
pack     .connect.cfg.if.config1.adapter         -side top  -padx 5 -pady {10 0} -fill x
458
label    .connect.cfg.if.config1.adapter.l1      -text "Serial Debug Interface:" -anchor w
459
pack     .connect.cfg.if.config1.adapter.l1      -side left -padx 5
460
combobox .connect.cfg.if.config1.adapter.p1      -textvariable gui_dbg_if -editable false -width 15 -command {updateConfiguration}
461
eval     .connect.cfg.if.config1.adapter.p1      list insert end [list "UART" "I2C"]
462
pack     .connect.cfg.if.config1.adapter.p1      -side right -padx 10
463 2 olivier.gi
 
464 158 olivier.gi
frame    .connect.cfg.if.config2.adapter
465
pack     .connect.cfg.if.config2.adapter         -side top  -padx 5 -pady {10 0} -fill x
466
label    .connect.cfg.if.config2.adapter.l2      -text "Adapter selection:" -anchor w
467
pack     .connect.cfg.if.config2.adapter.l2      -side left -padx 5
468
combobox .connect.cfg.if.config2.adapter.p2      -textvariable gui_adapter -editable false -width 15
469
eval     .connect.cfg.if.config2.adapter.p2      list insert end [list "GENERIC"]
470
pack     .connect.cfg.if.config2.adapter.p2      -side right -padx 5
471 2 olivier.gi
 
472 210 olivier.gi
# Device port & Speed selection
473 158 olivier.gi
frame    .connect.cfg.if.config1.serial_port
474
pack     .connect.cfg.if.config1.serial_port     -side top   -padx 5 -pady {10 10} -fill x
475
label    .connect.cfg.if.config1.serial_port.l1  -text "Device Port:"  -anchor w
476
pack     .connect.cfg.if.config1.serial_port.l1  -side left  -padx 5
477
combobox .connect.cfg.if.config1.serial_port.p1  -textvariable omsp_conf(device) -editable true -width 15
478
eval     .connect.cfg.if.config1.serial_port.p1  list insert end [utils::uart_port_list]
479
pack     .connect.cfg.if.config1.serial_port.p1  -side right -padx 10
480 2 olivier.gi
 
481 158 olivier.gi
frame    .connect.cfg.if.config2.serial_port
482
pack     .connect.cfg.if.config2.serial_port     -side top   -padx 5 -pady {10 10} -fill x
483
label    .connect.cfg.if.config2.serial_port.l2  -text "Speed:" -anchor w
484
pack     .connect.cfg.if.config2.serial_port.l2  -side left  -padx 5
485
combobox .connect.cfg.if.config2.serial_port.p2  -textvariable omsp_conf(baudrate) -editable [lindex [GetAllowedSpeeds] 0] -width 15
486
eval     .connect.cfg.if.config2.serial_port.p2  list insert end [lindex [GetAllowedSpeeds] 2]
487
pack     .connect.cfg.if.config2.serial_port.p2  -side right -padx 5
488
 
489
# Server Port field & I2C address selection
490
frame    .connect.cfg.ad.core_nr
491 172 olivier.gi
pack     .connect.cfg.ad.core_nr     -side left -padx 5 -pady {0 20} -fill y
492 158 olivier.gi
label    .connect.cfg.ad.core_nr.l3  -text "Core 3:" -anchor w
493 210 olivier.gi
pack     .connect.cfg.ad.core_nr.l3  -side bottom  -padx {25 0} -pady {10 10}
494 158 olivier.gi
label    .connect.cfg.ad.core_nr.l2  -text "Core 2:" -anchor w
495 210 olivier.gi
pack     .connect.cfg.ad.core_nr.l2  -side bottom  -padx {25 0} -pady {10 2}
496 158 olivier.gi
label    .connect.cfg.ad.core_nr.l1  -text "Core 1:" -anchor w
497 210 olivier.gi
pack     .connect.cfg.ad.core_nr.l1  -side bottom  -padx {25 0} -pady {10 2}
498 158 olivier.gi
label    .connect.cfg.ad.core_nr.l0  -text "Core 0:" -anchor w
499 210 olivier.gi
pack     .connect.cfg.ad.core_nr.l0  -side bottom  -padx {25 0} -pady {10 2}
500 158 olivier.gi
 
501
frame    .connect.cfg.ad.server_port
502 172 olivier.gi
pack     .connect.cfg.ad.server_port    -side left -padx 5 -pady {0 20} -fill y
503
entry    .connect.cfg.ad.server_port.p3 -textvariable server(3,port) -relief sunken -width 10
504 210 olivier.gi
pack     .connect.cfg.ad.server_port.p3 -side bottom  -padx 5 -pady {10 10}
505 172 olivier.gi
entry    .connect.cfg.ad.server_port.p2 -textvariable server(2,port) -relief sunken -width 10
506 210 olivier.gi
pack     .connect.cfg.ad.server_port.p2 -side bottom  -padx 5 -pady {10 0}
507 172 olivier.gi
entry    .connect.cfg.ad.server_port.p1 -textvariable server(1,port) -relief sunken -width 10
508 210 olivier.gi
pack     .connect.cfg.ad.server_port.p1 -side bottom  -padx 5 -pady {10 0}
509 172 olivier.gi
entry    .connect.cfg.ad.server_port.p0 -textvariable server(0,port) -relief sunken -width 10
510 210 olivier.gi
pack     .connect.cfg.ad.server_port.p0 -side bottom  -padx 5 -pady {10 0}
511 158 olivier.gi
label    .connect.cfg.ad.server_port.l  -text "Proxy Server Port" -anchor w
512 210 olivier.gi
pack     .connect.cfg.ad.server_port.l  -side bottom  -padx 5 -pady {10 0}
513 158 olivier.gi
 
514
frame    .connect.cfg.ad.arrow
515 172 olivier.gi
pack     .connect.cfg.ad.arrow     -side left -padx 5 -pady {0 20} -fill y
516 158 olivier.gi
label    .connect.cfg.ad.arrow.l3  -text "==>" -anchor w
517 210 olivier.gi
pack     .connect.cfg.ad.arrow.l3  -side bottom  -padx 5 -pady {10 10}
518 158 olivier.gi
label    .connect.cfg.ad.arrow.l2  -text "==>" -anchor w
519 210 olivier.gi
pack     .connect.cfg.ad.arrow.l2  -side bottom  -padx 5 -pady {10 2}
520 158 olivier.gi
label    .connect.cfg.ad.arrow.l1  -text "==>" -anchor w
521 210 olivier.gi
pack     .connect.cfg.ad.arrow.l1  -side bottom  -padx 5 -pady {10 2}
522 158 olivier.gi
label    .connect.cfg.ad.arrow.l0  -text "==>" -anchor w
523 210 olivier.gi
pack     .connect.cfg.ad.arrow.l0  -side bottom  -padx 5 -pady {10 2}
524 158 olivier.gi
 
525
frame    .connect.cfg.ad.i2c_addr
526 172 olivier.gi
pack     .connect.cfg.ad.i2c_addr     -side left -padx 5 -pady {0 20} -fill y
527 158 olivier.gi
spinbox  .connect.cfg.ad.i2c_addr.s3  -from 8 -to 119 -textvariable omsp_conf(3,cpuaddr) -width 4
528 210 olivier.gi
pack     .connect.cfg.ad.i2c_addr.s3  -side bottom    -padx 5 -pady {10 10}
529 158 olivier.gi
spinbox  .connect.cfg.ad.i2c_addr.s2  -from 8 -to 119 -textvariable omsp_conf(2,cpuaddr) -width 4
530 210 olivier.gi
pack     .connect.cfg.ad.i2c_addr.s2  -side bottom    -padx 5 -pady {10 0}
531 158 olivier.gi
spinbox  .connect.cfg.ad.i2c_addr.s1  -from 8 -to 119 -textvariable omsp_conf(1,cpuaddr) -width 4
532 210 olivier.gi
pack     .connect.cfg.ad.i2c_addr.s1  -side bottom    -padx 5 -pady {10 0}
533 158 olivier.gi
spinbox  .connect.cfg.ad.i2c_addr.s0  -from 8 -to 119 -textvariable omsp_conf(0,cpuaddr) -width 4
534 210 olivier.gi
pack     .connect.cfg.ad.i2c_addr.s0  -side bottom    -padx 5 -pady {10 0}
535 158 olivier.gi
label    .connect.cfg.ad.i2c_addr.l   -text "I2C Address" -anchor w
536 210 olivier.gi
pack     .connect.cfg.ad.i2c_addr.l   -side bottom    -padx 5 -pady {10 0}
537 158 olivier.gi
 
538
frame    .connect.cfg.ad.i2c_nr
539
pack     .connect.cfg.ad.i2c_nr     -side right -padx 5 -fill y
540
label    .connect.cfg.ad.i2c_nr.l   -text "Number of cores" -anchor w
541 210 olivier.gi
pack     .connect.cfg.ad.i2c_nr.l   -side top    -padx 50 -pady {10 0}
542 158 olivier.gi
spinbox  .connect.cfg.ad.i2c_nr.s   -from 1 -to 4 -textvariable omsp_nr -state readonly -width 4 -command {updateConfiguration}
543 210 olivier.gi
pack     .connect.cfg.ad.i2c_nr.s   -side top    -padx 50 -pady {10 10}
544 158 olivier.gi
 
545 172 olivier.gi
frame       .connect.cfg.ad.i2c_nr.f   -bd 2 -relief ridge
546
pack        .connect.cfg.ad.i2c_nr.f   -side top -padx 10 -pady {5 5} -fill x
547
label       .connect.cfg.ad.i2c_nr.f.l2  -text "Breakpoint configuration" -anchor w
548 210 olivier.gi
pack        .connect.cfg.ad.i2c_nr.f.l2  -side top    -padx 0 -pady {5 10}
549 172 olivier.gi
 
550
frame       .connect.cfg.ad.i2c_nr.f.soft
551
pack        .connect.cfg.ad.i2c_nr.f.soft   -side top -padx 0 -fill x
552
radiobutton .connect.cfg.ad.i2c_nr.f.soft.r -value "0" -text "" -state normal -variable breakSelect -command {updateSoftBreakpoints}
553 210 olivier.gi
pack        .connect.cfg.ad.i2c_nr.f.soft.r -side left -padx {10 0}  -pady {0 0}
554 172 olivier.gi
label       .connect.cfg.ad.i2c_nr.f.soft.l -text "Soft" -anchor w
555 210 olivier.gi
pack        .connect.cfg.ad.i2c_nr.f.soft.l -side left -padx {5 10} -pady {3 0}
556 172 olivier.gi
button      .connect.cfg.ad.i2c_nr.f.soft.b -text "Config." -state disabled -command {configSoftBreakpoints}
557
pack        .connect.cfg.ad.i2c_nr.f.soft.b -side right -padx {0 20}
558
 
559
frame       .connect.cfg.ad.i2c_nr.f.hard
560
pack        .connect.cfg.ad.i2c_nr.f.hard   -side top -padx 0 -pady {0 10} -fill x
561
radiobutton .connect.cfg.ad.i2c_nr.f.hard.r -value "1" -text "" -state normal -variable breakSelect -command {updateSoftBreakpoints}
562 210 olivier.gi
pack        .connect.cfg.ad.i2c_nr.f.hard.r -side left -padx {10 0}  -pady {0 0}
563 172 olivier.gi
label       .connect.cfg.ad.i2c_nr.f.hard.l -text "Hard" -anchor w
564 210 olivier.gi
pack        .connect.cfg.ad.i2c_nr.f.hard.l -side left -padx {5 10} -pady {3 0}
565 172 olivier.gi
 
566 158 olivier.gi
# Update according to default values
567
updateConfiguration
568
 
569 110 olivier.gi
# Connect to CPU & start proxy server
570 198 olivier.gi
frame       .connect.start.f
571
pack        .connect.start.f   -side top -padx 10 -pady 0 -fill x -expand true
572
button      .connect.start.f.b -text "Connect to CPU(s)\n and \nStart Proxy Server(s)" -command {startServerGUI}
573
pack        .connect.start.f.b -side top -padx 30
574
checkbutton .connect.start.comp_mode -text "MSPGCC Compatibility Mode" -variable mspgcc_compat_mode
575
pack        .connect.start.comp_mode -side bottom -padx 10
576 110 olivier.gi
 
577
 
578
# CPU Info
579
frame  .info.cpu
580
pack   .info.cpu      -side top   -padx 10 -pady {5 0} -fill x
581
label  .info.cpu.l    -text "CPU Info:"       -anchor w
582
pack   .info.cpu.l    -side left -padx {10 10}
583
label  .info.cpu.con  -text "Disconnected"    -anchor w -fg Red
584
pack   .info.cpu.con  -side left
585
button .info.cpu.more -text "More..."         -width 9 -command {displayMore} -state disabled
586
pack   .info.cpu.more -side right -padx {0 30}
587
 
588
 
589
# Server Info
590
frame  .info.server
591
pack   .info.server     -side top   -padx 10 -pady {0 10} -fill x
592
label  .info.server.l   -text "Server Info:"       -anchor w
593
pack   .info.server.l   -side left -padx {10 10}
594
label  .info.server.con -text "Not running"    -anchor w -fg Red
595
pack   .info.server.con -side left
596
 
597
 
598 2 olivier.gi
# Create the text widget to log received messages
599
frame  .server.t
600
pack   .server.t     -side top -padx 10 -pady 10 -fill x
601 110 olivier.gi
set server(log) [text   .server.t.log -width 80 -height 15 -borderwidth 2  \
602 2 olivier.gi
                          -setgrid true -yscrollcommand {.server.t.scroll set}]
603
pack   .server.t.log -side left  -fill both -expand true
604
scrollbar .server.t.scroll -command {.server.t.log yview}
605 87 olivier.gi
pack   .server.t.scroll -side right -fill both
606 2 olivier.gi
 
607
 
608
# Log commands
609
frame  .server.cmd
610 110 olivier.gi
pack   .server.cmd   -side top  -pady {0 10} -fill x
611 2 olivier.gi
button .server.cmd.clear -text "Clear log" -command {$server(log) delete 1.0 end}
612
pack   .server.cmd.clear -side left -padx 10
613
checkbutton .server.cmd.verbose -text "Verbose" -variable verbose
614
pack   .server.cmd.verbose -side right -padx 10
615 87 olivier.gi
 
616
 
617
# Load TCL script fields
618
frame  .tclscript.ft
619 110 olivier.gi
pack   .tclscript.ft        -side top  -padx 10  -pady 10 -fill x
620 87 olivier.gi
label  .tclscript.ft.l      -text "TCL script:" -state disabled
621
pack   .tclscript.ft.l      -side left -padx "0 10"
622
entry  .tclscript.ft.file   -width 58 -relief sunken -textvariable tcl_file_name -state disabled
623
pack   .tclscript.ft.file   -side left -padx 10
624
button .tclscript.ft.browse -text "Browse" -state disabled -command {set tcl_file_name [tk_getOpenFile -filetypes {{{TCL Files} {.tcl}} {{All Files} *}}]}
625 210 olivier.gi
pack   .tclscript.ft.browse -side left -padx 5
626 87 olivier.gi
frame  .tclscript.fb
627
pack   .tclscript.fb        -side top -fill x
628
button .tclscript.fb.read   -text "Source TCL script !" -state disabled -command {if {[file exists $tcl_file_name]} {source $tcl_file_name}}
629 110 olivier.gi
pack   .tclscript.fb.read   -side left -padx 20  -pady {0 10} -fill x
630 87 olivier.gi
 
631 110 olivier.gi
wm resizable . 0 0
632 172 olivier.gi
 
633 214 olivier.gi
# Close the window
634
wm protocol . WM_DELETE_WINDOW {
635
    if {[tk_messageBox -message "Quit?" -type yesno] eq "yes"} {
636
        stopAllServers
637
        utils::uart_close
638
        exit
639
    }
640
}
641 172 olivier.gi
 
642
#####################################
643
#  Breakpoint configuration window  #
644
#####################################
645
 
646
proc configSoftBreakpoints  { } {
647
 
648
    global omsp_nr
649
 
650
    # Destroy windows if already existing
651
    if {[lsearch -exact [winfo children .] .omsp_sft_brk]!=-1} {
652
        destroy .omsp_sft_brk
653
    }
654
 
655
    # Create master window
656
    set title "Software Breakpoint Configuration"
657
    toplevel     .omsp_sft_brk
658
    wm title     .omsp_sft_brk $title
659
    wm geometry  .omsp_sft_brk +380+200
660
    wm resizable .omsp_sft_brk 0 0
661
 
662
    # Title
663
    label  .omsp_sft_brk.title  -text "$title"   -anchor center -fg "\#6a5acd" -font {-weight bold -size 16}
664
    pack   .omsp_sft_brk.title  -side top -padx {20 20} -pady {20 10}
665
 
666
    # Create global frame
667
    frame     .omsp_sft_brk.map
668
    pack      .omsp_sft_brk.map   -side top  -padx {10 10} -pady {0 0}
669
 
670
    # Create frame for buttons
671
    frame       .omsp_sft_brk.map.b  -bd 2 -relief ridge
672
    pack        .omsp_sft_brk.map.b  -side top  -padx 10  -pady {10 0} -fill x -expand true
673
 
674
    button      .omsp_sft_brk.map.b.share -text "Shared Program Memory"    -command {setMemMapping 0 0 0 0}
675
    pack        .omsp_sft_brk.map.b.share -side left  -padx {20 15} -pady {10 10}
676
 
677
    button      .omsp_sft_brk.map.b.dedic -text "Dedicated Program Memory" -command {setMemMapping 0 1 2 3}
678
    pack        .omsp_sft_brk.map.b.dedic -side right -padx {15 20} -pady {10 10}
679
 
680
 
681
    # Create fram for radio-buttons
682
    frame       .omsp_sft_brk.map.r  -bd 2 -relief ridge
683
    pack        .omsp_sft_brk.map.r  -side top  -padx 10  -pady {10 20} -fill x -expand true
684
 
685
    frame       .omsp_sft_brk.map.r.core_nr
686
    pack        .omsp_sft_brk.map.r.core_nr     -side left -padx 5 -pady {0 20} -fill y
687
    label       .omsp_sft_brk.map.r.core_nr.l3  -text "Core 3:" -anchor w
688 210 olivier.gi
    pack        .omsp_sft_brk.map.r.core_nr.l3  -side bottom  -padx {25 0} -pady {10 10}
689 172 olivier.gi
    label       .omsp_sft_brk.map.r.core_nr.l2  -text "Core 2:" -anchor w
690 210 olivier.gi
    pack        .omsp_sft_brk.map.r.core_nr.l2  -side bottom  -padx {25 0} -pady {10 2}
691 172 olivier.gi
    label       .omsp_sft_brk.map.r.core_nr.l1  -text "Core 1:" -anchor w
692 210 olivier.gi
    pack        .omsp_sft_brk.map.r.core_nr.l1  -side bottom  -padx {25 0} -pady {10 2}
693 172 olivier.gi
    label       .omsp_sft_brk.map.r.core_nr.l0  -text "Core 0:" -anchor w
694 210 olivier.gi
    pack        .omsp_sft_brk.map.r.core_nr.l0  -side bottom  -padx {25 0} -pady {10 2}
695
 
696 172 olivier.gi
    frame       .omsp_sft_brk.map.r.pmem0
697
    pack        .omsp_sft_brk.map.r.pmem0    -side left -padx 5 -pady {0 20} -fill y
698
    radiobutton .omsp_sft_brk.map.r.pmem0.p3 -value "0" -text "" -state normal -variable mem_mapping(3)
699 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem0.p3 -side bottom  -padx 5 -pady {10 10}
700 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem0.p2 -value "0" -text "" -state normal -variable mem_mapping(2)
701 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem0.p2 -side bottom  -padx 5 -pady {10 0}
702 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem0.p1 -value "0" -text "" -state normal -variable mem_mapping(1)
703 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem0.p1 -side bottom  -padx 5 -pady {10 0}
704 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem0.p0 -value "0" -text "" -state normal -variable mem_mapping(0)
705 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem0.p0 -side bottom  -padx 5 -pady {10 0}
706 172 olivier.gi
    label       .omsp_sft_brk.map.r.pmem0.l  -text "Program\nMemory 0" -anchor w
707 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem0.l  -side bottom  -padx 5 -pady {10 0}
708 172 olivier.gi
 
709
    frame       .omsp_sft_brk.map.r.pmem1
710
    pack        .omsp_sft_brk.map.r.pmem1    -side left -padx 5 -pady {0 20} -fill y
711
    radiobutton .omsp_sft_brk.map.r.pmem1.p3 -value "1" -text "" -state normal -variable mem_mapping(3)
712 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem1.p3 -side bottom  -padx 5 -pady {10 10}
713 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem1.p2 -value "1" -text "" -state normal -variable mem_mapping(2)
714 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem1.p2 -side bottom  -padx 5 -pady {10 0}
715 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem1.p1 -value "1" -text "" -state normal -variable mem_mapping(1)
716 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem1.p1 -side bottom  -padx 5 -pady {10 0}
717 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem1.p0 -value "1" -text "" -state disable -variable mem_mapping(0)
718 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem1.p0 -side bottom  -padx 5 -pady {10 0}
719 172 olivier.gi
    label       .omsp_sft_brk.map.r.pmem1.l  -text "Program\nMemory 1" -anchor w
720 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem1.l  -side bottom  -padx 5 -pady {10 0}
721
 
722 172 olivier.gi
    frame       .omsp_sft_brk.map.r.pmem2
723
    pack        .omsp_sft_brk.map.r.pmem2    -side left -padx 5 -pady {0 20} -fill y
724
    radiobutton .omsp_sft_brk.map.r.pmem2.p3 -value "2" -text "" -state normal -variable mem_mapping(3)
725 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem2.p3 -side bottom  -padx 5 -pady {10 10}
726 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem2.p2 -value "2" -text "" -state normal -variable mem_mapping(2)
727 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem2.p2 -side bottom  -padx 5 -pady {10 0}
728 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem2.p1 -value "2" -text "" -state disable -variable mem_mapping(1)
729 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem2.p1 -side bottom  -padx 5 -pady {10 0}
730 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem2.p0 -value "2" -text "" -state disable -variable mem_mapping(0)
731 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem2.p0 -side bottom  -padx 5 -pady {10 0}
732 172 olivier.gi
    label       .omsp_sft_brk.map.r.pmem2.l  -text "Program\nMemory 2" -anchor w
733 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem2.l  -side bottom  -padx 5 -pady {10 0}
734
 
735 172 olivier.gi
    frame       .omsp_sft_brk.map.r.pmem3
736
    pack        .omsp_sft_brk.map.r.pmem3    -side left -padx 5 -pady {0 20} -fill y
737
    radiobutton .omsp_sft_brk.map.r.pmem3.p3 -value "3" -text "" -state normal -variable mem_mapping(3)
738 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem3.p3 -side bottom  -padx 5 -pady {10 10}
739 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem3.p2 -value "3" -text "" -state disable -variable mem_mapping(2)
740 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem3.p2 -side bottom  -padx 5 -pady {10 0}
741 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem3.p1 -value "3" -text "" -state disable -variable mem_mapping(1)
742 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem3.p1 -side bottom  -padx 5 -pady {10 0}
743 172 olivier.gi
    radiobutton .omsp_sft_brk.map.r.pmem3.p0 -value "3" -text "" -state disable -variable mem_mapping(0)
744 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem3.p0 -side bottom  -padx 5 -pady {10 0}
745 172 olivier.gi
    label       .omsp_sft_brk.map.r.pmem3.l  -text "Program\nMemory 3" -anchor w
746 210 olivier.gi
    pack        .omsp_sft_brk.map.r.pmem3.l  -side bottom  -padx 5 -pady {10 0}
747 172 olivier.gi
 
748
    # Create OK button
749
    button .omsp_sft_brk.okay -text "OK" -font {-weight bold}  -command {destroy .omsp_sft_brk}
750
    pack   .omsp_sft_brk.okay -side bottom -expand true -fill x -padx 5 -pady {0 10}
751
 
752
    # Update according to number of cores
753
    updateSoftBreakpoints
754
}
755
 
756
proc updateSoftBreakpoints  { } {
757
 
758
    global omsp_nr
759
    global breakSelect
760
 
761
    if {[winfo exists .omsp_sft_brk]} {
762
        if {$breakSelect==0} {
763
            .omsp_sft_brk.map.r.core_nr.l0  configure -state normal
764
            .omsp_sft_brk.map.r.pmem0.p0    configure -state normal
765
            if {$omsp_nr < 2} {
766
                .omsp_sft_brk.map.r.core_nr.l1  configure -state disabled
767
                .omsp_sft_brk.map.r.pmem0.p1    configure -state disabled
768
                .omsp_sft_brk.map.r.pmem1.p1    configure -state disabled
769
            } else {
770
                .omsp_sft_brk.map.r.core_nr.l1  configure -state normal
771
                .omsp_sft_brk.map.r.pmem0.p1    configure -state normal
772
                .omsp_sft_brk.map.r.pmem1.p1    configure -state normal
773
            }
774
 
775
            if {$omsp_nr < 3} {
776
                .omsp_sft_brk.map.r.core_nr.l2  configure -state disabled
777
                .omsp_sft_brk.map.r.pmem0.p2    configure -state disabled
778
                .omsp_sft_brk.map.r.pmem1.p2    configure -state disabled
779
                .omsp_sft_brk.map.r.pmem2.p2    configure -state disabled
780
            } else {
781
                .omsp_sft_brk.map.r.core_nr.l2  configure -state normal
782
                .omsp_sft_brk.map.r.pmem0.p2    configure -state normal
783
                .omsp_sft_brk.map.r.pmem1.p2    configure -state normal
784
                .omsp_sft_brk.map.r.pmem2.p2    configure -state normal
785
            }
786 210 olivier.gi
 
787 172 olivier.gi
            if {$omsp_nr < 4} {
788
                .omsp_sft_brk.map.r.core_nr.l3  configure -state disabled
789
                .omsp_sft_brk.map.r.pmem0.p3    configure -state disabled
790
                .omsp_sft_brk.map.r.pmem1.p3    configure -state disabled
791
                .omsp_sft_brk.map.r.pmem2.p3    configure -state disabled
792
                .omsp_sft_brk.map.r.pmem3.p3    configure -state disabled
793
            } else {
794
                .omsp_sft_brk.map.r.core_nr.l3  configure -state normal
795
                .omsp_sft_brk.map.r.pmem0.p3    configure -state normal
796
                .omsp_sft_brk.map.r.pmem1.p3    configure -state normal
797
                .omsp_sft_brk.map.r.pmem2.p3    configure -state normal
798
                .omsp_sft_brk.map.r.pmem3.p3    configure -state normal
799
            }
800
        } else {
801
            .omsp_sft_brk.map.r.core_nr.l0  configure -state disabled
802
            .omsp_sft_brk.map.r.pmem0.p0    configure -state disabled
803
            .omsp_sft_brk.map.r.core_nr.l1  configure -state disabled
804
            .omsp_sft_brk.map.r.pmem0.p1    configure -state disabled
805
            .omsp_sft_brk.map.r.pmem1.p1    configure -state disabled
806
            .omsp_sft_brk.map.r.core_nr.l2  configure -state disabled
807
            .omsp_sft_brk.map.r.pmem0.p2    configure -state disabled
808
            .omsp_sft_brk.map.r.pmem1.p2    configure -state disabled
809
            .omsp_sft_brk.map.r.pmem2.p2    configure -state disabled
810
            .omsp_sft_brk.map.r.core_nr.l3  configure -state disabled
811
            .omsp_sft_brk.map.r.pmem0.p3    configure -state disabled
812
            .omsp_sft_brk.map.r.pmem1.p3    configure -state disabled
813
            .omsp_sft_brk.map.r.pmem2.p3    configure -state disabled
814
            .omsp_sft_brk.map.r.pmem3.p3    configure -state disabled
815
        }
816
    }
817
}
818
 
819
proc setMemMapping {core0 core1 core2 core3} {
820
 
821
    global mem_mapping
822
    global omsp_nr
823
 
824
    set mem_mapping(0) $core0
825
    if {$omsp_nr > 1} {
826
        set mem_mapping(1) $core1
827
    }
828
    if {$omsp_nr > 2} {
829
        set mem_mapping(2) $core2
830
    }
831
    if {$omsp_nr > 3} {
832
        set mem_mapping(3) $core3
833
    }
834 198 olivier.gi
}

powered by: WebSVN 2.1.0

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