conf
This command (without a subcommand) prints out configuration of the simulator:0> conf ucsim version 0.9.10 Type of microcontroller: C52 CMOS cmos Controller has 14 hardware element(s). on cpu[0] on simif[0] off vcd[0] on timer0[0] on timer1[1] on uart[0] on dreg[0] on dport[0] on port[0] on port[1] on port[2] on port[3] on irq[0] on timer2[2] 0>The first line contains version number of the program. The second line informs about type of the simulated microcontroller. The third line prints out how many hardware elements are simulated.conf types
Prints out all available CPU types like -H option of the simulator.0> conf types Parameter Family Subtype C52 mcs52 cmos 51 mcs51 hmos 8051 mcs51 hmos 8751 mcs51 hmos C51 mcs51 cmos 80C51 mcs51 cmos 87C51 mcs51 cmos 31 mcs51 hmos 8031 mcs51 hmos C31 mcs51 cmos 80C31 mcs51 cmos 52 mcs52 hmos 8052 mcs51 hmos 8752 mcs51 hmos 80C52 mcs51 cmos 87C52 mcs51 cmos 32 mcs51 hmos 8032 mcs51 hmos C32 mcs51 cmos 80C32 mcs51 cmos F380 Silabs F380 cmos 51R Intel mcs51R cmos 51RA Intel mcs51R cmos 51RB Intel mcs51R cmos 51RC Intel mcs51R cmos C51R Intel mcs51R cmos C51RA Intel mcs51R cmos C51RB Intel mcs51R cmos C51RC Intel mcs51R cmos 89C51R 89C51R cmos C521 AMD 80C521 cmos 521 AMD 80C521 cmos 251 Intel mcs251 cmos C251 Intel mcs251 cmos 517 Siemens C517 cmos C517 Siemens C517 cmos 88X Infineon XC88[68] cmos 886 Infineon XC88[68] cmos 888 Infineon XC88[68] cmos XC88X Infineon XC88[68] cmos XC886 Infineon XC88[68] cmos XC888 Infineon XC88[68] cmos DS320 Dallas DS80C320 cmos DS390 Dallas DS80C390 cmos DS390F Dallas DS80C390F cmos 0>conf objects
This command is for development only.
0> version 0.9.10 0>
If a command name is given as a parameter then µCsim prints out all commands that has similar names:
0> ? s show subcommand Generic command for showing things about set subcommand Set value of different objects stop Stop simulation. step [number [unit]] Execute one or specified instructions. state State of microcontroller 0> ? s o show option [name] Show internal data of options set option name|nr value Set value of an option 0>Some commands have more than one name, which can produce interesting result:
0> ? t r timer delete id Delete a timer timer start id Start a timer 0>It looks like the names of the listed subcommands start with no "r" but take a closer look at those commands:
0> ? t d timer delete id Delete a timer Alternate name(s) of command: delete remove 0> ? t start timer start id Start a timer Alternate name(s) of command: run start 0>
If parameter is unique name of a command then long description of the command is printed out.
If the networks server function is not turned off by -z option and some active connections are opened then quit will close the current console only and will not finish µCsim. Quit command must be used on all consoles to completly exit, quit on last console will exit the program.
Note that if the -Z option was used at invocation, then the quit command does not terminate the simulator program. In this case kill command can be used to terminate the simulator. See for more information about using multiple consoles.
$ ucsim_51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> quit 0> $
$ cat test.cmd conf quit get opt $ ucsim_51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> exec "test.cmd" 2> conf ucsim version 0.9.10 Type of microcontroller: C52 CMOS cmos Controller has 14 hardware element(s). on cpu[0] on simif[0] off vcd[0] on timer0[0] on timer1[1] on uart[0] on dreg[0] on dport[0] on port[0] on port[1] on port[2] on port[3] on irq[0] on timer2[2] 2> quit 0> 2> 0>
0> expr 1+2 3 0> expr xram[256*dph+dpl]=&SP 129 0>Following formats are supported:
0> expr /bxc 123 00000000000000000000000001111011 7b '{' 0>
show copying
show warranty
show option
show error
show copying
This command can be used to list licensing information. It is the first 10 points of the version 2 of GNU General Public License. If you do not accept GPL, simply do not use the program.
show warranty
This command prints out the last 2 points of the license ("NO WARRANTY" message).
show option
This command is for development only.
show error
Errors or warnings are events that can happen in the simulated system during simulation. Report of that events can be turned on or off using set error command. Errors are organized in parent-child relationship. Children are listed under the parent:0> show error error: non-classified [on/ON] error: stack [on/ON] error: stack_overflow [unset/ON] error: memory [off/OFF] error: invalid_address [unset/OFF] error: non_decoded [unset/OFF] error: unknown_code [off/OFF] 0>First element is the type (Error or Warning). An error stops the simulation. A warning is just reported and simulation goes on. Next element is the name of the error. Last element shows current value and state. Value can be:If state is ON and the event happens, it is reported. If state is OFF then the event is silently ignored.
- on
- state is ON
- off
- state is OFF
- unset
- state is inherited from the parent.
get sfr address...
This command can be used to check the values of SFR location(s) if SFR exists in the simulated memory. Note that dump memory or ds can be used as well.Parameters are interpreted as SFR names or addresses, and the values of addressed locations are dumped out.
$ ucsim_51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> get sfr PCON P1 0 0x80 kahd SCON 256 0x87[135:1] 0b0000000- 0x00000000 '.................' 0 0x90[144:1] 0b1111111- 0x0000007f '..................' 127 Warning: Invalid address 0 0x80[128:1] 0b1111111- 0x00000000 '................' 0 Warning: Invalid address kahd 0x98[152:1] 0b0000000- 0x00000000 '...................' 0 Warning: Invalid address 256 0>Some microcontrollers do not have SFR address space.$ ucsim_z80 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> get sfr 0 Error: No SFR 0>
get option [name]
Get actual value of option(s). Some options can be set by set option to modify behaviour of the simulator. Using get option you can get actual value of these options. If you use this command without a parameter you get list of all options known by the program. In this way, you can figure out which options can be used.$ ucsim_51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> get option 0. analyser(by mcs51_controller): FALSE - Analyse and label code 1. analyzer(by mcs51_controller): FALSE - Analyze and label code 2. beep_break(by s51): FALSE - Beep at breakpoint hit (-B) 3. black_and_white(by s51): FALSE - Non-color console (-b) 4. color_answer(by s51): "bwhite:black" - Answer color 5. color_bg(by s51): "black" - Default background color 6. color_btn_off(by s51): "white:black" - OFF button color on FPGA display 7. color_btn_on(by s51): "bcyan:black" - ON button color on FPGA display 8. color_command(by s51): "green:black" - Color of entered command 9. color_comment(by s51): "magenta:black" - Comment color in disassembly 10. color_debug(by s51): "magenta:black" - Color of debug messages 11. color_dump_address(by s51): "byellow:black" - Address color in dump 12. color_dump_char(by s51): "green:black" - Text color in dump 13. color_dump_label(by s51): "bgreen:black" - Label color in dump 14. color_dump_number(by s51): "white:black" - Value color in dump 15. color_error(by s51): "red:black" - Text color in error messages 16. color_fg(by s51): "white" - Default foreground color 17. color_gray_answer(by s51): "white:black" - Gray answer color 18. color_led_off(by s51): "white:black" - OFF LED color on FPGA display 19. color_led_on(by s51): "b:green:black" - ON LED color on FPGA display 20. color_prompt(by s51): "bwhite:black" - Prompt color 21. color_prompt_console(by s51): "yellow:black" - Color of console number in prompt 22. color_result(by s51): "byellow:black" - Result of expression 23. color_sw_off(by s51): "white:black" - OFF switch color on FPGA display 24. color_sw_on(by s51): "bcyan:black" - ON switch color on FPGA display 25. color_ui_bit0(by s51): "white:black" - Bit 0 color on UI display 26. color_ui_bit1(by s51): "bred:black" - Bit 1 color on UI display 27. color_ui_label(by s51): "white:black" - Label color on UI display 28. color_ui_mitem(by s51): "bwhite:black" - Menu-item color on UI display 29. color_ui_mkey(by s51): "b:yellow:black" - Menu-key color on UI display 30. color_ui_run(by s51): "black:green" - Run state color on UI display 31. color_ui_stop(by s51): "white:red" - Stop state color on UI display 32. color_ui_time(by s51): "bblue:black" - Color of time-value on UI display 33. color_ui_title(by s51): "bmagenta:black" - Title color on UI display 37. debug(by console0): FALSE - Debug messages to console0 38. debug(by s51): FALSE - Print debug messages (-V) 39. echo_script(by s51): FALSE - Print breakpoint script before execute 41. expression_format(by s51): "d" - Format specifier to print expression result 42. force_colors(by s51): TRUE - Force use colored output (-A) 44. irq_stop(by mcs51_controller): FALSE - Stop when IRQ accepted 45. label_width(by s51): -1 - Space to allow for labels in dumps and disassembly (-1 for auto) 46. null_prompt(by s51): FALSE - Use \0 as prompt (-P) 47. prompt(by console0): "" - Prompt string of console0 48. prompt(by s51): (null) - String of prompt (-p) 50. selfjump_stop(by mcs51_controller): FALSE - Stop when jump branches to itself 58. writable_flash(by s51): FALSE - Use writable flash chip (-w) 59. xtal(by s51): 0.000 - Frequency of XTAL in Hz 0>The first element of the list is the number of the option. It is followed by the name of the option (debug, irq_stop, etc.). The number or the name can be used to identify the option in get option and set option commands. The next element shows which part of the simulator created the option.Next element of the list is the value of the option. It can be an integer or a floating point number, a string or a boolean value.
Last part describes the option.
Some options can have same name. An example is the debug option. One is created by the application to store value given by -V (see invocation). This will be used as default value when a new instance of a console is created:
$ cat getopt.cmd get opt debug $ ucsim_51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> get option debug 37. debug(by console0): FALSE - Debug messages to console0 38. debug(by s51): FALSE - Print debug messages (-V) 0> set opt 38 1 0> get opt debug 37. debug(by console0): FALSE - Debug messages to console0 38. debug(by s51): TRUE - Print debug messages (-V) 0> exec "getopt.cmd" 2> get opt debug 37. debug(by console2): TRUE - Debug messages to console2 38. debug(by console0): FALSE - Debug messages to console0 39. debug(by s51): TRUE - Print debug messages (-V) 0> 2> 0>
get error
Same as show error.
set option
set error
set memory
set bit
set hardware
set option name|nr value
Set option value. Options described at (get option) command can be set using this command. First parameter must be an option name or number and second the new value. The interpretation of the value depends on type of the option. The value for a boolean type of option is interpreted as follows: if first character of the value is one of 1, t, T, y, Y, then value will be TRUE; otherwise it will be FALSE.
$ ucsim_51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> get option debug 37. debug(by console0): FALSE - Debug messages to console0 38. debug(by s51): FALSE - Print debug messages (-V) 0> set opt debug 1 0> get opt debug 37. debug(by console0): TRUE - Debug messages to console0 38. debug(by s51): FALSE - Print debug messages (-V) 0> set opt 38 t 0> get opt debug 37. debug(by console0): TRUE - Debug messages to console0 38. debug(by s51): TRUE - Print debug messages (-V) 0>
set error error_name on|off|unset
This command can be used to set whether an error event should be reported or not. The current settings can be retrieved by show error command.
set console interactive [on|off]|noninteractive|raw|edited
set console hw
Open peripheral display of hw.
set memory memory_type address data...
This command can be used to modify the content of any simulated memory. First parameter must be a class name to specify the type of memory. Class names can be checked by info memory command. Chip names and address spaces can be used as well.
set memory bitaddress dataThe second parameter specifies the start address of the modification.
Remaining parameters will be written into the memory starting at the address specified by the second parameter. The data list can include numbers as well as strings. See syntax for more details.
Modified memory locations will be dumped out.
0> set mem xram 1 "ab\tcd\0ef\012ghq" 2 "ABC" 0x0001 61 62 09 63 64 00 65 66 ab.cd.ef 0x0009 0a 67 68 71 02 41 42 43 .ghq.ABC 0> set mem sfr PCON 0x34 0x87 PCON: 0b00110100 0x34 '4' 52 0> set mem xram_chip 1 2 0x0001 02 . 0>
set bit bitaddress 0|1
Set one bit to 0 or 1. The first parameter specifies the bit. It can be the address of the bit (number or symbolic name) or it can be specified in address.bitnumber format where address addressesthe SFR area and bitnumber is the number of the bit in the specified SFR location. Using this syntax, any SFR (and 8051's internal RAM) location can be modified it need not be really bit-addressable.Second parameter is interpreted as 1 if it is not zero.
The modified memory location is dumped out.
0> set bit TF1 1 0x8f TF1: 0b1 0x01 '.' 1 0> set bit 130 0 0x80.2 0b-----0-- 0x00 '.' 0 0> set bit PCON.2 1 0x87.2 0b-----1-- 0x01 '.' 1 0> set bit 10.7 1 0x21.7 0b1------- 0x01 '.' 1 0>
set hardware hardware_id data
This command can be used to set a value into a hardware element of the controller (conf command lists them).Currently only port element of the MCS51 accepts this method. It can be used to set value of external circuits that are connected to ports of the simulated controller. The first parameter specifies the port element (as an array), second is the new value.
0> conf ucsim version 0.9.10 Type of microcontroller: C52 CMOS cmos Controller has 14 hardware element(s). on cpu[0] on simif[0] off vcd[0] on timer0[0] on timer1[1] on uart[0] on dreg[0] on dport[0] on port[0] on port[1] on port[2] on port[3] on irq[0] on timer2[2] 0> set hw port[0] 12 0> info hw port[0] port[0] P0 11111111 0xff 255 . (Value in SFR register) Pin0 00001100 0x0c 12 . (Output of outside circuits) Port0 00001100 0x0c 12 . (Value on the port pins) Configuration memory of port 0x00 00000001 . Turn/get on/off state (bool, RW) 0x01 0000000c . Outside value of port pins (int, RW) 0x02 0000000c . Value of the port (int, RO) 0x03 000000ff . Value of output register (int, RW) 0> set hw port[0] 23 0> info hw port[0] port[0] P0 11111111 0xff 255 . (Value in SFR register) Pin0 00010111 0x17 23 . (Output of outside circuits) Port0 00010111 0x17 23 . (Value on the port pins) Configuration memory of port 0x00 00000001 . Turn/get on/off state (bool, RW) 0x01 00000017 . Outside value of port pins (int, RW) 0x02 00000017 . Value of the port (int, RO) 0x03 000000ff . Value of output register (int, RW) 0>
0> load "remo.hex" Loading from remo.hex 55755 words read from remo.hex 0> step 10000 Stop at 0x000197: (109) stepped 204816 ticks R0 R1 R2 R3 R4 R5 R6 R7 00 00 00 00 00 00 09 ce @R0 00 . ACC= 0x5d 93 ] B= 0x00 @R1 00 . PSW= 0x01 CY=0 AC=0 OV=0 P=1 SP 0x28 -> 23 d9 29 81 02 2d 00 00 DPTR= 0x0393 @DPTR= 0x2a 42 * 0x0197 60 05 JZ 0x019e F 0x000197 Simulated 204816 ticks (1.852e-02 sec) Host usage: 0.001555 sec, rate=11.910206 0> state CPU state= OK PC= 0x000197 frequency= 11059200 HZ Operation since last reset= 28575 vclks Inst= 10000 Fetch= 16351 Read= 7115 Write= 5109 Total time since last reset= 0.018519965277780 sec (204816 clks) Time in isr = 0.000000000000000 sec (0 clks) 0.00% Time in idle= 0.000000000000000 sec (0 clks) 0.00% Most value of stack pointer= 0x000030 Simulation: stopped Runtime: 0.015998 sec 0>The "CPU state" in the first line is an internal piece of information. PC is the value of the program counter. First line shows the XTAL frequency too.
The following lines contain information about simulated time. First, full simulated time (elapsed from last reset) is printed out in seconds and the number of clock periods then the same data is printed out about time spent in interrupt service routines as well as in idle mode. The last data in the lines of ISR and IDLE time shows the ratio of ISRs, Idle times and the main program.
Last lines inform about maximum value of the stack pointer and a "not very well" calculated average value of it, and if the simulation is running or stopped.
0> load "remo.hex" Loading from remo.hex 55755 words read from remo.hex 0> info reg R0 R1 R2 R3 R4 R5 R6 R7 41 58 fc c9 8b bc 95 6b @R0 76 v ACC= 0x00 0 . B= 0x00 @R1 73 s PSW= 0x00 CY=0 AC=0 OV=0 P=0 SP 0x07 -> 6b 95 bc 8b c9 fc 58 41 DPTR= 0x0000 @DPTR= 0x83 131 . 0x0000 02 01 60 LJMP 0x0160 0> step Stop at 0x000160: (109) stepped 24 ticks R0 R1 R2 R3 R4 R5 R6 R7 41 58 fc c9 8b bc 95 6b @R0 76 v ACC= 0x00 0 . B= 0x00 @R1 73 s PSW= 0x00 CY=0 AC=0 OV=0 P=0 SP 0x07 -> 6b 95 bc 8b c9 fc 58 41 DPTR= 0x0000 @DPTR= 0x83 131 . 0x0160 c2 90 CLR 0x900x90 <P1>.0 F 0x000160 0> step Stop at 0x000162: (109) stepped 12 ticks R0 R1 R2 R3 R4 R5 R6 R7 41 58 fc c9 8b bc 95 6b @R0 76 v ACC= 0x00 0 . B= 0x00 @R1 73 s PSW= 0x00 CY=0 AC=0 OV=0 P=0 SP 0x07 -> 6b 95 bc 8b c9 fc 58 41 DPTR= 0x0000 @DPTR= 0x83 131 . 0x0162 c2 97 CLR 0x970x90 <P1>.7 F 0x000162 0> reset 0> info reg R0 R1 R2 R3 R4 R5 R6 R7 41 58 fc c9 8b bc 95 6b @R0 76 v ACC= 0x00 0 . B= 0x00 @R1 73 s PSW= 0x00 CY=0 AC=0 OV=0 P=0 SP 0x07 -> 6b 95 bc 8b c9 fc 58 41 DPTR= 0x0000 @DPTR= 0x83 131 . 0x0000 02 01 60 LJMP 0x0160 0>Optional parameter can be the ID of a peripheral, a hardware element. In this case the specified peripheral will be reseted only.
0> conf ucsim version 0.9.10 Type of microcontroller: C52 CMOS cmos Controller has 14 hardware element(s). on cpu[0] on simif[0] off vcd[0] on timer0[0] on timer1[1] on uart[0] on dreg[0] on dport[0] on port[0] on port[1] on port[2] on port[3] on irq[0] on timer2[2] 0> reset uart 0>
info breakpoints
info registers
info hardware
info memory
info variables
info history
info breakpoints
This subcommand prints out information about breakpoints:0> break 12 Breakpoint 1 at 0x00000c (cond="") 0x000c F ff MOV R7,A 0> tbreak 43 Breakpoint 2 at 0x00002b (cond="") 0x002b D ff MOV R7,A 0> break sfr w 0x80 0> i b Num Type Disp Hit Cnt Address Cond 1 fetch keep 1 1 0x00000c true 2 fetch del 1 1 0x00002b true 3 event keep 1 1 0x000080 write 0>As you see above, the command can be shortened to "i b". The list of breakpoints contains 7 columns:
- Num
- Number of the breakpoint.
- Type
- This column shows type of the breakpoint. It can be fetch for normal breakpoints or event for event breakpoints. First the normal breakpoints are listed and then the event breakpoints.
- Disp
- This shows if the breakpoint is temporary (del) or not (keep).
- Hit
- How many times the breakpoint must be hit before it really stops the program.
- Cnt
- Counter of breakpoint hits. This counter decrements and the breakpoint is activated if it reaches zero.
- Address
- Address where the breakpoint is set.
- Cond
- If any condition was defined for a breakpoint, this field shows the evaluated value of the condition expression. For event breakpoints this field shows if it breaks at read or write operation.
info registers
This subcommand prints out full register set of the CPU. Output of this command depends of type of CPU.Registers of MCS51 family
0> info reg R0 R1 R2 R3 R4 R5 R6 R7 41 58 fc c9 8b bc 95 6b @R0 76 v ACC= 0x00 0 . B= 0x00 @R1 73 s PSW= 0x00 CY=0 AC=0 OV=0 P=0 SP 0x07 -> 6b 95 bc 8b c9 fc 58 41 DPTR= 0x0000 @DPTR= 0x83 131 . 0x0000 ff MOV R7,A 0>In first two lines the actual register bank is dumped out. Register banks reside in internal RAM, actual register bank selected by RS0 and RS1 bits of PSW register.Next two lines begin with value of indirectly addressed internal RAM cells and show most important internal registers, A, B, PSW and flags.
Next line shows the stack pointer and top of the stack.
Last line shows the DPTR and XRAM value where it points.
After register values, instruction at PC is disassembled.
Registers of AVR family
0> i r 0x0000 04 17 b7 70 1f 72 63 12 15 a3 e0 33 71 c1 1c a7 ...p.rc....3q... 0x0010 75 32 21 90 a5 fe dd 77 d5 15 d7 f1 0c 59 ad 86 u2!....w.....Y.. ITHSVNZC SREG= 0xbf 191 . 10111111 SP = 0x001df3 X= 0xf1d7 [X]= 0x00 0 . Y= 0x590c [Y]= 0x00 0 . Z= 0x86ad [Z]= 0x00 0 . 0x0000 5a41 subi r0,161 0>First two lines show first 32 bytes of internal RAM which is the register set of AVR controllers.At the beginning of next two lines bits of status register are printed. These lines present hexadecimal, decimal and ASCII values of the status register too, and value of the stack pointer.
Following line shows indirect addressing registers X, Y, and Z as well as pointed memory values.
Last line is disassembled instruction at PC.
Registers of Z80 family
0> i r SZ-A-PNC Flags= 0xff 255 . A= 0xff 255 . 11111111 BC= 0x0000 [BC]= 41 65 A DE= 0x0000 [DE]= 41 65 A HL= 0x0000 [HL]= 41 65 A IX= 0x0000 [IX]= 41 65 A IY= 0x0000 [IY]= 41 65 A AF= 0xffff [AF]= 00 0 . SP limit= 0xf000 SP= 0xffff -> 0041 58fc c98b bc95 6b72 266b c55e af85 8cd8 65df a8d9 9fa6 0x0000 41 LD B,C 0>Registers of XA family
0> i r CA---VNZ | R0:0d07 R1:b242 R2:3ecd R3:ecc3 01---001 | R4:64ef R5:4773 R6:3bb3 SP:0100 ES:0000 DS:0000 0x0000 41 58 CMP R2h,R4l 0>Registers of HC08 family
0> i r V--HINZC Flags= $60 96 ` A= $00 0 . 0--00000 H= $00 0 . X= $00 0 . SP= $00ff [SP+1]= 00 0 . Limit= $0080 0xf17c 19 ee bclr #4,*$ee 0>
info hardware|hw identifier
This subcommand prints out information about a unit of the controller. identifier specifies hardware element. One form of it is a name. Names of hardware elements can be checked by conf command. This form is accepted only when name is unique. If more than one element exists with the same name then name must be followed by id number in square brackets in same form as it is listed by conf command.Output format of this command depends on CPU family and type of the CPU too because requested unit can be different in different type of controller even in the same CPU family.
$ ucsim_51 -t 51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> conf ucsim version 0.9.10 Type of microcontroller: 51 HMOS hmos Controller has 13 hardware element(s). on cpu[0] on simif[0] off vcd[0] on timer0[0] on timer1[1] on uart[0] on dreg[0] on dport[0] on port[0] on port[1] on port[2] on port[3] on irq[0] 0> info hw port[2] port[2] P2 11111111 0xff 255 . (Value in SFR register) Pin2 11111111 0xff 255 . (Output of outside circuits) Port2 11111111 0xff 255 . (Value on the port pins) Configuration memory of port 0x00 00000001 . Turn/get on/off state (bool, RW) 0x01 000000ff . Outside value of port pins (int, RW) 0x02 000000ff . Value of the port (int, RO) 0x03 000000ff . Value of output register (int, RW) 0> info hw timer0 timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0 Configuration memory of timer0 0x00 00000001 . Turn ticking of this peripheral on/off (bool, RW) 0> info hw uart[0] uart[0] on Input: Output: Shift, fixed clock MultiProc=none irq=dis prio=0 Receiver OFF RB8=0 irq=0 buf=0x00 Transmitter TB8=0 irq=0 buf=0x00 Configuration memory of mcs51_uart 0x00 00000001 . Turn ticking of UART on/off (bool, RW) 0x01 00000000 . Check input file at every cycle (bool, RW) 0x02 00000018 . Escape char on display (int, RW) 0x03 00000000 . Not used 0x04 00000000 . Received char written by simulator (int, R) 0x05 00000000 . Flow-control simulation on/off (bool, RW) 0x06 00000001 . UART enabled to receive by flow-control (bool, RW) 0x07 0000000a . Characters to send as new line (int, RW) 0x08 00000000 . Not used 0x09 00000000 . Not used 0>Timer #2 differs a little bit from other timers of MCS51:$ ucsim_51 -t 52 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> conf ucsim version 0.9.10 Type of microcontroller: C52 HMOS hmos Controller has 14 hardware element(s). on cpu[0] on simif[0] off vcd[0] on timer0[0] on timer1[1] on uart[0] on dreg[0] on dport[0] on port[0] on port[1] on port[2] on port[3] on irq[0] on timer2[2] 0> info hw timer0 timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0 Configuration memory of timer0 0x00 00000001 . Turn ticking of this peripheral on/off (bool, RW) 0> info hw timer2 timer2[2] 0x0000 reload 0x0000 timer OFF irq=0 dis prio=0 Configuration memory of timer2 0x00 00000001 . Turn ticking of this peripheral on/off (bool, RW) 0>
info memory
This command shows information about memory system: chips, address spaces and address decoders.$ ucsim_51 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> info mem Memory chips: 0x000000-0x0000ff 256 variable_storage (32,%08x,0x%02x) 0x000000-0x00ffff 65536 rom_chip (8,%02x,0x%04x) 0x000000-0x0000ff 256 iram_chip (8,%02x,0x%02x) 0x000000-0x00ffff 65536 xram_chip (8,%02x,0x%04x) 0x000000-0x00007f 128 sfr_chip (8,%02x,0x%02x) Address spaces: 0x000000-0x0000ff 256 variables (32,%08x,0x%02x) 0x000000-0x00ffff 65536 rom (8,%02x,0x%04x) 0x000000-0x0000ff 256 iram (8,%02x,0x%02x) 0x000080-0x0000ff 128 sfr (8,%02x,0x%02x) 0x000000-0x00ffff 65536 xram (8,%02x,0x%04x) 0x000000-0x000007 8 regs (8,%02x,0x%01x) 0x000000-0x0000ff 256 bits (1,%01x,0x%02x) 0x000000-0x000001 2 dptr (8,%02x,0x%01x) Address decoders: variables 0x00 0xff -> variable_storage 0x00 activated rom 0x0000 0xffff -> rom_chip 0x0000 activated iram 0x00 0xff -> iram_chip 0x00 activated sfr 0x80 0xff -> sfr_chip 0x00 activated xram 0x0000 0xffff -> xram_chip 0x0000 activated regs 0x0 0x7 -> banked bank selector: sfr[0xd0] mask=0x18 banks=4 act=0 banks: * 0. iram_chip 0x00 1. iram_chip 0x08 2. iram_chip 0x10 3. iram_chip 0x18 bits 0x00 0x7f -> bander(8/1) iram_chip 0x20 activated bits 0x80 0xff -> bander(8/8) sfr_chip 0x00 activated dptr 0x0 0x1 -> sfr_chip 0x02 activated 0>First column shows address ranges, next one is the size followed by the name of the memory. This name can be used in other commands (such as dump, set memory, etc.). Last column shows some technical information (width in bits, format specifier to print out content and address).Address decoders are associated with address spaces. Each address space has a list of decoders. First column of the address decoder information is the number of the decoder. Next three columns specifies name and area of the address space which is handled by the decoder. After "->" sign the name and the address of the memory chip is printed where the decoder maps the area of the address space.
Memory system of other controller family can be different.
$ ucsim_avr uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> info mem Memory chips: 0x000000-0x0000ff 256 variable_storage (32,%08x,0x%02x) 0x000000-0x00ffff 65536 rom_chip (16,%04x,0x%04x) 0x000000-0x00007f 128 iram_chip (8,%02x,0x%02x) Address spaces: 0x000000-0x0000ff 256 variables (32,%08x,0x%02x) 0x000000-0x00ffff 65536 rom (16,%04x,0x%04x) 0x000000-0x00ffff 65536 iram (8,%02x,0x%04x) Address decoders: variables 0x00 0xff -> variable_storage 0x00 activated rom 0x0000 0xffff -> rom_chip 0x0000 activated iram 0x0000 0x007f -> iram_chip 0x00 activated 0>
info variables [[/filter] search]
Print out information about variables. Variable is memory location which has a name. It can be created by var command and several variables are created by the simulator. Optionally the search string can be specified in the command to search for it in variable names.Optional /filter parameter can be used to select variables according to place where they were defined:
- /p List predefined variables only,
- /u Print user defined variables,
- /d List variables from debug info (cdb) file
0> info var x cpu_movxri_addr cpu_0_cfg[0xa] = 0x000000a0,160U,160 Address where high address is in 'm' mode (int, RW) cpu_movxri_as cpu_0_cfg[0x9] = 0x00000073,115U,115,'s' Address space where high address is in 'm' mode, 'i','s','x','c' (int, RW) cpu_movxri_mode cpu_0_cfg[0x8] = 0x0000006d,109U,109,'m' Calc mode of high address for MOVX @Ri, 'm'=memory, 'e'=expr (int, RW) sim_xtal simif_0_cfg[0x6] = 0x00a8c000,11059200U,11059200 Xtal frequency in Hz (int, RW) 0> var xyz 0> info var /u x xyz variables[0x00] = 0x00000000,0U,0 0>First word is the name of the variable, followed by memory and the address, last word is the actual value in hexadecimal. Predefined variables have a short description which is printed in next line.
info history
This command is the same as history information.
Known subcommands are:
timer add
timer delete
timer get
timer start
timer stop
timer set
Each subcommand can (some must) be followed by a timer id which can be a number or a string. Timers are numbered from 1. You can use any number greater than 0 to identify a timer. Or you can use a symbolic name, in this case simulator uses the first unused number to allocate a new timer.
timer add|create|make id [direction [in_isr]]
To create a new timer. New timers are turned ON by default and initialized to value 0. Direction is an integer (can be positive or negative) number which is added to the actual value in every step. If in_isr is TRUE the timer counts only when execution is in an interrupt handler.
timer delete|remove id
To remove a timer if you don't need it any more.
timer get [id]
To get value of timers. If you don't use timer id in this command simulator prints out value of all timers including predefined ones. See example below.
timer start|run id
To turn a timer ON.
timer stop id
To turn a timer OFF. It still exist but doesn't count xtal periods.
timer set|value id value
To set value of the timer (number of xtal periods). value is the new value.$ ucsim_p1516 uCsim 0.9.10, Copyright (C) 1997 Daniel Drotos. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. 0> step 1000 Stop at 0x00f688: (109) stepped 4000 ticks F= 0x04 U=0 P=0 O=0 C=0 Z=1 S=0 R0= 0x00000035 [R0]= 0x00000000 R1= 0x0000f05d [R1]= 0x00000068 R2= 0x00000035 [R2]= 0x00000000 R3= 0x00000000 [R3]= 0x01f2f040 R4= 0x00000000 [R4]= 0x01f2f040 R5= 0x00000000 [R5]= 0x01f2f040 R6= 0x00000000 [R6]= 0x01f2f040 R7= 0x00000000 [R7]= 0x01f2f040 R8= 0x00000000 [R8]= 0x01f2f040 R9= 0x00000000 [R9]= 0x01f2f040 R10= 0x00000000 [R10]= 0x01f2f040 R11= 0x00000000 [R11]= 0x01f2f040 R12= 0x00000000 [R12]= 0x01f2f040 R13= 0x0000fb26 [R13]= 0x00000000 R14= 0x0000f6b7 [R14]= 0x11f2f6af R15= 0x0000f688 [R15]= 0x11f2f686 S0,Flag= 0x00000004 S1,Ver = 0x00020213 S2,Fea1= 0x0000000f S3,Fea2= 0x00000000 0x0f688 11f2f686 EQ jz 0xf686 F 0x00f688 Simulated 4000 ticks (1.600e-04 sec) Host usage: 0.000180 sec, rate=0.888859 0> tim add 10 0> tim get timer #1("time") ON 0.000160000000000 sec (4000 clks) timer #2("isr") ON,ISR 0.000000000000000 sec (0 clks) timer #3("idle") ON,IDLE 0.000000000000000 sec (0 clks) timer #4("halt") ON,HALT 0.000000000000000 sec (0 clks) timer #10("unnamed") ON 0.000000000000000 sec (0 clks) 0> tim add "a" 0> tim set "a" 312 0> tim get timer #1("time") ON 0.000160000000000 sec (4000 clks) timer #2("isr") ON,ISR 0.000000000000000 sec (0 clks) timer #3("idle") ON,IDLE 0.000000000000000 sec (0 clks) timer #4("halt") ON,HALT 0.000000000000000 sec (0 clks) timer #5("a") ON 0.000012480000000 sec (312 clks) timer #10("unnamed") ON 0.000000000000000 sec (0 clks) 0>