diff options
author | Andrej Shadura <andrewsh@debian.org> | 2018-05-08 16:00:42 +0200 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2018-05-08 16:00:42 +0200 |
commit | 2fc4dd61e5607569909548975eaf54cef87be96e (patch) | |
tree | 19417eb5639eacffcfac6d9de53e0ab464010503 /lib/simulator | |
parent | 47aa8b00b2b11df13a100489e0f904a4947177ef (diff) |
New upstream version 1.4.9
Diffstat (limited to 'lib/simulator')
22 files changed, 228 insertions, 166 deletions
diff --git a/lib/simulator/bitmap.tcl b/lib/simulator/bitmap.tcl index c2b4623..0090bcb 100644 --- a/lib/simulator/bitmap.tcl +++ b/lib/simulator/bitmap.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,36 +36,36 @@ set _BITMAP_TCL _ class BitMap { ## COMMON - common btmap_count 0 ;# Int: Counter of object instances + public common btmap_count 0 ;# Int: Counter of object instances # Last window geometry - common win_geometry [lindex $::CONFIG(BITMAP_CONFIG) 0] - - common bit_addr_clr {#0000FF} ;# Color: Bit address - common reg_addr_clr {#00DD00} ;# Color: Register address - common rect_size 14 ;# Int: Size of rectangle repersenting one bit - common rect_sep 2 ;# Int: Space between bits - common reg_sep 4 ;# Int: Space between octetes - common row_sep 4 ;# Int: Space between rows - common bm_x_org 50 ;# Int: Bitmap origin (X) - common bm_y_org 20 ;# Int: Bitmap origin (Y) - - common zero_fill #FF0000 ;# Color: Bit fill color for log. 0 (Non-selected) - common zero_outline #FF8888 ;# Color: Bit outline color for log. 0 (Non-selected) - common zero_a_fill #FF8888 ;# Color: Bit fill color for log. 0 (Selected bit) - common zero_a_outline #FFDDDD ;# Color: Bit outline color for log. 0 (Selected bit) - - common one_fill #00FF00 ;# Color: Bit color for log. 1 (Non-selected) - common one_outline #88FF88 ;# Color: Bit outline color for log. 1 (Non-selected) - common one_a_fill #88FF88 ;# Color: Bit fill color for log. 1 (Selected bit) - common one_a_outline #DDFFDD ;# Color: Bit outline color for log. 1 (Selected bit) + public common win_geometry [lindex $::CONFIG(BITMAP_CONFIG) 0] + + public common bit_addr_clr {#0000FF} ;# Color: Bit address + public common reg_addr_clr {#00DD00} ;# Color: Register address + public common rect_size 14 ;# Int: Size of rectangle repersenting one bit + public common rect_sep 2 ;# Int: Space between bits + public common reg_sep 4 ;# Int: Space between octetes + public common row_sep 4 ;# Int: Space between rows + public common bm_x_org 50 ;# Int: Bitmap origin (X) + public common bm_y_org 20 ;# Int: Bitmap origin (Y) + + public common zero_fill #FF0000 ;# Color: Bit fill color for log. 0 (Non-selected) + public common zero_outline #FF8888 ;# Color: Bit outline color for log. 0 (Non-selected) + public common zero_a_fill #FF8888 ;# Color: Bit fill color for log. 0 (Selected bit) + public common zero_a_outline #FFDDDD ;# Color: Bit outline color for log. 0 (Selected bit) + + public common one_fill #00FF00 ;# Color: Bit color for log. 1 (Non-selected) + public common one_outline #88FF88 ;# Color: Bit outline color for log. 1 (Non-selected) + public common one_a_fill #88FF88 ;# Color: Bit fill color for log. 1 (Selected bit) + public common one_a_outline #DDFFDD ;# Color: Bit outline color for log. 1 (Selected bit) # Font: Normal font for canvas widget - common bitmap_n_font [font create \ + public common bitmap_n_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ ] # Font: Bold font for canvas widget - common bitmap_b_font [font create \ + public common bitmap_b_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ diff --git a/lib/simulator/engine/engine_auxiliary_alo_functions.tcl b/lib/simulator/engine/engine_auxiliary_alo_functions.tcl index 8929268..44392c3 100644 --- a/lib/simulator/engine/engine_auxiliary_alo_functions.tcl +++ b/lib/simulator/engine/engine_auxiliary_alo_functions.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -53,9 +56,10 @@ private method undefined_octet {} { } ## Add value to accumulator and affect PSW flags - # @parm Int val - value to add + # @parm Int val - value to add + # @parm Int carry - addtional value to add (ment for the Carry flag) # @return void -private method alo_add {val} { +private method alo_add {val {carry 0}} { # Adjust stepback stack if {${::Simulator::reverse_run_steps}} { @@ -69,7 +73,7 @@ private method alo_add {val} { set val_l [expr {$val & 15}] ;# Low-order nibble of val # Compute low-order nibble of result - set result [expr {$val_l + $A_l}] + set result [expr {$val_l + $A_l + $carry}] # Flag AC if {$result > 15} { @@ -109,10 +113,7 @@ private method alo_add {val} { # @parm Int val - value to add # @return void private method alo_addc {val} { - if {[getBit $symbol(C)]} { - incr val - } - alo_add $val + alo_add $val [getBit $symbol(C)] } ## Subtract tegister from ACC with borrow and affect PSW flags @@ -126,8 +127,9 @@ private method alo_subb {val} { } # Flag PSW.C + set carry 0 if {[getBit $symbol(C)]} { - incr val + set carry 1 } # Local variables @@ -137,7 +139,7 @@ private method alo_subb {val} { set val_l [expr {$val & 15}] ;# Low-order nibble of val # Compute low-order nibble of result - set result_l [expr {$A_l - $val_l}] + set result_l [expr {$A_l - $val_l - $carry}] # Flag AC if {$result_l < 0} { diff --git a/lib/simulator/engine/engine_backward_stepping.tcl b/lib/simulator/engine/engine_backward_stepping.tcl index 7914c9b..af5e7d9 100644 --- a/lib/simulator/engine/engine_backward_stepping.tcl +++ b/lib/simulator/engine/engine_backward_stepping.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_control.tcl b/lib/simulator/engine/engine_control.tcl index 6b76b5a..33fbe84 100644 --- a/lib/simulator/engine/engine_control.tcl +++ b/lib/simulator/engine/engine_control.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_core.tcl b/lib/simulator/engine/engine_core.tcl index 0c78129..6b169f1 100644 --- a/lib/simulator/engine/engine_core.tcl +++ b/lib/simulator/engine/engine_core.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -58,20 +61,20 @@ class Simulator_ENGINE { inherit Hibernate ;# Import hibernation facility ## COMMON - common symbol ;# Array of SFR symbolic names (eg. $symbol(P0) == "80") - common PIN ;# Array describing pins with some special function - common PORT_LATCHES ;# List: Port latch registers - common GUI_UPDATE_INT 66;# Int: Time interval [ms] in which the GUI is regulary updated in the run mode + public common symbol ;# Array of SFR symbolic names (eg. $symbol(P0) == "80") + public common PIN ;# Array describing pins with some special function + public common PORT_LATCHES ;# List: Port latch registers + public common GUI_UPDATE_INT 66;# Int: Time interval [ms] in which the GUI is regulary updated in the run mode # Default values for SFR (values to set after reset) - common reset_reg_values { + public common reset_reg_values { {A 0} {B 0} {DP0L 0} {DP0H 0} {IE 0} {IP 0} {PSW 0} {TCON 0} {TMOD 0} {TH0 0} {TH1 0} {TL0 0} {TL1 0} {PCON 0} {SP 7} } # Default values for special (uC dependend) SFR (values to set after reset) - common reset_reg_values_1 { + public common reset_reg_values_1 { {T2CON 0} {T2MOD 0} {RCAP2L 0} {RCAP2H 0} {TL2 0} {TH2 0} {AUXR1 0} {ACSR 0} {AUXR 0} {P0 255} {P1 255} {P2 255} diff --git a/lib/simulator/engine/engine_external_interface_management.tcl b/lib/simulator/engine/engine_external_interface_management.tcl index 5a1f220..028e824 100644 --- a/lib/simulator/engine/engine_external_interface_management.tcl +++ b/lib/simulator/engine/engine_external_interface_management.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -1100,8 +1103,8 @@ public method getTime {} { } # Local variables - set us [expr {($ms % 1000)}] ;# Number of micro seconds - set ms [expr {$ms / 1000}] ;# Number of mili seconds + set us [expr {($ms % 1000)}] ;# Number of microseconds + set ms [expr {$ms / 1000}] ;# Number of miliseconds set s [expr {int($s)}] ;# Number of seconds set h [expr {$s / 3600}] ;# Number of hours set s [expr {$s % 3600}] @@ -1111,7 +1114,7 @@ public method getTime {} { # Adjust length of nano-seconds string set len [string length $ns] if {$len < 3} { - set ns_s "[string repeat { } [expr {3 - $len}]]$ns" + set ns_s "[string repeat {0} [expr {3 - $len}]]$ns" } else { set ns_s $ns } @@ -1165,11 +1168,7 @@ public method getTime {} { } # Append micro-seconds if {$us > 0 || $result != {}} { - append result " ${us_s}µs" - } - # Append nano-seconds - if {$ns > 0 || $result != {}} { - append result " ${ns_s}ns" + append result " ${us_s}.${ns_s}µs" } # Done ... diff --git a/lib/simulator/engine/engine_hibernation.tcl b/lib/simulator/engine/engine_hibernation.tcl index d5a5faa..b34d828 100644 --- a/lib/simulator/engine/engine_hibernation.tcl +++ b/lib/simulator/engine/engine_hibernation.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_initialization_cleanup.tcl b/lib/simulator/engine/engine_initialization_cleanup.tcl index 8865dd2..d0a238c 100644 --- a/lib/simulator/engine/engine_initialization_cleanup.tcl +++ b/lib/simulator/engine/engine_initialization_cleanup.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_instructions.tcl b/lib/simulator/engine/engine_instructions.tcl index 19c45af..a606f93 100644 --- a/lib/simulator/engine/engine_instructions.tcl +++ b/lib/simulator/engine/engine_instructions.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -1014,6 +1017,7 @@ private method ins_movx {opr0 opr1} { # Adjust engine configuration set eeprom_WR_time 1 set eeprom_WR 1 + $this simulator_GUI_invoke_write_to_eeprom } return diff --git a/lib/simulator/engine/engine_mcu_configuration.tcl b/lib/simulator/engine/engine_mcu_configuration.tcl index 2226a7d..3fc12dd 100644 --- a/lib/simulator/engine/engine_mcu_configuration.tcl +++ b/lib/simulator/engine/engine_mcu_configuration.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_memory_management.tcl b/lib/simulator/engine/engine_memory_management.tcl index e3a5828..5d74906 100644 --- a/lib/simulator/engine/engine_memory_management.tcl +++ b/lib/simulator/engine/engine_memory_management.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_opcodes.tcl b/lib/simulator/engine/engine_opcodes.tcl index e06dc12..17bca3d 100644 --- a/lib/simulator/engine/engine_opcodes.tcl +++ b/lib/simulator/engine/engine_opcodes.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_text_based_interface.tcl b/lib/simulator/engine/engine_text_based_interface.tcl index 0b6448c..ef61a61 100644 --- a/lib/simulator/engine/engine_text_based_interface.tcl +++ b/lib/simulator/engine/engine_text_based_interface.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2011-2011 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -109,7 +112,7 @@ namespace eval SimulatorEngineCLI { class SimEngineWrapper { inherit Simulator_ENGINE Pale - common changed_registers [list] + public common changed_registers [list] # TODO: get rid of these variables: public variable procData {} diff --git a/lib/simulator/engine/engine_virtual_hw_controller.tcl b/lib/simulator/engine/engine_virtual_hw_controller.tcl index a13c9b9..3413eb3 100644 --- a/lib/simulator/engine/engine_virtual_hw_controller.tcl +++ b/lib/simulator/engine/engine_virtual_hw_controller.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/hibernate.tcl b/lib/simulator/hibernate.tcl index 0cd090e..7966b3b 100644 --- a/lib/simulator/hibernate.tcl +++ b/lib/simulator/hibernate.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -46,34 +49,34 @@ set _HIBERNATE_TCL _ class Hibernate { ## COMMON - common version {1.0} ;# Float: Hibernate facility version - common hib_progress_d 0 ;# Int: Variable for hibernation progress dialog -- Memory - common hib_progress_s 0 ;# Int: Variable for hibernation progress dialog -- Program steps - common hib_abort 0 ;# Bool: Abort hibernation process - common expected ;# String: Expected next XML element - common take_data ;# Bool: Take element data on next parsing cycle - common current_element {} ;# String: Current XML element -- auxiliary variable for XML parser handler - common xml_tmp {} ;# Mixed: Auxiliary variable of any kind for XML parser handler - common source_file {} ;# String: Filename of the file from which the given file was generated - common exclude_stepback 0 ;# Bool: Exclude program steps - common counter 0 ;# Int: Counter of iterations for resume function for XML parser handler - common xdata_size 0 ;# Int: Size of external data memory - common eeprom_size 0 ;# Int: Size of data EEPROM - common sbs_length 0 ;# Int: Size of stepback stack - common file_variable ;# Bool: Checkbox variable for "Different filename" - common mcu_variable ;# Bool: Checkbox variable for "Different processor" - common xdata_variable ;# Int: RadioButton variable for "Different XDATA size" - common md5_variable ;# Bool: Checkbox variable for "Different MD5 hash" + public common version {1.0} ;# Float: Hibernate facility version + public common hib_progress_d 0 ;# Int: Variable for hibernation progress dialog -- Memory + public common hib_progress_s 0 ;# Int: Variable for hibernation progress dialog -- Program steps + public common hib_abort 0 ;# Bool: Abort hibernation process + public common expected ;# String: Expected next XML element + public common take_data ;# Bool: Take element data on next parsing cycle + public common current_element {} ;# String: Current XML element -- auxiliary variable for XML parser handler + public common xml_tmp {} ;# Mixed: Auxiliary variable of any kind for XML parser handler + public common source_file {} ;# String: Filename of the file from which the given file was generated + public common exclude_stepback 0 ;# Bool: Exclude program steps + public common counter 0 ;# Int: Counter of iterations for resume function for XML parser handler + public common xdata_size 0 ;# Int: Size of external data memory + public common eeprom_size 0 ;# Int: Size of data EEPROM + public common sbs_length 0 ;# Int: Size of stepback stack + public common file_variable ;# Bool: Checkbox variable for "Different filename" + public common mcu_variable ;# Bool: Checkbox variable for "Different processor" + public common xdata_variable ;# Int: RadioButton variable for "Different XDATA size" + public common md5_variable ;# Bool: Checkbox variable for "Different MD5 hash" if {$::GUI_AVAILABLE} { # Big font for dialog "Program resumption" - common big_font [font create \ + public common big_font [font create \ -family {helvetica} \ -weight bold \ -size [expr {int(-35 * $::font_size_factor)}] \ ] # Normal font for dialog "Program resumption" - common text_font [font create \ + public common text_font [font create \ -family {helvetica} \ -weight bold \ -size [expr {int(-14 * $::font_size_factor)}] \ diff --git a/lib/simulator/interruptmonitor.tcl b/lib/simulator/interruptmonitor.tcl index 510b070..6ab3335 100644 --- a/lib/simulator/interruptmonitor.tcl +++ b/lib/simulator/interruptmonitor.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,34 +36,34 @@ set _INTERRUPTMONITOR_TCL _ class InterruptMonitor { ## COMMON - common geometry ${::CONFIG(INTR_MON_GEOMETRY)} ;# Last window geometry - common intr_mon_count 0 ;# Counter of intances - common bg_color {#0088FF} ;# Color for highlighted background + public common geometry ${::CONFIG(INTR_MON_GEOMETRY)} ;# Last window geometry + public common intr_mon_count 0 ;# Counter of intances + public common bg_color {#0088FF} ;# Color for highlighted background # Small header font - common header_font [font create \ + public common header_font [font create \ -size [expr {int(-17 * $::font_size_factor)}] \ -weight bold \ -family {helvetica} \ ] # Big header font - common header_font_big [font create \ + public common header_font_big [font create \ -size [expr {int(-21 * $::font_size_factor)}] \ -weight bold \ -family {helvetica} \ ] # Common label font - common lbl_font [font create \ + public common lbl_font [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -family {helvetica} \ ] # Font for value labels - common val_font [font create \ + public common val_font [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ -family {helvetica} \ ] # Font for value labels - underline - common val_font_under [font create \ + public common val_font_under [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ -family {helvetica} \ diff --git a/lib/simulator/sfrmap.tcl b/lib/simulator/sfrmap.tcl index 65e5806..5a3895c 100644 --- a/lib/simulator/sfrmap.tcl +++ b/lib/simulator/sfrmap.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,7 +36,7 @@ set _SFRMAP_TCL _ class SFRMap { ## COMMON - common sfrmap_count 0 ;# Int: Counter of object instances + public common sfrmap_count 0 ;# Int: Counter of object instances ## PRIVATE private variable dialog_opened 0 ;# Bool: Dialog window opened diff --git a/lib/simulator/simulator.tcl b/lib/simulator/simulator.tcl index 8804022..e85ea6b 100644 --- a/lib/simulator/simulator.tcl +++ b/lib/simulator/simulator.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -53,51 +56,51 @@ class Simulator { inherit Simulator_GUI Simulator_ENGINE InterruptMonitor SFRMap Stopwatch BitMap StackMonitor UARTMonitor ## COMMON - common highlight_color {#DD8800} ;# Foreground color for changed registers - common normal_color {#000000} ;# Foreground color for unchanged registers - common error_dialog_project ;# Object: $this for current addressing error dialog - common not_again_val 0 ;# Bool: Value of checkbutton "Do not shot this dialog again" - - common reverse_run_steps 10 ;# Int: Number of steps which can be taken back - common ignore_stack_overflow 0 ;# Bool: Do not show "Stack overflow" dialog - common ignore_stack_underflow 0 ;# Bool: Do not show "Stack underflow" dialog - common ignore_watchdog_reset 0 ;# Bool: Ignore reset invoked by watchdog overflow - common ignore_read_from_wr_only 0 ;# Bool: Ignore reading from read only register - common ignore_invalid_reti 0 ;# Bool: Ignore invalid return fom interrupt - common ignore_invalid_ins 0 ;# Bool: Ignore invalid instructions - common ignore_invalid_IDATA 0 ;# Bool: Ignore access to unimplemented IDATA memory - common ignore_invalid_EDATA 0 ;# Bool: Ignore access to unimplemented EDATA memory - common ignore_invalid_XDATA 0 ;# Bool: Ignore access to unimplemented XDATA memory - common ignore_invalid_BIT 0 ;# Bool: Ignore access to unimplemented bit - common ignore_invalid_CODE 0 ;# Bool: Ignore access to unimplemented CODE memory - common ignore_invalid_USB 0 ;# Bool: Ignore "UART: Frame discarded" - common ignore_invalid_UMC 0 ;# Bool: Ignore "UART mode has been changed while UART was engaged" - common ignore_invalid_TMC 0 ;# Bool: Ignore "Timer mode has been changed while timer was running" - common ignore_invalid_brkpoints 0 ;# Bool: Do not warn user about invalid (unreachable) breakpoints - - common ignore_EEPROM_WR_fail 0 ;# Bool: Ignore EEPROM write failure (due to EECON.WRTINH, EECON.RDYBSY or EECON.EEMWE) - common ignore_EEPROM_WR_abort 0 ;# Bool: Ignore EEPROM write cycle abort - common undefined_value 2 ;# Int: 2 == Random; 1 == 255; 0 == 0 + public common highlight_color {#DD8800} ;# Foreground color for changed registers + public common normal_color {#000000} ;# Foreground color for unchanged registers + public common error_dialog_project ;# Object: $this for current addressing error dialog + public common not_again_val 0 ;# Bool: Value of checkbutton "Do not shot this dialog again" + + public common reverse_run_steps 10 ;# Int: Number of steps which can be taken back + public common ignore_stack_overflow 0 ;# Bool: Do not show "Stack overflow" dialog + public common ignore_stack_underflow 0 ;# Bool: Do not show "Stack underflow" dialog + public common ignore_watchdog_reset 0 ;# Bool: Ignore reset invoked by watchdog overflow + public common ignore_read_from_wr_only 0 ;# Bool: Ignore reading from read only register + public common ignore_invalid_reti 0 ;# Bool: Ignore invalid return fom interrupt + public common ignore_invalid_ins 0 ;# Bool: Ignore invalid instructions + public common ignore_invalid_IDATA 0 ;# Bool: Ignore access to unimplemented IDATA memory + public common ignore_invalid_EDATA 0 ;# Bool: Ignore access to unimplemented EDATA memory + public common ignore_invalid_XDATA 0 ;# Bool: Ignore access to unimplemented XDATA memory + public common ignore_invalid_BIT 0 ;# Bool: Ignore access to unimplemented bit + public common ignore_invalid_CODE 0 ;# Bool: Ignore access to unimplemented CODE memory + public common ignore_invalid_USB 0 ;# Bool: Ignore "UART: Frame discarded" + public common ignore_invalid_UMC 0 ;# Bool: Ignore "UART mode has been changed while UART was engaged" + public common ignore_invalid_TMC 0 ;# Bool: Ignore "Timer mode has been changed while timer was running" + public common ignore_invalid_brkpoints 0 ;# Bool: Do not warn user about invalid (unreachable) breakpoints + + public common ignore_EEPROM_WR_fail 0 ;# Bool: Ignore EEPROM write failure (due to EECON.WRTINH, EECON.RDYBSY or EECON.EEMWE) + public common ignore_EEPROM_WR_abort 0 ;# Bool: Ignore EEPROM write cycle abort + public common undefined_value 2 ;# Int: 2 == Random; 1 == 255; 0 == 0 # Normal font for error dialog - common error_normal_font [font create \ + public common error_normal_font [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ ] # Bold font for error dialog - common error_bold_font [font create \ + public common error_bold_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight bold \ ] # Header font for error dialog - common error_header_font [font create \ + public common error_header_font [font create \ -family {helvetica} \ -size [expr {int(-17 * $::font_size_factor)}] \ -weight bold \ ] # Main header font - common error_main_header [font create \ + public common error_main_header [font create \ -family {helvetica} \ -size [expr {int(-20 * $::font_size_factor)}] \ -weight bold \ diff --git a/lib/simulator/simulator_gui.tcl b/lib/simulator/simulator_gui.tcl index 9ae70b9..52adb34 100644 --- a/lib/simulator/simulator_gui.tcl +++ b/lib/simulator/simulator_gui.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -40,20 +43,20 @@ set _SIMULATOR_GUI_TCL _ class Simulator_GUI { ## COMMON - common sim_gui_count 0 ;# Counter of instances - common name_color {#0000DD} ;# Color for register name labels (eg. 'SP') - common name_nr_color {#8800DD} ;# Color for not-register name labels (eg. 'Clock') + public common sim_gui_count 0 ;# Counter of instances + public common name_color {#0000DD} ;# Color for register name labels (eg. 'SP') + public common name_nr_color {#8800DD} ;# Color for not-register name labels (eg. 'Clock') - common on_color {#00CC00} ;# Foreground color for bits in state 1 (for bit maps) - common off_color {#DD0000} ;# Foreground color for bits in state 0 (for bit maps) + public common on_color {#00CC00} ;# Foreground color for bits in state 1 (for bit maps) + public common off_color {#DD0000} ;# Foreground color for bits in state 0 (for bit maps) # Font for bit labels (eg. 'EA') - common bitfont [font create \ + public common bitfont [font create \ -family {helvetica} \ -size [expr {int(-11 * $::font_size_factor)}] \ -weight [expr {$::MICROSOFT_WINDOWS ? "normal" : "bold"}] \ ] # Same as $bitfont but underlined - common bitfont_under [font create \ + public common bitfont_under [font create \ -family {helvetica} \ -size [expr {int(-11 * $::font_size_factor)}] \ -underline 1 \ @@ -61,9 +64,9 @@ class Simulator_GUI { ] # Color for small labels (eg. 'HEX') - common small_color {#5599BB} + public common small_color {#5599BB} # Font for small labels (eg. 'OCT') - common smallfont $::smallfont + public common smallfont $::smallfont if {$::MICROSOFT_WINDOWS} { ;# On MS Windows we need some smaller font to fit in set smallfont [font create \ -size [expr {int(-9 * $::font_size_factor)}] \ @@ -72,18 +75,18 @@ class Simulator_GUI { ] } - common hcolor {#FFAA00} ;# Highlight foreground color for entry widgets - common hbcolor {#CCCCCC} ;# Highlight background color for entry widgets + public common hcolor {#FFAA00} ;# Highlight foreground color for entry widgets + public common hbcolor {#CCCCCC} ;# Highlight background color for entry widgets # Font for other memory entries (eg. PCON) - common entry_font [font create \ + public common entry_font [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -family $::DEFAULT_FIXED_FONT \ -weight [expr {$::MICROSOFT_WINDOWS ? "normal" : "bold"}] \ ] # Postfixes for entry text variables - common entry_variables { + public common entry_variables { B_char A_bin IP DPH T0 T1 DPL PCON P1_bin P3_bin TMOD A_hex PC_dec B_oct SCON B_dec A_char TL0 TL1 DATA SP P0 P1 B_bin P2 P3 PC_hex @@ -588,7 +591,7 @@ class Simulator_GUI { {Interrupt 0 Edge Flag\nCleared by hardware when interrupt is processed if edge-triggered (see IT0).\nSet by hardware when external interrupt is detected on INT0# pin.} {Interrupt 0 Type Control Bit\nClear to select low level active (level triggered) for external interrupt 0 (INT0#).\nSet to select falling edge active (edge triggered) for external interrupt 0.} } - create_bitmap_register $timers_frame_reg 2 TMOD {G1 CT1 M11 M10 G0 CT0 M01 M00} 1 { + create_bitmap_register $timers_frame_reg 2 TMOD {G1 CT1 M11 M01 G0 CT0 M10 M00} 1 { {Timer 1 Gating Control Bit} {Timer 1 Counter/Timer Select Bit} {Timer 1 Mode Select Bit} @@ -611,7 +614,7 @@ class Simulator_GUI { # Create hexadecimal entries for registers: TCON TMOD foreach reg {TCON TMOD} \ addr {136 137} \ - bits {{TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0} {G1 CT1 M11 M10 G0 CT0 M01 M00}} \ + bits {{TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0} {G1 CT1 M11 M01 G0 CT0 M10 M00}} \ stip { {SFR 0x88: Timer/Counter control register} {SFR 0x89: Timer/Counter mode control register} @@ -1521,6 +1524,7 @@ class Simulator_GUI { -style TEntry \ -textvariable ::Simulator_GUI::ENV${obj_idx}_TIME \ -state readonly \ + -justify right \ -font [font create -size [expr {int(-12 * $::font_size_factor)}] -family $::DEFAULT_FIXED_FONT] \ ] setStatusTip -widget $frame1_top_right_1._TIME_e -text [mc "Overall time"] @@ -2418,10 +2422,9 @@ class Simulator_GUI { # Create progress bar set ::Simulator_GUI::ENV${obj_idx}_EEPROM_prg 0 - set eeprom_progressbar [ttk::progressbar \ + set eeprom_progressbar [ProgressBar \ $eeprom_operation_frame.progressbar \ - -mode determinate \ - -orient horizontal \ + -type normal \ -maximum 100 \ -variable ::Simulator_GUI::ENV${obj_idx}_EEPROM_prg \ ] diff --git a/lib/simulator/stackmonitor.tcl b/lib/simulator/stackmonitor.tcl index b51fabb..ca99fc8 100644 --- a/lib/simulator/stackmonitor.tcl +++ b/lib/simulator/stackmonitor.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -35,18 +38,18 @@ set _STACKMONITOR_TCL _ class StackMonitor { ## COMMON - common push_value {} ;# String: Value to PUSH onto the stack by user - common stack_mon_count 0 ;# Int: Counter of intances - common geometry ${::CONFIG(STACK_MON_GEOMETRY)} ;# Geometry: Last window geometry - common collapsed ${::CONFIG(STACK_MON_COLLAPSED)};# Bool: Bottom bar hidden + public common push_value {} ;# String: Value to PUSH onto the stack by user + public common stack_mon_count 0 ;# Int: Counter of intances + public common geometry ${::CONFIG(STACK_MON_GEOMETRY)} ;# Geometry: Last window geometry + public common collapsed ${::CONFIG(STACK_MON_COLLAPSED)};# Bool: Bottom bar hidden # Font for the text widget representing the stack (bold) - common font0 [font create \ + public common font0 [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ ] # Font for the text widget representing the stack (normal) - common font1 [font create \ + public common font1 [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight normal \ diff --git a/lib/simulator/stopwatch.tcl b/lib/simulator/stopwatch.tcl index 353ac41..824e9b9 100644 --- a/lib/simulator/stopwatch.tcl +++ b/lib/simulator/stopwatch.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,16 +36,16 @@ set _STOPWATCH_TCL _ class Stopwatch { ## Class variables - common stopw_count 0 ;# Int: Counter of class instances + public common stopw_count 0 ;# Int: Counter of class instances # List: Short names of stopwatch entries - common stats_keys { + public common stats_keys { US CC IC IP PB IN SC RT RI BR } # List: Full names of stopwatch entries - common stats_names { + public common stats_names { {Micro seconds} {Clock cycles} {Instruction cycles} {Instructions passed} {Program bytes} {Interrupts} {Subprogram calls} {RET} {RETI} diff --git a/lib/simulator/uart_monitor.tcl b/lib/simulator/uart_monitor.tcl index 28d3b48..d6febbc 100644 --- a/lib/simulator/uart_monitor.tcl +++ b/lib/simulator/uart_monitor.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2011 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,46 +36,46 @@ set _UART_MONITOR_TCL _ class UARTMonitor { - common geometry ${::CONFIG(UART_MON_GEOMETRY)} ;# Last window geometry - common uart_mon_count 0 ;# Counter of intances + public common geometry ${::CONFIG(UART_MON_GEOMETRY)} ;# Last window geometry + public common uart_mon_count 0 ;# Counter of intances # Font: Tiny normal font - common tiny_font [font create \ + public common tiny_font [font create \ -family {helvetica} \ -size [expr {int(-9 * $::font_size_factor)}] \ -weight {normal} \ ] # Font: Big bold font - common big_font [font create \ + public common big_font [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight {bold} \ ] # Font: Normal font - common normal_font [font create \ + public common normal_font [font create \ -family {helvetica} \ -size [expr {int(-11 * $::font_size_factor)}] \ -weight {normal} \ ] # Font: - common normal_fixed_font [font create \ + public common normal_fixed_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-11 * $::font_size_factor)}] \ -weight {normal} \ ] # Font: - common bold_fixed_font [font create \ + public common bold_fixed_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-11 * $::font_size_factor)}] \ -weight {bold} \ ] - common rect_size 12 - common empty_fill {#888888} - common empty_outline {#AAAAAA} + public common rect_size 12 + public common empty_fill {#888888} + public common empty_outline {#AAAAAA} - common MAX_G_LOG_LENGTH 100 ;# Int: - common MAX_D_LOG_LENGTH 100 ;# Int: + public common MAX_G_LOG_LENGTH 100 ;# Int: + public common MAX_D_LOG_LENGTH 100 ;# Int: private variable dialog_opened 0 ;# Bool: Dialog window opened private variable win ;# Widget: Dialog window |