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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [tools/] [bin/] [openmsp430-gdbproxy.tcl] - Diff between revs 158 and 172

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 158 Rev 172
Line 27... Line 27...
# 
# 
# Author(s):
# Author(s):
#             - Olivier Girard,    olgirard@gmail.com
#             - Olivier Girard,    olgirard@gmail.com
#
#
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# $Rev: 158 $
# $Rev: 172 $
# $LastChangedBy: olivier.girard $
# $LastChangedBy: olivier.girard $
# $LastChangedDate: 2012-10-15 23:49:09 +0200 (Mon, 15 Oct 2012) $
# $LastChangedDate: 2012-12-28 00:06:56 +0100 (Fri, 28 Dec 2012) $
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
 
 
###############################################################################
###############################################################################
#                                                                             #
#                                                                             #
#                            SOURCE LIBRARIES                                 #
#                            SOURCE LIBRARIES                                 #
Line 60... Line 60...
#                                                                             #
#                                                                             #
#                            GLOBAL VARIABLES                                 #
#                            GLOBAL VARIABLES                                 #
#                                                                             #
#                                                                             #
###############################################################################
###############################################################################
 
 
global CpuNr
 
 
 
global omsp_conf
global omsp_conf
global omsp_info
global omsp_info
 
 
global omsp_nr
global omsp_nr
 
 
 
global mem_mapping
 
 
global gui_dbg_if
global gui_dbg_if
global gui_adapter
global gui_adapter
global clients
global clients
global server
global server
global verbose
global verbose
global shell
global shell
 
global breakSelect
 
 
# Initialize to default values
# Initialize to default values
set CpuNr                 0
 
set omsp_nr               1
set omsp_nr               1
set omsp_conf(interface)  uart_generic
set omsp_conf(interface)  uart_generic
#set omsp_nr               4
 
#set omsp_conf(interface)  i2c_usb-iss
 
set omsp_conf(device)     [lindex [utils::uart_port_list] end]
set omsp_conf(device)     [lindex [utils::uart_port_list] end]
set omsp_conf(baudrate)   [lindex [GetAllowedSpeeds] 1]
set omsp_conf(baudrate)   [lindex [GetAllowedSpeeds] 1]
set omsp_conf(0,cpuaddr)  50
set omsp_conf(0,cpuaddr)  50
set omsp_conf(1,cpuaddr)  51
set omsp_conf(1,cpuaddr)  51
set omsp_conf(2,cpuaddr)  52
set omsp_conf(2,cpuaddr)  52
set omsp_conf(3,cpuaddr)  53
set omsp_conf(3,cpuaddr)  53
 
 
set server(port)    2000
set server(0,port)      2000
 
set server(1,port)      2001
 
set server(2,port)      2002
 
set server(3,port)      2003
 
 
 
set mem_mapping(0)         0
 
set mem_mapping(1)         0
 
set mem_mapping(2)         0
 
set mem_mapping(3)         0
 
 
 
set breakSelect            0
 
 
set shell           0
set shell           0
set verbose         0
set verbose         0
 
 
###############################################################################
###############################################################################
Line 121... Line 129...
    switch -exact -- [lindex $argv $i] {
    switch -exact -- [lindex $argv $i] {
        -device   {set omsp_conf(device)    [lindex $argv [expr $i+1]]; incr i}
        -device   {set omsp_conf(device)    [lindex $argv [expr $i+1]]; incr i}
        -adaptor  {set omsp_conf(interface) [lindex $argv [expr $i+1]]; incr i}
        -adaptor  {set omsp_conf(interface) [lindex $argv [expr $i+1]]; incr i}
        -speed    {set omsp_conf(baudrate)  [lindex $argv [expr $i+1]]; incr i}
        -speed    {set omsp_conf(baudrate)  [lindex $argv [expr $i+1]]; incr i}
        -i2c_addr {set omsp_conf(0,cpuaddr) [lindex $argv [expr $i+1]]; incr i}
        -i2c_addr {set omsp_conf(0,cpuaddr) [lindex $argv [expr $i+1]]; incr i}
        -port     {set server(port)         [lindex $argv [expr $i+1]]; incr i}
        -port     {set server(0,port)       [lindex $argv [expr $i+1]]; incr i}
        -shell    {set shell   1}
        -shell    {set shell   1}
        -verbose  {set verbose 1}
        -verbose  {set verbose 1}
        -h        {help; exit 0}
        -h        {help; exit 0}
        -help     {help; exit 0}
        -help     {help; exit 0}
        default   {}
        default   {}
Line 210... Line 218...
#                               SHELL MODE                                    #
#                               SHELL MODE                                    #
###############################################################################
###############################################################################
if {$shell} {
if {$shell} {
 
 
    # Connect to device
    # Connect to device
    if {![GetDevice $CpuNr]} {
    if {![GetDevice 0]} {
        puts "ERROR: Could not open $omsp_conf(device)
        puts "ERROR: Could not open $omsp_conf(device)
        puts "INFO:  Available serial ports are:"
        puts "INFO:  Available serial ports are:"
        foreach port [utils::uart_port_list] {
        foreach port [utils::uart_port_list] {
            puts "INFO:                               -  $port"
            puts "INFO:                               -  $port"
        }
        }
Line 223... Line 231...
        }
        }
        exit 1
        exit 1
    }
    }
 
 
    # Display info
    # Display info
    if {$omsp_info($CpuNr,alias)==""} {
    if {$omsp_info(0,alias)==""} {
        puts "INFO: Sucessfully connected with the openMSP430 target."
        puts "INFO: Sucessfully connected with the openMSP430 target."
    } else {
    } else {
        puts "INFO: Sucessfully connected with the openMSP430 target ($omsp_info($CpuNr,alias))."
        puts "INFO: Sucessfully connected with the openMSP430 target ($omsp_info(0,alias))."
    }
    }
    set sizes [GetCPU_ID_SIZE $CpuNr]
    set sizes [GetCPU_ID_SIZE 0]
    if {$omsp_info($CpuNr,asic)} {
    if {$omsp_info(0,asic)} {
        puts "INFO: CPU Version              - $omsp_info($CpuNr,cpu_ver) / ASIC"
        puts "INFO: CPU Version              - $omsp_info(0,cpu_ver) / ASIC"
    } else {
    } else {
        puts "INFO: CPU Version              - $omsp_info($CpuNr,cpu_ver) / FPGA"
        puts "INFO: CPU Version              - $omsp_info(0,cpu_ver) / FPGA"
    }
    }
    puts "INFO: User Version             - $omsp_info($CpuNr,user_ver)"
    puts "INFO: User Version             - $omsp_info(0,user_ver)"
    if {$omsp_info($CpuNr,cpu_ver)==1} {
    if {$omsp_info(0,cpu_ver)==1} {
        puts "INFO: Hardware Multiplier      - --"
        puts "INFO: Hardware Multiplier      - --"
    } elseif {$omsp_info($CpuNr,mpy)} {
    } elseif {$omsp_info(0,mpy)} {
        puts "INFO: Hardware Multiplier      - Yes"
        puts "INFO: Hardware Multiplier      - Yes"
    } else {
    } else {
        puts "INFO: Hardware Multiplier      - No"
        puts "INFO: Hardware Multiplier      - No"
    }
    }
    puts "INFO: Program Memory Size      - $omsp_info($CpuNr,pmem_size) B"
    puts "INFO: Program Memory Size      - $omsp_info(0,pmem_size) B"
    puts "INFO: Data Memory Size         - $omsp_info($CpuNr,dmem_size) B"
    puts "INFO: Data Memory Size         - $omsp_info(0,dmem_size) B"
    puts "INFO: Peripheral Address Space - $omsp_info($CpuNr,per_size) B"
    puts "INFO: Peripheral Address Space - $omsp_info(0,per_size) B"
    puts "INFO: $omsp_info($CpuNr,hw_break) Hardware Brea/Watch-point unit(s) detected"
    puts "INFO: $omsp_info(0,hw_break) Hardware Brea/Watch-point unit(s) detected"
    puts ""
    puts ""
 
 
    # Reset & Stop CPU
    # Reset & Stop CPU
    ExecutePOR_Halt $CpuNr
    ExecutePOR_Halt 0
 
 
    # Start server for GDB
    # Start server for GDB
    if {![startServer]} {
    if {![startServer 0]} {
        exit 1
        exit 1
    }
    }
 
 
    vwait forever
    vwait forever
}
}
Line 315... Line 323...
        .connect.cfg.ad.server_port.p3  configure -state disabled
        .connect.cfg.ad.server_port.p3  configure -state disabled
        .connect.cfg.ad.core_nr.l0      configure -state disabled
        .connect.cfg.ad.core_nr.l0      configure -state disabled
        .connect.cfg.ad.core_nr.l1      configure -state disabled
        .connect.cfg.ad.core_nr.l1      configure -state disabled
        .connect.cfg.ad.core_nr.l2      configure -state disabled
        .connect.cfg.ad.core_nr.l2      configure -state disabled
        .connect.cfg.ad.core_nr.l3      configure -state disabled
        .connect.cfg.ad.core_nr.l3      configure -state disabled
 
        .connect.cfg.ad.i2c_nr.f.soft.b configure -state disabled
 
        if {[winfo exists .omsp_sft_brk]} {
 
            updateSoftBreakpoints
 
        }
 
 
    } elseif {$gui_dbg_if=="I2C"} {
    } elseif {$gui_dbg_if=="I2C"} {
#       .connect.cfg.ad.core_nr.l0      configure -state normal
        .connect.cfg.ad.core_nr.l0      configure -state normal
#       .connect.cfg.ad.i2c_nr.l        configure -state normal
        .connect.cfg.ad.i2c_nr.l        configure -state normal
#       .connect.cfg.ad.i2c_nr.s        configure -state normal
        .connect.cfg.ad.i2c_nr.s        configure -state normal
        .connect.cfg.ad.i2c_addr.l      configure -state normal
        .connect.cfg.ad.i2c_addr.l      configure -state normal
        .connect.cfg.ad.i2c_addr.s0     configure -state normal
        .connect.cfg.ad.i2c_addr.s0     configure -state normal
        .connect.cfg.ad.arrow.l0        configure -state normal
        .connect.cfg.ad.arrow.l0        configure -state normal
        .connect.cfg.ad.server_port.p0  configure -state normal
        .connect.cfg.ad.server_port.p0  configure -state normal
#       .connect.cfg.ad.core_nr.l0      configure -state normal
 
 
 
 
 
        if {$omsp_nr < 2} {
        if {$omsp_nr < 2} {
            .connect.cfg.ad.core_nr.l1      configure -state disabled
            .connect.cfg.ad.core_nr.l1      configure -state disabled
            .connect.cfg.ad.server_port.p1  configure -state disabled
            .connect.cfg.ad.server_port.p1  configure -state disabled
            .connect.cfg.ad.arrow.l1        configure -state disabled
            .connect.cfg.ad.arrow.l1        configure -state disabled
            .connect.cfg.ad.i2c_addr.s1     configure -state disabled
            .connect.cfg.ad.i2c_addr.s1     configure -state disabled
 
            .connect.cfg.ad.i2c_nr.f.soft.b configure -state disabled
        } else            {
        } else            {
            .connect.cfg.ad.core_nr.l1      configure -state normal
            .connect.cfg.ad.core_nr.l1      configure -state normal
            .connect.cfg.ad.server_port.p1  configure -state normal
            .connect.cfg.ad.server_port.p1  configure -state normal
            .connect.cfg.ad.arrow.l1        configure -state normal
            .connect.cfg.ad.arrow.l1        configure -state normal
            .connect.cfg.ad.i2c_addr.s1     configure -state normal
            .connect.cfg.ad.i2c_addr.s1     configure -state normal
 
            .connect.cfg.ad.i2c_nr.f.soft.b configure -state normal
        }
        }
 
 
        if {$omsp_nr < 3} {
        if {$omsp_nr < 3} {
            .connect.cfg.ad.core_nr.l2      configure -state disabled
            .connect.cfg.ad.core_nr.l2      configure -state disabled
            .connect.cfg.ad.server_port.p2  configure -state disabled
            .connect.cfg.ad.server_port.p2  configure -state disabled
Line 361... Line 374...
            .connect.cfg.ad.core_nr.l3      configure -state normal
            .connect.cfg.ad.core_nr.l3      configure -state normal
            .connect.cfg.ad.server_port.p3  configure -state normal
            .connect.cfg.ad.server_port.p3  configure -state normal
            .connect.cfg.ad.arrow.l3        configure -state normal
            .connect.cfg.ad.arrow.l3        configure -state normal
            .connect.cfg.ad.i2c_addr.s3     configure -state normal
            .connect.cfg.ad.i2c_addr.s3     configure -state normal
        }
        }
 
        updateSoftBreakpoints
    }
    }
 
 
    .connect.cfg.if.config2.serial_port.p2 configure -editable  1
    .connect.cfg.if.config2.serial_port.p2 configure -editable  1
    eval .connect.cfg.if.config2.serial_port.p2  list delete 0 end
    eval .connect.cfg.if.config2.serial_port.p2  list delete 0 end
    eval .connect.cfg.if.config2.serial_port.p2  list insert   end [lindex [GetAllowedSpeeds] 2]
    eval .connect.cfg.if.config2.serial_port.p2  list insert   end [lindex [GetAllowedSpeeds] 2]
Line 408... Line 422...
####################################
####################################
#  CREATE THE REST                 #
#  CREATE THE REST                 #
####################################
####################################
 
 
# Exit button
# Exit button
button .menu.exit -text "Exit" -command {stopServer; exit 0}
button .menu.exit -text "Exit" -command {stopAllServers; exit 0}
pack   .menu.exit -side left
pack   .menu.exit -side left
 
 
# openMSP430 label
# openMSP430 label
label  .menu.omsp      -text "openMSP430 GDB proxy" -anchor center -fg "\#6a5acd" -font {-weight bold -size 14}
label  .menu.omsp      -text "openMSP430 GDB proxy" -anchor center -fg "\#6a5acd" -font {-weight bold -size 14}
pack   .menu.omsp      -side right -padx 20
pack   .menu.omsp      -side right -padx 20
Line 467... Line 481...
eval     .connect.cfg.if.config2.serial_port.p2  list insert end [lindex [GetAllowedSpeeds] 2]
eval     .connect.cfg.if.config2.serial_port.p2  list insert end [lindex [GetAllowedSpeeds] 2]
pack     .connect.cfg.if.config2.serial_port.p2  -side right -padx 5
pack     .connect.cfg.if.config2.serial_port.p2  -side right -padx 5
 
 
# Server Port field & I2C address selection
# Server Port field & I2C address selection
frame    .connect.cfg.ad.core_nr
frame    .connect.cfg.ad.core_nr
pack     .connect.cfg.ad.core_nr     -side left -padx 5 -fill y
pack     .connect.cfg.ad.core_nr     -side left -padx 5 -pady {0 20} -fill y
label    .connect.cfg.ad.core_nr.l3  -text "Core 3:" -anchor w
label    .connect.cfg.ad.core_nr.l3  -text "Core 3:" -anchor w
pack     .connect.cfg.ad.core_nr.l3  -side bottom  -padx {25 0} -pady {10 10}
pack     .connect.cfg.ad.core_nr.l3  -side bottom  -padx {25 0} -pady {10 10}
label    .connect.cfg.ad.core_nr.l2  -text "Core 2:" -anchor w
label    .connect.cfg.ad.core_nr.l2  -text "Core 2:" -anchor w
pack     .connect.cfg.ad.core_nr.l2  -side bottom  -padx {25 0} -pady {10 2}
pack     .connect.cfg.ad.core_nr.l2  -side bottom  -padx {25 0} -pady {10 2}
label    .connect.cfg.ad.core_nr.l1  -text "Core 1:" -anchor w
label    .connect.cfg.ad.core_nr.l1  -text "Core 1:" -anchor w
pack     .connect.cfg.ad.core_nr.l1  -side bottom  -padx {25 0} -pady {10 2}
pack     .connect.cfg.ad.core_nr.l1  -side bottom  -padx {25 0} -pady {10 2}
label    .connect.cfg.ad.core_nr.l0  -text "Core 0:" -anchor w
label    .connect.cfg.ad.core_nr.l0  -text "Core 0:" -anchor w
pack     .connect.cfg.ad.core_nr.l0  -side bottom  -padx {25 0} -pady {10 2}
pack     .connect.cfg.ad.core_nr.l0  -side bottom  -padx {25 0} -pady {10 2}
 
 
frame    .connect.cfg.ad.server_port
frame    .connect.cfg.ad.server_port
pack     .connect.cfg.ad.server_port    -side left -padx 5 -fill y
pack     .connect.cfg.ad.server_port    -side left -padx 5 -pady {0 20} -fill y
entry    .connect.cfg.ad.server_port.p3 -textvariable server(port) -relief sunken -width 10
entry    .connect.cfg.ad.server_port.p3 -textvariable server(3,port) -relief sunken -width 10
pack     .connect.cfg.ad.server_port.p3 -side bottom  -padx 5 -pady {10 10}
pack     .connect.cfg.ad.server_port.p3 -side bottom  -padx 5 -pady {10 10}
entry    .connect.cfg.ad.server_port.p2 -textvariable server(port) -relief sunken -width 10
entry    .connect.cfg.ad.server_port.p2 -textvariable server(2,port) -relief sunken -width 10
pack     .connect.cfg.ad.server_port.p2 -side bottom  -padx 5 -pady {10 0}
pack     .connect.cfg.ad.server_port.p2 -side bottom  -padx 5 -pady {10 0}
entry    .connect.cfg.ad.server_port.p1 -textvariable server(port) -relief sunken -width 10
entry    .connect.cfg.ad.server_port.p1 -textvariable server(1,port) -relief sunken -width 10
pack     .connect.cfg.ad.server_port.p1 -side bottom  -padx 5 -pady {10 0}
pack     .connect.cfg.ad.server_port.p1 -side bottom  -padx 5 -pady {10 0}
entry    .connect.cfg.ad.server_port.p0 -textvariable server(port) -relief sunken -width 10
entry    .connect.cfg.ad.server_port.p0 -textvariable server(0,port) -relief sunken -width 10
pack     .connect.cfg.ad.server_port.p0 -side bottom  -padx 5 -pady {10 0}
pack     .connect.cfg.ad.server_port.p0 -side bottom  -padx 5 -pady {10 0}
label    .connect.cfg.ad.server_port.l  -text "Proxy Server Port" -anchor w
label    .connect.cfg.ad.server_port.l  -text "Proxy Server Port" -anchor w
pack     .connect.cfg.ad.server_port.l  -side bottom  -padx 5 -pady {10 0}
pack     .connect.cfg.ad.server_port.l  -side bottom  -padx 5 -pady {10 0}
 
 
frame    .connect.cfg.ad.arrow
frame    .connect.cfg.ad.arrow
pack     .connect.cfg.ad.arrow     -side left -padx 5 -fill y
pack     .connect.cfg.ad.arrow     -side left -padx 5 -pady {0 20} -fill y
label    .connect.cfg.ad.arrow.l3  -text "==>" -anchor w
label    .connect.cfg.ad.arrow.l3  -text "==>" -anchor w
pack     .connect.cfg.ad.arrow.l3  -side bottom  -padx 5 -pady {10 10}
pack     .connect.cfg.ad.arrow.l3  -side bottom  -padx 5 -pady {10 10}
label    .connect.cfg.ad.arrow.l2  -text "==>" -anchor w
label    .connect.cfg.ad.arrow.l2  -text "==>" -anchor w
pack     .connect.cfg.ad.arrow.l2  -side bottom  -padx 5 -pady {10 2}
pack     .connect.cfg.ad.arrow.l2  -side bottom  -padx 5 -pady {10 2}
label    .connect.cfg.ad.arrow.l1  -text "==>" -anchor w
label    .connect.cfg.ad.arrow.l1  -text "==>" -anchor w
pack     .connect.cfg.ad.arrow.l1  -side bottom  -padx 5 -pady {10 2}
pack     .connect.cfg.ad.arrow.l1  -side bottom  -padx 5 -pady {10 2}
label    .connect.cfg.ad.arrow.l0  -text "==>" -anchor w
label    .connect.cfg.ad.arrow.l0  -text "==>" -anchor w
pack     .connect.cfg.ad.arrow.l0  -side bottom  -padx 5 -pady {10 2}
pack     .connect.cfg.ad.arrow.l0  -side bottom  -padx 5 -pady {10 2}
 
 
frame    .connect.cfg.ad.i2c_addr
frame    .connect.cfg.ad.i2c_addr
pack     .connect.cfg.ad.i2c_addr     -side left -padx 5 -fill y
pack     .connect.cfg.ad.i2c_addr     -side left -padx 5 -pady {0 20} -fill y
spinbox  .connect.cfg.ad.i2c_addr.s3  -from 8 -to 119 -textvariable omsp_conf(3,cpuaddr) -width 4
spinbox  .connect.cfg.ad.i2c_addr.s3  -from 8 -to 119 -textvariable omsp_conf(3,cpuaddr) -width 4
pack     .connect.cfg.ad.i2c_addr.s3  -side bottom    -padx 5 -pady {10 10}
pack     .connect.cfg.ad.i2c_addr.s3  -side bottom    -padx 5 -pady {10 10}
spinbox  .connect.cfg.ad.i2c_addr.s2  -from 8 -to 119 -textvariable omsp_conf(2,cpuaddr) -width 4
spinbox  .connect.cfg.ad.i2c_addr.s2  -from 8 -to 119 -textvariable omsp_conf(2,cpuaddr) -width 4
pack     .connect.cfg.ad.i2c_addr.s2  -side bottom    -padx 5 -pady {10 0}
pack     .connect.cfg.ad.i2c_addr.s2  -side bottom    -padx 5 -pady {10 0}
spinbox  .connect.cfg.ad.i2c_addr.s1  -from 8 -to 119 -textvariable omsp_conf(1,cpuaddr) -width 4
spinbox  .connect.cfg.ad.i2c_addr.s1  -from 8 -to 119 -textvariable omsp_conf(1,cpuaddr) -width 4
Line 521... Line 535...
label    .connect.cfg.ad.i2c_nr.l   -text "Number of cores" -anchor w
label    .connect.cfg.ad.i2c_nr.l   -text "Number of cores" -anchor w
pack     .connect.cfg.ad.i2c_nr.l   -side top    -padx 50 -pady {10 0}
pack     .connect.cfg.ad.i2c_nr.l   -side top    -padx 50 -pady {10 0}
spinbox  .connect.cfg.ad.i2c_nr.s   -from 1 -to 4 -textvariable omsp_nr -state readonly -width 4 -command {updateConfiguration}
spinbox  .connect.cfg.ad.i2c_nr.s   -from 1 -to 4 -textvariable omsp_nr -state readonly -width 4 -command {updateConfiguration}
pack     .connect.cfg.ad.i2c_nr.s   -side top    -padx 50 -pady {10 10}
pack     .connect.cfg.ad.i2c_nr.s   -side top    -padx 50 -pady {10 10}
 
 
 
frame       .connect.cfg.ad.i2c_nr.f   -bd 2 -relief ridge
 
pack        .connect.cfg.ad.i2c_nr.f   -side top -padx 10 -pady {5 5} -fill x
 
label       .connect.cfg.ad.i2c_nr.f.l2  -text "Breakpoint configuration" -anchor w
 
pack        .connect.cfg.ad.i2c_nr.f.l2  -side top    -padx 0 -pady {5 10}
 
 
 
frame       .connect.cfg.ad.i2c_nr.f.soft
 
pack        .connect.cfg.ad.i2c_nr.f.soft   -side top -padx 0 -fill x
 
radiobutton .connect.cfg.ad.i2c_nr.f.soft.r -value "0" -text "" -state normal -variable breakSelect -command {updateSoftBreakpoints}
 
pack        .connect.cfg.ad.i2c_nr.f.soft.r -side left -padx {10 0}  -pady {0 0}
 
label       .connect.cfg.ad.i2c_nr.f.soft.l -text "Soft" -anchor w
 
pack        .connect.cfg.ad.i2c_nr.f.soft.l -side left -padx {5 10} -pady {3 0}
 
button      .connect.cfg.ad.i2c_nr.f.soft.b -text "Config." -state disabled -command {configSoftBreakpoints}
 
pack        .connect.cfg.ad.i2c_nr.f.soft.b -side right -padx {0 20}
 
 
 
frame       .connect.cfg.ad.i2c_nr.f.hard
 
pack        .connect.cfg.ad.i2c_nr.f.hard   -side top -padx 0 -pady {0 10} -fill x
 
radiobutton .connect.cfg.ad.i2c_nr.f.hard.r -value "1" -text "" -state normal -variable breakSelect -command {updateSoftBreakpoints}
 
pack        .connect.cfg.ad.i2c_nr.f.hard.r -side left -padx {10 0}  -pady {0 0}
 
label       .connect.cfg.ad.i2c_nr.f.hard.l -text "Hard" -anchor w
 
pack        .connect.cfg.ad.i2c_nr.f.hard.l -side left -padx {5 10} -pady {3 0}
 
 
# Update according to default values
# Update according to default values
updateConfiguration
updateConfiguration
 
 
# Connect to CPU & start proxy server
# Connect to CPU & start proxy server
button .connect.start.but -text "Connect to CPU(s)\n and \nStart Proxy Server(s)" -command {startServerGUI}
button .connect.start.but -text "Connect to CPU(s)\n and \nStart Proxy Server(s)" -command {startServerGUI}
Line 583... Line 618...
pack   .tclscript.fb        -side top -fill x
pack   .tclscript.fb        -side top -fill x
button .tclscript.fb.read   -text "Source TCL script !" -state disabled -command {if {[file exists $tcl_file_name]} {source $tcl_file_name}}
button .tclscript.fb.read   -text "Source TCL script !" -state disabled -command {if {[file exists $tcl_file_name]} {source $tcl_file_name}}
pack   .tclscript.fb.read   -side left -padx 20  -pady {0 10} -fill x
pack   .tclscript.fb.read   -side left -padx 20  -pady {0 10} -fill x
 
 
wm resizable . 0 0
wm resizable . 0 0
 
 
 No newline at end of file
 No newline at end of file
 
 
 
 
 
 
 
#####################################
 
#  Breakpoint configuration window  #
 
#####################################
 
 
 
proc configSoftBreakpoints  { } {
 
 
 
    global omsp_nr
 
 
 
    # Destroy windows if already existing
 
    if {[lsearch -exact [winfo children .] .omsp_sft_brk]!=-1} {
 
        destroy .omsp_sft_brk
 
    }
 
 
 
    # Create master window
 
    set title "Software Breakpoint Configuration"
 
    toplevel     .omsp_sft_brk
 
    wm title     .omsp_sft_brk $title
 
    wm geometry  .omsp_sft_brk +380+200
 
    wm resizable .omsp_sft_brk 0 0
 
 
 
    # Title
 
    label  .omsp_sft_brk.title  -text "$title"   -anchor center -fg "\#6a5acd" -font {-weight bold -size 16}
 
    pack   .omsp_sft_brk.title  -side top -padx {20 20} -pady {20 10}
 
 
 
    # Create global frame
 
    frame     .omsp_sft_brk.map
 
    pack      .omsp_sft_brk.map   -side top  -padx {10 10} -pady {0 0}
 
 
 
    # Create frame for buttons
 
    frame       .omsp_sft_brk.map.b  -bd 2 -relief ridge
 
    pack        .omsp_sft_brk.map.b  -side top  -padx 10  -pady {10 0} -fill x -expand true
 
 
 
    button      .omsp_sft_brk.map.b.share -text "Shared Program Memory"    -command {setMemMapping 0 0 0 0}
 
    pack        .omsp_sft_brk.map.b.share -side left  -padx {20 15} -pady {10 10}
 
 
 
    button      .omsp_sft_brk.map.b.dedic -text "Dedicated Program Memory" -command {setMemMapping 0 1 2 3}
 
    pack        .omsp_sft_brk.map.b.dedic -side right -padx {15 20} -pady {10 10}
 
 
 
 
 
    # Create fram for radio-buttons
 
    frame       .omsp_sft_brk.map.r  -bd 2 -relief ridge
 
    pack        .omsp_sft_brk.map.r  -side top  -padx 10  -pady {10 20} -fill x -expand true
 
 
 
    frame       .omsp_sft_brk.map.r.core_nr
 
    pack        .omsp_sft_brk.map.r.core_nr     -side left -padx 5 -pady {0 20} -fill y
 
    label       .omsp_sft_brk.map.r.core_nr.l3  -text "Core 3:" -anchor w
 
    pack        .omsp_sft_brk.map.r.core_nr.l3  -side bottom  -padx {25 0} -pady {10 10}
 
    label       .omsp_sft_brk.map.r.core_nr.l2  -text "Core 2:" -anchor w
 
    pack        .omsp_sft_brk.map.r.core_nr.l2  -side bottom  -padx {25 0} -pady {10 2}
 
    label       .omsp_sft_brk.map.r.core_nr.l1  -text "Core 1:" -anchor w
 
    pack        .omsp_sft_brk.map.r.core_nr.l1  -side bottom  -padx {25 0} -pady {10 2}
 
    label       .omsp_sft_brk.map.r.core_nr.l0  -text "Core 0:" -anchor w
 
    pack        .omsp_sft_brk.map.r.core_nr.l0  -side bottom  -padx {25 0} -pady {10 2}
 
 
 
    frame       .omsp_sft_brk.map.r.pmem0
 
    pack        .omsp_sft_brk.map.r.pmem0    -side left -padx 5 -pady {0 20} -fill y
 
    radiobutton .omsp_sft_brk.map.r.pmem0.p3 -value "0" -text "" -state normal -variable mem_mapping(3)
 
    pack        .omsp_sft_brk.map.r.pmem0.p3 -side bottom  -padx 5 -pady {10 10}
 
    radiobutton .omsp_sft_brk.map.r.pmem0.p2 -value "0" -text "" -state normal -variable mem_mapping(2)
 
    pack        .omsp_sft_brk.map.r.pmem0.p2 -side bottom  -padx 5 -pady {10 0}
 
    radiobutton .omsp_sft_brk.map.r.pmem0.p1 -value "0" -text "" -state normal -variable mem_mapping(1)
 
    pack        .omsp_sft_brk.map.r.pmem0.p1 -side bottom  -padx 5 -pady {10 0}
 
    radiobutton .omsp_sft_brk.map.r.pmem0.p0 -value "0" -text "" -state normal -variable mem_mapping(0)
 
    pack        .omsp_sft_brk.map.r.pmem0.p0 -side bottom  -padx 5 -pady {10 0}
 
    label       .omsp_sft_brk.map.r.pmem0.l  -text "Program\nMemory 0" -anchor w
 
    pack        .omsp_sft_brk.map.r.pmem0.l  -side bottom  -padx 5 -pady {10 0}
 
 
 
    frame       .omsp_sft_brk.map.r.pmem1
 
    pack        .omsp_sft_brk.map.r.pmem1    -side left -padx 5 -pady {0 20} -fill y
 
    radiobutton .omsp_sft_brk.map.r.pmem1.p3 -value "1" -text "" -state normal -variable mem_mapping(3)
 
    pack        .omsp_sft_brk.map.r.pmem1.p3 -side bottom  -padx 5 -pady {10 10}
 
    radiobutton .omsp_sft_brk.map.r.pmem1.p2 -value "1" -text "" -state normal -variable mem_mapping(2)
 
    pack        .omsp_sft_brk.map.r.pmem1.p2 -side bottom  -padx 5 -pady {10 0}
 
    radiobutton .omsp_sft_brk.map.r.pmem1.p1 -value "1" -text "" -state normal -variable mem_mapping(1)
 
    pack        .omsp_sft_brk.map.r.pmem1.p1 -side bottom  -padx 5 -pady {10 0}
 
    radiobutton .omsp_sft_brk.map.r.pmem1.p0 -value "1" -text "" -state disable -variable mem_mapping(0)
 
    pack        .omsp_sft_brk.map.r.pmem1.p0 -side bottom  -padx 5 -pady {10 0}
 
    label       .omsp_sft_brk.map.r.pmem1.l  -text "Program\nMemory 1" -anchor w
 
    pack        .omsp_sft_brk.map.r.pmem1.l  -side bottom  -padx 5 -pady {10 0}
 
 
 
    frame       .omsp_sft_brk.map.r.pmem2
 
    pack        .omsp_sft_brk.map.r.pmem2    -side left -padx 5 -pady {0 20} -fill y
 
    radiobutton .omsp_sft_brk.map.r.pmem2.p3 -value "2" -text "" -state normal -variable mem_mapping(3)
 
    pack        .omsp_sft_brk.map.r.pmem2.p3 -side bottom  -padx 5 -pady {10 10}
 
    radiobutton .omsp_sft_brk.map.r.pmem2.p2 -value "2" -text "" -state normal -variable mem_mapping(2)
 
    pack        .omsp_sft_brk.map.r.pmem2.p2 -side bottom  -padx 5 -pady {10 0}
 
    radiobutton .omsp_sft_brk.map.r.pmem2.p1 -value "2" -text "" -state disable -variable mem_mapping(1)
 
    pack        .omsp_sft_brk.map.r.pmem2.p1 -side bottom  -padx 5 -pady {10 0}
 
    radiobutton .omsp_sft_brk.map.r.pmem2.p0 -value "2" -text "" -state disable -variable mem_mapping(0)
 
    pack        .omsp_sft_brk.map.r.pmem2.p0 -side bottom  -padx 5 -pady {10 0}
 
    label       .omsp_sft_brk.map.r.pmem2.l  -text "Program\nMemory 2" -anchor w
 
    pack        .omsp_sft_brk.map.r.pmem2.l  -side bottom  -padx 5 -pady {10 0}
 
 
 
    frame       .omsp_sft_brk.map.r.pmem3
 
    pack        .omsp_sft_brk.map.r.pmem3    -side left -padx 5 -pady {0 20} -fill y
 
    radiobutton .omsp_sft_brk.map.r.pmem3.p3 -value "3" -text "" -state normal -variable mem_mapping(3)
 
    pack        .omsp_sft_brk.map.r.pmem3.p3 -side bottom  -padx 5 -pady {10 10}
 
    radiobutton .omsp_sft_brk.map.r.pmem3.p2 -value "3" -text "" -state disable -variable mem_mapping(2)
 
    pack        .omsp_sft_brk.map.r.pmem3.p2 -side bottom  -padx 5 -pady {10 0}
 
    radiobutton .omsp_sft_brk.map.r.pmem3.p1 -value "3" -text "" -state disable -variable mem_mapping(1)
 
    pack        .omsp_sft_brk.map.r.pmem3.p1 -side bottom  -padx 5 -pady {10 0}
 
    radiobutton .omsp_sft_brk.map.r.pmem3.p0 -value "3" -text "" -state disable -variable mem_mapping(0)
 
    pack        .omsp_sft_brk.map.r.pmem3.p0 -side bottom  -padx 5 -pady {10 0}
 
    label       .omsp_sft_brk.map.r.pmem3.l  -text "Program\nMemory 3" -anchor w
 
    pack        .omsp_sft_brk.map.r.pmem3.l  -side bottom  -padx 5 -pady {10 0}
 
 
 
    # Create OK button
 
    button .omsp_sft_brk.okay -text "OK" -font {-weight bold}  -command {destroy .omsp_sft_brk}
 
    pack   .omsp_sft_brk.okay -side bottom -expand true -fill x -padx 5 -pady {0 10}
 
 
 
    # Update according to number of cores
 
    updateSoftBreakpoints
 
}
 
 
 
proc updateSoftBreakpoints  { } {
 
 
 
    global omsp_nr
 
    global breakSelect
 
 
 
    if {[winfo exists .omsp_sft_brk]} {
 
        if {$breakSelect==0} {
 
            .omsp_sft_brk.map.r.core_nr.l0  configure -state normal
 
            .omsp_sft_brk.map.r.pmem0.p0    configure -state normal
 
            if {$omsp_nr < 2} {
 
                .omsp_sft_brk.map.r.core_nr.l1  configure -state disabled
 
                .omsp_sft_brk.map.r.pmem0.p1    configure -state disabled
 
                .omsp_sft_brk.map.r.pmem1.p1    configure -state disabled
 
            } else {
 
                .omsp_sft_brk.map.r.core_nr.l1  configure -state normal
 
                .omsp_sft_brk.map.r.pmem0.p1    configure -state normal
 
                .omsp_sft_brk.map.r.pmem1.p1    configure -state normal
 
            }
 
 
 
            if {$omsp_nr < 3} {
 
                .omsp_sft_brk.map.r.core_nr.l2  configure -state disabled
 
                .omsp_sft_brk.map.r.pmem0.p2    configure -state disabled
 
                .omsp_sft_brk.map.r.pmem1.p2    configure -state disabled
 
                .omsp_sft_brk.map.r.pmem2.p2    configure -state disabled
 
            } else {
 
                .omsp_sft_brk.map.r.core_nr.l2  configure -state normal
 
                .omsp_sft_brk.map.r.pmem0.p2    configure -state normal
 
                .omsp_sft_brk.map.r.pmem1.p2    configure -state normal
 
                .omsp_sft_brk.map.r.pmem2.p2    configure -state normal
 
            }
 
 
 
            if {$omsp_nr < 4} {
 
                .omsp_sft_brk.map.r.core_nr.l3  configure -state disabled
 
                .omsp_sft_brk.map.r.pmem0.p3    configure -state disabled
 
                .omsp_sft_brk.map.r.pmem1.p3    configure -state disabled
 
                .omsp_sft_brk.map.r.pmem2.p3    configure -state disabled
 
                .omsp_sft_brk.map.r.pmem3.p3    configure -state disabled
 
            } else {
 
                .omsp_sft_brk.map.r.core_nr.l3  configure -state normal
 
                .omsp_sft_brk.map.r.pmem0.p3    configure -state normal
 
                .omsp_sft_brk.map.r.pmem1.p3    configure -state normal
 
                .omsp_sft_brk.map.r.pmem2.p3    configure -state normal
 
                .omsp_sft_brk.map.r.pmem3.p3    configure -state normal
 
            }
 
        } else {
 
            .omsp_sft_brk.map.r.core_nr.l0  configure -state disabled
 
            .omsp_sft_brk.map.r.pmem0.p0    configure -state disabled
 
            .omsp_sft_brk.map.r.core_nr.l1  configure -state disabled
 
            .omsp_sft_brk.map.r.pmem0.p1    configure -state disabled
 
            .omsp_sft_brk.map.r.pmem1.p1    configure -state disabled
 
            .omsp_sft_brk.map.r.core_nr.l2  configure -state disabled
 
            .omsp_sft_brk.map.r.pmem0.p2    configure -state disabled
 
            .omsp_sft_brk.map.r.pmem1.p2    configure -state disabled
 
            .omsp_sft_brk.map.r.pmem2.p2    configure -state disabled
 
            .omsp_sft_brk.map.r.core_nr.l3  configure -state disabled
 
            .omsp_sft_brk.map.r.pmem0.p3    configure -state disabled
 
            .omsp_sft_brk.map.r.pmem1.p3    configure -state disabled
 
            .omsp_sft_brk.map.r.pmem2.p3    configure -state disabled
 
            .omsp_sft_brk.map.r.pmem3.p3    configure -state disabled
 
        }
 
    }
 
}
 
 
 
proc setMemMapping {core0 core1 core2 core3} {
 
 
 
    global mem_mapping
 
    global omsp_nr
 
 
 
    set mem_mapping(0) $core0
 
    if {$omsp_nr > 1} {
 
        set mem_mapping(1) $core1
 
    }
 
    if {$omsp_nr > 2} {
 
        set mem_mapping(2) $core2
 
    }
 
    if {$omsp_nr > 3} {
 
        set mem_mapping(3) $core3
 
    }
 
}
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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