diff options
Diffstat (limited to 'lib/simulator/engine/engine_initialization_cleanup.tcl')
-rw-r--r--[-rwxr-xr-x] | lib/simulator/engine/engine_initialization_cleanup.tcl | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/lib/simulator/engine/engine_initialization_cleanup.tcl b/lib/simulator/engine/engine_initialization_cleanup.tcl index e8a1ffa..8865dd2 100755..100644 --- a/lib/simulator/engine/engine_initialization_cleanup.tcl +++ b/lib/simulator/engine/engine_initialization_cleanup.tcl @@ -2,7 +2,7 @@ # Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) ############################################################################ -# Copyright (C) 2007-2009 by Martin Ošmera # +# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # # This program is free software; you can redistribute it and#or modify # @@ -21,6 +21,11 @@ # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # ############################################################################ +# >>> File inclusion guard +if { ! [ info exists _ENGINE_INITIALIZATION_CLEANUP_TCL ] } { +set _ENGINE_INITIALIZATION_CLEANUP_TCL _ +# <<< File inclusion guard + # -------------------------------------------------------------------------- # DESCRIPTION # Part of simulator engine functionality. @@ -52,7 +57,7 @@ destructor { # This function is called after each simulator start # @return void private method simulator_system_power_on {} { - if {$feature_avaliable(wtd)} { + if {$feature_available(wtd)} { set sfr($symbol(WDTRST)) [undefined_octet] set wdtrst_prev_val $sfr($symbol(WDTRST)) if {$sync_ena} { @@ -60,7 +65,7 @@ private method simulator_system_power_on {} { } } - if {$feature_avaliable(uart)} { + if {$feature_available(uart)} { set sfr($symbol(SBUFR)) [undefined_octet] set sfr($symbol(SBUFT)) [undefined_octet] set controllers_conf(UART_M) 0 @@ -70,7 +75,7 @@ private method simulator_system_power_on {} { } } - if {$feature_avaliable(pof)} { + if {$feature_available(pof)} { set controllers_conf(POF) 1 set sfr($symbol(PCON)) 16 if {$sync_ena} { @@ -78,7 +83,7 @@ private method simulator_system_power_on {} { } } - if {$feature_avaliable(spi)} { + if {$feature_available(spi)} { set sfr($symbol(SPDR)) 0 if {$sync_ena} { catch {$this Simulator_GUI_sync S $symbol(SPDR)} @@ -103,7 +108,7 @@ public method simulator_initialize_mcu {} { + [$this cget -P_option_mcu_xcode])}] - # Parse processor definition and set array feature_avaliable + # Parse processor definition and set array feature_available foreach index { 5 6 7 9 10 11 17 20 21 22 23 24 25 26 @@ -118,24 +123,24 @@ public method simulator_initialize_mcu {} { auxrwdidle auxrdisrto xram xcode } { if {[lindex $proc_data $index] == {yes}} { - set feature_avaliable($name) 1 - } { - set feature_avaliable($name) 0 + set feature_available($name) 1 + } else { + set feature_available($name) 0 } } for {set i 12; set j 0} {$i < 17} {incr i; incr j} { set port_mask [lindex $proc_data $i] if {$port_mask != {} && $port_mask != {00000000}} { - set feature_avaliable(p$j) 1 - set feature_avaliable(port$j) $port_mask - } { - set feature_avaliable(p$j) 0 - set feature_avaliable(port$j) {00000000} + set feature_available(p$j) 1 + set feature_available(port$j) $port_mask + } else { + set feature_available(p$j) 0 + set feature_available(port$j) {00000000} } } - # Set incomplite_regs_mask, restricted_bits and incomplite_regs - array unset incomplite_regs_mask + # Set incomplete_regs_mask, restricted_bits and incomplete_regs + array unset incomplete_regs_mask set restricted_bits {} foreach reg_mask [lindex $proc_data 18] { set addr [string range $reg_mask 0 1] @@ -143,7 +148,7 @@ public method simulator_initialize_mcu {} { set addr [expr "0x$addr"] set mask [expr "0x$mask"] - set incomplite_regs_mask($addr) $mask + set incomplete_regs_mask($addr) $mask if {$addr > 127 && !($addr % 8)} { for {set i 1} {$i <= 128} {set i [expr {$i * 2}]; incr addr} { @@ -153,7 +158,7 @@ public method simulator_initialize_mcu {} { } } } - set incomplite_regs [array names incomplite_regs_mask] + set incomplete_regs [array names incomplete_regs_mask] # Determiate list of write-only registers set write_only_regs {} @@ -186,7 +191,7 @@ public method simulator_initialize_mcu {} { # Power on virtual uC and derminate list of implemented SFR simulator_system_power_on master_reset 0 - set avaliable_sfr [array names sfr] + set available_sfr [array names sfr] # Initialize/Clear code memory and data EEPROM simulator_clear_memory code @@ -312,18 +317,18 @@ proc InitializeNS {} { set PORT_LATCHES [list $symbol(P0) $symbol(P1) $symbol(P2) $symbol(P3) $symbol(P4)] } -## Shutdown simulator engine +## Stop simulator engine # @return void private method internal_shutdown {} { set break 1 $this Simulator_sync_clock } -## Determinate if the specified feature is avaliable on this MCU +## Determinate if the specified feature is available on this MCU # @parm String key - feature name (e.g. 'p0') # @return Bool - result (1 == yes; 0 == no) -public method get_feature_avaliable {key} { - return $feature_avaliable($key) +public method get_feature_available {key} { + return $feature_available($key) } ## Get number of implemented ports and list of port indexes @@ -331,10 +336,14 @@ public method get_feature_avaliable {key} { public method get_ports_info {} { set sum 0 for {set i 0} {$i < 5} {incr i} { - if {$feature_avaliable(p$i)} { + if {$feature_available(p$i)} { incr sum lappend lst $i } } return [list $sum $lst] } + +# >>> File inclusion guard +} +# <<< File inclusion guard |