diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
| commit | 268a53de823a6750d6256ee1fb1e7707b4b45740 (patch) | |
| tree | 42c1799a9a82b2f7d9790ee9fe181d72a7274751 /sim/ucsim/doc | |
| download | sdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz | |
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'sim/ucsim/doc')
42 files changed, 7304 insertions, 0 deletions
diff --git a/sim/ucsim/doc/Makefile b/sim/ucsim/doc/Makefile new file mode 100644 index 0000000..a5c28a2 --- /dev/null +++ b/sim/ucsim/doc/Makefile @@ -0,0 +1,86 @@ +# +# uCsim doc/Makefile +# +# (c) Drotos Daniel, Talker Bt. 1997 +# + +STARTYEAR = 1997 + +SHELL = /bin/sh +INSTALL = /usr/bin/install -c + +top_builddir = .. +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} +bindir = ${exec_prefix}/bin +libdir = ${exec_prefix}/lib +datadir = ${datarootdir} +datarootdir = ${prefix}/share +includedir = ${prefix}/include +mandir = ${datarootdir}/man +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +infodir = ${datarootdir}/info +srcdir = . + +#docdir = $(prefix)/share/doc/ucsim +docdir = ${datarootdir}/doc/${PACKAGE}/ucsim + + +# Compiling entire program or any subproject +# ------------------------------------------ +all: doc + +doc: checkconf + +# Compiling and installing everything and runing test +# --------------------------------------------------- +install: all installdirs + cp $(srcdir)/*.html $(DESTDIR)$(docdir) + cp $(srcdir)/*.svg $(DESTDIR)$(docdir) + cp $(srcdir)/*.jpg $(DESTDIR)$(docdir) + cp $(srcdir)/*.fig $(DESTDIR)$(docdir) + + +# Deleting all the installed files +# -------------------------------- +uninstall: + rm -rf $(DESTDIR)$(docdir) + + +# Performing self-test +# -------------------- +check: + +test: + + +# Performing installation test +# ---------------------------- +installcheck: + + +# Creating installation directories +# --------------------------------- +installdirs: + test -d $(DESTDIR)$(docdir) || $(INSTALL) -d $(DESTDIR)$(docdir) + test -d $(DESTDIR)$(man1dir) || $(INSTALL) -d $(DESTDIR)$(man1dir) + + +# Creating dependencies +# --------------------- +include $(srcdir)/clean.mk + +# My rules +# -------- + +# Remaking configuration +# ---------------------- +checkconf: + @if [ -f $(top_builddir)/devel ]; then\ + $(MAKE) -C $(top_builddir) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\ + fi + +# End of s51.src/Makefile.in diff --git a/sim/ucsim/doc/Makefile.in b/sim/ucsim/doc/Makefile.in new file mode 100644 index 0000000..67c4b56 --- /dev/null +++ b/sim/ucsim/doc/Makefile.in @@ -0,0 +1,86 @@ +# +# uCsim doc/Makefile +# +# (c) Drotos Daniel, Talker Bt. 1997 +# + +STARTYEAR = 1997 + +SHELL = /bin/sh +INSTALL = @INSTALL@ + +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +includedir = @includedir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +infodir = @infodir@ +srcdir = @srcdir@ +VPATH = @srcdir@ +#docdir = $(prefix)/share/doc/ucsim +docdir = @docdir@/ucsim + + +# Compiling entire program or any subproject +# ------------------------------------------ +all: doc + +doc: checkconf + +# Compiling and installing everything and runing test +# --------------------------------------------------- +install: all installdirs + cp $(srcdir)/*.html $(DESTDIR)$(docdir) + cp $(srcdir)/*.svg $(DESTDIR)$(docdir) + cp $(srcdir)/*.jpg $(DESTDIR)$(docdir) + cp $(srcdir)/*.fig $(DESTDIR)$(docdir) + + +# Deleting all the installed files +# -------------------------------- +uninstall: + rm -rf $(DESTDIR)$(docdir) + + +# Performing self-test +# -------------------- +check: + +test: + + +# Performing installation test +# ---------------------------- +installcheck: + + +# Creating installation directories +# --------------------------------- +installdirs: + test -d $(DESTDIR)$(docdir) || $(INSTALL) -d $(DESTDIR)$(docdir) + test -d $(DESTDIR)$(man1dir) || $(INSTALL) -d $(DESTDIR)$(man1dir) + + +# Creating dependencies +# --------------------- +include $(srcdir)/clean.mk + +# My rules +# -------- + +# Remaking configuration +# ---------------------- +checkconf: + @if [ -f $(top_builddir)/devel ]; then\ + $(MAKE) -C $(top_builddir) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\ + fi + +# End of s51.src/Makefile.in diff --git a/sim/ucsim/doc/UCsim.jpg b/sim/ucsim/doc/UCsim.jpg Binary files differnew file mode 100644 index 0000000..a4356ac --- /dev/null +++ b/sim/ucsim/doc/UCsim.jpg diff --git a/sim/ucsim/doc/analyzer.html b/sim/ucsim/doc/analyzer.html new file mode 100644 index 0000000..7692fe8 --- /dev/null +++ b/sim/ucsim/doc/analyzer.html @@ -0,0 +1,32 @@ +<html> + <head> + <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type"> + <title>μCsim: Code Analyzer</title> + </head> + <body bgcolor="white"> + <h1>Code analyser</h1> + Code + analyser analyses the code of the simulated program and tries to + figure out which address contains valid instruction. <br> + <br> + Analyser starts + analysing of the code with address 0 which always must contain an + instruction because reset of the device sets zero into program + counter. So, analyser marks address 0 that it contains an + instruction. Then it marks the address of the next instruction and so + on. If the analyser finds a <i>jump</i> instruction it continues with + destination address of the <i>jump</i> instruction. If it finds a + <i>call</i> instruction, it recursively analyses destination address + as well as next instruction follows the <i>call</i> one.<br> + <br> + Analysator + stops if it finds an address which is already marked or if it finds a + <i>return</i> instruction or an indirect <i>jump</i> which is + impossible to follow. All these mean that it is impossible to discover + all instructions of the program. + <p>This problem is solved in very simple way. If the + execution reaches an unmarked address, the analyser is called to + analyse the code starting at actual address pointed by the PC.</p> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/chip.fig b/sim/ucsim/doc/chip.fig new file mode 100644 index 0000000..49e0d02 --- /dev/null +++ b/sim/ucsim/doc/chip.fig @@ -0,0 +1,108 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 3375 2610 5130 2925 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3375 2610 5130 2610 5130 2925 3375 2925 3375 2610 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3600 2925 3600 2790 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3825 2925 3825 2790 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4050 2925 4050 2790 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4905 2925 4905 2790 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4680 2925 4680 2790 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4230 2790 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4365 2790 4365 2790 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4500 2790 +-6 +6 3375 2295 5130 2610 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3375 2295 5130 2295 5130 2610 3375 2610 3375 2295 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3600 2610 3600 2475 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3825 2610 3825 2475 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4050 2610 4050 2475 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4905 2610 4905 2475 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4680 2610 4680 2475 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4230 2475 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4365 2475 4365 2475 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4500 2475 +-6 +6 3375 2925 5130 3240 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3375 2925 5130 2925 5130 3240 3375 3240 3375 2925 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3600 3240 3600 3105 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3825 3240 3825 3105 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4050 3240 4050 3105 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4905 3240 4905 3105 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4680 3240 4680 3105 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4230 3105 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4365 3105 4365 3105 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4500 3105 +-6 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 + 0 0 1.00 60.00 120.00 + 0 0 1.00 60.00 120.00 + 3375 3600 5130 3600 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3375 1215 5130 1215 5130 1530 3375 1530 3375 1215 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3600 1530 3600 1395 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3825 1530 3825 1395 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4050 1530 4050 1395 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4905 1530 4905 1395 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4680 1530 4680 1395 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4230 1395 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 4365 1395 4365 1395 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4500 1395 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4230 1710 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4230 1890 +2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 1 + 4230 2070 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 + 0 0 1.00 60.00 120.00 + 0 0 1.00 60.00 120.00 + 5445 3240 5445 1215 +4 1 0 50 -1 16 12 0.0000 4 180 885 4230 3555 width (bits)\001 +4 0 0 50 -1 16 12 0.0000 4 180 870 5535 2295 size (cells)\001 +4 2 0 50 -1 16 12 0.0000 4 120 150 3285 3195 0.\001 +4 2 0 50 -1 16 12 0.0000 4 120 150 3285 2475 2.\001 +4 2 0 50 -1 16 12 0.0000 4 135 150 3285 2835 1.\001 +4 2 0 50 -1 16 12 0.0000 4 135 540 3285 1440 size-1.\001 +4 1 0 50 -1 16 12 0.0000 4 180 735 4230 3825 (cellsize)\001 diff --git a/sim/ucsim/doc/chip.svg b/sim/ucsim/doc/chip.svg new file mode 100644 index 0000000..368e1df --- /dev/null +++ b/sim/ucsim/doc/chip.svg @@ -0,0 +1,278 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" +"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Creator: fig2dev Version 3.2 Patchlevel 6-beta --> +<!-- CreationDate: Wed Jul 20 21:14:05 2016 --> +<!-- Magnification: 1.050 --> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="3.4in" height="2.4in" + viewBox="2803 1262 4040 2825"> +<g style="stroke-width:.025in; fill:none"> +<!-- Line: box --> +<rect x="3543" y="2740" width="1842" height="330" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3779,3070 +3779,2929 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4015,3070 +4015,2929 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4251,3070 +4251,2929 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5149,3070 +5149,2929 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4913,3070 +4913,2929 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4440,2929 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4582,2929 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4724,2929 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="3543" y="2409" width="1842" height="330" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3779,2740 +3779,2598 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4015,2740 +4015,2598 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4251,2740 +4251,2598 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5149,2740 +5149,2598 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4913,2740 +4913,2598 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4440,2598 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4582,2598 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4724,2598 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="3543" y="3070" width="1842" height="330" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3779,3401 +3779,3259 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4015,3401 +4015,3259 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4251,3401 +4251,3259 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5149,3401 +5149,3259 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4913,3401 +4913,3259 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4440,3259 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4582,3259 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4724,3259 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3561,3779 +5367,3779 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 3543 3779 - 5401 3779--> +<polyline points="5257 3811 +5383 3779 +5257 3748 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Arrowhead on XXXpoint 5385 3779 - 3527 3779--> +<polyline points="3671 3748 +3545 3779 +3671 3811 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line: box --> +<rect x="3543" y="1275" width="1842" height="330" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3779,1606 +3779,1464 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4015,1606 +4015,1464 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4251,1606 +4251,1464 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5149,1606 +5149,1464 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4913,1606 +4913,1464 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4440,1464 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4582,1464 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4724,1464 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4440,1795 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4440,1984 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4440,2173 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5716,3384 +5716,1292 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 5716 3401 - 5716 1259--> +<polyline points="5748 1403 +5716 1277 +5685 1403 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Arrowhead on XXXpoint 5716 1275 - 5716 3417--> +<polyline points="5685 3273 +5716 3399 +5748 3273 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Text --> +<text xml:space="preserve" x="4440" y="3732" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">width (bits)</text> +<!-- Text --> +<text xml:space="preserve" x="5811" y="2409" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">size (cells)</text> +<!-- Text --> +<text xml:space="preserve" x="3448" y="3354" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">0.</text> +<!-- Text --> +<text xml:space="preserve" x="3448" y="2598" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">2.</text> +<!-- Text --> +<text xml:space="preserve" x="3448" y="2976" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">1.</text> +<!-- Text --> +<text xml:space="preserve" x="3448" y="1511" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">size-1.</text> +<!-- Text --> +<text xml:space="preserve" x="4440" y="4015" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">(cellsize)</text> +</g> +</svg> diff --git a/sim/ucsim/doc/clean.mk b/sim/ucsim/doc/clean.mk new file mode 100644 index 0000000..3170d74 --- /dev/null +++ b/sim/ucsim/doc/clean.mk @@ -0,0 +1,22 @@ +# Deleting all files created by building the program +# -------------------------------------------------- +clean: + rm -f *core *[%~] *.[oa] *.bak + rm -f .[a-z]*~ + + +# Deleting all files created by configuring or building the program +# ----------------------------------------------------------------- +distclean: clean + rm -f Makefile *.dep + + +# Like clean but some files may still exist +# ----------------------------------------- +mostlyclean: clean + + +# Deleting everything that can reconstructed by this Makefile. It deletes +# everything deleted by distclean plus files created by bison, etc. +# ----------------------------------------------------------------------- +realclean: distclean diff --git a/sim/ucsim/doc/cmd.html b/sim/ucsim/doc/cmd.html new file mode 100644 index 0000000..f6845a3 --- /dev/null +++ b/sim/ucsim/doc/cmd.html @@ -0,0 +1,201 @@ +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> + <title>Commands of s51</title> + </head> + <body style="background-color: white;"> + <h1>Command reference of <i>μCsim</i></h1> + <!--GENERAL--> <a href="cmd_general.html">General commands and information</a> + <ul> + <li><a href="cmd_general.html#conf"><b>conf</b> Configuration</a> + <ul> + <li><a href="cmd_general.html#conf_objects"><b>conf objects</b></a></li> + </ul> + </li> + <li><a href="cmd_general.html#h"><b>help,?</b> Help about commands</a></li> + <li><a href="cmd_general.html#q"><b>quit</b> Quit</a></li> + <li><a href="cmd_general.html#kill"><b>kill</b> Shut down the simulator</a></li> + <li><a href="cmd_general.html#exec"><b>exec</b> Execute commands from file</a></li> + <li><a href="cmd_general.html#expression"><b>expression</b> Compute value + of an expression</a></li> + <li><a href="cmd_general.html#show"><b>show</b> Show different kind of + information</a> + <ul> + <li><a href="cmd_general.html#show_copying"><b>show copying</b></a> </li> + <li><a href="cmd_general.html#show_warranty"><b>show warranty</b></a> + </li> + <li><a href="cmd_general.html#show_option"><b>show option</b></a></li> + <li><a href="cmd_general.html#show_error"><b>show error</b></a></li> + </ul> + </li> + <li><a href="cmd_general.html#get"><b>get</b> Get various things</a> + <ul> + <li><b><a href="cmd_general.html#get_option">get option</a></b> </li> + <li><b><a href="cmd_general.html#get_sfr">get sfr</a></b> </li> + <li><b><a href="cmd_general.html#get_error">get error</a></b></li> + </ul> + </li> + <li><a href="cmd_general.html#set"><b>set</b> Set various things</a> + <ul> + <li><a href="cmd_general.html#set_option"><b>set option</b></a></li> + <li><a href="cmd_general.html#set_error"><b>set error</b></a></li> + <li><a href="cmd_general.html#set_console"><b>set console</b></a></li> + <li><a href="cmd_general.html#set_memory"><b>set memory</b></a> </li> + <li><a href="cmd_general.html#set_bit"><b>set bit</b></a> </li> + <li><a href="cmd_general.html#set_hardware"><b>set hardware</b></a></li> + </ul> + </li> + <li><a href="cmd_general.html#state"><b>state</b> State of simulator</a> </li> + <li><a href="cmd_general.html#reset"><b>reset</b> Reset </a></li> + <li><a href="cmd_general.html#info"><b>info</b> Information</a> + <ul> + <li><a href="cmd_general.html#info_breakpoints"><b>info breakpoints</b></a> + </li> + <li><a href="cmd_general.html#info_registers"><b>info registers</b></a> + </li> + <li><a href="cmd_general.html#info_hardware"><b>info hardware</b></a> + </li> + <!--li><a href="cmd_general.html#info_stack"><b>info stack</b></a> + (<font color="#ff2211">since 0.5.0</font>) </li--> + <li><a href="cmd_general.html#info_memory"><b>info memory</b></a></li> + <li>info variables</li> + </ul> + </li> + <li><a href="cmd_general.html#timer"><b>timer</b> Managing timers to + measure execution time and profiling</a> + <ul> + <li><a href="cmd_general.html#timer_add">timer add</a> </li> + <li><a href="cmd_general.html#timer_delete">timer delete</a> </li> + <li><a href="cmd_general.html#timer_get">timer get</a> </li> + <li><a href="cmd_general.html#timer_start">timer start</a> </li> + <li><a href="cmd_general.html#timer_stop">timer stop</a> </li> + <li><a href="cmd_general.html#timer_set">timer set</a> </li> + </ul> + </li> + </ul> + <!--MEMORY--> <a href="cmd_memory.html">Memory manipulation</a> + <ul> + <li><a href="cmd_memory.html#file"><b>file,load</b> Load FILE into ROM</a> + </li> + <li><a href="cmd_memory.html#dl"><b>download,dl</b> Download (intel hex) + data into ROM</a> </li> + <li><a href="cmd_memory.html#fill"><b>fill</b> Fill memory region with + data</a></li> + <li><a href="cmd_memory.html#where"><b>where,Where</b> Search for data in + memory</a></li> + <li><a href="cmd_memory.html#hole"><b>hole</b> search area in + memory, filled with value + <li><a href="cmd_memory.html#memory"><b>memory</b> Manage address spaces, + memory chips and address decoders</a> + <ul> + <li>memory create</li> + <ul> + <li><a href="cmd_memory.html#memory_createchip">memory create chip</a></li> + </ul> + <ul> + <li><a href="cmd_memory.html#memory_createaddressspace">memory + create addressspace</a></li> + <li><a href="cmd_memory.html#memory_createaddressdecoder">memory + create addressdecoder</a></li> + <li>memory create banker</li> + <li>memory create bank</li> + <li>memory create bander</li> + </ul> + </ul> + <ul> + <li><a href="cmd_memory.html#memory_info">memory info</a></li> + <li>memory cell</li> + </ul> + <ul> + </ul> + <ul> + <ul> + </ul> + </ul> + </li> + <li>var</li> + </ul> + <!--EXEC--> <a href="cmd_exec.html">Execution</a> + <ul> + <li><a href="cmd_exec.html#run"><b>r,run,go</b> Go</a></li> + <li><a href="cmd_exec.html#stop"><b>stop</b> Stop</a></li> + <li><a href="cmd_exec.html#step"><b>s,step</b> Step</a></li> + <li><a href="cmd_exec.html#n"><b>n,next</b> Next</a> </li> + <li><a href="cmd_exec.html#pc"><b>pc</b> Set/get PC</a></li> + </ul> + <!--BREAKPOINT--> <a href="cmd_bp.html">Breakpoints</a> + <ul> + <li><a href="cmd_bp.html#break"><b>break</b> Set fix breakpoint</a></li> + <li><a href="cmd_bp.html#tbreak"><b>tbreak</b> Set temporary breakpoint</a></li> + <li><a href="cmd_bp.html#clear"><b>clear</b> Clear fix breakpoint</a> </li> + <li><a href="cmd_bp.html#delete"><b>delete</b> Delete breakpoint(s)</a></li> + <li><a href="cmd_bp.html#commands"><b>commands</b> Define breakpoint + script</a></li> + </ul> + <!--DUMP--> <a href="cmd_dump.html">Dump commands</a> + <ul> + <li><a href="cmd_dump.html#dump"><b>dump</b> Dump memory or bits</a></li> + <li><a href="cmd_dump.html#disassemble"><b>disassemble</b> Disassemble</a> + </li> + <li><a href="cmd_dump.html#dc"><b>dc</b> Dump code in disass format</a> </li> + <li><a href="cmd_dump.html#dch"><b>dch</b> Dump code in hex format</a> </li> + <li><a href="cmd_dump.html#di"><b>di</b> Dump Internal RAM</a> </li> + <li><a href="cmd_dump.html#dx"><b>dx</b> Dump External RAM</a> </li> + <li><a href="cmd_dump.html#ds"><b>ds</b> Dump SFR</a> </li> + </ul> + <!--REMOVED--> <a href="cmd_removed.html">Removed obsolete commands</a> + <ul> + <li><a href="cmd_removed.html#wi">wi,Wi</a> Search for string in Internal + RAM (use <a href="cmd_memory.html#where">where,Where</a> instead) </li> + <li><a href="cmd_removed.html#wx">wx,Wx</a> Search for string in External + RAM (use <a href="cmd_memory.html#where">where,Where</a> instead) </li> + <li><a href="cmd_removed.html#wc">wc,Wc</a> Search for string in ROM (use + <a href="cmd_memory.html#where">where,Where</a> instead) </li> + <li><a href="cmd_removed.html#gopt">gopt</a> Get value of option(s) (use <a + href="cmd_general.html#get_option">get option</a> instead) </li> + <li><a href="cmd_removed.html#sopt">sopt</a> Set value of option (use <a + href="cmd_general.html#set_option">set option</a> instead) </li> + <li><a href="cmd_removed.html#g">g Go</a> (use <a href="cmd_exec.html#run">run</a> + instead) </li> + <li>bs Set FETCH Breakpoint (use <a href="cmd_bp.html#break">break</a> or + <a href="cmd_bp.html#tbreak">tbreak</a> instead) </li> + <li><a href="cmd_removed.html#bse">bse</a> Set EVENT Breakpoint (use <a href="cmd_bp.html#break">break</a> + or <a href="cmd_bp.html#tbreak">tbreak</a> instead) </li> + <li>bd Delete FETCH Breakpoint (use <a href="cmd_bp.html#clear">clear</a> + instead) </li> + <li><a href="cmd_removed.html#bde">bde</a> Delete EVENT Breakpoint (use <a + href="cmd_bp.html#delete">delete</a> instead) </li> + <li><a href="cmd_removed.html#ba">ba</a> Delete all breakpoints (use <a href="cmd_bp.html#delete">delete</a> + instead) </li> + <li>bl List Breakpoints (use <a href="cmd_bp.html#info">info breakpoints</a> + instead) </li> + <li>dr Dump registers (use <a href="cmd_general.html#info_reg">info + registers</a> instead) </li> + <li><a href="cmd_removed.html#dp">dp</a> Dump ports (use <a href="cmd_general.html#info_hw">info + hardware</a> instead) </li> + <li><a href="cmd_removed.html#si">si</a> Set Internal RAM (use <a href="cmd_general.html#set_mem">set + memory</a> instead) </li> + <li><a href="cmd_removed.html#sx">sx</a> Set External RAM (use <a href="cmd_general.html#set_mem">set + memory</a> instead) </li> + <li><a href="cmd_removed.html#sc">sc</a> Set code (ROM) (use <a href="cmd_general.html#set_mem">set + memory</a> instead) </li> + <li><a href="cmd_removed.html#ss">ss</a> Set SFR area (use <a href="cmd_general.html#set_mem">set + memory</a> instead) </li> + <li><a href="cmd_removed.html#sb">sb</a> Set bit (use <a href="cmd_general.html#set_bit">set + bit</a> instead) </li> + <li><a href="cmd_removed.html#fi">fi</a> Fill IRAM area with data (use <a + href="cmd_memory.html#fill">fill</a> instead) </li> + <li><a href="cmd_removed.html#fx">fx</a> Fill XRAM area with data (use <a + href="cmd_memory.html#fill">fill</a> instead) </li> + <li><a href="cmd_removed.html#fs">fs</a> Fill SFR area with data (use <a + href="cmd_memory.html#fill">fill</a> instead) </li> + <li><a href="cmd_removed.html#fc">fc</a> Fill ROM area with data (use <a + href="cmd_memory.html#fill">fill</a> instead) </li> + <li><a href="cmd_removed.html#db">db</a> Dump bit (use <a href="cmd_general.html#dump">dump</a> + instead) </li> + <li><a href="cmd_removed.html#sp">sp</a> Set port pins (use <a href="cmd_general.html#set_port">set + port</a> instead) </li> + </ul> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/cmd.txt b/sim/ucsim/doc/cmd.txt new file mode 100644 index 0000000..8284194 --- /dev/null +++ b/sim/ucsim/doc/cmd.txt @@ -0,0 +1,70 @@ +app +G conf +G conf objects +G help,? +G quit +G kill + G exec file + G expression,let expr +G show copying +G show warranty +G show option [name] +G show error +G get option [name] +G set option name|nr value +G set error error_name on|off|unset + +sim +E run,go,r [start [stop]] +E stop +E step,s +E next,n + gui start + gui stop + +uc +G state + statistic [mem [startaddr [endaddr]] + GM file "file" + GM download,dl +E pc [addr] +G reset +D dump mem_type [start [stop [bytes_per_line]] +D dump bitname... +D dch [start [stop]] +D dc [start [stop]] +D disassemble [start [offset [lines]]] + GM fill mem_type start end data + GM where mem_type data... + GM Where mem_type data... +B break addr [hit] +B break mem_type r|w addr [hit] +B tbreak addr [hit] +B tbreak mem_type r|w addr [hit] +B clear [addr...] +B delete [nr...] +G get sfr addr... +G set memory mem_type addr data... +G set bit addr 0|1 +G set hardware,hw cath params... +G info breakpoints +G info registers +G info hardware,hw cath +G info stack +G info memory +G timer add,create,make id [direction [in_isr]] +G timer delete,remove id +G timer get [id] +G timer run,start id +G timer stop id +G timer value,set id value + memory createchip,cchip id size cellsize + memory createaddressspace,createaddrspace,createaspace,caddressspace,caddrspace,caspace id startaddr size + memory createaddressdecoder,createaddrdecoder,createadecoder,caddressdecoder,caddrdecoder,cadecoder addressspace begin end chip begin +G memory info + + s51 + +D di [start [stop]] +D dx [start [stop]] +D ds [start [stop]] diff --git a/sim/ucsim/doc/cmd_bp.html b/sim/ucsim/doc/cmd_bp.html new file mode 100644 index 0000000..0429e30 --- /dev/null +++ b/sim/ucsim/doc/cmd_bp.html @@ -0,0 +1,112 @@ +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> + <title>Breakpoints commands of μCsim</title> + </head> + <body style=" background-color: white;"> + <!-- BREAKPOINTS --> + <h2>Commands of <i>μCsim</i> to manage breakpoints</h2> + Two kind of breakpoint can be used: fetch and event breakpoint. <b>Fetch</b> + breakpoints are classical breakpoints. They can be placed at any instruction + in the code memory. Breakpoint will be hit if CPU fetches instruction code + from the memory location specified by the breakpoint. Only fetching of first + byte of the instruction hits the breakpoint. If the execution reaches a + breakpoint it stops <i>before</i> the instruction at location specified by + the breakpoint would be executed. + <p><b>Event</b> breakpoints are special onces. They cause stop of execution + if event specified by the breakpoint occurs. Event can be a read or a + write operation on any address space location. Event breakpoint stops + execution <i>after</i> specified event occurred. </p> + <p>Every breakpoint can be <b>fix</b> (permanent) or <b>dynamic</b> + (temporary). Dynamic breakpoints are automatically removed when they + reached. Some commands place dynamic fetch breakpoints into the code, for + example <a href="#g"><b>go</b></a> or <a href="#n"><b>next</b></a>. </p> + <p>A <b>hit number</b> can be associated to any breakpoint. This hit number + specifies how many times the breakpoint must be hit before it causes the + execution to stop. This hit number is 1 by default. </p> + <hr> <a name="break"> + <h3>break <i>addr [hit] [if expression]</i> <br> + break <i>memory_type r|w addr [hit] [if expression]<br> + </i></h3> + </a> <a name="tbreak"> + <h3>tbreak<i> addr [hit] [if expression]</i> <br> + tbreak <i>memory_type r|w addr [hit] [if expression]<br> + </i></h3> + </a> Set fetch or event breakpoint. The command specifies if the breakpoint + will be fix (<b>break</b>) or dynamic (temporary) (<b>tbreak</b>). + <p>Fetch or event breakpoint can be defined. First form defines fetch while + second form defines event breakpoint. </p> + <dl> + <dt>Fetch breakpoint </dt> + <dd>First parameter specifies address where the breakpoint must be placed + to. It should be address of an instruction. <br> + Second parameter is optional and it specifies the hit number. It is 1 by + default. </dd> + <dt>Event breakpoint </dt> + <dd>First parameter specifies class name of memory where we are going to + watch for en event. Class names of memories can be checked by <a href="cmd_general.html#info_memory">info + memory</a> command. <br> + Second parameter specifies the event. It can be <b>r</b> to specify <b>read</b> + operation or <b>w</b> which means <b>write</b> operation. <br> + Remaining parameters are address of watched memory location and an + optional hit number (1 by default). </dd> + </dl> + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">dc 0 0x10</font> + 000000 02 01 60 LJMP 0160 + * 000003 02 00 3c LJMP 003c + * 000006 ff MOV R7,A + * 000007 ff MOV R7,A + * 000008 ff MOV R7,A + * 000009 ff MOV R7,A + * 00000a ff MOV R7,A + * 00000b 02 3b e0 LJMP 3be0 + * 00000e ff MOV R7,A + * 00000f ff MOV R7,A + * 000010 ff MOV R7,A +> <font color="#118811">break 0x160</font> +Breakpoint 1 at 0x000160: CLR P1.0 +> <font color="#118811">tbreak 8 2</font> +Breakpoint 2 at 0x000008: MOV R7,A +> <font color="#118811">g</font> +Simulation started, PC=0x000000 +Stop at 000160: (4) Breakpoint +F 000160 +> </pre> + <hr> <a name="clear"> + <h3>clear <i>[addr...]</i></h3> + </a> Delete fetch breakpoint. Parameter specifies address of breakpoint. If + there is no breakpoint specified at given address this command prints out a + warning message. + <p>If parameter is not given then breakpoint at current PC will be deleted + if it exists. If more than one address is specified then all breakpoints + at specified addresses will be deleted. </p> + <pre>> <font color="#118811">i b</font> +Num Type Disp Hit Cnt Address What +1 fetch keep 1 1 0x000160 CLR P1.0 +2 fetch del 1 1 0x000180 LJMP 022a +1 event keep 1 1 0x000006 wi +> <font color="#118811">clear 160</font> +No breakpoint at 0000a0 +> <font color="#118811">clear 0x160</font> +> <font color="#118811">i b</font> +Num Type Disp Hit Cnt Address What +2 fetch del 1 1 0x000180 LJMP 022a +1 event keep 1 1 0x000006 wi +> </pre> + <hr> <a name="delete"> + <h3>delete <i>[number...]</i></h3> + </a> Delete breakpoint(s) by its number. + <p>If parameter is not used then all breakpoints are deleted. </p> + <hr> <a name="commands"> + <h3>commands <i>script</i></h3> + </a> + <p> </p> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/cmd_dump.html b/sim/ucsim/doc/cmd_dump.html new file mode 100644 index 0000000..96634e7 --- /dev/null +++ b/sim/ucsim/doc/cmd_dump.html @@ -0,0 +1,310 @@ +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> + <title>Dump commands of μCsim</title> + </head> + <body bgcolor="white"> + <h2>Dump commands of μCsim</h2> + <a name="dump"> + <h3>dump <i>[/format] memory_type [start [end [bytes_per_line]]]</i> <br> + dump <i>bit_name...</i></h3> + </a> First form can be used get content of memory while second form can be + used to check value of bit or bits. + <blockquote> <a name="dump_memory"> + <h4>dump <i>[/format] memory_type [start [end [bytes_per_line]]]</i></h4> + </a> Hexadecimal dump of a memory region. First parameter specifies + memory. It can be name of an address space or a chip, and can be checked + using <a href="cmd_general.html#info_memory">info memory</a> command + which lists size and name of all available memories. + <p><b>start</b> and <b>end</b> parameters can be used to specify the + first and last address of the dumped region. If <b>end</b> is omitted + then 64 memory location is dumped. If both <b>start</b> and <b>end</b> + are omitted then next 64 memory location will be dumped out. Every time + when dump command is used the address of last dumped memory location is + stored and next dump command automatically continues at next address. </p> + <p>Last parameter can be used to specify how many memory locations should + be dumped out in one line. It is 8 by default. </p> + <pre>$ <font color="#118811">s51 remo.hex</font> +ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> 55470 words read from remo.hex +55470 words read from remo.hex +> <font color="#118811">run</font> +Simulation started, PC=0x000000 + +Stop at 0x000515: (105) User stopped +F 0x000515 +> <font color="#118811">du rom 20</font> +0x0014 00 ac ff ff ff ff ff ff ........ +0x001c ff ff ff ff ff ff ff 02 ........ +0x0024 01 1c ff ff ff ff ff 32 .......2 +0x002c ff ff ff ff 02 0f a7 02 ........ +0x0034 0e 9c 02 0d d2 02 08 41 .......A +0x003c c0 82 c0 83 c0 d0 c0 e0 ........ +0x0044 c0 00 a2 90 c0 d0 c2 90 ........ +0x004c 78 18 06 30 03 4b 20 92 x..0.K . +0x0054 48 30 07 05 c2 07 02 00 H0...... +0x005c 9d 30 08 05 20 93 3a c2 .0.. .:. +> <font color="#118811">du xram 10 20 10</font> +0x000a ff 01 00 fa 01 01 40 01 01 44 ......@..D +0x0014 01 . +> <font color="#118811">du xram</font> +0x0015 00 00 00 00 00 00 00 00 ........ +0x001d 00 10 01 00 ae 01 00 ae ........ +0x0025 02 12 e1 00 5a 85 00 01 ....Z... +0x002d 00 3b 00 00 5a 85 00 ab .;..Z... +0x0035 1f 80 00 00 01 00 01 00 ........ +0x003d fa 0c 02 01 00 fa 00 02 ........ +0x0045 00 01 00 ab 00 00 00 00 ........ +0x004d 00 00 5a 85 ff 00 01 00 ..Z..... +0x0055 00 00 00 94 a7 01 0c a6 ........ +0x005d 00 6f ff 00 00 00 00 00 .o...... +> +</pre> + <hr> <a name="dump_bit"> + <h4>dump <i>bit_name...</i></h4> + </a> If the simulated controller supports addressable bits (such as MCS51 + does) this command can be used to print out values of bit(s). <a href="syntax.html#bit_param">Any + form of bit address</a> can be used as parameter: + <pre>0> <font color="#118811">dump ac p1.2 0x21</font> + PSW.6 0xd0 00 0 + P1.2 0x90 ff 1 + 0x24.1 0x24 24 0 +0> +</pre> Please note, that this command can not be used, if there is no address + space called <b>sfr</b>. + <pre>$ <font color="#118811">sz80</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> dump 0.0 +No memory specified. Use "info memory" for available memories +0> +</pre> </blockquote> + <hr> <a name="dch"> + <h3>dch <i>[start [stop]]</i></h3> + </a> Hexadecimal dump of code memory area from address <b>start</b> to + address <b>stop</b>. Default value of start address is address of following + memory cell which was dumped by previous <b>dch</b> command. If <b>stop</b> + parameter is not given <b>dch</b> command lists 10 lines 8 bytes per line. + <pre>$ <font color="#118811">s51 remo.hex</font> +ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">wc remo</font> +0013da 52 65 6d 6f Remo +> <font color="#118811">dch 0x13da</font> +0013da 52 65 6d 6f 20 00 56 65 Remo .Ve +0013e2 72 73 69 6f 6e 20 31 2e rsion 1. +0013ea 30 20 00 43 6f 70 79 72 0 .Copyr +0013f2 69 67 68 74 20 28 63 29 ight (c) +0013fa 20 00 31 39 39 34 2c 39 .1994,9 +001402 35 20 00 54 61 6c 6b 65 5 .Talke +00140a 72 20 42 74 2e 00 53 75 r Bt..Su +001412 6e 64 61 79 2e 00 4d 6f nday..Mo +00141a 6e 64 61 79 2e 00 54 68 nday..Th +001422 75 65 73 64 61 79 2e 00 uesday.. +> </pre> + First element in every lines is address of first byte dumped out in the + line. Next elements are hexadecimal values of bytes followed by ASCII + characters of bytes dumped out in the line. If value of the memory cell is + not printable than a dot is dumped out. + <hr> <a name="dc"> + <h3>dc <i>[start [stop]]</i></h3> + </a> Disassembled dump of code memory area. This command simply produces + disassembled list of memory area specified by the parameters. Default value + of <b>start</b> parameter is last address listed by previous <b>dc</b> + command. If <b>stop</b> parameter is not given 20 lines are listed. + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">dc</font> + 000000 02 01 60 LJMP 0160 + * 000003 02 00 3c LJMP 003c + * 000006 ff MOV R7,A + * 000007 ff MOV R7,A + * 000008 ff MOV R7,A + * 000009 ff MOV R7,A + * 00000a ff MOV R7,A + * 00000b 02 3b e0 LJMP 3be0 + * 00000e ff MOV R7,A + * 00000f ff MOV R7,A + * 000010 ff MOV R7,A + * 000011 ff MOV R7,A + * 000012 ff MOV R7,A + * 000013 02 00 ac LJMP 00ac + * 000016 ff MOV R7,A + * 000017 ff MOV R7,A + * 000018 ff MOV R7,A + * 000019 ff MOV R7,A + * 00001a ff MOV R7,A + * 00001b ff MOV R7,A + * 00001c ff MOV R7,A +> </pre> + <hr> <a name="disassemble"> + <h3>disassemble <i>[start [offset [lines]]]</i></h3> + </a> Disassemble code. This command can be used to list disassembled + instructions which discovered by the <a href="analyzer.html">code analyser</a>. + First two parameters specify the address where the list starts. First + parameter is address where the command starts to search an instruction. This + search goes forward. When the first instruction marked by code analyser + found the simulator skips as many instructions as you specify in second + parameter. If <b>offset</b> is negative the simulator goes backward and + skips specified number of instructions. Default value of <b>start</b> + parameter is last address which was listed by previous <b>dis</b> command + and default value of <b>offset</b> is -1. It means you can make continuous + list repeating parameterless <b>dis</b> command. + <p>In third parameter you can specify how many instructions you want to + list. Default value is 20. </p> + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">dis</font> + 000000 02 01 60 LJMP 0160 + 000160 c2 90 CLR P1.0 + 000162 c2 97 CLR P1.7 + 000164 d2 b5 SETB P3.5 + 000166 d2 b4 SETB P3.4 + 000168 75 81 22 MOV SP,#22 + 00016b 75 d0 00 MOV PSW,#00 + 00016e 7e 00 MOV R6,#00 + 000170 7f 00 MOV R7,#00 + 000172 79 04 MOV R1,#04 + 000174 12 0d b8 LCALL 0db8 + 000177 0f INC R7 + 000178 d9 fa DJNZ R1,0174 + 00017a 75 0b 00 MOV 0b,#00 + 00017d 75 0c 00 MOV 0c,#00 + 000180 02 02 2a LJMP 022a + 000183 78 22 MOV R0,#22 + 000185 76 00 MOV @R0,#00 + 000187 d8 fc DJNZ R0,0185 +> <font color="#118811">br 0x180</font> +> <font color="#118811">tbr 0x189</font> +> <font color="#118811">dis 0x180 -3 10</font> + 000178 d9 fa DJNZ R1,0174 + 00017a 75 0b 00 MOV 0b,#00 + 00017d 75 0c 00 MOV 0c,#00 +F 000180 02 02 2a LJMP 022a + 000183 78 22 MOV R0,#22 + 000185 76 00 MOV @R0,#00 + 000187 d8 fc DJNZ R0,0185 +D 000189 22 RET + 00018a 90 09 ec MOV DPTR,#09ec + 00018d ae 83 MOV R6,DPH +> </pre> + If there is an <b>F</b> or <b>D</b> character at the beginning of the + line, it means that there is a fix or dynamic fetch breakpoint at listed + address. Next element on the list can be an asterix (<b>*</b>) which means + that the listed address is not marked by the code analyser. <b>dis</b> + lists marked instructions only so asterix never appears in the list. Next + element of the list is address displayed as six digit hexadecimal number. + Address is followed by hexadecimal dump of instruction's code. Last element + of the list is disassembled instruction. Every number appeared on the list + is hexadecimal number. + <hr> <a name="di"> + <h3>di <i>[start [stop]]</i></h3> + </a> Hexadecimal dump of <b>iram</b> named address space area from address + <b>start</b> to address <b>stop</b>. Default value of start address is + address of following memory cell which was dumped by previous <b>di</b> + command. If <b>stop</b> parameter is not given <b>di</b> command lists 10 + lines 8 bytes per line. + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +0> <font color="#118811">set opt irq_stop 1</font> +0> <font color="#118811">go</font> +Simulation started, PC=0x000000 +Stop at 000023: (5) Interrupt +F 000023 +0> <font color="#118811">di</font> +000000 18 02 16 ba 00 02 00 0a ........ +000008 00 00 00 00 00 00 00 00 ........ +000010 00 00 00 00 00 00 00 00 ........ +000018 4a 00 00 00 00 00 00 00 J....... +000020 bc 27 06 2d 02 ee 35 8f .'.-..5. +000028 31 e7 42 01 0e 01 0b 00 1.B..... +000030 ec 0b 7f 10 7f a9 7e 08 ......~. +000038 fe 03 09 00 00 00 af 08 ........ +000040 af 08 00 00 00 00 00 00 ........ +000048 00 00 00 00 00 00 00 00 ........ +0> +</pre> + <hr> <a name="dx"> + <h3>dx <i>[start [stop]]</i></h3> + </a> Hexadecimal dump of <b>xram</b> named address space area from address + <b>start</b> to address <b>stop</b>. Default value of start address is + address of following memory cell which was dumped by previous <b>dx</b> + command. If <b>stop</b> parameter is not given <b>dx</b> command lists 10 + lines 8 bytes per line. + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +0> <font color="#118811">set opt irq_stop 1</font> +0> <font color="#118811">go</font> +Simulation started, PC=0x000000 +Stop at 000023: (5) Interrupt +F 000023 +0> <font color="#118811">dx 0x100</font> +000100 00 00 00 00 00 00 00 00 ........ +000108 00 00 00 00 00 00 00 00 ........ +000110 00 00 00 00 00 00 00 00 ........ +000118 00 00 00 00 00 00 00 00 ........ +000120 00 00 00 00 00 00 00 00 ........ +000128 00 00 00 00 00 00 00 44 .......D +000130 61 6e 69 00 00 00 02 02 ani..... +000138 07 00 00 ff 00 00 07 cb ........ +000140 08 0c 32 00 07 cb 06 05 ..2..... +000148 02 00 24 00 00 00 00 00 ..$..... +0> +</pre> + <hr> <a name="ds"> + <h3>ds <i>[start [stop]]</i></h3> + </a> Hexadecimal dump of <b>sfr</b> named address space area from address <b>start</b> + to address <b>stop</b>. Default value of start address is address of + following memory cell which was dumped by previous <b>ds</b> command. If <b>stop</b> + parameter is not given <b>ds</b> command lists 10 lines 8 bytes per line. + <pre>$ <font color="#118811">s51 remo.hex</font> +ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +0> <font color="#118811">set opt irq_stop 1</font> +0> <font color="#118811">go</font> +Simulation started, PC=0x000000 +Stop at 000023: (5) Interrupt +F 000023 +0> <font color="#118811">ds</font> +0x80 ff 2a 1e 13 00 00 00 80 .*...... +0x88 d5 21 f7 fd 50 fd 00 00 .!..P... +0x90 fe 00 00 00 00 00 00 00 ........ +0x98 7e 0a 00 00 00 00 00 00 ~....... +0xa0 ff 00 00 00 00 00 00 00 ........ +0xa8 97 00 00 00 00 00 00 00 ........ +0xb0 ff 00 00 00 00 00 00 00 ........ +0xb8 15 00 00 00 00 00 00 00 ........ +0xc0 00 00 00 00 00 00 00 00 ........ +0xc8 00 00 00 00 00 00 00 00 ........ +0> +</pre> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/cmd_exec.html b/sim/ucsim/doc/cmd_exec.html new file mode 100644 index 0000000..fe5b70a --- /dev/null +++ b/sim/ucsim/doc/cmd_exec.html @@ -0,0 +1,165 @@ +<html> + <head> + <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type"> + <title>Execution commands of μCsim</title> + </head> + <body bgcolor="white"> + <h2>Execution commands of <i>μCsim</i></h2> + <a name="run"> + <h3>r,run,go [start [stop]]</h3> + </a> + This command starts the execution of the simulated program. + <p>Parameters are optional. First parameter specifies start address of + the execution. By default execution starts at address specified by + actual value of the PC. This can be overridden by first parameter. + </p> + <p>If second parameter is specified it places a dynamic breakpoint at + specified address which stops the execution. If stop address is not + given the simulator stops if it reaches a breakpoint, or the CPU + accepts an interrupt and <b>stopit</b> option is TRUE, or fatal error + occurs or <a href="#stop">stop</a> command is used on an other + console, or ENTER key is pressed on the console where the run command + was issued. + </p> + <p>If program execution is started the console is <i>frozen</i> it is + not possible to give commands on this console to the simulator while + execution is running. If it is needed to control the simulator during + program execution then more consoles can be used. See using <a href="mulcons.html">multiple + consoles</a> for more information. + </p> + <p>Note that first instruction is executed without effect of + breakpoints and simulation will be started afterwards. It means that + if there is a breakpoint at start address then it will not be hit. See + following example: + </p> + <pre>$ <font color="#118811">./s51</font> +ucsim 0.2.38-pre1, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">b 0x10</font> +Breakpoint 1 at 0x000010: MOV R7,A +> <font color="#118811">b 0x20</font> +Breakpoint 2 at 0x000020: MOV R7,A +> <font color="#118811">run 0x10</font> +Warning: maybe not instruction at 0x000010 +Simulation started, PC=0x000010 +Stop at 0x000020: (104) Breakpoint +F 0x000020 +> +</pre> + <hr> + <a name="stop"> + <h3>stop</h3> + </a> + This command stops the simulation, it freezes the CPU and all the + peripherals. + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">g</font> +Simulation started +> <font color="#118811">dr</font> +000000 00 01 00 14 00 00 5a 47 ......ZG +000000 00 . ACC= 0x47 71 G B= 0x01 DPTR= 0x001c @DPTR= 0x47 71 G +000001 01 . PSW= 0x00 CY=0 AC=0 OV=0 P=0 + 006f02 90 00 1e MOV DPTR,#001e +> <font color="#118811">stop</font> + 006ac5 24 a5 ADD A,#a5 +> +</pre> + Simulated program is executed in background and the simulator accepts + commands. If it stopped by the stop command the instruction pointed by + PC is disassembled, see the <a href="#dis"><b>dis</b></a> command for + description of disassembled form. + <hr> + <a name="step"> + <h3>s,step [steps]</h3> + </a> + Step command. It executes one instruction without effect of + breakpoints. + <p>The optional parameter can be used to specify number of instructions + to execute. Note that breakpoints will stop the execution after the + first instruction. + </p> + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">s</font> +000000 00 00 00 00 00 00 00 00 ........ +000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 . +000000 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0 + 000160 c2 90 CLR P1.0 +> </pre> + After execution of actual instruction pointed by PC (or all + instructions specified by the optional parameter) the <b>step</b> + command dumps out the register set. + <hr> + <a name="n"> + <h3>n,next</h3> + </a> + Execute until next instruction is reached. This command is similar to + <a href="#s"><b>step</b></a> command described above but if actual + instruction to execute is a subroutine call the <b>next</b> command + places a dynamic breakpoint after the call instruction and starts to + execute the subroutine. If the subroutine is infinite the breakpoint + set by <b>next</b> will never reached. It can be a dangerous situation + because the execution started by the <b>next</b> command can not be + stopped interactively. But it can be stopped by other breakpoints. + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">run 0 0x172</font> + 000172 79 04 MOV R1,#04 +> <font color="#118811">dis 0x172 0 5</font> + 000170 7f 00 MOV R7,#00 + 000172 79 04 MOV R1,#04 + 000174 12 0d b8 LCALL 0db8 + 000177 0f INC R7 + 000178 d9 fa DJNZ R1,0174 + 00017a 75 0b 00 MOV 0b,#00 +> <font color="#118811">n</font> +000000 00 04 00 00 00 00 00 00 ........ +000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 . +000004 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0 + 000174 12 0d b8 LCALL 0db8 +> <font color="#118811">n</font> +000000 00 04 00 00 00 00 00 00 ........ +000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0167 @DPTR= 0x00 0 . +000004 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0 + 000177 0f INC R7 +> </pre> + <hr> + <a name="pc"> + <h3>pc [address]</h3> + </a> + Using this command without any parameter it simply dumps out + instruction pointed by the PC. Specify address if you want to set the + PC. + <pre>$ s51 +S51 0.1.5, Copyright (C) 1997 Daniel Drotos, Talker Bt. +S51 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. +> <font color="#118811">pc</font> + * 000000 ff MOV R7,A +> <font color="#118811">pc 123</font> + * 00007b ff MOV R7,A +> <font color="#118811">sopt debug t </font> +> <font color="#118811">pc 32</font> +Warning: maybe not instruction at 000020 + * 000020 ff MOV R7,A +> </pre> + <hr> + <!--OK--> + </body> +</html> diff --git a/sim/ucsim/doc/cmd_general.html b/sim/ucsim/doc/cmd_general.html new file mode 100644 index 0000000..49c6d2c --- /dev/null +++ b/sim/ucsim/doc/cmd_general.html @@ -0,0 +1,813 @@ +<html> + <head> + <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type"> + <title>General commands of μCsim</title> + </head> + <body style="background-color: white;"> + <h2>General commands of <i>μCsim</i></h2> + <h3><a name="conf">conf</a></h3> + Conf command can be used to display different kind of information about <i>μCsim</i>. + It can be followed by a subcommand: + <p><a href="#conf_">conf</a> <br> + conf <a href="#conf_objects">objects</a> </p> + <blockquote> + <h4><a name="conf_">conf</a></h4> + This command (without a subcommand) prints out configuration of the + simulator: + <pre>0> <font color="#118811">conf</font> +ucsim version 0.5.0-pre3 +Type of microcontroller: 51 CMOS +Controller has 9 hardware element(s). + timer0[0] + timer1[1] + uart[0] + port[0] + port[1] + port[2] + port[3] + irq[0] + _51_dummy[0] +0> +</pre> First line contains version number of the program. Second line informs + about type of the simulated microcontroller. Third line prints out how + many hardware elements are simulated. + <h4><a name="conf_objects">conf <i>objects</i></a></h4> + This command is for development only. </blockquote> + <hr> + <h3><a name="h">?,help <i>[command]</i></a></h3> + Help command. It prints out short description of the commands. + <p>If a command name is given as parameter then <i>μCsim</i> prints out all + command that has similar names: </p> + <pre>0> <font color="#118811">? s</font> +show subcommand Generic command for showing things about the uCsim +set subcommand Set, see `set' command for more help +stop Stop +step Step +state State of microcontroller +statistic [mem [startaddr [endaddr]]] + Statistic of memory accesses +0> <font color="#118811">? s o</font> +show option [name] Show internal data of options +set option name|nr value + Set value of an option +0> +</pre> Some commands have more than one name which can produce interesting + result: + <pre>0> <font color="#118811">? t r</font> +timer delete id Delete a timer +timer start id Start a timer +0> +</pre> It looks that names of listed subcommands start with no "r" but take a + closer look on that commands: + <pre>0> <font color="#118811">? t d</font> +timer delete id Delete a timer +Names of command: delete remove +long help of timer delete +0> <font color="#118811">? t start</font> +timer start id Start a timer +Names of command: run start +long help of timer run +0> </pre> + <p>If parameter is unique name of a command then long description of the + command is printed out. </p> + <hr> + <h3><a name="q">quit</a></h3> + Quit. This command terminates actual console, it does not ask you to confirm + your intention. Simulator always reads commands from a file so end of file + condition finishes too. If command console is on standard input/output, + pressing the CTRL-D will quit just like the quit command. + <p>Note that if <a href="invoke.html#Zoption">-Z option</a> was used at + invocation then the quit command does not terminate the simulator program. + In this case <a href="#kill">kill</a> command can be used to terminate + the simulator. See for more information about <a href="mulcons.html">using + multiple consoles</a>. </p> + <pre>$ <font color="#118811">s51</font> +ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">q</font> +$ </pre> + <hr> + <h3><a name="kill">kill</a></h3> + This command terminates the simulator. It does not ask for confirmation. It + doesn't matter how many consoles are used and what commands are running on + them. + <hr> + <h3><a name="exec">exec <i>file</i></a></h3> + Reads commands from "file" and executes them. This command opens a new + console (which will use same in/out file as the actual one) to execute the + file. This means the "quit" command in the file will not exit the simulator: + <pre>drdani@emma:~$ <font color="#118811">cat /tmp/x</font> +get opt +quit +conf +drdani@emma:~$ <font color="#118811">s51</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">exec "/tmp/x"</font> +1> get opt + 0. config_file(by application) is hidden! + 1. console_on(by application) is hidden! + 2. cpu_type(by application) is hidden! + 3. debug(by console1): FALSE - Debug messages to console1 + 4. debug(by console0): FALSE - Debug messages to console0 + 5. debug(by application): FALSE - Print debug messages (-V) + 6. irq_stop(by mcs51_controller): FALSE - Stop when IRQ accepted + 7. null_prompt(by application): FALSE - Use \0 as prompt (-P) + 8. prompt(by console1): "" - Prompt string of console1 + 9. prompt(by console0): "" - Prompt string of console0 +10. prompt(by application): (null) - String of prompt (-p) +11. serial_in_file(by application) is hidden! +12. serial_out_file(by application) is hidden! +13. xtal(by application): 11059200.000 - Frequency of XTAL in Hz +1> quit +0> +</pre> + <hr> + <h3><a name="expression">expression [/format] <i>expr</i></a></h3> + Executes "expr" as an expression. For more about expressions, see <a href="syntax.html">command + syntax</a>. + <pre>0> <font color="#118811">expr 1 + 2</font> +3 +0> <font color="#118811">expr xram[256*dph+dpl]= &sp</font> +129 +0> +</pre> + <hr> + <h3><a name="show">show</a></h3> + Show command can be used to display different kind of information. It must + be followed by a subcommand. Subcommands are: + <p>show <a href="#show_copying">copying</a> <br> + show <a href="#show_warranty">warranty</a> <br> + show <a href="#show_option">option</a> <br> + show <a href="#show_error">error</a> </p> + <blockquote> + <h4><a name="show_copying">show copying</a></h4> + This command can be used to list licensing information. It is first 10 + point of the version 2 of GNU General Public License. If you do not accept + GPL simply do not use the program. + <hr> + <h4><a name="show_warranty">show warranty</a></h4> + This command prints out last 2 point of the license ("NO WARRANTY" + message). + <hr> + <h4><a name="show_option">show option</a></h4> + This command is for development only. + <hr> + <h4><a name="show_error">show error</a></h4> + Errors or warnings are events which can happen in the simulated system + during simulation. Report of that events can be turned on or off using <a + href="#set_error"><b>set error</b></a> command. Errors are organized in + parent-child relationship. Childs are listed under the parent: + <pre>0> <font color="#118811">sh er</font> +Error: non-classified [on/ON] + Error: memory [on/ON] + Error: invalid_address [unset/ON] + Error: non_decoded [unset/ON] + Error: stack [off/OFF] + Error: stack_tracker [unset/OFF] + Error: stack_tracker_wrong_handle [unset/OFF] + Error: operation_on_empty_stack [unset/OFF] + Warning: stack_operation_unmatched_to_top_of_stack [unset/OFF] + Warning: stack_looks_corrupted [unset/OFF] +0> </pre> + First element is the type (Error or Warning). Error stops the simulation. + Warning is just reported and simulation goes on. Next element is the name + of the error. Last element shows actual value and state. Value can be: + <dl> + <dt><b>on</b></dt> + <dd>state is ON </dd> + <dt><b>off</b></dt> + <dd>state is OFF </dd> + <dt><b>unset</b></dt> + <dd>state is inherited from the parent. </dd> + </dl> + If state is <b>ON</b> and the event happens, it is reported. If state is + <b>OFF</b> then the event is silently ignored. </blockquote> + <hr> + <h3><a name="get">get</a></h3> + This command can be used to get value of various kind of things. It requires + a subcommand to specify what is going to be set. Known subcommands are: + <p>get <a href="#get_sfr">sfr</a> <br> + get <a href="#get_option">option</a> <br> + get <a href="#get_error">error</a> </p> + <blockquote> + <h4><a name="get_sfr">get sfr <i>address...</i></a></h4> + This command can be used to check values of SFR location(s) if SFR exists + in simulated memory. Note that <a href="cmd_dump.html#dump_memory">dump + memory</a> or <a href="cmd_dump.html#ds">ds</a> can be used as well. + <p>Parameters are interpreted as SFR names or addresses and values of + addressed locations are dumped out. </p> + <pre>$ <font color="#118811">s51 </font> +ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">get sfr pcon p1 0 0x80 kahd scon 256</font> +0x87 00 . +0x90 ff . +Warning: Invalid address 0 +0x80 ff . +Warning: Invalid address kahd +0x98 00 . +Warning: Invalid address 256 +0> </pre> + <hr> + <h4><a name="get_option">get option <i>[name]</i></a></h4> + Get actual value of option(s). Some options can be set by <a href="#set_option"><b>set + option</b></a> to modify behaviour of the simulator. Using <b>get + option</b> you can get actual value of these options. If you use this + command without parameter you get list of all options known by the + program. In this way you can figure out which options can be used. + <pre>$ <font color="#118811">s51 -V</font> +ucsim 0.5.0, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">get opt</font> + 3. debug(by console0): FALSE - Debug messages to console0 + 4. debug(by application): FALSE - Print debug messages (-V) + 5. irq_stop(by mcs51_controller): FALSE - Stop when IRQ accepted + 6. null_prompt(by application): FALSE - Use \0 as prompt (-P) + 7. prompt(by console0): "" - Prompt string of console0 + 8. prompt(by application): (null) - String of prompt (-p) +11. xtal(by application): 11059200.000 - Frequency of XTAL in Hz +0> +</pre> First element of the list is the number of the option. It is followed by + name of the option (<b>debug</b>, <b>irq_stop</b>, etc.). Number or the + name can be used to identify the option in <b>get option</b> and <a href="#set_option"><b>set + option</b></a> command. Next element shows which part of the simulator + created the option. + <p>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. </p> + <p>Last part describes the option. </p> + <p>Some options can have same name. An example is the <b>debug</b> + option. One is created by the application to store value given by -V + (see <a href="invoke.html">invocation</a>). This will be used as + default value when a new instance of a console is created: </p> + <pre>$ <font color="#118811">cat /tmp/x</font> +get opt debug +$ <font color="#118811">s51</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">get opt debug</font> + 3. debug(by console0): FALSE - Debug messages to console0 + 4. debug(by application): FALSE - Print debug messages (-V) +0> <font color="#118811">set opt 4 1</font> +0> <font color="#118811">get opt debug</font> + 3. debug(by console0): FALSE - Debug messages to console0 + 4. debug(by application): TRUE - Print debug messages (-V) +0> <font color="#118811">exec "/tmp/x"</font> +1> get opt debug + 3. debug(by console1): TRUE - Debug messages to console1 + 4. debug(by console0): FALSE - Debug messages to console0 + 5. debug(by application): TRUE - Print debug messages (-V) +1> +0> +</pre> + <hr> + <h4><a name="get_error">get error</a></h4> + Same as <a href="#show_error">show error</a>. </blockquote> + <hr> + <h3><a name="set">set</a></h3> + This command can be used to set various kind of things. It requires a + subcommand to specify what is going to be set. Known subcommands are: + <p>set <a href="#set_option">option</a> <br> + set <a href="#set_error">error</a> <br> + set <a href="#set_memory">memory</a> <br> + set <a href="#set_bit">bit</a> <br> + set <a href="#set_hardware">hardware</a> </p> + <blockquote> + <h4><a name="set_option">set option <i>name|nr value</i></a></h4> + <p>Set option value. Options described at (<a href="#get_option"><b>get + option</b></a>) command can be set using this command. First + parameter must be an option name or number and second the new value. + Interpretation of the value depends on type of the option. Value for a + boolean type of option interpreted as follows: if first character of the + value is one of <tt>1</tt>, <tt>t</tt>, <tt>T</tt>, <tt>y</tt>, <tt>Y</tt> + then value will be TRUE otherwise it will be FALSE. </p> + <pre>$ <font color="#118811">s51 -V</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">get opt</font> + 0. config_file(by application) is hidden! + 1. console_on(by application) is hidden! + 2. cpu_type(by application) is hidden! + 3. debug(by console0): TRUE - Debug messages to console0 + 4. debug(by application): TRUE - Print debug messages (-V) + 5. irq_stop(by mcs51_controller): FALSE - Stop when IRQ accepted + 6. null_prompt(by application): FALSE - Use \0 as prompt (-P) + 7. prompt(by console0): "" - Prompt string of console0 + 8. prompt(by application): (null) - String of prompt (-p) + 9. serial_in_file(by application) is hidden! +10. serial_out_file(by application) is hidden! +11. xtal(by application): 11059200.000 - Frequency of XTAL in Hz +> <font color="#118811">set opt debug f</font> +Ambiguous option name, use number instead +> <font color="#118811">set opt 3 f</font> +> <font color="#118811">get opt debug</font> + 3. debug(by console0): FALSE - Debug messages to console0 + 4. debug(by application): TRUE - Print debug messages (-V) +> </pre> + <hr> + <h4><a name="set_error">set error <i>error_name on|off|unset</i></a></h4> + This command can be used to set if an error event should be reported or + not. Actual settings can be retrieved by <a href="show_error">show error</a> + command.<br> + <hr> + <h4><a name="set_console">set console <i>interactive + [on|off]|noninteractive|raw|edited</i><br> + </a></h4> + <hr> + <h4><a name="set_memory">set memory <i>memory_type address data...</i></a></h4> + This command can be used to modify content of any simulated memory. First + parameter must be a class name to specify type of memory. Class names can + de checked by <a href="cmd_general.html#info_memory">info memory</a> + command. Chips and address spaces can be used as well. + <p>Second parameter specifies start address of the modification. </p> + <p>Remaining parameters will be written into the memory starting at + address specified by second parameter. Data list can include numbers as + well as strings. See <a href="syntax.html">syntax</a> for more details. + </p> + <p>Modified memory locations will be dumped out. </p> + <pre>0> <font color="#118811">set mem xram 1 "ab\tcd\0ef\012ghq" 2 "ABC"</font> +0x0001 61 62 09 63 64 00 65 66 ab.cd.ef +0x0009 0a 67 68 71 02 41 42 43 .ghq.ABC +0> <font color="#118811">set mem sfr pcon 0x34</font> +0x87 34 4 +0> <font color="#118811">set mem xram_chip 1 2</font> +0x0001 02 . +0> </pre> + <hr> + <h4><a name="set_bit">set bit <i>address 0|1</i></a></h4> + Set one bit to 0 or 1. First parameter specifies the bit. It can be the + address of the bit (number or symbolic name) or it can be specified in <i>address<b>.</b>bitnumber</i> + format where <i>address</i> addresses SFR area and <i>bitnumber</i> is + number of bit in specified SFR location. Using this syntax any SFR (and + 8051's internal RAM) location can be modified it need not be really bit + addressable. + <p>Second parameter interpreted as 1 if it is not zero. </p> + <p>Modified memory location is dumped out. </p> + <pre>$ <font color="#118811">s51 </font> +ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">set bit tf1 1</font> +0x88 80 . +> <font color="#118811">set bit 130 0</font> +0x80 fb . +> <font color="#118811">set bit pcon.2 1</font> +0x87 04 . +> <font color="#118811">set bit 10.7 1</font> +0x0a 80 . +> +</pre> + <hr> + <h4><a name="set_hardware">set hardware <i>hardware_id data</i></a></h4> + This command can be used to set value into a hardware element of the + controller (<a href="#conf">conf</a> command lists them). + <p>Actually only <b>port</b> element of MCS51 accepts this method. It can + be used to set value of external circuits which connected to ports of + simulated controller. First parameter specifies port element (as an + array), second is the new value. </p> + <pre>0> <font color="#118811">conf</font> +Type of microcontroller: 51 CMOS +Controller has 9 hardware element(s). + timer0[0] + timer1[1] + uart[0] + port[0] + port[1] + port[2] + port[3] + irq[0] + _51_dummy[0] +0> <font color="#118811">set hw port[0] 12</font> +0> <font color="#118811">i h po[0]</font> +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) +0> <font color="#118811">set hw port[0] 23</font> +0> <font color="#118811">i h po[0]</font> +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) +0> <font color="#118811">set hw irq[0] 12</font> +Nothing to do +0> +</pre> </blockquote> + <hr> + <h3><a name="state">state</a></h3> + State of the simulator and the simulated microcontroller: + <pre>> <font color="#118811">state</font> +CPU state= OK PC= 0x004349 XTAL= 1.10592e+07 +Total time since last reset= 0.614873 sec (6800004 clks) +Time in isr = 0.0144227 sec (159504 clks) 2.3% +Time in idle= 0 sec (0 clks) 0% +Max value of stack pointer= 0x000049, avg= 0x000026 +> +</pre> The "CPU state" in the first line is an internal information. PC is value + of the program counter. First line shows XTAL frequency too. + <p>Following lines contain information about simulated time. First, full + simulated time (elapsed from last reset) is printed out in seconds and + number of clock periods then same data is printed out about time spent in + interrupt service routines as well as in idle mode. Last data in lines of + ISR and IDLE time shows ratio of ISRs, Idle times and main program. </p> + <p>Last line informs about maximum value of the stack pointer and a "not + very well" calculated average value of it. </p> + <hr> + <h3><a name="reset">reset</a></h3> + Reset command. It resets the microcontroller. It has same effect as active + signal on the RST pin. + <pre>$ <font color="#118811">s51 -V remoansi.hex</font> +ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">i r</font> +000000 00 00 00 00 00 00 00 00 ........ +000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 . +000000 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0 + 000000 02 01 60 LJMP 0160 +> <font color="#118811">s</font> +000000 00 00 00 00 00 00 00 00 ........ +000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 . +000000 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0 + 000160 c2 90 CLR P1.0 +> <font color="#118811">s</font> +000000 00 00 00 00 00 00 00 00 ........ +000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 . +000000 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0 + 000162 c2 97 CLR P1.7 +> <font color="#118811">res</font> +> <font color="#118811">i r</font> +000000 00 00 00 00 00 00 00 00 ........ +000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 . +000000 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0 + 000000 02 01 60 LJMP 0160 +> </pre> + <hr> + <h3><a name="info">info</a></h3> + This command prints out information about different things which must be + specified as parameter to the command. Following subcommands are known: + <p>info <a href="#info_breakpoints">breakpoints</a> <br> + info <a href="#info_registers">registers</a> <br> + info <a href="#info_hardware">hardware</a> <br> + <!-- info <a href="#info_stack">stack</a> <br>--> + info <a href="#info_memory">memory</a> <br> + info <a href="#info_variables">variables</a> </p> + <blockquote> + <h4><a name="info_breakpoints">info breakpoints</a></h4> + This subcommand prints out information about breakpoints: + <pre>0> <font color="#118811">b 12</font> +Breakpoint 1 at 0x00000c: MOV R7,A +0> <font color="#118811">tb 43</font> +Breakpoint 2 at 0x00002b: MOV R7,A +0> <font color="#118811">b sfr w 0x80</font> +0> <font color="#118811">i b</font> +Num Type Disp Hit Cnt Address What +1 fetch keep 1 1 0x00000c MOV R7,A +2 fetch del 1 1 0x00002b MOV R7,A +3 event keep 1 1 0x000080 write +0> +</pre> As you see above, the command can be shortened to "i b". The list of + breakpoints contains 7 columns: + <dl> + <dt><b>Num</b> </dt> + <dd>Number of the breakpoint. </dd> + <dt><b>Type</b> </dt> + <dd>This column shows type of the breakpoint. It can be <i>fetch</i> + for normal breakpoints or <i>event</i> for event breakpoints. First + the normal breakpoints are listed and then the event breakpoints. </dd> + <dt><b>Disp</b> </dt> + <dd>This shows if the breakpoint is temporary (<i>del</i>) or not (<i>keep</i>). + </dd> <dt><b>Hit</b> </dt> + <dd>How many times the breakpoint must be hit before it really stops the + program. </dd> + <dt><b>Cnt</b> </dt> + <dd>Counter of breakpoint hits. This counter decrements and the + breakpoint is activated if it reaches zero. </dd> + <dt><b>Address</b> </dt> + <dd>Address where the breakpoint is set. </dd> + <dt><b>What</b> </dt> + <dd>For normal breakpoints this field contains disassembled instruction + where the breakpoint is set. For event breakpoints it contains type of + event. </dd> + </dl> + <hr> + <h4><a name="info_registers">info registers</a></h4> + This subcommand prints out full register set of the CPU. Output of this + command depends of type of CPU. + <h5>Registers of MCS51 family</h5> + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">sopt stopit 1</font> +> <font color="#118811">g</font> +5 + * 000023 02 01 1c LJMP 011c +> <font color="#118811">i r</font> +000000 18 02 16 ba 00 02 00 0a ........ +000018 4a J ACC= 0x0a 10 . B= 0x00 DPTR= 0x16ba @DPTR= 0x00 0 . +000002 16 . PSW= 0x00 CY=0 AC=0 OV=0 P=0 + * 000023 02 01 1c LJMP 011c +> </pre> + In first line the actual register bank is dumped out. Register banks + reside in internal RAM, address at the beginning of the line shows start + address of actual register bank selected by RS0 and RS1 bits of PSW + register. + <p>Next two lines begin with value of indirectly addressed internal RAM + cells. Second line shows IRAM cell pointed by R0 while third line shows + IRAM addressed by R1. </p> + <p>Second line displays some important registers. First one is the + accumulator. Its value dumped out in hexadecimal, decimal form and then + the ASCII character of its value. It is followed by value of the B + register which is dumped out in hexadecimal form only. Next is DPTR + register in hexadecimal and then external RAM cell which is addressed by + DPTR. This is dumped out in hexadecimal, decimal and ASCII too. </p> + <p>In third line you find program status word in hexadecimal and then some + flag bits of PSW register. Last line is disassembled instruction at PC. + </p> + <h5>Registers of AVR family</h5> + <pre>$ <font color="#118811">savr test_arith.hex</font> +ucsim 0.2.37, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> 83 words read from test_arith.hex +83 words read from test_arith.hex +> <font color="#118811">run</font> + +Stop at 0x000047: (105) User stopped +F 0x000047 +> <font color="#118811">i r</font> +000000 00 2c 21 23 20 35 19 14 03 00 00 00 00 00 00 00 .,!# 5.......... +000010 00 01 1e 89 01 00 10 e2 14 00 01 10 00 00 00 00 ................ +ITHSVNZC SREG= 0x03 3 . +00000011 SP = 0x000000 +X= 0x1001 [X]= 0x00 0 . Y= 0x0000 [Y]= 0x00 0 . Z= 0x0000 [Z]= 0x00 0 . + * 000047 940c 0047 jmp 0x000047 +> +</pre> First two lines show first 32 bytes of internal RAM which is the register + set of AVR controllers. + <p>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. </p> + <p>Following line shows indirect addressing registers X, Y, and Z as well + as pointed memory values. </p> + <p>Last line is disassembled instruction at PC. </p> + <h5>Registers of Z80 family</h5> + <pre>$ <font color="#118811">sz80</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">i r</font> +SZ-A--P-C Flags= 0x00 0 . A= 0x00 0 . +00-0--0-0 +BC= 0x0000 [BC]= 00 0 . DE= 0x0000 [DE]= 00 0 . HL= 0x0000 [HL]= 00 0 . +IX= 0x0000 [IX]= 00 0 . IY= 0x0000 [IY]= 00 0 . SP= 0x0000 [SP]= 00 0 . + ? 0x0000 00 NOP +0> +</pre> + <h5>Registers of XA family</h5> + <pre>$ <font color="#118811">sxa</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +The XA Simulator is in development, UNSTABLE, DEVELOPERS ONLY! +0> <font color="#118811">i r</font> +CA---VNZ | R0:0100 R1:0302 R2:0504 R3:0706 +00---000 | R4:0908 R5:0b0a R6:0d0c SP:0100 ES:0000 DS:0000 + ? 0x0302 02 03 ADD R0l,[R3] +0> +</pre> + <h5>Registers of HC08 family</h5> + <pre>$ <font color="#118811">shc08</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">i r</font> +V--HINZC Flags= 0x60 96 ` A= 0x00 0 . +0--00000 H= 0x00 0 . X= 0x00 0 . +SP= 0x00ff [SP+1]= 00 0 . + ? 0x0000 00 01 02 brset #0,*0x01,0x0005 +0> +</pre> + <hr> + <h4><a name="info_hardware">info hardware|hw <i>identifier</i></a></h4> + This subcommand prints out information about a unit of the controller. <b>identifier</b> + specifies hardware element. One form of it is a name. Names of hardware + elements can be checked by <a href="#conf">conf</a> 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 <a href="#conf">conf</a> command. + <p>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. </p> + <pre>$ <font color="#118811">s51 -t 51</font> +ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">conf</font> +ucsim version 0.5.0-pre3 +Type of microcontroller: 51 CMOS +Controller has 8 hardware element(s). + timer0[0] + timer1[1] + uart[0] + port[0] + port[1] + port[2] + port[3] + irq[0] + _51_dummy[0] +0> <font color="#118811">i h port[2]</font> +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) +0> <font color="#118811">i h t[0]</font> +timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0 +0> <font color="#118811">i h u</font> +uart[0] Shift, fixed clock MultiProc=none irq=dis prio=0 +Receiver OFF RB8=0 irq=0 +Transmitter TB8=0 irq=0 +0> +</pre> Timer #2 differs a little bit from other timers of MCS51: + <pre>$ <font color="#118811">s51 -t 52</font> +ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">i h timer0</font> +timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0 +0> <font color="#118811">i h t[2]</font> +timer2[2] 0x0000 reload 0x0000 timer OFF irq=0 dis prio=0 +0> +</pre> +<hr> +<!-- + <h4><a name="info_stack">info stack</a></h4> + This command prints out information about data stored in the CPU's stack + and operations which put them there. + <pre>$ <font color="#118811">s51 ~/remo.hex</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +55470 words read from /home/staff/drdani/remo.hex +0> <font color="#118811">set opt irq_stop true</font> +0> <font color="#118811">r</font> +Simulation started, PC=0x000000 +Stop at 0x000023: (2) Interrupt +F 0x000023 +0> <font color="#118811">i s</font> +OP SP before-after L DATA/ADDR INSTRUCTION +call 0x000022-0x000024 2 0x002976 0x022a 12 29 76 LCALL 2976 +call 0x000024-0x000026 2 0x002379 0x2976 12 23 79 LCALL 2379 +call 0x000026-0x000028 2 0x003612 0x2517 12 36 12 LCALL 3612 +intr 0x000028-0x00002a 2 0x000023 0x366f 20 0c 02 JB 21.4,3674 +0> +</pre> First column shows the operation which can be <b>call</b> or <b>push</b> + or <b>intr</b> (interrupt call). Next column contains value of the SP + register before and after the operation. Column "L" shows size of the + data, and the next column the data itself. Note, that for call operations + (call, and intr) the <b>called</b> address is printed, not the pushed + one! Last column is the instruction which has been executed when the + operation occurred. +<hr> +--> + <h4><a name="info_memory">info memory</a></h4> + This command shows information about <a href="memory.html">memory system</a>: + chips, address spaces and address decoders. + <pre>$ <font color="#118811">s51</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">i m</font> +Memory chips: + 0x000000-0x010000 65536 rom_chip (8,%02x,0x%04x) + 0x000000-0x000080 128 iram_chip (8,%02x,0x%02x) + 0x000000-0x010000 65536 xram_chip (8,%02x,0x%04x) + 0x000000-0x000080 128 sfr_chip (8,%02x,0x%02x) +Address spaces: + 0x000000-0x010000 65536 rom (8,%02x,0x%04x) + 0x000000-0x000080 128 iram (8,%02x,0x%02x) + 0x000080-0x000080 128 sfr (8,%02x,0x%02x) + 0x000000-0x010000 65536 xram (8,%02x,0x%04x) +Address decoders: + 0 rom 0x0000 0xffff -> rom_chip 0x0000 activated + 0 iram 0x00 0x7f -> iram_chip 0x00 activated + 0 sfr 0x80 0xff -> sfr_chip 0x00 activated + 0 xram 0x0000 0xffff -> xram_chip 0x0000 activated +0> +</pre> 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 <a href="cmd_dump.html#dump">dump</a>, + <a href="#set_memory">set memory</a>, etc.). Last column shows some + technical information (width in bits, format specifier to print out + content and address). + <p>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. </p> + <p>Memory system of other controller family can be different. </p> + <pre>$ <font color="#118811">savr</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">i m</font> +Memory chips: + 0x000000-0x00ffff 65536 rom_chip (16,%04x,0x%04x) + 0x000000-0x00007f 128 iram_chip (8,%02x,0x%02x) +Address spaces: + 0x000000-0x00ffff 65536 rom (16,%04x,0x%04x) + 0x000000-0x00ffff 65536 iram (8,%02x,0x%04x) +Address decoders: + 0 rom 0x0000 0xffff -> rom_chip 0x0000 activated + 0 iram 0x0000 0x007f -> iram_chip 0x00 activated +0> +</pre> + <hr> + <h4><a name="info_variables">info variables</a></h4> + </blockquote> + <hr> + <h3><a name="timer">timer</a></h3> + Handling of timers. Don't be confused! This command doesn't handle timer + element of the controller. It manages "clock counters" which can be used to + profile applications. + <p>Known subcommands are: </p> + <p>timer <a href="#timer_add">add</a> <br> + timer <a href="#timer_delete">delete</a> <br> + timer <a href="#timer_get">get</a> <br> + timer <a href="#timer_start">start</a> <br> + timer <a href="#timer_stop">stop</a> <br> + timer <a href="#timer_set">set</a> </p> + <p>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 simbolic name, in + this case simulator uses the first unused number to allocate a new timer. + </p> + <blockquote> + <h4><a name="timer_add">timer add|create|make <i>id [direction [in_isr]]</i></a></h4> + To create a new timer. New timers are turned ON by default and initialized + to value 0. <b>Direction</b> is an integer (can be positive or negative) + number which is added to the actual value in every step. If <b>in_isr</b> + is TRUE the timer counts only when execution is in an interrupt handler. + <hr> + <h4><a name="timer_delete">timer delete|remove <i>id</i></a></h4> + To remove a timer if you don't need it any more. + <hr> + <h4><a name="timer_get">timer get <i>[id]</i></a></h4> + 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. + <hr> + <h4><a name="timer_start">timer start|run <i>id</i></a></h4> + To turn a timer ON. + <hr> + <h4><a name="timer_stop">timer stop <i>id</i></a></h4> + To turn a timer OFF. It still exist but doesn't count xtal periods. + <hr> + <h4><a name="timer_set">timer set|value <i>id value</i></a></h4> + To set value of the timer (number of xtal periods). <b>value</b> is the + new value. + <pre>0> <font color="#118811">tim a 3</font> +0> <font color="#118811">tim g</font> +timer #0("time") ON: 0.463255 sec (5123232 clks) +timer #0("isr") ON: 0.0051888 sec (57384 clks) +timer #0("idle") ON,ISR: 0 sec (0 clks) +timer #3("unnamed") ON: 0 sec (0 clks) +0> <font color="#118811">tim a "a"</font> +0> <font color="#118811">tim g</font> +timer #0("time") ON: 0.463255 sec (5123232 clks) +timer #0("isr") ON: 0.0051888 sec (57384 clks) +timer #0("idle") ON,ISR: 0 sec (0 clks) +timer #1("a") ON: 0 sec (0 clks) +timer #3("unnamed") ON: 0 sec (0 clks) +0> +</pre> </blockquote> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/cmd_memory.html b/sim/ucsim/doc/cmd_memory.html new file mode 100644 index 0000000..2e4eca9 --- /dev/null +++ b/sim/ucsim/doc/cmd_memory.html @@ -0,0 +1,287 @@ +<html> + <head> + <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type"> + <title>Memory manipulation commands of μCsim</title> + </head> + <body bgcolor="white"> + <h2>Memory manipulation commands of μCsim</h2> + Every command which changes content of ROM area such as <b><a href="#dl">dl</a></b> + or <b><a href="cmd_general#set_memory">set + memory</a></b> deletes result of <a href="analyzer.html">code + analyser</a> and causes to re-analyse the code. + <hr> + <a name="file"> + <h3>file,load <i>"FILE"</i></h3> + </a> + Loads file named FILE into the simulated code memory. File must + contain data in Intel HEX format. + <pre>> <font color="#118811">file "../../remo.hex"</font> +55470 words read from ../../remo.hex +> +</pre> + Don't forget to enclose file name in quotes to make the parameter to + be a string. + <hr> + <a name="dl"> + <h3>download,dl</h3> + </a> + Download command. It is same as <a href="#l">load</a> above but it + reads information from command console which is standard input by + default. This command stops read records when it detects an "END" + record which is normally the last record. This command has two + equivalent forms <b>download</b> and <b>dl</b>. + <pre>$ <font color="#118811">s51 -V</font> +ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">do +:03000000020003F8 +:1000030075812078207600D8FC900000AE83AF8203 +:100013009000001200416005E4F0A380F690009F79 +:1000230012004A9000A312004A9000A712006890A1 +:1000330000AD12006875D0001200B50200B3EF6581 +:10004300827003EE658322E493F8740193F97402DA +:1000530093FE740393F5828E83E869700122E4931F +:10006300F6A30880F4E493FC740193FD740293FEF9 +:10007300740393FF740493F8740593F582888312D1 +:100083000041700122E493A3A883A9828C838D820B +:10009300F0A3AC83AD828883898280E3212100B5FC +:1000A300212100B5000000B500B5000000B500B582 +:0200B30080FECD +:1000B5007520117501AA850120750102850120228F +:00000001FF</font> +197 bytes loaded +> </pre> + <hr> + <a name="fill"> + <h3>fill <i>memory_type start end data</i></h3> + </a> + Fill memory region with specified data. First parameter specifies + memory. Name of the memory must be used, it can be checked using <a href="cmd_general.html#info_memory">info + memory</a> command which + lists size and name of all available memories. + <p><b>start</b> and <b>end</b> parameters specify first and last + address of the memory region to be filled. + </p> + <p><b>data</b> parameter specifies the data which is used to fill the + memory region. + </p> + <pre>$ <font color="#118811">s51</font> +ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">fill xram 12 0x12 0x56</font> +> <font color="#118811">dump xram 0 0x20</font> +0x0000 00 00 00 00 00 00 00 00 ........ +0x0008 00 00 00 00 56 56 56 56 ....VVVV +0x0010 56 56 56 00 00 00 00 00 VVV..... +0x0018 00 00 00 00 00 00 00 00 ........ +0x0020 00 . +> </pre> + <hr> + <a name="where"> + <h3>where,Where <i>memory_type data...</i></h3> + </a> + Searching for some data in memory. First parameter specifies + memory. Name of the memory must be used, it can be checked using <a href="cmd_general.html#info_memory">info + memory</a> command which + lists size and name of all available memories. + <p>Other parameters can be mixed list of strings (characters between " + and ") and numbers. Strings can contain escape sequencies. μCsim + merges all parameters together and will search for merged list of + values in specified memory. + </p> + <p><b>where</b> command do case unsensitive search while <b>Where</b> + command is for case sensitive search. + </p> + <p>Search is done in whole memory and all matches are dumped out. + </p> + <pre>$ <font color="#118811">s51</font> +ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">set mem xram 20 "Dani d ani D ani dani Dani"</font> +0x0014 44 61 6e 69 20 64 20 61 Dani d a +0x001c 6e 69 20 44 20 61 6e 69 ni D ani +0x0024 20 64 61 6e 69 20 44 61 dani Da +0x002c 6e 69 ni +> <font color="#118811">where xram "dani"</font> +0x0014 44 61 6e 69 Dani +0x0025 64 61 6e 69 dani +0x002a 44 61 6e 69 Dani +> <font color="#118811">Where xram "d ani"</font> +0x0019 64 20 61 6e 69 d ani +> </pre> + <hr> + <a name="hole"> + <h3>hole <i>[memory [length [value]]]</i></h3> + </a> + <p>Searching for a memory area where all locations are filled with + value. By default this command searches rom but any memory can be + specified. Areas shorter than specified length (default is 100) + will not be listed. Searched value is 0 (zero) by default but + other can be sepcified as the last patrameter. + </p> + <pre>$ <font color="#118811">s51</font> +uCsim 0.6-pre55, 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> hole +0x0000 65535 +0> <font color="#118811">hole xram</font> +0> <font color="#118811">fill xram 0x100 0x1ff 11</font> +0> <font color="#118811">hole xram 50 11</font> +0x0100 255 +0> <font color="#118811">fill xram 0x500 0x600 11</font> +0&ht; <font color="#118811">hole xram 50 11</font> +0x0100 255 +0x0500 256 +0> <font color="#118811">rom[0x200]=1</font> +1 +0> <font color="#118811">hole</font> +0x0000 511 +0x0201 65022 +0> </pre> + <p> + Data of found areas are listed in two columns. First column is + the start address of the area in hexadecimal and the second + column is area lenght (in decimal). + </p> + <hr> + <a name="memory"> + <h3>memory</h3> + </a> + This set of commands can be used to manipulate <a href="memory.html">memory + system</a> including <a href="memory.html#chip">chips</a>, <a href="memory.html#address_space">address + spaces</a> and <a href="memory.html#address_decoder">address decoders</a>. + <p>Subcommands are: + </p> + <p>memory <a href="#memory_createchip">createchip</a> + <br> + memory <a href="#memory_createaddressspace">createaddressspace</a> + <br> + memory <a href="#memory_createaddressdecoder">createaddressdecoder</a> + <br> + memory <a href="#memory_info">info</a> + </p> + <blockquote> + <a name="memory_createchip"> + <h4>memory createchip|cchip <i>id size + cellsize</i></h4> + </a> + This command creates a chip (array of storage elements). <b>id</b> + must be a unique name which will be used to identify the chip in other + commands. <b>size</b> is number of storage elements, <b>cellsize</b> + is number of bits stored in one element. + <hr> + <a name="memory_createaddressspace"> + <h4>memory +createaddressspace|caddressspace|caddrspace|caspace|createaddrspace|createaspace + <i>id startaddr size</i></h4> + </a> + This command should never be used. It defines an address space, names + it as <b>id</b> sets its starting address and size. Simulator programs + (<b>s51</b>, <b>savr</b>, etc.) define necessary address spaces for + themself, so this command is not needed. + <hr> + <a name="memory_createaddressdecoder"> + <h4>memory +createaddressdecoder|caddrdecoder|caddressdecoder|cadecoder|createaddrdecoder|createadecoder + <i>addressspace begin end chip begin</i></h4> + </a> + Address decoder maps a part of the address space to a chip + area. <b>addressspace</b> parameter is name of the address space, + <b>begin</b> and <b>end</b> specify address range of the address space + to be mapped. <b>chip</b> parameter is name of the memory chip and + the second <b>begin</b> parameter is the (start of the) chip address + where the area is mapped to. + <p>Address space will be split if a "middle" are is mapped: + </p> + <pre>$ <font color="#118811">s51</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">i m</font> +Memory chips: + 0x000000-0x00ffff 65536 rom_chip (8,%02x,0x%04x) + 0x000000-0x00007f 128 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-0x00ffff 65536 rom (8,%02x,0x%04x) + 0x000000-0x00007f 128 iram (8,%02x,0x%02x) + 0x000080-0x0000ff 128 sfr (8,%02x,0x%02x) + 0x000000-0x00ffff 65536 xram (8,%02x,0x%04x) +Address decoders: + 0 rom 0x0000 0xffff -> rom_chip 0x0000 activated + 0 iram 0x00 0x7f -> iram_chip 0x00 activated + 0 sfr 0x80 0xff -> sfr_chip 0x00 activated + 0 xram 0x0000 0xffff -> xram_chip 0x0000 activated +0> <font color="#118811">mem cchip myram 0x1000 8</font> +0> <font color="#118811">mem createaddressdecoder xram 1234 2000 myram 15</font> +0> <font color="#118811">i m</font> +Memory chips: + 0x000000-0x00ffff 65536 rom_chip (8,%02x,0x%04x) + 0x000000-0x00007f 128 iram_chip (8,%02x,0x%02x) + 0x000000-0x00ffff 65536 xram_chip (8,%02x,0x%04x) + 0x000000-0x00007f 128 sfr_chip (8,%02x,0x%02x) + 0x000000-0x000fff 4096 myram (8,%02x,0x%03x) +Address spaces: + 0x000000-0x00ffff 65536 rom (8,%02x,0x%04x) + 0x000000-0x00007f 128 iram (8,%02x,0x%02x) + 0x000080-0x0000ff 128 sfr (8,%02x,0x%02x) + 0x000000-0x00ffff 65536 xram (8,%02x,0x%04x) +Address decoders: + 0 rom 0x0000 0xffff -> rom_chip 0x0000 activated + 0 iram 0x00 0x7f -> iram_chip 0x00 activated + 0 sfr 0x80 0xff -> sfr_chip 0x00 activated + 0 xram 0x0000 0x04d1 -> xram_chip 0x0000 activated + 1 xram 0x04d2 0x07d0 -> myram 0x00f activated + 2 xram 0x07d1 0xffff -> xram_chip 0x07d1 activated +0> +</pre> + It is easy to share chip area between address spaces: + <pre>$ <font color="#118811">s51</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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> <font color="#118811">mem createaddressdecoder rom 0 0xfff xram_chip 0xf000</font> +0> <font color="#118811">i m</font> +Memory chips: + 0x000000-0x00ffff 65536 rom_chip (8,%02x,0x%04x) + 0x000000-0x00007f 128 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-0x00ffff 65536 rom (8,%02x,0x%04x) + 0x000000-0x00007f 128 iram (8,%02x,0x%02x) + 0x000080-0x0000ff 128 sfr (8,%02x,0x%02x) + 0x000000-0x00ffff 65536 xram (8,%02x,0x%04x) +Address decoders: + 0 rom 0x0000 0x0fff -> xram_chip 0xf000 activated + 1 rom 0x1000 0xffff -> rom_chip 0x1000 activated + 0 iram 0x00 0x7f -> iram_chip 0x00 activated + 0 sfr 0x80 0xff -> sfr_chip 0x00 activated + 0 xram 0x0000 0xffff -> xram_chip 0x0000 activated +0> <font color="#118811">rom[0]=0xab</font> +171 +0> <font color="#118811">xram[0xf000]</font> +171 +0> +</pre> + <hr> + </blockquote> + <a name="memory_info"> + <h4>memory info</h4> + </a> + This command is same as <a href="cmd_general.html#info_memory">info + memory</a>. + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/cmd_removed.html b/sim/ucsim/doc/cmd_removed.html new file mode 100644 index 0000000..5d3ee31 --- /dev/null +++ b/sim/ucsim/doc/cmd_removed.html @@ -0,0 +1,588 @@ +<html> + <head> + <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type"> + <title>Removed commands of μCsim</title> + </head> + <body bgcolor="white"> + <h2>Removed commands of μCsim</h2> + <font color="gray"> + <a name="bse"> + <h3>bse wi|ri|wx|rx|ws|rs|rc f|d addr [hit]</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_bp.html#break">break</a> + or <a href="cmd_bp.html#tbreak">tbreak</a> instead!!</font> + <p>Set event breakpoint. First parameter specifies type of event. See <a + href="#breakpoints">general description of event breakpoints</a> above + about meaning of event identifiers. Second parameter specify if the + breakpoint will be fix (<b>f</b>) or dynamic (<b>d</b>). Third + parameter specifies address. Remember that this is not an instruction + address, it is address of the memory cell where specified event should + occur. + </p> + <p>Forth parameter is optional and it specifies the hit number. It is + 1 by default. + </p> + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">dis</font> + 00d47e 22 RET + 000000 02 01 60 LJMP 0160 + 000160 c2 90 CLR P1.0 + 000162 c2 97 CLR P1.7 + 000164 d2 b5 SETB P3.5 + 000166 d2 b4 SETB P3.4 + 000168 75 81 22 MOV SP,#22 + 00016b 75 d0 00 MOV PSW,#00 + 00016e 7e 00 MOV R6,#00 + 000170 7f 00 MOV R7,#00 + 000172 79 04 MOV R1,#04 + 000174 12 0d b8 LCALL 0db8 + 000177 0f INC R7 + 000178 d9 fa DJNZ R1,0174 + 00017a 75 0b 00 MOV 0b,#00 + 00017d 75 0c 00 MOV 0c,#00 + 000180 02 02 2a LJMP 022a + 000183 78 22 MOV R0,#22 + 000185 76 00 MOV @R0,#00 + 000187 d8 fc DJNZ R0,0185 +> <font color="#118811">bse wi f 6</font> +> <font color="#118811">g</font> +4 + 000170 7f 00 MOV R7,#00 +> </pre> + <a name="bde"> + <h3>bde wi|ri|wx|rx|ws|rs|rc addr</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_bp.html#delete">delete</a> + instead!!</font> + <p>Delete event breakpoint. First parameter must be given to specify type + of event. Second parameter is address of memory cell which the + breakpoint is associated to. Continuing example given above: + </p> + <pre>> <font color="#118811">bl</font> +D 2(2) 000180 02 LJMP 022a +F 1(1) 000006 wi +> <font color="#118811">bde ri 6</font> +No ri breakpoint at 000006 +> <font color="#118811">bde wi 6</font> +> <font color="#118811">bl</font> +D 2(2) 000180 02 LJMP 022a +> </pre> + <a name="ba"> + <h3>ba</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_bp.html#delete">delete</a> + instead!!</font> + <p>Delete all breakpoints. This command deletes all fetch as well as + event breakpoints. Be carefull because it does not ask you to confirm + your intention. + </p> + <pre>> <font color="#118811">bl</font> +F 1(1) 000160 c2 CLR P1.0 +D 2(2) 000180 02 LJMP 022a +F 1(1) 000006 wi +> <font color="#118811">ba</font> +> <font color="#118811">bl</font> +> </pre> + <a name="dp"> + <h3>dp</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#info_hw">info + hardware</a> instead!!</font> + <p>Dump out ports. This command shows actual value of ports. + </p> + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">sopt stopit 1</font> +> <font color="#118811">g</font> +5 + * 000023 02 01 1c LJMP 011c +> <font color="#118811">dp</font> +P0 11111111 0xff 255 . P1 11111110 0xfe 254 . +Pin0 11111111 0xff 255 . Pin1 11111111 0xff 255 . +Port0 11111111 0xff 255 . Port1 11111110 0xfe 254 . + +P2 11111111 0xff 255 . P3 11111111 0xff 255 . +Pin2 11111111 0xff 255 . Pin3 11111111 0xff 255 . +Port2 11111111 0xff 255 . Port3 11111111 0xff 255 . +> </pre> + First lines on the list (labelled with Px) are value of SFRs which are + internal latch registers. Second lines (labelled with Pinx) are outputs + of external devices connected to port pins of the + microcontroller. These values can be set by you using <a href="#sp"><b>sp</b></a> + command. Third lines (labelled with Portx) + show actual values can be measured on pins of the device. These values + are calculated with following pseudo formula: + <p><tt>Portx= Px AND Pinx</tt> + </p> + <p>All three values are displayed in binary, hexadecimal, decimal form + and then the ASCII character of the value is shown. + <a name="ds"></a></p> + <h3><a name="ds">ds [addr...]</a></h3> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_dump.html#dump">dump</a> + instead!!</font> + Print out SFR. This command can be used to get value of all or some + SFRs. If you do not specify any parameter the <b>ds</b> command simply + dumps out full SFR area 16 bytes per line. + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">sopt stopit 1</font> +> <font color="#118811">g</font> +5 + * 000023 02 01 1c LJMP 011c +> <font color="#118811">ds</font> +000080 ff 2a ba 16 00 00 00 00 55 a1 d7 fe 50 fd 00 00 .*......U...P... +000090 fe 00 00 00 00 00 00 00 7e 00 00 00 00 00 00 00 ........~....... +0000a0 ff 00 00 00 00 00 00 00 97 00 00 00 00 00 00 00 ................ +0000b0 ff 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 ................ +0000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ +0000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ +0000e0 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ +0000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ +> <font color="#118811">ds p1 0x87</font> + P1 fe 254 . +000087 00 0 . +> <font color="#118811">ds p2 ip scon</font> + P2 ff 255 . + IP 15 21 . + SCON 7e 126 ~ +> </pre> + If you specify one or more parameter the <b>ds</b> command prints out + value of registers specified by parameters. Parameter can be an + address or a symbolic name of the register. Note that the simulator + implements a register at all address in the address space which is not + true in real microcontroller where reading of an unimplemented + register gets undefined value. Value of the registers printed out in + hexadecimal, decimal, and ASCII form. + <p>Note that different type of controllers can implement different + registers: + </p> + <pre>$ <font color="#118811">s51</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">ds rcap2l</font> +> <font color="#118811">q</font> +$ <font color="#118811">s51 -t 52</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">ds rcap2l</font> +RCAP2L 00 0 . +> </pre> + <a name="db"> + <h3>db addr...</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_dump.html#dump">dump</a> + instead!!</font> + Dump bits. This command can be used to get value of bits. At least one + parameter must be given. Bit address can be specified in three + forms. First of all name of the bit can be used if it has any. Direct + bit address is accepted too and it can be specified by address of IRAM + or SFR which contains the bit and bit number within the byte separated + by a dot. If the requested bit is in an SFR the address of the + register can be specified by its name. + <pre>$ <font color="#118811">s51</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">db it1 0x20.3 0x43 p2.5</font> +000088 IT1 0 +000020 20.3 0 +000028 28.3 0 +0000a0 P2.5 1 +> </pre> + Value of bits are printed out one per line. The list starts direct + address of the bit followed by bit name or address of the memory cell + or SFR which contains the displayed bit and bit number within the byte + separated by a dot. At last the value of the bit is shown. Displaying + a port bit you get value of SFR latch: + <pre>> <font color="#118811">sp 1 0x0f</font> +> <font color="#118811">ss p1 0x55</font> +000090 55 U +> <font color="#118811">dp</font> +P0 11111111 0xff 255 . P1 01010101 0x55 85 U +Pin0 11111111 0xff 255 . Pin1 00001111 0x0f 15 . +Port0 11111111 0xff 255 . Port1 00000101 0x05 5 . + +P2 11111111 0xff 255 . P3 11111111 0xff 255 . +Pin2 11111111 0xff 255 . Pin3 11111111 0xff 255 . +Port2 11111111 0xff 255 . Port3 11111111 0xff 255 . +> <font color="#118811">db p1.2 p1.3 p1.4 p1.5 p1.6</font> +000090 P1.2 1 +000090 P1.3 0 +000090 P1.4 1 +000090 P1.5 0 +000090 P1.6 1 +> </pre> + <a name="g"> + <h3>g [start [stop]]</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_exec.html#run">run</a> + instead!!</font> + <p>Go, start execution. Parameters are optional. First parameter + specifies start address of the execution. By default execution starts + at address specified by actual value of the PC. This can be overridden + by first parameter. If second parameter is specified it places a + dynamic breakpoint at specified address which stops the execution. If + stop address is not given the simulator stops if it reaches a + breakpoint, or the CPU accepts an interrupt and <b>stopit</b> option + is TRUE, or fatal error occurres or <a href="#stop">stop</a> command is + used. Note that first instruction is executed without effect of + breakpoints. It means that if there is a breakpoint at start address + then it will not be hit. + </p> + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +55755 bytes read from remoansi.hex +> <font color="#118811">b 0x187</font> +> <font color="#118811">sopt stopit y</font> +> <font color="#118811">g</font> +Simulation started, PC=0x000000 +Stop at 000187: (4) Breakpoint +F 000187 +> </pre> + After execution is started the <tt>Simulation started</tt> message + appears with value of PC where the execution started and the simulator + is ready to accept other commands while the simulation is running in + background. + <!--If execution stops the simulator first writes out a number which is +the reason of the stop (this is a diagnostic feature, it will beimproved in future versions). Reason can be: +<dl><dt>0 +<dd>There is no reason to stop. This number should never appear. +<dt>1 +<dd>Serious error for example unknown instruction code which is +impossible to execute. +<dt>2 +<dd>Invalid address used in an instruction. For example indirectaddress is bigger then 127 in 51 type of controller. Execution can be +continued but result will be undefined. +<dt>3 +<dd>Stack overflow. Execution can be continued but result will beundefined. +<dt>4 +<dd>Breakpoint has been reached. +<dt>5 +<dd>Interrupt accepted. It only stops the execution if <b>stopit</b> +option is set to TRUE. See <a href="#sopt">sopt</a> command. +</dl> +After this diagnostic message the simulator prints out intruction atthe PC in disassembled form. See <a href="#dis"><b>dis</b></a> +commands for description of disassembled form.--> + <a name="wi"> + <h3>wi,Wi string</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#where">where,Where</a> + instead!!</font> + <p>Searching for specified string in internal RAM area. String is + interpreted from first non-space character until end of the command + including spaces. <b>wi</b> command makes case insensitive search and + <b>Wi</b> can be used to make case sensitive search. Result is a hexa + dump of memory areas that match with specified string. Most of C-style + escape sequences can be used in the string: <tt>\f</tt>, <tt>\n</tt>, + <tt>\r</tt>, <tt>\t</tt>, <tt>\v</tt>, <tt>\a</tt>, <tt>\b</tt>, + <tt>\0</tt>, and <tt>\0xxx</tt> where <tt>xxx</tt> is an octadecimal + number of the code of the character. + </p> + <pre>$ <font color="#118811">s51 remoansi.hex</font> +ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +58659 bytes read from remoansi.hex +> <font color="#118811">g</font> +Simulation started, PC=0x000000 + +Stop at 00019c: (7) User stopped +F 00019c +> <font color="#118811">si 20 Dani DAni</font> +000014 44 61 6e 69 44 41 6e 69 DaniDAni +> <font color="#118811">wi dani</font> +000014 44 61 6e 69 Dani +000018 44 41 6e 69 DAni +> <font color="#118811">Wi Dani</font> +000014 44 61 6e 69 Dani +> <font color="#118811">wi dani\0</font> +000018 44 41 6e 69 00 DAni. +> </pre> + <a name="wx"> + <h3>wx,Wx string</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#where">where,Where</a> + instead!!</font> + <p>Search commands. These commands are similar to <a href="#wi"><b>wi, + Wi</b></a> commands the only difference is that <b>wx,Wx</b> are + used + to search for a string in external memory. + <a name="wc"></a></p> + <h3><a name="wc">wc,Wc string</a></h3> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#where">where,Where</a> + instead!!</font> + <p>Search commands. These commands are similar to <a href="#wi"><b>wi, + Wi</b></a> commands the only difference is that <b>wx,Wx</b> are + used + to search for a string in code memory area. + <a name="gopt"></a></p> + <h3><a name="gopt">gopt [opt]</a></h3> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#get_option">get_option</a> + instead!!</font> + <p>Get actual value of option(s). Some options can be set by <a href="#sopt"><b>sopt</b></a> + to modify behavior of the + simulator. Using <b>gopt</b> you can get actual value of these + options. If you use this command without parameter you get list of all + options known by the program. In this way you can figure out which + options can be used. + </p> + <pre>$ <font color="#118811">s51 -V</font> +ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">gopt</font> +verbose TRUE Verbose flag. +stopit FALSE Stop if interrupt accepted. +debug FALSE Debug flag. +> <font color="#118811">gopt stopit</font> +stopit FALSE Stop if interrupt accepted. +> </pre> + This version of the simulator knows about three options. First element + of the list is name of the option (<b>verbose</b>, <b>debug</b> and + <b>stopit</b>). This name can be used to identify the option in + <b>gopt</b> and <a href="#sopt"><b>sopt</b></a> command. Second + element of the list is the value of the option. In this case type of + both options is boolean, their value can be TRUE or FALSE. Third + element is a short description of the option. + <dl> + <dt><b>verbose</b> </dt> + <dd>? + </dd> + <dt><b>debug</b> </dt> + <dd>Debug flag can be set by <b>-V</b> option of the + program to TRUE otherwise its default value is FALSE. If it is TRUE, + the simulator prints out short messages about important events. + </dd> + <dt><b>stopit</b> </dt> + <dd>Setting this option to TRUE (default value is + FALSE) forces execution to stop every time when CPU accepts an + interrupt. You do not have to use breakpoints to inspect interrupts. + </dd> + </dl> + <a name="sopt"> + <h3>sopt opt value</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#set_option">set_option</a> + instead!!</font> + <p>Set option value. Options described at previous command (<a href="#gopt"><b>gopt</b></a>) + can be set using this command. First + parameter must be an option name and second the new + value. Interpretation of the value depends on type of the + option. Value for a boolean type of option interpreted as follows: if + first character of the value is one of <tt>1</tt>, <tt>t</tt>, + <tt>T</tt>, <tt>y</tt>, <tt>Y</tt> then value will be TRUE otherwise + it will be FALSE. + </p> + <pre>$ <font color="#118811">s51 -V</font> +ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">gopt</font> +verbose TRUE Verbose flag. +stopit FALSE Stop if interrupt accepted. +debug FALSE Debug messages appears on this console. +> <font color="#118811">sopt debug t</font> +> <font color="#118811">gopt</font> +verbose TRUE Verbose flag. +stopit FALSE Stop if interrupt accepted. +debug TRUE Debug messages appears on this console. +> </pre> + <a name="si"> + <h3>si addr data...</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#set_memory">set + memory</a> instead!!</font> + <p>Write data into internal RAM area. First parameter specifies start + address of memory area to set and other parameters are data to set. + </p> + <pre>$ <font color="#118811">s51</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">si 10 dani\040hej-ho</font> +00000a 64 61 6e 69 20 68 65 6a 2d 68 6f dani hej-ho +> </pre> + Result of the command is a memory dump of area which has been modified + by the command. If there is syntax error in a data parameter then + remaining parameters are dropped out. + <pre>> <font color="#118811">si 20 1 2 0xi 3 4</font> +Bad data 0xi +000014 01 02 .. +> </pre> + <a name="sx"> + <h3>sx addr data...</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#set_memory">set + memory</a> instead!!</font> + <p>This command is similar to <a href="#si"><b>si</b></a> command + described above but it is used to modify external RAM. + <a name="sc"></a></p> + <h3><a name="sc">sc addr data...</a></h3> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#set_memory">set + memory</a> instead!!</font> + <p>This command is similar to <a href="#si"><b>si</b></a> command + described above but it is used to modify code memory area (ROM). + <a name="ss"></a></p> + <h3><a name="ss">ss addr data...</a></h3> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#set_memory">set + memory</a> instead!!</font> + <p>This command is similar to <a href="#si"><b>si</b></a> command + described above but it is used to modify SFR. Other difference is that + first parameter (<b>start</b> address) can be specified by name of SFR + not by address only. + </p> + <pre>$ <font color="#118811">s51</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">ss p1 0</font> +000090 00 . +> </pre> + <a name="sb"> + <h3>sb addr data...</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#set_bit">set + bit</a> instead!!</font> + <p>Modify bit(s). First parameter is address of first bit to modify. See + description of <a href="#db"><b>db</b></a> command how bit address can + be specified. If first character of data parameter is <tt>0</tt> it + means <i>zero</i> otherwise it means <i>one</i>. + </p> + <pre>$ <font color="#118811">s51</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">sb 0x23.5 1</font> +> <font color="#118811">db 0x23.5</font> +000023 23.5 1 +> <font color="#118811">sb p3.3 0</font> +> <font color="#118811">dp</font> +P0 11111111 0xff 255 . P1 11111111 0xff 255 . +Pin0 11111111 0xff 255 . Pin1 11111111 0xff 255 . +Port0 11111111 0xff 255 . Port1 11111111 0xff 255 . + +P2 11111111 0xff 255 . P3 11110111 0xf7 247 . +Pin2 11111111 0xff 255 . Pin3 11111111 0xff 255 . +Port2 11111111 0xff 255 . Port3 11110111 0xf7 247 . +> <font color="#118811">sb tr1 0</font> +> <font color="#118811">db tr1</font> +000088 TR1 0 +> <font color="#118811">sb tr1 1</font> +> <font color="#118811">db tr1</font> +000088 TR1 1 +> </pre> + <a name="sp"> + <h3>sp port data</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#set_port">set + port</a> instead!!</font> + <p>This command can be used to set up output values of external circuits + connected to port pins. If a port bit is used as output to drive + external circuits, do not set corresponding pin bit to zero because + read back value of the port can be false. First parameter must be + number of the port between 0 and 3. + </p> + <pre>$ <font color="#118811">s51</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">dp</font> +P0 11111111 0xff 255 . P1 11111111 0xff 255 . +Pin0 11111111 0xff 255 . Pin1 11111111 0xff 255 . +Port0 11111111 0xff 255 . Port1 11111111 0xff 255 . + +P2 11111111 0xff 255 . P3 11111111 0xff 255 . +Pin2 11111111 0xff 255 . Pin3 11111111 0xff 255 . +Port2 11111111 0xff 255 . Port3 11111111 0xff 255 . +> <font color="#118811">ss p1 0x55</font> +000090 55 U +> <font color="#118811">sp 1 0x0f</font> +> <font color="#118811">dp</font> +P0 11111111 0xff 255 . P1 01010101 0x55 85 U +Pin0 11111111 0xff 255 . Pin1 00001111 0x0f 15 . +Port0 11111111 0xff 255 . Port1 00000101 0x05 5 . + +P2 11111111 0xff 255 . P3 11111111 0xff 255 . +Pin2 11111111 0xff 255 . Pin3 11111111 0xff 255 . +Port2 11111111 0xff 255 . Port3 11111111 0xff 255 . +> </pre> + <a name="fi"> + <h3>fi start stop data</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#fill">fill</a> + instead!!</font> + <p>Fill command. It can be used to fill up an area of internal RAM with a + specified data. + </p> + <pre>$ <font color="#118811">s51</font> +ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> <font color="#118811">fi 11 0x34 44</font> +> <font color="#118811">di</font> +000000 00 00 00 00 00 00 00 00 ........ +000008 00 00 00 2c 2c 2c 2c 2c ...,,,,, +000010 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,, +000018 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,, +000020 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,, +000028 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,, +000030 2c 2c 2c 2c 2c 00 00 00 ,,,,,... +000038 00 00 00 00 00 00 00 00 ........ +000040 00 00 00 00 00 00 00 00 ........ +000048 00 00 00 00 00 00 00 00 ........ +> </pre> + <a name="fx"> + <h3>fx start stop data</h3> + </a> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#fill">fill</a> + instead!!</font> + <p>Fill command. It works similar to <a href="#fi"><b>fi</b></a> but it + puts data into external RAM instead of internal RAM. + <a name="fs"></a></p> + <h3><a name="fs">fs start stop data</a></h3> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#fill">fill</a> + instead!!</font> + <p>Fill command. It works similar to <a href="#fi"><b>fi</b></a> but it + puts data into SFR instead of internal RAM. + <a name="fc"></a></p> + <h3><a name="fc">fc start stop data</a></h3> + <font color="#ff2211">Removed 0.2.38, use <a href="cmd_general.html#fill">fill</a> + instead!!</font> + </font> + <p><font color="gray">Fill command. It works similar to <a href="#fi"><b>fi</b></a> + but it + puts data into code memory (ROM) instead of internal RAM. + </font> + </p> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/conf.mk b/sim/ucsim/doc/conf.mk new file mode 100644 index 0000000..b51dcf1 --- /dev/null +++ b/sim/ucsim/doc/conf.mk @@ -0,0 +1,10 @@ +# +# Makefile targets to remake configuration +# + +freshconf: Makefile + +Makefile: $(srcdir)/Makefile.in $(top_srcdir)/configure.ac + cd $(top_builddir) && $(SHELL) ./config.status + +# End of doc/conf.mk diff --git a/sim/ucsim/doc/cpu-mem.fig b/sim/ucsim/doc/cpu-mem.fig new file mode 100644 index 0000000..20753bd --- /dev/null +++ b/sim/ucsim/doc/cpu-mem.fig @@ -0,0 +1,93 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 1 0 3 + 0 0 1.00 60.00 120.00 + 4320 2160 6660 2160 6660 2430 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 1 0 3 + 0 0 1.00 60.00 120.00 + 4320 2025 6840 2025 6840 2430 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 5175 2430 5175 2160 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 5355 2430 5355 2025 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 1 0 3 + 0 0 1.00 60.00 120.00 + 4320 1845 8460 1845 8460 2430 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 1 3 + 0 0 1.00 60.00 120.00 + 8640 2430 8640 1710 4320 1710 +2 3 0 1 0 1 51 -1 20 0.000 0 0 -1 0 0 11 + 5580 3375 5490 3375 5670 3195 5850 3375 5760 3375 5760 3555 + 5850 3555 5670 3735 5490 3555 5580 3555 5580 3375 +2 3 0 1 0 1 51 -1 20 0.000 0 0 -1 0 0 11 + 7020 3375 6930 3375 7110 3195 7290 3375 7200 3375 7200 3555 + 7290 3555 7110 3735 6930 3555 7020 3555 7020 3375 +2 3 0 1 0 1 51 -1 20 0.000 0 0 -1 0 0 11 + 8775 3375 8685 3375 8865 3195 9045 3375 8955 3375 8955 3555 + 9045 3555 8865 3735 8685 3555 8775 3555 8775 3375 +2 2 0 1 0 1 50 -1 20 0.000 0 0 -1 0 0 5 + 9090 3735 4320 3735 4320 3915 9090 3915 9090 3735 +2 2 0 1 0 26 50 -1 20 0.000 0 0 -1 0 0 5 + 3150 1575 4320 1575 4320 4815 3150 4815 3150 1575 +2 2 0 1 0 13 48 -1 20 0.000 0 0 -1 0 0 5 + 4995 4635 6210 4635 6210 5400 4995 5400 4995 4635 +2 2 0 1 -1 17 50 -1 20 0.000 0 0 -1 0 0 5 + 5085 2430 6120 2430 6120 3195 5085 3195 5085 2430 +2 2 0 1 0 17 50 -1 20 0.000 0 0 -1 0 0 5 + 6525 2430 7560 2430 7560 3195 6525 3195 6525 2430 +2 2 0 1 0 15 50 -1 20 0.000 0 0 -1 0 0 5 + 8280 2430 9315 2430 9315 3195 8280 3195 8280 2430 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 0 7 + 5130 1440 5220 1350 6210 1350 6300 1260 6390 1350 7380 1350 + 7470 1440 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 0 7 + 8280 1440 8370 1350 8730 1350 8820 1260 8910 1350 9270 1350 + 9360 1440 +2 1 0 1 0 7 53 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 5985 3195 5985 4635 +2 1 0 1 0 7 53 -1 -1 0.000 0 0 -1 0 1 3 + 0 0 1.00 60.00 120.00 + 7425 3195 7425 4815 6210 4815 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 1 3 + 0 0 1.00 60.00 120.00 + 9180 3195 9180 4950 6210 4950 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 1 0 4 + 0 0 1.00 60.00 120.00 + 4410 1710 4455 1755 4455 5265 4995 5265 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 2 + 4410 1845 4455 1890 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 2 + 4410 2025 4455 2070 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 2 + 4410 2160 4455 2205 +2 1 0 1 0 2 50 -1 20 0.000 0 0 -1 0 0 31 + 8460 3195 8640 3375 8550 3375 8550 4410 4680 4410 4860 4725 + 4860 4635 4995 4860 4860 5085 4860 4995 4590 4590 4320 4590 + 4320 4095 5175 4095 5175 3375 5085 3375 5265 3195 5445 3375 + 5355 3375 5355 4095 6615 4095 6615 3375 6525 3375 6705 3195 + 6885 3375 6795 3375 6795 4095 8370 4095 8370 3375 8280 3375 + 8460 3195 +4 1 0 49 -1 16 12 0.0000 4 135 1035 7650 2070 Control lines\001 +4 1 0 49 -1 16 12 0.0000 4 180 465 7650 2295 (R/W)\001 +4 1 0 47 -1 16 12 0.0000 4 135 390 3690 3060 CPU\001 +4 1 0 49 -1 16 12 0.0000 4 135 735 7920 3690 Data bus\001 +4 1 0 49 -1 16 12 0.0000 4 135 1020 6480 4320 Address bus\001 +4 1 0 46 -1 16 12 0.0000 4 135 705 5580 5220 Decoder\001 +4 1 0 46 -1 16 12 0.0000 4 135 675 5580 4995 Address\001 +4 1 0 48 -1 16 12 0.0000 4 135 510 5625 2880 Mem1\001 +4 1 0 48 -1 16 12 0.0000 4 135 510 7065 2880 Mem2\001 +4 1 0 48 -1 16 12 0.0000 4 135 510 8775 2880 Mem3\001 +4 1 0 49 -1 16 12 0.0000 4 180 1380 6300 1125 Address Space I.\001 +4 1 0 49 -1 16 12 0.0000 4 180 705 8820 1125 Space II.\001 +4 1 0 49 -1 16 12 0.0000 4 135 675 8820 900 Address\001 +4 1 0 46 -1 16 12 0.0000 4 180 1350 7695 5220 Chip select lines\001 diff --git a/sim/ucsim/doc/cpu-mem.svg b/sim/ucsim/doc/cpu-mem.svg new file mode 100644 index 0000000..d176f8f --- /dev/null +++ b/sim/ucsim/doc/cpu-mem.svg @@ -0,0 +1,329 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" +"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Creator: fig2dev Version 3.2 Patchlevel 6-beta --> +<!-- CreationDate: Wed Jul 20 21:15:51 2016 --> +<!-- Magnification: 1.050 --> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="5.5in" height="4.1in" + viewBox="3294 771 6544 4910"> +<g style="stroke-width:.025in; fill:none"> +<!-- Line --> +<polyline points="6283,3372 +6283,4866 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 6283 4866 - 6283 3338--> +<polyline points="6314 3482 +6283 3356 +6251 3482 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="7795,3372 +7795,5055 +6519,5055 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 7795 5055 - 7795 3338--> +<polyline points="7826 3482 +7795 3356 +7763 3482 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polygon points="5858,3543 +5763,3543 +5952,3354 +6141,3543 +6047,3543 +6047,3732 +6141,3732 +5952,3921 +5763,3732 +5858,3732 +5858,3543 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#0000ff; +"/> +<!-- Line --> +<polygon points="7370,3543 +7275,3543 +7464,3354 +7653,3543 +7559,3543 +7559,3732 +7653,3732 +7464,3921 +7275,3732 +7370,3732 +7370,3543 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#0000ff; +"/> +<!-- Line --> +<polygon points="9212,3543 +9118,3543 +9307,3354 +9496,3543 +9401,3543 +9401,3732 +9496,3732 +9307,3921 +9118,3732 +9212,3732 +9212,3543 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#0000ff; +"/> +<!-- Line: box --> +<rect x="4535" y="3921" width="5007" height="188" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#0000ff; +"/> +<!-- Line: box --> +<rect x="3307" y="1653" width="1228" height="3401" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#b46100; +"/> +<!-- Line: box --> +<rect x="5338" y="2551" width="1086" height="803" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00d1d1; +"/> +<!-- Line: box --> +<rect x="6850" y="2551" width="1086" height="803" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00d1d1; +"/> +<!-- Line: box --> +<rect x="8692" y="2551" width="1086" height="803" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#008f8f; +"/> +<!-- Line --> +<polyline points="8881,3354 +9070,3543 +8976,3543 +8976,4629 +4913,4629 +5102,4960 +5102,4866 +5244,5102 +5102,5338 +5102,5244 +4818,4818 +4535,4818 +4535,4299 +5433,4299 +5433,3543 +5338,3543 +5527,3354 +5716,3543 +5622,3543 +5622,4299 +6944,4299 +6944,3543 +6850,3543 +7039,3354 +7228,3543 +7133,3543 +7133,4299 +8787,4299 +8787,3543 +8692,3543 +8881,3354 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00ff00; +"/> +<!-- Line --> +<polyline points="4535,2267 +6992,2267 +6992,2533 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 6992 2267 - 6992 2566--> +<polyline points="6960 2423 +6992 2549 +7023 2423 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="4535,2125 +7181,2125 +7181,2533 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 7181 2125 - 7181 2566--> +<polyline points="7149 2423 +7181 2549 +7212 2423 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="5433,2534 +5433,2267 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 5433 2267 - 5433 2566--> +<polyline points="5401 2423 +5433 2549 +5464 2423 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="5622,2534 +5622,2125 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 5622 2125 - 5622 2566--> +<polyline points="5590 2423 +5622 2549 +5653 2423 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="4535,1937 +8881,1937 +8881,2533 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 8881 1937 - 8881 2566--> +<polyline points="8850 2423 +8881 2549 +8913 2423 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="9070,2534 +9070,1795 +4535,1795 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 9070 1795 - 9070 2566--> +<polyline points="9039 2423 +9070 2549 +9102 2423 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="5385,1511 +5480,1417 +6519,1417 +6614,1322 +6708,1417 +7748,1417 +7842,1511 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="8692,1511 +8787,1417 +9165,1417 +9259,1322 +9354,1417 +9732,1417 +9826,1511 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Text --> +<text xml:space="preserve" x="8031" y="2173" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Control lines</text> +<!-- Text --> +<text xml:space="preserve" x="8031" y="2409" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">(R/W)</text> +<!-- Text --> +<text xml:space="preserve" x="8314" y="3874" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Data bus</text> +<!-- Text --> +<text xml:space="preserve" x="6803" y="4535" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Address bus</text> +<!-- Text --> +<text xml:space="preserve" x="6614" y="1181" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Address Space I.</text> +<!-- Text --> +<text xml:space="preserve" x="9259" y="1181" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Space II.</text> +<!-- Text --> +<text xml:space="preserve" x="9259" y="944" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Address</text> +<!-- Line: box --> +<rect x="5244" y="4866" width="1275" height="803" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00b000; +"/> +<!-- Text --> +<text xml:space="preserve" x="5905" y="3023" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem1</text> +<!-- Text --> +<text xml:space="preserve" x="7417" y="3023" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem2</text> +<!-- Text --> +<text xml:space="preserve" x="9212" y="3023" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem3</text> +<!-- Text --> +<text xml:space="preserve" x="3874" y="3212" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">CPU</text> +<!-- Line --> +<polyline points="9637,3372 +9637,5196 +6519,5196 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 9637 5196 - 9637 3338--> +<polyline points="9669 3482 +9637 3356 +9606 3482 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="4629,1795 +4677,1842 +4677,5527 +5226,5527 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 4677 5527 - 5259 5527--> +<polyline points="5116 5559 +5241 5527 +5116 5496 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="4629,1937 +4677,1984 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4629,2125 +4677,2173 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4629,2267 +4677,2314 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Text --> +<text xml:space="preserve" x="5858" y="5480" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Decoder</text> +<!-- Text --> +<text xml:space="preserve" x="5858" y="5244" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Address</text> +<!-- Text --> +<text xml:space="preserve" x="8078" y="5480" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Chip select lines</text> +</g> +</svg> diff --git a/sim/ucsim/doc/cpu_types.html b/sim/ucsim/doc/cpu_types.html new file mode 100644 index 0000000..13c3698 --- /dev/null +++ b/sim/ucsim/doc/cpu_types.html @@ -0,0 +1,129 @@ +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> + <title>μCsim: CPU types</title> + </head> + <body bgcolor="white"> + <h1>Select type of CPU</h1> + The simulator supports following type of microprocessors from MCS51 family: + <p><a href="#51">8051/8031</a> <br> + <a href="#52">8052/8032</a> <br> + <a href="#ds390">DS390</a> <br> + <a href="#51r">8051R</a> <br> + <a href="#89c51r">89C51R</a> <br> + <a href="#251">80251</a> </p> + <h3><a name="51">8051/8031</a></h3> + You can select this type of microcontroller using one of the following + parameter for -t option: + <ul> + <li>51 (HMOS type) </li> + <li>8051 (HMOS type) </li> + <li>8751 (HMOS type) </li> + <li>C51 (CMOS type) </li> + <li>80C51 (CMOS type) </li> + <li>87C51 (CMOS type) </li> + <li>31 (HMOS type) </li> + <li>8031 (HMOS type) </li> + <li>C31 (CMOS type) </li> + <li>80C31 (CMOS type) </li> + </ul> + It includes core 51 features: + <ul> + <li>64k external RAM </li> + <li>64k ROM </li> + <li>128 byte internal RAM </li> + <li>2 timers (timer #0, timer #1) </li> + <li>Serial interface </li> + <li>4 8-bit quasi bi-directional ports </li> + </ul> + CMOS types also include: + <ul> + <li>Idle mode </li> + <li>Power down mode </li> + </ul> + <h3><a name="52">8052/8032</a></h3> + You can select this type of microcontroller using one of the following + parameter for -t option: + <ul> + <li>52 (HMOS type) </li> + <li>8052 (HMOS type) </li> + <li>8752 (HMOS type) </li> + <li>C52 (CMOS type) </li> + <li>80C52 (CMOS type) </li> + <li>87C52 (CMOS type) </li> + <li>32 (HMOS type) </li> + <li>8032 (HMOS type) </li> + <li>C32 (CMOS type) </li> + <li>80C32 (CMOS type) </li> + </ul> + It includes same features as <a href="#51">8051/8031</a> microcontrollers + and additionally: + <ul> + <li>3 timers (timer #0, timer #1, timer #2) </li> + <li>256 bytes of internal RAM </li> + </ul> + <h3><a name="ds320">DS320</a></h3> + You can select this type of microcontroller using <b>DS320</b> as parameter + for -t option (this is a CMOS type). It includes same features as <a href="#52">8052</a> + and adds: + <ul> + <li>support for dual DPTR register </li> + </ul> + <h3><a name="ds390">DS390</a></h3> + You can select this type of microcontroller using <b>DS390</b> as parameter + for -t option (this is a CMOS type). It includes same features as <a href="#52">8052</a> + and adds: + <ul> + <li>24 bit flat mode </li> + <li>support for dual DPTR register </li> + <li>128k external RAM </li> + <li>128k ROM </li> + <li>4k internal SRAM usable </li> + <li>10 bit stack mode </li> + <li>"timed access" of SFRs </li> + </ul> + <h3><a name="51r">8051R</a></h3> + You can select this type of microcontroller using one of the following + parameter for -t option (all are CMOS types): + <ul> + <li>51R </li> + <li>51RA </li> + <li>51RB </li> + <li>51RC </li> + <li>C51RA </li> + <li>C51RB </li> + <li>C51RC </li> + </ul> + It includes all features that <a href="#52">8052/8032</a> does and + additionally: + <ul> + <li>Extended interrupt priority system (4 priority levels) </li> + <li>Extended serial line interface (automatic address recognition) </li> + <li>Watchdog timer </li> + </ul> + <h3><a name="89c51r">89C51R</a></h3> + You can select this type of microcontroller using <tt>89C51R</tt> parameter + for -t option (this CPU is always CMOS). This is a Philips clone, excluding + duplicated DPTR it is similar to 8051XR from Intel. + <p>It includes all features that <a href="#51r">8051R</a> does and + additionally: </p> + <ul> + <li>PCA (Programmable Counter Array): 5 16-bit counter, one of them can + act as watchdog timer. </li> + <li>Duplicated DPTR. </li> + </ul> + <h3><a name="251">80251</a></h3> + You can select this type of microcontroller using one of the following + parameter for -t option (all are CMOS types): + <ul> + <li>251 </li> + <li>C251 </li> + </ul> + <p>It includes all features that <a href="#89c51r">89C51R</a> does and + additionally: </p> + <ul> + <li>Nothing implemented yet. </li> + </ul> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/decoded.fig b/sim/ucsim/doc/decoded.fig new file mode 100644 index 0000000..77d98bf --- /dev/null +++ b/sim/ucsim/doc/decoded.fig @@ -0,0 +1,116 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha4 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 3 0 15 46 -1 20 0.000 0 0 -1 0 0 2 + 3285 1080 3465 1080 +2 1 0 3 0 15 46 -1 20 0.000 0 0 -1 0 0 2 + 3285 4140 3465 4140 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 7 + 3375 3870 3465 3780 3465 3465 3555 3375 3465 3285 3465 2970 + 3375 2880 +2 2 0 1 0 17 50 -1 20 0.000 0 0 -1 0 0 5 + 3870 1350 4410 1350 4410 2520 3870 2520 3870 1350 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 7 + 3375 2520 3465 2430 3465 1980 3555 1890 3465 1800 3465 1440 + 3375 1350 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 0 0 2 + 3375 3870 3870 3870 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 0 0 2 + 3375 2520 3870 2520 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3690 2520 3690 1350 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3690 3870 3690 2880 +2 1 0 3 0 15 46 -1 20 0.000 0 0 -1 0 0 2 + 3375 2925 3375 3870 +2 2 0 1 0 17 50 -1 20 0.000 0 0 -1 0 0 5 + 3870 2880 4410 2880 4410 3870 3870 3870 3870 2880 +2 1 0 3 0 15 46 -1 20 0.000 0 0 -1 0 0 2 + 3375 1350 3375 2520 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3375 1080 3375 4140 +2 1 0 3 8 15 46 -1 20 0.000 0 0 -1 0 0 2 + 5715 1350 5895 1350 +2 1 0 3 8 15 46 -1 20 0.000 0 0 -1 0 0 2 + 5715 3375 5895 3375 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 7 + 5805 2970 5895 2880 5895 2565 5985 2475 5895 2385 5895 2070 + 5805 1980 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 0 0 2 + 5805 2970 6300 2970 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 6075 2970 6075 1980 +2 2 0 1 0 15 50 -1 20 0.000 0 0 -1 0 0 5 + 6300 1980 6840 1980 6840 2970 6300 2970 6300 1980 +2 1 0 3 8 15 46 -1 20 0.000 0 0 -1 0 0 2 + 5805 1980 5805 2970 +2 1 0 1 8 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 5805 1350 5805 3375 +2 1 0 3 8 15 46 -1 20 0.000 0 0 -1 0 0 2 + 8280 1350 8460 1350 +2 1 0 3 8 15 46 -1 20 0.000 0 0 -1 0 0 2 + 8280 3375 8460 3375 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 7 + 8370 2970 8460 2880 8460 2745 8550 2655 8460 2565 8460 2385 + 8370 2295 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 0 0 2 + 8370 2970 8865 2970 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 8640 2970 8640 2295 +2 1 0 3 8 15 46 -1 20 0.000 0 0 -1 0 0 2 + 8370 2295 8370 2970 +2 1 0 1 8 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 8370 1350 8370 3375 +2 2 0 1 0 15 50 -1 20 0.000 0 0 -1 0 0 5 + 8865 2295 9405 2295 9405 2970 8865 2970 8865 2295 +2 2 0 1 -1 7 60 -1 20 0.000 0 0 -1 0 0 5 + 8865 2295 9405 2295 9405 1980 8865 1980 8865 2295 +2 1 0 1 0 7 58 -1 -1 0.000 0 0 -1 0 0 2 + 9000 1710 9180 2025 +2 1 0 1 0 7 60 -1 -1 0.000 0 0 -1 0 0 2 + 5805 3105 6525 3555 +2 1 0 1 0 7 60 -1 -1 0.000 0 0 -1 0 0 2 + 6390 1530 5805 2250 +2 1 0 1 0 7 60 -1 -1 0.000 0 0 -1 0 0 2 + 6930 1530 8370 2475 +4 1 0 46 -1 16 12 0.0000 4 135 465 4140 1530 size2\001 +4 1 0 46 -1 16 12 0.0000 4 135 540 4140 2025 Mem2\001 +4 2 0 46 -1 16 12 0.0000 4 165 1035 3285 2520 mem2_start\001 +4 2 0 46 -1 16 12 0.0000 4 180 1035 3285 3870 mem1_start\001 +4 1 0 46 -1 16 12 0.0000 4 195 885 2835 4185 begin_as1\001 +4 1 0 46 -1 16 12 0.0000 4 180 735 2880 1125 end_as1\001 +4 1 0 46 -1 16 12 0.0000 4 180 1515 2790 810 Address Space I.\001 +4 1 0 46 -1 16 12 0.0000 4 180 1575 5220 1080 Address Space II.\001 +4 1 0 46 -1 16 12 0.0000 4 150 465 4140 3060 size1\001 +4 1 0 46 -1 16 12 0.0000 4 150 540 4140 3465 Mem1\001 +4 1 0 46 -1 16 12 0.0000 4 135 105 4140 2430 0\001 +4 1 0 46 -1 16 12 0.0000 4 135 105 4140 3780 0\001 +4 1 0 46 -1 16 12 0.0000 4 135 105 6570 2925 0\001 +4 1 0 46 -1 16 12 0.0000 4 135 465 6570 2160 size3\001 +4 1 0 46 -1 16 12 0.0000 4 135 540 6570 2520 Mem3\001 +4 1 0 46 -1 16 12 0.0000 4 165 735 5310 1395 end_as2\001 +4 1 0 46 -1 16 12 0.0000 4 180 885 5220 3420 begin_as2\001 +4 2 0 46 -1 16 12 0.0000 4 165 1035 5715 2970 mem3_start\001 +4 1 0 46 -1 16 12 0.0000 4 135 105 9135 2925 0\001 +4 1 0 46 -1 16 12 0.0000 4 135 360 9135 2160 size\001 +4 1 0 46 -1 16 12 0.0000 4 135 435 9135 2520 Mem\001 +4 1 0 46 -1 16 12 0.0000 4 165 630 7875 1395 end_as\001 +4 1 0 46 -1 16 12 0.0000 4 180 780 7785 3420 begin_as\001 +4 2 0 46 -1 16 12 0.0000 4 165 930 8280 2970 mem_start\001 +4 0 0 60 -1 16 12 0.0000 4 135 1140 8865 1170 Non-decoded\001 +4 0 0 60 -1 16 12 0.0000 4 150 705 8865 1395 memory\001 +4 0 0 60 -1 16 12 0.0000 4 135 405 8865 1620 cells\001 +4 0 0 60 -1 16 12 0.0000 4 135 1140 6165 3735 Non-decoded\001 +4 0 0 60 -1 16 12 0.0000 4 135 900 6165 3960 addresses\001 +4 0 0 60 -1 16 12 0.0000 4 135 765 6255 1260 Decoded\001 +4 0 0 60 -1 16 12 0.0000 4 135 900 6255 1485 addresses\001 diff --git a/sim/ucsim/doc/decoded.svg b/sim/ucsim/doc/decoded.svg new file mode 100644 index 0000000..bc5a2dc --- /dev/null +++ b/sim/ucsim/doc/decoded.svg @@ -0,0 +1,323 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" +"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Creator: fig2dev Version 3.2 Patchlevel 6-beta --> +<!-- CreationDate: Wed Jul 20 21:17:03 2016 --> +<!-- Magnification: 1.050 --> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="7.0in" height="3.2in" + viewBox="2097 670 8452 3799"> +<g style="stroke-width:.025in; fill:none"> +<!-- Line: box --> +<rect x="9307" y="2078" width="566" height="330" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#ffffff; +"/> +<!-- Line --> +<polyline points="6094,3259 +6850,3732 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="6708,1606 +6094,2362 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="7275,1606 +8787,2598 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Text --> +<text xml:space="preserve" x="9307" y="1228" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">Non-decoded</text> +<!-- Text --> +<text xml:space="preserve" x="9307" y="1464" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">memory</text> +<!-- Text --> +<text xml:space="preserve" x="9307" y="1700" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">cells</text> +<!-- Text --> +<text xml:space="preserve" x="6472" y="3921" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">Non-decoded</text> +<!-- Text --> +<text xml:space="preserve" x="6472" y="4157" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">addresses</text> +<!-- Text --> +<text xml:space="preserve" x="6566" y="1322" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">Decoded</text> +<!-- Text --> +<text xml:space="preserve" x="6566" y="1559" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">addresses</text> +<!-- Line --> +<polyline points="9448,1795 +9637,2125 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="4062" y="1417" width="566" height="1228" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00d1d1; +"/> +<!-- Line: box --> +<rect x="4062" y="3023" width="566" height="1039" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00d1d1; +"/> +<!-- Line --> +<polyline points="3543,1133 +3543,4346 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="6614" y="2078" width="566" height="1039" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#008f8f; +"/> +<!-- Line --> +<polyline points="6094,1417 +6094,3543 +" style="stroke:#00008f;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="8787,1417 +8787,3543 +" style="stroke:#00008f;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="9307" y="2409" width="566" height="708" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#008f8f; +"/> +<!-- Line --> +<polyline points="3448,1133 +3637,1133 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3448,4346 +3637,4346 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3543,4062 +3637,3968 +3637,3637 +3732,3543 +3637,3448 +3637,3118 +3543,3023 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3543,2645 +3637,2551 +3637,2078 +3732,1984 +3637,1889 +3637,1511 +3543,1417 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3543,4062 +4062,4062 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Line --> +<polyline points="3543,2645 +4062,2645 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Line --> +<polyline points="3874,2645 +3874,1434 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Arrowhead on XXXpoint 3874 2645 - 3874 1401--> +<polyline points="3905 1545 +3874 1419 +3842 1545 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="3874,4062 +3874,3040 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Arrowhead on XXXpoint 3874 4062 - 3874 3007--> +<polyline points="3905 3151 +3874 3025 +3842 3151 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="3543,3070 +3543,4062 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3543,1417 +3543,2645 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="6000,1417 +6188,1417 +" style="stroke:#00008f;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="6000,3543 +6188,3543 +" style="stroke:#00008f;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="6094,3118 +6188,3023 +6188,2692 +6283,2598 +6188,2503 +6188,2173 +6094,2078 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="6094,3118 +6614,3118 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Line --> +<polyline points="6377,3118 +6377,2095 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Arrowhead on XXXpoint 6377 3118 - 6377 2062--> +<polyline points="6409 2206 +6377 2080 +6346 2206 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="6094,2078 +6094,3118 +" style="stroke:#00008f;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="8692,1417 +8881,1417 +" style="stroke:#00008f;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="8692,3543 +8881,3543 +" style="stroke:#00008f;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="8787,3118 +8881,3023 +8881,2881 +8976,2787 +8881,2692 +8881,2503 +8787,2409 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="8787,3118 +9307,3118 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Line --> +<polyline points="9070,3118 +9070,2426 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Arrowhead on XXXpoint 9070 3118 - 9070 2393--> +<polyline points="9102 2537 +9070 2411 +9039 2537 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="8787,2409 +8787,3118 +" style="stroke:#00008f;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Text --> +<text xml:space="preserve" x="4346" y="1606" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">size2</text> +<!-- Text --> +<text xml:space="preserve" x="4346" y="2125" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem2</text> +<!-- Text --> +<text xml:space="preserve" x="3448" y="2645" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">mem2_start</text> +<!-- Text --> +<text xml:space="preserve" x="3448" y="4062" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">mem1_start</text> +<!-- Text --> +<text xml:space="preserve" x="2976" y="4393" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">begin_as1</text> +<!-- Text --> +<text xml:space="preserve" x="3023" y="1181" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">end_as1</text> +<!-- Text --> +<text xml:space="preserve" x="2929" y="850" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Address Space I.</text> +<!-- Text --> +<text xml:space="preserve" x="5480" y="1133" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Address Space II.</text> +<!-- Text --> +<text xml:space="preserve" x="4346" y="3212" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">size1</text> +<!-- Text --> +<text xml:space="preserve" x="4346" y="3637" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem1</text> +<!-- Text --> +<text xml:space="preserve" x="4346" y="2551" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">0</text> +<!-- Text --> +<text xml:space="preserve" x="4346" y="3968" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">0</text> +<!-- Text --> +<text xml:space="preserve" x="6897" y="3070" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">0</text> +<!-- Text --> +<text xml:space="preserve" x="6897" y="2267" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">size3</text> +<!-- Text --> +<text xml:space="preserve" x="6897" y="2645" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem3</text> +<!-- Text --> +<text xml:space="preserve" x="5574" y="1464" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">end_as2</text> +<!-- Text --> +<text xml:space="preserve" x="5480" y="3590" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">begin_as2</text> +<!-- Text --> +<text xml:space="preserve" x="6000" y="3118" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">mem3_start</text> +<!-- Text --> +<text xml:space="preserve" x="9590" y="3070" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">0</text> +<!-- Text --> +<text xml:space="preserve" x="9590" y="2267" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">size</text> +<!-- Text --> +<text xml:space="preserve" x="9590" y="2645" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem</text> +<!-- Text --> +<text xml:space="preserve" x="8267" y="1464" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">end_as</text> +<!-- Text --> +<text xml:space="preserve" x="8173" y="3590" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">begin_as</text> +<!-- Text --> +<text xml:space="preserve" x="8692" y="3118" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">mem_start</text> +</g> +</svg> diff --git a/sim/ucsim/doc/index.html b/sim/ucsim/doc/index.html new file mode 100644 index 0000000..6c7399f --- /dev/null +++ b/sim/ucsim/doc/index.html @@ -0,0 +1,109 @@ +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> + <title>Mikrocontroller Simulator</title> + </head> + <body style=" background-color: white;"> [ <a href="news.html">News</a> ] + [ <a href="#download">Download</a> ] [ <a href="#install">Installation</a> + ] [ <a href="#use">Usage</a> ] [ <a href="mailto:drdani@mazsola.iit.uni-miskolc.hu">Mail + to developer</a> ] + <p> </p> + <pre><tt><font size="+1"> + _____ _ + / ____| (_) + _ _| | ___ _ _ __ ___ +| | | | | / __| | '_ ` _ \ +| |_| | |____\__ \ | | | | | | +\ ._,_|\_____|___/_|_| |_| |_| +| | +|_| + </font></tt></pre> + <h1>Software simulator for microcontrollers</h1> + <b><i>μCsim</i></b> can be used to simulate microcontrollers. It supports + MCS51 family, AVR core, Z80, HC08, ST7, STM8, TLCS90, XA51 and Paduk. It can + run on Linux, Windows, OSX, BSD, and other systems.<br> + <br> + See <a href="news.html">what's new</a> in current version.<br> + <h2><a name="download">Download</a></h2> + There are two places where you can download <i>μCsim</i> from:<br> + <ol> + <li>SDCC homepage. <i>μCsim</i> is part of the SDCC (Small Device C + Compiler) project. You can download source of SDCC and precompiled + binaries from <a href="http://sdcc.sf.net">http://sdcc.sf.net</a>.</li> + <li><i>μCsim</i> site. Standalone source package is available on the <i>μCsim</i> + web site:<br> + <a href="http://mazsola.iit.uni-miskolc.hu/ucsim/download">http://mazsola.iit.uni-miskolc.hu/ucsim/download</a> + </li> + </ol> + <p><!-- INSTALL --></p> + <h2><a name="install">How to install</a></h2> + UNIX version is distributed in source. + <ol> + <li>Get archive file, uncompress and untar it. These steps will produce a + directory <b>ucsim-X.Y.Z</b> where X.Y.Z is the version number. </li> + <li>Make sure, that following packages are installed on your system: <b>make</b>, + <b>bison</b> (or yacc), <b>flex</b> (or lex), <b>libncurses-dev</b>. + You will need a C and a C++ compiler as well.</li> + <li>Go to the directory and configure the package. Issue <tt><b>configure</b></tt> + command. It will determine your system and produce <b>Makefile</b>. + Installation directory can be specified with <b><tt>--prefix=<i>dir</i></tt></b><!-- -- --> + option to the <tt><b>configure</b></tt>. Default directory is <tt>/usr/local</tt>. + Executable file will be placed in <tt>bin</tt> subdirectory. </li> + <li>Compile the package with <tt><b>make</b></tt> command. </li> + <li>Install executables <b>s51</b>, <b>savr</b>, <b>shc08</b>, <b>sxa</b>, + <b>sz80, etc.</b> to any directory you want. It can be done with <tt><b>make + install</b></tt> command which will place files in installation + directory specified with <tt><b>--prefix=<i>dir</i></b><!-- -- +--></tt> option of <tt><b>configure</b></tt>. Note that you may have to have + special privilege to do this if installation directory is not writable + by you. </li> + </ol> + <!-- USE --> + <h2><a name="use">How to use</a></h2> + <ul> + <li> <a href="invoke.html">Invocation</a>.<br> + Starting the simulator program. </li> + </ul> + <p><b>Features of the simulator</b> </p> + <ul> + <li><a href="analyzer.html">Code analyser</a>. <br> + The simulator tries to figure out places of valid instructions in code + area.</li> + <li><a href="cpu_types.html">Processor types</a>. <br> + The simulator can simulate different type of microcontrollers. </li> + <li><a href="mulcons.html">Multiple consoles</a>. <br> + The simulator can handle more than one command consoles and accepts + command from multiple sources. It also can be driven by other programs + such as debugger interfaces. </li> + <li><a href="serial.html">Serial interfaces</a>. <br> + The simulator can virtually connect a terminal to serial interface of + the simulated CPU. </li> + <li><a href="memory.html">Memory simulation</a>. <br> + Simulated CPU provides address spaces, storage is simulated by memory + chips, address decoders connects them together. </li> + <li><a href="simif.html">Simulator interface</a>.<br> + This is a special interface which provides services for the simulated + program. This services can be used to control the simulator (for example + run/stop) and access some host features (print, file I/O).</li> + <li><a href="vcd.html">VCD file dumper</a>.<br> + This is a special virtual hardware peripheral which can monitor changes + of a memory location (or a bit in MCS51 where bit address space is + available) and write out changes to a VCD file.</li> + <li><a href="syntax.html">Command syntax</a> and <a href="cmd.html">command + reference</a>. <br> + The simulator can be controlled via a command line interface. It accepts + simple commands. </li> + </ul> + <hr> + <table border="0"> + <tbody> + <tr> + <td><a href="mailto:drdani@mazsola.iit.uni-miskolc.hu"><img src="post.jpg" + align="top" border="0"></a></td> + <td><i>© 1997,99 Dániel Drótos, Talker Bt.</i> <br> + <a href="mailto:drdani@mazsola.iit.uni-miskolc.hu">drdani@mazsola.iit.uni-miskolc.hu</a></td> + </tr> + </tbody> + </table> + </body> +</html> diff --git a/sim/ucsim/doc/invoke.html b/sim/ucsim/doc/invoke.html new file mode 100644 index 0000000..773935f --- /dev/null +++ b/sim/ucsim/doc/invoke.html @@ -0,0 +1,215 @@ +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> + <title>μCsim: Invokation</title> + </head> + <body style=" background-color: white;"> + <h1>Starting the simulator</h1> + There are separate programs to simulate different microcontroller families: + <p>MCS51 family is simulated by <b>s51</b> <br> + AVR family is simulated by <b>savr</b> <br> + Z80 processor is simulated by <b>sz80</b> <br> + XA family is simulated by <b>sxa</b> <br> + HC08 processor is simulated by <b>shc08</b> <br> + ST7 family is simulated by <b>sst7</b> <br> + STM8 family is simulated by <b>sstm8</b> <br> + TLCS90 family is simulated by <b>stlcs<br> + </b>Padauk family is simulated by <b>spdk</b></p> + <p>The simulator can be started in the following way: </p> + <p><tt><font color="blue">$</font> s51 [-hHVvPgGwb] [-p prompt] [-t CPU] [-X + freq[k|M]] [-C cfg_file] [-e command] [-c file] [-s file] [-S + optionlist] [-I if_optionlist] [-a nr] [-Z portnum] [-k portnum] [-o colorlist] [files...]</tt> </p> + <p>Specified files must be names of Intel hex files. Simulator loads them in + the specified order into the ROM of the simulated system. If the file is + specified without extension, the simulator will try to find intel hex file + (filename extended with .hex), omf file (with .omf) and cdb file (with + .cdb extension). Simulator can interpret content of these SDCC output + files and reads information from them.</p> + <p>Options: </p> + <dl> + <dt><tt><b>-t CPU</b></tt> </dt> + <dd>Type of CPU. Recognized types are different for different simulators, + for example MCS51 simulator recognizes 51, 8051, 8751, C51, 80C51, + 87C51, 31, 8031, C31, 80C31, 52, 8052, 8752, C52, 80C52, 87C52, 32, + 8032, C32, 80C32, 51R, 51RA, 51RB, 51RC, C51R, C51RA, C51RB, C51RC, + 89C51R, 251, C251, DS390, DS390F. Note that recognition of a CPU type as + option does not mean that the simulator can simulate that kind of CPU. + Default type is C51. <br> + DS390 supports Dallas DS80C390 24 bit flat mode, dual-dptr operations, + etc. DS390F is the same as DS390, but it starts already in 24 bit flat + mode (ACON = 0xFA instead of 0xF8). DS390F is needed to run programs + compiled with sdcc -mds390.<br> + <span style="font-family: monospace;">-H</span> option can be used to + list all of recognized CPU types.<br> + See <a href="cpu_types.html">how to select CPU type</a>. </dd> + <dt><tt><b>-X freq[k|M]</b></tt> </dt> + <dd>XTAL frequency is <b>freq</b> Hertz. <b>k</b> or <b>M</b> can be + used to specify frequency in kHZ or MHz. Space is not allowed between + the number and the <b>k</b> or <b>M</b>. Default value is 11059200 Hz. + <a name="coption"></a></dd> + <dt><span style="font-family: monospace;"><b>-C cfg_file</b></span></dt> + <dd>Read and execute initial commands from specified file.</dd> + <dt><b><span style="font-family: monospace;">-e command</span></b></dt> + <dd>Execute command at program startup (before config file).</dd> + <dt><a name="coption"><tt><b>-c file</b></tt></a> </dt> + <dd>Open command console on <b>file</b>. Command consoles are on standard + input and output by default. Using this option the console can be opened + on any file for example on the serial interface of the computer. <a name="Zoption"></a></dd> + <dt><a name="Zoption"><tt><b>-Z portnum</b></tt></a> </dt> + <dd>Listen for incoming connections on port <b>portnum</b>. Using this + option <i>μCsim</i> can serve multiple consoles. You can get a console + by simply telnet into machine running <i>μCsim</i> to port <b>portnumber</b>. + This option is not available on platforms which doesn't support BSD + networking. <br> + See <a href="mulcons.html">how to use multiple consoles</a>. </dd> + <dt><tt><b>-k portnum</b></tt></dt> + <dd>Listen for incoming connections on port <b>portnum</b>. When this + port connected, the connection will be attached to simulated UART0.This + option is not useful for other UARTs, so it is better to use the more + general -S option. </dd> + <dt><tt><b>-s file</b></tt> </dt> + <dd>Connect serial interface (UART0) of the simulated microcontroller to + the <b>file</b>. Nothing is used by default which means that characters + transmitted by serial interface of the simulated microcontroller go to + nowhere and it will never receive anything. If you are going to + communicate with serial interface interactively the best idea is to + specify a terminal with -s option. </dd> + <dt><tt><b>-S uart=nr,in=file,out=file,port=nr,iport=nr,oport=nr</b></tt> + </dt> + <dd>Using this option you can specify different files for input and output + streams that <i>μCsim</i> uses to simulate microprocessor's serial + interface. <br> + See <a href="serial.html">more about serial interface simulation</a>. </dd> + <dt><span style="font-family: monospace;"><b>-I + if=memory[address],in=file,out=file</b></span></dt> + <dd>Specify options (as comma separated list) for the simulator interface. + <b>if</b> option turns on the interface and specifies address space and + location for use by the interface. <b>in</b> and <b>out</b> can be + used to specify file names to use for file IO. + <br>See <a href="simif.html">more about simulator interface</a>.</dd> + <dt><tt><b>-p prompt</b></tt> </dt> + <dd>Using this option you can specify any string to be the prompt of + command interpreter, for example: + <pre><font color="blue">$</font> s51 -p "s51> " +<font color="green">ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +0s51> </font></pre> + </dd> + <dt><tt><b>-P</b></tt> </dt> + <dd>Prompt will be a null ('\0') character. This feature can be useful for + programs which controls simulator through a pipe. </dd> + <dt><span style="font-family: monospace;"><b>-o colorsetting,...<br> + </b></span></dt> + <dd>List of color settings in form: <span style="font-family: monospace;">what=colspec,...</span> + where <i>what</i> specifies object to be colored and <i>colspec</i> is + : separated list of color options e.g.: prompt=b:white:black (bold white + on black).<br> + <i>what</i> can be:<br> + <ul> + <li><span style="font-family: monospace;">prompt</span> prompt color,</li> + <li><span style="font-family: monospace;">prompt_console</span> + console number in front of the prompt,</li> + <li><span style="font-family: monospace;">command</span> color of + entered command,</li> + <li><span style="font-family: monospace;">answer</span> default color + for answers printed by commands,</li> + <li><span style="font-family: monospace;">result</span> color of + expression result,</li> + <li><span style="font-family: monospace;">dump_address</span> address + color in memory dump (1<sup>st</sup> column)</li> + <li><span style="font-family: monospace;">dump_number</span> color of + numerical part of the dump (2<sup>nd</sup> column)</li> + <li><span style="font-family: monospace;">dump_char</span> color of + textual part of the dump (3<sup>rd</sup> column)</li> + <li><span style="font-family: monospace;">error</span> color of error + messages</li> + <li><span style="font-family: monospace;">debug</span> color of debug + messages</li> + <li><span style="font-family: monospace;">ui_mkey</span> menu-key + color on UI display</li> + <li><span style="font-family: monospace;">ui_mitem</span> menu-item + color on UI display</li> + <li><span style="font-family: monospace;">ui_label</span> label color + on UI display</li> + <li><span style="font-family: monospace;">ui_time</span> color of + time-value on UI display</li> + <li><span style="font-family: monospace;">ui_title</span> title color + on UI display</li> + <li><span style="font-family: monospace;">ui_run</span> run-state + color on UI display</li> + <li><span style="font-family: monospace;">ui_stop</span> stop-state + color on UI display</li> + </ul> + <i>colspec</i> can be a rendering option, or a color name. First color + name is used for foreground color and the last one will be the color of + background. Rendering options are:<br> + <ul> + <li><span style="font-family: monospace;">b</span> bold</li> + <li><span style="font-family: monospace;">f</span> faint</li> + <li><span style="font-family: monospace;">i</span> italic</li> + <li><span style="font-family: monospace;">u</span> undelined</li> + <li><span style="font-family: monospace;">d</span> double underlined</li> + <li><span style="font-family: monospace;">c</span> crossed over</li> + <li><span style="font-family: monospace;">o</span> overlined</li> + <li><span style="font-family: monospace;">k</span> or <span style="font-family: monospace;">l</span> + blink</li> + </ul> + Color name can be a predefined name, or an RGB value. Known names are:<br> + <ul> + <li><span style="font-family: monospace;">black</span></li> + <li><span style="font-family: monospace;">bblack</span> (bright black, + this is grey on some terminals)</li> + <li><span style="font-family: monospace;">red</span></li> + <li><span style="font-family: monospace;">bred</span> (bright red)</li> + <li><span style="font-family: monospace;">green</span></li> + <li><span style="font-family: monospace;">bgreen</span> (bright green)</li> + <li><span style="font-family: monospace;">yellow</span></li> + <li><span style="font-family: monospace;">byellow</span> (bright + yellow)</li> + <li><span style="font-family: monospace;">blue</span></li> + <li><span style="font-family: monospace;">bblue</span> (bright blue)</li> + <li><span style="font-family: monospace;">magenta</span></li> + <li><span style="font-family: monospace;">bmagenta</span> (bright + magenta)</li> + <li><span style="font-family: monospace;">cyan</span></li> + <li><span style="font-family: monospace;">bcyan</span> (bright cyan)</li> + <li><span style="font-family: monospace;">white</span></li> + <li><span style="font-family: monospace;">bwhite</span> (bright white)</li> + </ul> + How the named colors appear on the screen depends on the terminal + emulator program.<br> + RGB values can be specified as <span style="font-family: monospace;">#RRGGBB</span> + where components are two character hexadecimal values of the red, green + and blue.<br> + Example (set prompt to blinking bold white on green, and set command to + underlined bright green on black):<br> + <span style="font-family: monospace;">-o + prompt=lb:white:green,command=u:bgreen:black</span></dd> + <dt><b><span style="font-family: monospace;">-b</span></b></dt> + <dd>Black & white (non-color) console.</dd> + <dt><span style="font-family: monospace;"><b>-g</b></span></dt> + <dd>Go, start simulation when the program is loaded.</dd> + <dt><span style="font-family: monospace;"><b>-G</b></span></dt> + <dd>Start simulation when the program is loaded and terminate the + simulator when the simulation stops (maybe on breakpoint).</dd> + <dt><span style="font-family: monospace;"><b>-a nr</b></span></dt> + <dd>Set size of variable space. Default is 256.</dd> + <dt><span style="font-family: monospace;"><b>-w</b></span></dt> + <dd>Writable flash.</dd> + <dt><tt><b>-V</b></tt> </dt> + <dd>Verbose mode. The simulator notifies you about some kind of internal + actions for example interrupts. Messages are printed on command console. + </dd> + <dt><tt><b>-v</b></tt> </dt> + <dd>Print out version number and stop. </dd> + <dt><tt><b>-H</b></tt> </dt> + <dd>Print out types of known CPUs. Names printed out by this option can be + used to determine CPU type using <tt><b>-t</b></tt> option. </dd> + <dt><tt><b>-h</b></tt> </dt> + <dd>Print out a short help about the options and stop. </dd> + </dl> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/memory.html b/sim/ucsim/doc/memory.html new file mode 100644 index 0000000..7974125 --- /dev/null +++ b/sim/ucsim/doc/memory.html @@ -0,0 +1,57 @@ +<html> + <head> + <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type"> + <title>Memory simulation in μCsim</title> + </head> + <body> + <h1>Memory simulation in <i>μCsim</i></h1> + Typical microprocessor system can look like this: + <p><img src="cpu-mem.svg" alt="[CPU-memory connection]" border="0"></p> + <h3><a name="address_space">Address space</a></h3> + In our terminology "<b>address space</b>" means a set of: + <ul> + <li>address bus lines </li> + <li>data bus lines </li> + <li>control (read/write) lines</li> + </ul> + Bus lines can be shared by address spaces, in this case number of control + line sets specifies the address spaces. + <p>Microcontrollers usually have more address spaces. Some is used inside + only, some can be used for external memories. </p> + <p>Address space does not store any value. It just specifies range of + addresses by <i>start address</i> (which is not necessarily zero) and <i>size</i> + which the CPU can provide when it tries to access a memory location.</p> + <h3><a name="chip">Memory chip</a></h3> + "<b>Memory chip</b>" is a circuit which can hold values in cells. Cells are + indexed from 0 up to size-1. Each cell stores some (usually 8) bits. + <p><img src="chip.svg" alt="[Memory chip]" border="0"></p> + <h3><a name="address_decoder">Address decoder</a></h3> + Addresses coming from an address space via address bus must be routed to + memory and translated to cell indexes. This is done by the "<b>address + decoder</b>". It listens addresses on the bus and control lines and + enables exactly one memory chip. This way cells of the memory chip appear in + the address space. + <p><img src="decoded.svg" boder="0" alt="[Decoded addresses]"> </p> + <p>It is possible that some addresses are not decoded. Writing to such an + address results data to be lost. Reading of a non-decoded address results + random value. Pullup or pulldown resistors can be applied to data bus + lines to provide a specific value for read operations. </p> + <p>As it shown above, it is also possible that some cells of a chip is not + mapped to any address. </p> + <h3><a name="shared_chips">Mixed address spaces (shared chips)</a></h3> + Decoder connects an address of an address space to a cell of a memory chip. + Only one cell can be connected to each addresses but same cell can be + connected to more than one address spaces. This is done by routing different + control lines to the same chip through logic <b>L</b>: + <p><img src="share-chip.svg" alt="[Sharing memchip]" border="0"> </p> + <p>Because each cell of a memory chip uses same read/write control, in real + world it is not possible to share individual cells of a chip between + address spaces. In μCsim simulator we can define as many address decoders + as we want so it is possible to map any cell to any address. </p> + <h3><a name="banking">Memory banking</a></h3> + <p>Banking...</p> + <h3><a name="banding">Bit banding</a></h3> + <p>Banding...</p> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/mulcons.html b/sim/ucsim/doc/mulcons.html new file mode 100644 index 0000000..757e249 --- /dev/null +++ b/sim/ucsim/doc/mulcons.html @@ -0,0 +1,83 @@ +<html> + <head> + <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type"> + <title>μCsim: Multiple Consoles</title> + </head> + <body bgcolor="white"> + <h1>Using multiple consoles</h1> + <h3>Why?</h3> + Using more than one console can be useful if you want to issue a + command during the simulated program is executed. + <h3>How?</h3> + <p>To get multiple consoles you have to execute the simulator in the + <i>background</i> like daemons run in UNIX systems. The simulator + then will listen and wait for network connection requests and provide + console functions for network connections. + </p> + <p>To run <i>μCsim</i> in the background you have to use <a href="invoke.html#Zoption">-Z</a> + option for the simulator: + </p> + <pre><font color="blue">pigmy$</font> s51 -Z 5555 foo.hex +</pre> + In this case s51 runs in foreground in your command interpreters point + of view. Of course you can run the program really in the background: + <pre><font color="blue">pigmy$</font> s51 -Z 5555 foo.hex & +</pre> + The parameter of the <a href="invoke.html#Zoption">-Z</a> option is a + port number. This can be number of any unused port of your machine. If + the specified port is already occupied then following message appears: + <pre><font color="blue">pigmy$</font> s51 -Z 5555 +<font color="red">bind: Address already in use</font> +</pre> + In this case you have to use an other number. + <p>Let's suppose you have found a free port number and the simulator + listens on it. Now go to somewhere else, at least to an other window + and connect to the simulator: + </p> + <pre><font color="blue">other_machine$</font> telnet pigmy 5555 +</pre> + First parameter to the telnet command is the name of the machine where + the simulator is running on. It can be <tt>localhost</tt> if you are + on the same machine or the fully qualified host name if you are at the + other end of the world. Second parameter is the number of the port + where the simulator is listening. It must be the same number which was + specified as parameter of the <a href="invoke.html#Zoption">-Z</a> + option when the simulator was started (see above). + <p>Connecting to the simulator you get a command console: + </p> + <pre><font color="blue">pigmy$</font> telnet pigmy 5555 +<font color="green">Trying 127.0.0.1... +Connected to pigmy.talker.bt. +Escape character is '^]'. +ucsim 0.2.21, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +> +</font> +</pre> + <h3>What to do with it?</h3> + Obviously you can telnet into the simulator as many times as many + command consoles you want. You can start the execution using one + console and while the program is executed you can, for example, modify + ports on the other console. + <h3>Stop</h3> + Using <a href="cmd.html#q">quit (q)</a> command you can not stop the + simulator. It just stops the actual console and the simulator + continues to listen for incoming network connections. + <p>To stop the simulator completely you have to use <a href="cmd.html#kill">kill</a> + command. Note that if you stop the + simulator then all the active network connections (all other consoles) + will stop. + </p> + <h3>Tricks</h3> + You can get a console on the terminal where you started the + simulator. To do this you must explicitly ask the simulator to open a + console on the standard input/output. You can do this using <a href="invoke.html#coption">-c</a> + option and specify the actual + terminal as parameter for it: + <pre><font color="blue">pigmy$</font> s51 -Z 5555 foo.hex -c /dev/tty +</pre> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/news.html b/sim/ucsim/doc/news.html new file mode 100644 index 0000000..5c41f88 --- /dev/null +++ b/sim/ucsim/doc/news.html @@ -0,0 +1,30 @@ +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=iso-8859-2"> + <title>μCsim: News</title> + </head> + <body> + <h1>News</h1> + <h2>version 0.6</h2> + <ul> + <li>Command line editing</li> + <li>Command line history</li> + <li>New operators for expr and variables</li> + <li>TLCS90 simulator</li> + <li>Simulator interface</li> + <li>Memory banking</li> + <li>Bit banding</li> + <li>Serial line simulation for STM8</li> + <li>pdk14 simulator</li> + <li>Conditional breakpoints</li> + <li>Breakpoint script</li> + <li>Built-in terminal for UART with simulator control</li> + <li>Built-in display and control for MCS51 ports</li> + <li>Dump changes of values to VCD file</li> + <li>Read information from SDCC outputs: cdb and omf file</li> + <li>Variables</li> + <li>Colors</li> + </ul> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/obsolete.html b/sim/ucsim/doc/obsolete.html new file mode 100644 index 0000000..8d1370a --- /dev/null +++ b/sim/ucsim/doc/obsolete.html @@ -0,0 +1,28 @@ +<html> + <head> + <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type"> + </head> + <body><a name="bl"> + <h3>bl</h3> + </a> + List breakpoints. This command prints out information about every + fetch and then event breakpoints. + <pre>> <font color="#118811">bl</font> +F 1(1) 000160 c2 CLR P1.0 +D 2(2) 000180 02 LJMP 022a +F 1(1) 000006 wi +> </pre> + First character on the list shows permanency of the + breakpoint. <b>F</b> means fix and <b>D</b> means dynamic. Second item + on the list is the hit number associated to breakpoint. After that + between the parentheses there is the actual value of the hit + counter. If hit counter reaches zero, breakpoint is activated and hit + counter is preset with value of hit number. Next item is the + address. Next items are different for fetch and event breakpoints. + <p>Fetch breakpoints list hexadecimal code of instruction at + breakpoint's address and then disassembled instruction. + </p> + <p>Event breakpoints list identification of the event's type. + </p> + </body> +</html> diff --git a/sim/ucsim/doc/post.jpg b/sim/ucsim/doc/post.jpg Binary files differnew file mode 100644 index 0000000..37dbfa1 --- /dev/null +++ b/sim/ucsim/doc/post.jpg diff --git a/sim/ucsim/doc/serial.html b/sim/ucsim/doc/serial.html new file mode 100644 index 0000000..1f75e10 --- /dev/null +++ b/sim/ucsim/doc/serial.html @@ -0,0 +1,105 @@ +<html> + <head> + <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type"> + <title>μCsim: Serial Interafces</title> + </head> + <body bgcolor="white"> + <h1>Using serial interfaces</h1> + <h3>Connecting a terminal</h3> + You can easily connect a terminal to the serial interface of the + simulated microcontroller. This terminal is just a file so it can be + anything which is represented as a file. It can be a real serial line + of the computer: + <pre><font color="blue">$</font> s51 -s/dev/ttyS1 +</pre> + Of course you must use the actual device name of your operating + system. Device name <tt>ttyS1</tt> above is used in Linux + systems. Your system can use other names. + <p>You can use a terminal of your system. It can be a virtual console + if your system provides such as Linux does for example. On X Windows + you can use <b>xterm</b> windows as terminals, one for running the + simulator and one as a terminal on CPU's serial line. Here is a sample + how to do this: + </p> + <ol> + <li>Prepare the terminal window which will be connected to the + serial line: + <p></p> + <ul> + <li>Check the device name which represents the terminal: + <pre><font color="blue">$</font> tty +<font color="green">/dev/ttyp1</font> +</pre> + </li> + <li>Disconnect the shell from the terminal. Usually I use the + <b>tail</b> command and any existing text file: + <pre><font color="blue">$</font> tail -f $HOME/.profile +</pre> + </li> + </ul> + </li> + <li>Run the simulator in the other window: + <pre><font color="blue">$</font> s51 -s/dev/ttyp1 program.hex +</pre> + Use the output of the <b>tty</b> command above as the parameter of the + <tt>-s</tt> option. + </li> + </ol> + Every character sent out by the simulated program + appears in the "terminal" window and every charater you type in there + will be received by the simulated controller's serial line. + <h3>Connecting two instances of simulator</h3> + Executing two instances of the simulator, serial lines of two + simulators (micros) can be connected together so they can talk to + each other over their serial interface. It is because you can specify + separate files for serial input and output. For example you run two + simulators "1" and "2", here is the sample how to connect them: + <p><img src="serial1.svg"> + </p> + <ol> + <li>Make two FIFOs to represent physical wires in serial cable + connecting two micros: + <pre><font color="blue">$</font> mkfifo 1-2 2-1 <font color="magenta"># 1-2: 1->2 and 2-1: 2->1</font> +</pre> + </li> + <li>Start two simulators and specify the FIFOs as input and output of + serial interface: + <pre><font color="blue">term1 $</font> <font color="magenta"># start sim "1"</font> +<font color="blue">term1 $</font> s51 -Sin=2-1,out=1-2 program_1_.hex +<font color="blue">term2 $</font> <font color="magenta"># start sim "2"</font> +<font color="blue">term2 $</font> s51 -Sout=2-1,in=1-2 program_2_.hex +</pre> + Because opening a pipe blocks the program until other direction is + opened, the order of arguments above is <b>important</b>! + <p> + </p> + </li> + <li>Debug programs as usual. + </li> + </ol> + Using the most usefull unix commands <b>cat</b> and <b>tee</b> and + just some more FIFOs you can monitor serial communication, here is a + sample: + <p><img src="serial2.svg"> + </p> + <ol> + <li>Make some FIFOs to use between simulators and tee "monitors": + <pre><font color="blue">$</font> mkfifo 1_tee tee_2 2_tee tee_2 +</pre> + </li> + <li>Run monitoring programs (in two xterms for example): + <pre><font color="blue">xterm1 $</font> cat 1_tee|tee /dev/tty >tee_2 # monitor 1->2 +<font color="blue">xterm2 $</font> cat 2_tee|tee /dev/tty >tee_1 # monitor 2->1 +</pre> + </li> + <li>Now you can start simulators (on two other terminals:) + <pre><font color="blue">xterm3 $</font> s51 -Sin=tee_1,out=1_tee program_1_.hex +<font color="blue">xterm4 $</font> s51 -Sin=tee_2,out=2_tee program_2_.hex +</pre> + </li> + <li>Start your apps and listen what they are talking about. + </li> + </ol> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/serial1.fig b/sim/ucsim/doc/serial1.fig new file mode 100644 index 0000000..ad24a87 --- /dev/null +++ b/sim/ucsim/doc/serial1.fig @@ -0,0 +1,53 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +6 3750 2250 5175 2550 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 4912.500 2400.000 5025 2250 5100 2400 5025 2550 +1 2 0 1 0 0 0 0 20 0.000 1 0.0000 3825 2400 75 150 3750 2400 3900 2400 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3825 2250 5025 2250 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3825 2550 5025 2550 +-6 +6 3900 5625 5325 5925 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 5062.500 5775.000 5175 5625 5250 5775 5175 5925 +1 2 0 1 0 0 0 0 20 0.000 1 0.0000 3975 5775 75 150 3900 5775 4050 5775 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3975 5625 5175 5625 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3975 5925 5175 5925 +-6 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 2250 3450 3675 2475 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 6300 3675 5250 2475 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 6975 3975 5400 5775 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3000 3675 3825 5775 +2 2 0 1 9 7 0 0 -1 0.000 0 0 -1 0 0 5 + 825 3225 3900 3225 3900 2925 825 2925 825 3225 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 825 3225 3900 3225 3900 4875 825 4875 825 3225 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 4800 3600 7875 3600 7875 5250 4800 5250 4800 3600 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 4800 3600 7875 3600 7875 3300 4800 3300 4800 3600 +4 1 0 0 0 16 12 0.0000 4 135 330 4425 2175 2-1\001 +4 1 0 0 0 16 12 0.0000 4 135 330 4575 5550 1-2\001 +4 1 9 0 0 18 12 0.0000 4 135 525 6375 3525 term2\001 +4 1 9 0 0 18 12 0.0000 4 135 525 2325 3150 term1\001 +4 0 1 0 0 12 12 0.0000 4 150 2520 900 3600 $ s51 -Sin=2-1,out=1-2 \\\001 +4 0 1 0 0 12 12 0.0000 4 180 1470 900 3810 program_1_.hex\001 +4 0 1 0 0 12 12 0.0000 4 180 1470 4950 4125 program_2_.hex\001 +4 0 1 0 0 12 12 0.0000 4 150 2520 4950 3900 $ s51 -Sout=2-1,in=1-2 \\\001 diff --git a/sim/ucsim/doc/serial1.svg b/sim/ucsim/doc/serial1.svg new file mode 100644 index 0000000..c38d593 --- /dev/null +++ b/sim/ucsim/doc/serial1.svg @@ -0,0 +1,133 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" +"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Creator: fig2dev Version 3.2 Patchlevel 6-beta --> +<!-- CreationDate: Wed Jul 20 21:20:20 2016 --> +<!-- Magnification: 1.000 --> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="5.9in" height="3.3in" + viewBox="813 2025 7105 3912"> +<g style="stroke-width:.025in; fill:none"> +<!-- Arc --> +<path style="stroke:#000000;stroke-width:7;stroke-linecap:butt;" +d="M 5025,2250 A 187 187 0 0 1 5025 2550 " /> +<!-- Ellipse --> +<ellipse transform="translate(3825,2400) rotate(-0.00000000)" rx="75" ry="150" + style="fill:#000000;stroke:#000000;stroke-width:7;"/> +<!-- Line --> +<polyline points="3825,2250 +5025,2250 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3825,2550 +5025,2550 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arc --> +<path style="stroke:#000000;stroke-width:7;stroke-linecap:butt;" +d="M 5175,5625 A 187 187 0 0 1 5175 5925 " /> +<!-- Ellipse --> +<ellipse transform="translate(3975,5775) rotate(-0.00000000)" rx="75" ry="150" + style="fill:#000000;stroke:#000000;stroke-width:7;"/> +<!-- Line --> +<polyline points="3975,5625 +5175,5625 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3975,5925 +5175,5925 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="2264,3442 +3675,2475 +" style="stroke:#ff0000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 3675 2475 - 2237 3458--> +<polyline points="2333 3356 +2251 3449 +2366 3406 +" style="stroke:#ff0000;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="6300,3675 +5260,2486 +" style="stroke:#ff0000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 6300 3675 - 5240 2463--> +<polyline points="5352 2545 +5251 2475 +5307 2585 +" style="stroke:#ff0000;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="6965,3987 +5400,5775 +" style="stroke:#00ff00;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 5400 5775 - 6984 3963--> +<polyline points="6916 4085 +6973 3975 +6871 4045 +" style="stroke:#00ff00;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="3000,3675 +3819,5760 +" style="stroke:#00ff00;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 3000 3675 - 3830 5788--> +<polyline points="3752 5672 +3824 5773 +3808 5650 +" style="stroke:#00ff00;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line: box --> +<rect x="825" y="2925" width="3075" height="300" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="825" y="3225" width="3075" height="1650" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="4800" y="3600" width="3075" height="1650" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="4800" y="3300" width="3075" height="300" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Text --> +<text xml:space="preserve" x="4425" y="2175" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">2-1</text> +<!-- Text --> +<text xml:space="preserve" x="4575" y="5550" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">1-2</text> +<!-- Text --> +<text xml:space="preserve" x="6375" y="3525" fill="#0000b0" font-family="Helvetica" font-style="normal" font-weight="bold" font-size="144" text-anchor="middle">term2</text> +<!-- Text --> +<text xml:space="preserve" x="2325" y="3150" fill="#0000b0" font-family="Helvetica" font-style="normal" font-weight="bold" font-size="144" text-anchor="middle">term1</text> +<!-- Text --> +<text xml:space="preserve" x="900" y="3600" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">$ s51 -Sin=2-1,out=1-2 \</text> +<!-- Text --> +<text xml:space="preserve" x="900" y="3810" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">program_1_.hex</text> +<!-- Text --> +<text xml:space="preserve" x="4950" y="4125" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">program_2_.hex</text> +<!-- Text --> +<text xml:space="preserve" x="4950" y="3900" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">$ s51 -Sout=2-1,in=1-2 \</text> +</g> +</svg> diff --git a/sim/ucsim/doc/serial2.fig b/sim/ucsim/doc/serial2.fig new file mode 100644 index 0000000..81beaef --- /dev/null +++ b/sim/ucsim/doc/serial2.fig @@ -0,0 +1,97 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +6 7125 2325 7425 3825 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 7275.000 3563.000 7425 3675 7275 3750 7125 3675 +1 2 0 1 0 0 0 0 20 0.000 1 4.7124 7275 2475 75 150 7275 2400 7275 2550 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7125 2475 7125 3675 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 7425 2475 7425 3675 +-6 +6 2475 2400 2775 3900 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 2625.000 3638.000 2775 3750 2625 3825 2475 3750 +1 2 0 1 0 0 0 0 20 0.000 1 4.7124 2625 2550 75 150 2625 2475 2625 2625 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2475 2550 2475 3750 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 2775 2550 2775 3750 +-6 +6 5175 6750 6675 7050 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 5437.000 6900.000 5325 7050 5250 6900 5325 6750 +1 2 0 1 0 0 0 0 20 0.000 1 3.1416 6525 6900 75 150 6600 6900 6450 6900 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6525 6750 5325 6750 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 6525 7050 5325 7050 +-6 +6 4200 5700 4500 7200 +5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 4350.000 6938.000 4500 7050 4350 7125 4200 7050 +1 2 0 1 0 0 0 0 20 0.000 1 4.7124 4350 5850 75 150 4350 5775 4350 5925 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4200 5850 4200 7050 +2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4500 5850 4500 7050 +-6 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 4275 1725 2700 2400 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 4350 5700 2550 5025 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 4875 4950 7950 4950 7950 6600 4875 6600 4875 4950 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 4875 4950 7950 4950 7950 4650 4875 4650 4875 4950 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3450 4725 2625 3900 +2 2 0 1 9 7 0 0 -1 0.000 0 0 -1 0 0 5 + 3450 1350 6525 1350 6525 1050 3450 1050 3450 1350 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 3450 1350 6525 1350 6525 3000 3450 3000 3450 1350 +2 2 0 1 9 7 0 0 -1 0.000 0 0 -1 0 0 5 + 2775 8325 5850 8325 5850 8025 2775 8025 2775 8325 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 2775 8325 5850 8325 5850 9975 2775 9975 2775 8325 +2 2 0 1 9 7 0 0 -1 0.000 0 0 -1 0 0 5 + 900 4575 3975 4575 3975 4275 900 4275 900 4575 +2 2 0 1 9 7 0 0 -1 0.000 0 0 7 0 0 5 + 900 4575 3975 4575 3975 6225 900 6225 900 4575 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 5550 1875 7200 2325 +2 1 0 1 4 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 7275 3825 6375 5100 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 4575 8700 4350 7275 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 6675 6900 7500 5325 +2 1 0 1 2 7 0 0 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 3675 8475 5175 6900 +4 1 9 0 0 18 12 0.0000 4 135 630 6450 4875 xterm4\001 +4 0 1 0 0 12 12 0.0000 4 180 2940 975 4950 $ s51 -Sin=tee_1,out=1_tee \\\001 +4 0 1 0 0 12 12 0.0000 4 180 1470 975 5160 program_1_.hex\001 +4 1 9 0 0 18 12 0.0000 4 135 630 4950 1275 xterm1\001 +4 1 9 0 0 18 12 0.0000 4 135 630 4275 8250 xterm2\001 +4 1 9 0 0 18 12 0.0000 4 135 630 2400 4500 xterm3\001 +4 0 1 0 0 12 12 0.0000 4 180 2940 4950 5250 $ s51 -Sin=tee_2,out=2_tee \\\001 +4 0 1 0 0 12 12 0.0000 4 180 1470 4950 5475 program_2_.hex\001 +4 0 1 0 0 12 12 0.0000 4 180 1365 3525 1650 $ cat 1_tee|\\\001 +4 0 1 0 0 12 12 0.0000 4 180 1995 3525 1875 tee /dev/tty >tee_2\001 +4 0 1 0 0 12 12 0.0000 4 180 1365 2850 8625 $ cat 2_tee|\\\001 +4 0 1 0 0 12 12 0.0000 4 180 1995 2850 8850 tee /dev/tty >tee_1\001 +4 0 0 0 0 16 12 0.0000 4 165 465 2850 3600 1_tee\001 +4 0 0 0 0 16 12 0.0000 4 165 465 6600 3525 tee_2\001 +4 0 0 0 0 16 12 0.0000 4 165 465 3675 6825 tee_1\001 +4 0 0 0 0 16 12 0.0000 4 165 465 5700 7275 2_tee\001 diff --git a/sim/ucsim/doc/serial2.svg b/sim/ucsim/doc/serial2.svg new file mode 100644 index 0000000..e8bfe0c --- /dev/null +++ b/sim/ucsim/doc/serial2.svg @@ -0,0 +1,253 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" +"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Creator: fig2dev Version 3.2 Patchlevel 6-beta --> +<!-- CreationDate: Wed Jul 20 21:20:34 2016 --> +<!-- Magnification: 1.000 --> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="6.3in" height="7.5in" + viewBox="888 1038 7523 8949"> +<g style="stroke-width:.025in; fill:none"> +<!-- Arc --> +<path style="stroke:#000000;stroke-width:7;stroke-linecap:butt;" +d="M 7425,3675 A 187 187 0 0 1 7125 3675 " /> +<!-- Ellipse --> +<ellipse transform="translate(7275,2475) rotate(-270.00063138)" rx="75" ry="150" + style="fill:#000000;stroke:#000000;stroke-width:7;"/> +<!-- Line --> +<polyline points="7125,2475 +7125,3675 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="7425,2475 +7425,3675 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arc --> +<path style="stroke:#000000;stroke-width:7;stroke-linecap:butt;" +d="M 2775,3750 A 187 187 0 0 1 2475 3750 " /> +<!-- Ellipse --> +<ellipse transform="translate(2625,2550) rotate(-270.00063138)" rx="75" ry="150" + style="fill:#000000;stroke:#000000;stroke-width:7;"/> +<!-- Line --> +<polyline points="2475,2550 +2475,3750 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="2775,2550 +2775,3750 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arc --> +<path style="stroke:#000000;stroke-width:7;stroke-linecap:butt;" +d="M 5325,7050 A 187 187 0 0 1 5325 6750 " /> +<!-- Ellipse --> +<ellipse transform="translate(6525,6900) rotate(-180.00042092)" rx="75" ry="150" + style="fill:#000000;stroke:#000000;stroke-width:7;"/> +<!-- Line --> +<polyline points="6525,6750 +5325,6750 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="6525,7050 +5325,7050 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arc --> +<path style="stroke:#000000;stroke-width:7;stroke-linecap:butt;" +d="M 4500,7050 A 187 187 0 0 1 4200 7050 " /> +<!-- Ellipse --> +<ellipse transform="translate(4350,5850) rotate(-270.00063138)" rx="75" ry="150" + style="fill:#000000;stroke:#000000;stroke-width:7;"/> +<!-- Line --> +<polyline points="4200,5850 +4200,7050 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4500,5850 +4500,7050 +" style="stroke:#000000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4261,1731 +2700,2400 +" style="stroke:#ff0000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 2700 2400 - 4288 1719--> +<polyline points="4174 1800 +4273 1726 +4150 1745 +" style="stroke:#ff0000;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="4350,5700 +2564,5030 +" style="stroke:#00ff00;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 4350 5700 - 2535 5019--> +<polyline points="2673 5039 +2551 5025 +2652 5095 +" style="stroke:#00ff00;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line: box --> +<rect x="4875" y="4950" width="3075" height="1650" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="4875" y="4650" width="3075" height="300" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3450,4725 +2636,3911 +" style="stroke:#ff0000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 3450 4725 - 2614 3889--> +<polyline points="2732 3964 +2626 3901 +2689 4007 +" style="stroke:#ff0000;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line: box --> +<rect x="3450" y="1050" width="3075" height="300" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="3450" y="1350" width="3075" height="1650" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="2775" y="8025" width="3075" height="300" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="2775" y="8325" width="3075" height="1650" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="900" y="4275" width="3075" height="300" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="900" y="4575" width="3075" height="1650" rx="0" +style="stroke:#0000b0;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5550,1875 +7184,2321 +" style="stroke:#ff0000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 5550 1875 - 7214 2328--> +<polyline points="7074 2321 +7198 2324 +7090 2263 +" style="stroke:#ff0000;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="7275,3825 +6384,5087 +" style="stroke:#ff0000;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 7275 3825 - 6366 5112--> +<polyline points="6420 4982 +6376 5098 +6469 5017 +" style="stroke:#ff0000;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="4575,8700 +4352,7290 +" style="stroke:#00ff00;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 4575 8700 - 4347 7260--> +<polyline points="4398 7389 +4350 7276 +4339 7399 +" style="stroke:#00ff00;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="6683,6886 +7500,5325 +" style="stroke:#00ff00;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 7500 5325 - 6668 6913--> +<polyline points="6705 6777 +6676 6898 +6758 6805 +" style="stroke:#00ff00;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="3686,8464 +5175,6900 +" style="stroke:#00ff00;stroke-width:7; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 5175 6900 - 3664 8485--> +<polyline points="3736 8365 +3675 8473 +3779 8406 +" style="stroke:#00ff00;stroke-width:7;stroke-miterlimit:8; +"/> +<!-- Text --> +<text xml:space="preserve" x="6450" y="4875" fill="#0000b0" font-family="Helvetica" font-style="normal" font-weight="bold" font-size="144" text-anchor="middle">xterm4</text> +<!-- Text --> +<text xml:space="preserve" x="975" y="4950" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">$ s51 -Sin=tee_1,out=1_tee \</text> +<!-- Text --> +<text xml:space="preserve" x="975" y="5160" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">program_1_.hex</text> +<!-- Text --> +<text xml:space="preserve" x="4950" y="1275" fill="#0000b0" font-family="Helvetica" font-style="normal" font-weight="bold" font-size="144" text-anchor="middle">xterm1</text> +<!-- Text --> +<text xml:space="preserve" x="4275" y="8250" fill="#0000b0" font-family="Helvetica" font-style="normal" font-weight="bold" font-size="144" text-anchor="middle">xterm2</text> +<!-- Text --> +<text xml:space="preserve" x="2400" y="4500" fill="#0000b0" font-family="Helvetica" font-style="normal" font-weight="bold" font-size="144" text-anchor="middle">xterm3</text> +<!-- Text --> +<text xml:space="preserve" x="4950" y="5250" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">$ s51 -Sin=tee_2,out=2_tee \</text> +<!-- Text --> +<text xml:space="preserve" x="4950" y="5475" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">program_2_.hex</text> +<!-- Text --> +<text xml:space="preserve" x="3525" y="1650" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">$ cat 1_tee|\</text> +<!-- Text --> +<text xml:space="preserve" x="3525" y="1875" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">tee /dev/tty >tee_2</text> +<!-- Text --> +<text xml:space="preserve" x="2850" y="8625" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">$ cat 2_tee|\</text> +<!-- Text --> +<text xml:space="preserve" x="2850" y="8850" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">tee /dev/tty >tee_1</text> +<!-- Text --> +<text xml:space="preserve" x="2850" y="3600" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">1_tee</text> +<!-- Text --> +<text xml:space="preserve" x="6600" y="3525" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">tee_2</text> +<!-- Text --> +<text xml:space="preserve" x="3675" y="6825" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">tee_1</text> +<!-- Text --> +<text xml:space="preserve" x="5700" y="7275" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">2_tee</text> +</g> +</svg> diff --git a/sim/ucsim/doc/share-chip.fig b/sim/ucsim/doc/share-chip.fig new file mode 100644 index 0000000..05271aa --- /dev/null +++ b/sim/ucsim/doc/share-chip.fig @@ -0,0 +1,145 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 3 0 15 46 -1 20 0.000 0 0 -1 0 0 2 + 3240 4725 3420 4725 +2 1 0 3 0 15 46 -1 20 0.000 0 0 -1 0 0 2 + 3240 7785 3420 7785 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 7 + 3330 7515 3420 7425 3420 7110 3510 7020 3420 6930 3420 6615 + 3330 6525 +2 2 0 1 0 17 50 -1 20 0.000 0 0 -1 0 0 5 + 3825 4995 4365 4995 4365 6165 3825 6165 3825 4995 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 7 + 3330 6165 3420 6075 3420 5625 3510 5535 3420 5445 3420 5085 + 3330 4995 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 0 0 2 + 3330 7515 3825 7515 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 0 0 2 + 3330 6165 3825 6165 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3645 6165 3645 4995 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3645 7515 3645 6525 +2 1 0 3 0 15 46 -1 20 0.000 0 0 -1 0 0 2 + 3330 6525 3330 7515 +2 2 0 1 0 17 50 -1 20 0.000 0 0 -1 0 0 5 + 3825 6525 4365 6525 4365 7515 3825 7515 3825 6525 +2 1 2 1 0 15 46 -1 -1 2.000 0 0 -1 0 0 3 + 5130 6615 4905 6615 4365 6165 +2 1 2 1 0 15 46 -1 20 2.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 4905 6615 4905 5445 +2 1 0 3 0 15 46 -1 20 0.000 0 0 -1 0 0 2 + 3330 4995 3330 6165 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 3330 4725 3330 7785 +2 1 0 3 8 15 46 -1 20 0.000 0 0 -1 0 0 2 + 5130 5445 5130 6615 +2 1 0 3 8 15 46 -1 20 0.000 0 0 -1 0 0 2 + 5040 4995 5220 4995 +2 1 0 3 8 15 46 -1 20 0.000 0 0 -1 0 0 2 + 5040 7020 5220 7020 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 7 + 5130 6615 5220 6525 5220 6075 5310 5985 5220 5895 5220 5535 + 5130 5445 +2 1 0 1 8 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 5130 4995 5130 7020 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 3645 945 3645 675 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 3825 945 3825 540 +2 3 0 1 0 1 51 -1 20 0.000 0 0 -1 0 0 11 + 5490 1890 5400 1890 5580 1710 5760 1890 5670 1890 5670 2070 + 5760 2070 5580 2250 5400 2070 5490 2070 5490 1890 +2 2 0 1 0 26 50 -1 20 0.000 0 0 -1 0 0 5 + 1620 90 2790 90 2790 3330 1620 3330 1620 90 +2 2 0 1 0 13 48 -1 20 0.000 0 0 -1 0 0 5 + 3465 3150 4680 3150 4680 3915 3465 3915 3465 3150 +2 2 0 1 -1 17 50 -1 20 0.000 0 0 -1 0 0 5 + 3555 945 4590 945 4590 1710 3555 1710 3555 945 +2 2 0 1 0 17 50 -1 20 0.000 0 0 -1 0 0 5 + 4995 945 6030 945 6030 1710 4995 1710 4995 945 +2 1 0 1 0 7 53 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 4455 1710 4455 3150 +2 1 0 1 0 7 53 -1 -1 0.000 0 0 -1 0 1 3 + 0 0 1.00 60.00 120.00 + 5895 1710 5895 3330 4680 3330 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 1 0 4 + 0 0 1.00 60.00 120.00 + 2880 225 2925 270 2925 3780 3465 3780 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 2 + 2880 360 2925 405 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 2 + 2880 540 2925 585 +2 1 0 1 0 7 46 -1 -1 0.000 0 0 -1 0 0 2 + 2880 675 2925 720 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2790 675 4095 675 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2790 540 4095 540 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 2790 360 4095 360 +2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 4095 225 2790 225 +2 2 0 1 0 1 50 -1 20 0.000 0 0 -1 0 0 5 + 5985 2250 2790 2250 2790 2430 5985 2430 5985 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4095 135 4410 135 4410 765 4095 765 4095 135 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3 + 0 0 1.00 60.00 120.00 + 4410 495 5130 495 5130 945 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3 + 0 0 1.00 60.00 120.00 + 4410 315 5310 315 5310 945 +2 1 0 1 0 2 50 -1 20 0.000 0 0 -1 0 0 24 + 5265 1890 5265 2925 3150 2925 3330 3240 3330 3150 3465 3375 + 3330 3600 3330 3510 3060 3105 2790 3105 2790 2610 3645 2610 + 3645 1890 3555 1890 3735 1710 3915 1890 3825 1890 3825 2610 + 5085 2610 5085 1890 4995 1890 5175 1710 5355 1890 5265 1890 +2 3 0 1 0 1 51 -1 20 0.000 0 0 -1 0 0 11 + 4050 1890 3960 1890 4140 1710 4320 1890 4230 1890 4230 2070 + 4320 2070 4140 2250 3960 2070 4050 2070 4050 1890 +4 1 0 46 -1 16 12 0.0000 4 135 435 4095 5175 size2\001 +4 1 0 46 -1 16 12 0.0000 4 135 510 4095 5670 Mem2\001 +4 2 0 46 -1 16 12 0.0000 4 150 960 3240 6165 mem2_start\001 +4 2 0 46 -1 16 12 0.0000 4 165 960 3240 7515 mem1_start\001 +4 1 0 46 -1 16 12 0.0000 4 180 870 2790 7830 begin_as1\001 +4 1 0 46 -1 16 12 0.0000 4 165 720 2835 4770 end_as1\001 +4 1 0 46 -1 16 12 0.0000 4 180 1380 2745 4455 Address Space I.\001 +4 1 0 46 -1 16 12 0.0000 4 180 1425 5175 4725 Address Space II.\001 +4 1 0 46 -1 16 12 0.0000 4 135 435 4095 6705 size1\001 +4 1 0 46 -1 16 12 0.0000 4 135 510 4095 7110 Mem1\001 +4 1 0 46 -1 16 12 0.0000 4 120 105 4095 6075 0\001 +4 1 0 46 -1 16 12 0.0000 4 120 105 4095 7425 0\001 +4 2 0 46 -1 16 12 0.0000 4 150 960 6210 6660 mem3_start\001 +4 1 0 46 -1 16 12 0.0000 4 180 870 5715 7065 begin_as2\001 +4 1 0 46 -1 16 12 0.0000 4 165 720 5670 5040 end_as2\001 +4 1 0 47 -1 16 12 0.0000 4 135 390 2160 1575 CPU\001 +4 1 0 46 -1 16 12 0.0000 4 135 705 4050 3735 Decoder\001 +4 1 0 46 -1 16 12 0.0000 4 135 675 4050 3510 Address\001 +4 1 0 48 -1 16 12 0.0000 4 135 510 4095 1395 Mem1\001 +4 1 0 48 -1 16 12 0.0000 4 135 510 5535 1395 Mem2\001 +4 1 0 49 -1 16 12 0.0000 4 135 1020 4275 2835 Address bus\001 +4 1 0 49 -1 16 12 0.0000 4 135 735 6435 2430 Data bus\001 +4 1 0 50 -1 16 20 0.0000 4 225 165 4275 540 L\001 +4 1 0 49 -1 16 12 0.0000 4 135 1035 5940 405 Control lines\001 +4 1 0 49 -1 16 12 0.0000 4 180 465 5940 630 (R/W)\001 +4 0 0 50 -1 16 12 0.0000 4 135 600 6120 1170 Shared\001 +4 0 0 50 -1 16 12 0.0000 4 135 660 6120 1395 memory\001 +4 0 0 50 -1 16 12 0.0000 4 180 345 6120 1620 chip\001 diff --git a/sim/ucsim/doc/share-chip.svg b/sim/ucsim/doc/share-chip.svg new file mode 100644 index 0000000..d09c397 --- /dev/null +++ b/sim/ucsim/doc/share-chip.svg @@ -0,0 +1,474 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" +"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Creator: fig2dev Version 3.2 Patchlevel 6-beta --> +<!-- CreationDate: Wed Jul 20 21:17:51 2016 --> +<!-- Magnification: 1.050 --> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="4.6in" height="6.8in" + viewBox="1688 81 5511 8215"> +<g style="stroke-width:.025in; fill:none"> +<!-- Line --> +<polyline points="4677,1813 +4677,3307 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 4677 3307 - 4677 1779--> +<polyline points="4708 1923 +4677 1797 +4645 1923 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="6188,1813 +6188,3496 +4913,3496 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 6188 3496 - 6188 1779--> +<polyline points="6220 1923 +6188 1797 +6157 1923 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polygon points="5763,1984 +5669,1984 +5858,1795 +6047,1984 +5952,1984 +5952,2173 +6047,2173 +5858,2362 +5669,2173 +5763,2173 +5763,1984 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#0000ff; +"/> +<!-- Line --> +<polygon points="4251,1984 +4157,1984 +4346,1795 +4535,1984 +4440,1984 +4440,2173 +4535,2173 +4346,2362 +4157,2173 +4251,2173 +4251,1984 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#0000ff; +"/> +<!-- Line: box --> +<rect x="4015" y="5244" width="566" height="1228" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00d1d1; +"/> +<!-- Line: box --> +<rect x="4015" y="6850" width="566" height="1039" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00d1d1; +"/> +<!-- Line --> +<polyline points="3496,4960 +3496,8173 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5385,5244 +5385,7370 +" style="stroke:#00008f;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line: box --> +<rect x="1700" y="94" width="1228" height="3401" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#b46100; +"/> +<!-- Line: box --> +<rect x="3732" y="992" width="1086" height="803" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00d1d1; +"/> +<!-- Line: box --> +<rect x="5244" y="992" width="1086" height="803" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00d1d1; +"/> +<!-- Line: box --> +<rect x="2929" y="2362" width="3354" height="188" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#0000ff; +"/> +<!-- Line: box --> +<rect x="4299" y="141" width="330" height="661" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="4629,519 +5385,519 +5385,974 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 5385 519 - 5385 1007--> +<polyline points="5354 864 +5385 990 +5417 864 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="4629,330 +5574,330 +5574,974 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 5574 330 - 5574 1007--> +<polyline points="5543 864 +5574 990 +5606 864 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="5527,1984 +5527,3070 +3307,3070 +3496,3401 +3496,3307 +3637,3543 +3496,3779 +3496,3685 +3212,3259 +2929,3259 +2929,2740 +3826,2740 +3826,1984 +3732,1984 +3921,1795 +4110,1984 +4015,1984 +4015,2740 +5338,2740 +5338,1984 +5244,1984 +5433,1795 +5622,1984 +5527,1984 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00ff00; +"/> +<!-- Text --> +<text xml:space="preserve" x="4488" y="566" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="252" text-anchor="middle">L</text> +<!-- Text --> +<text xml:space="preserve" x="6425" y="1228" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">Shared</text> +<!-- Text --> +<text xml:space="preserve" x="6425" y="1464" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">memory</text> +<!-- Text --> +<text xml:space="preserve" x="6425" y="1700" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="start">chip</text> +<!-- Line --> +<polyline points="3826,975 +3826,708 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 3826 708 - 3826 1007--> +<polyline points="3795 864 +3826 990 +3858 864 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="4015,975 +4015,566 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 4015 566 - 4015 1007--> +<polyline points="3984 864 +4015 990 +4047 864 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="2929,708 +4281,708 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 2929 708 - 4314 708--> +<polyline points="4171 740 +4297 708 +4171 677 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="2929,566 +4281,566 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 2929 566 - 4314 566--> +<polyline points="4171 598 +4297 566 +4171 535 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="2929,377 +4281,377 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 2929 377 - 4314 377--> +<polyline points="4171 409 +4297 377 +4171 346 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="4282,236 +2929,236 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 2929 236 - 4314 236--> +<polyline points="4171 267 +4297 236 +4171 204 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Text --> +<text xml:space="preserve" x="4488" y="2976" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Address bus</text> +<!-- Text --> +<text xml:space="preserve" x="6755" y="2551" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Data bus</text> +<!-- Text --> +<text xml:space="preserve" x="6236" y="425" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Control lines</text> +<!-- Text --> +<text xml:space="preserve" x="6236" y="661" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">(R/W)</text> +<!-- Line: box --> +<rect x="3637" y="3307" width="1275" height="803" rx="0" +style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +fill:#00b000; +"/> +<!-- Text --> +<text xml:space="preserve" x="4299" y="1464" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem1</text> +<!-- Text --> +<text xml:space="preserve" x="5811" y="1464" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem2</text> +<!-- Text --> +<text xml:space="preserve" x="2267" y="1653" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">CPU</text> +<!-- Line --> +<polyline points="3401,4960 +3590,4960 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3401,8173 +3590,8173 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3496,7889 +3590,7795 +3590,7464 +3685,7370 +3590,7275 +3590,6944 +3496,6850 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3496,6472 +3590,6377 +3590,5905 +3685,5811 +3590,5716 +3590,5338 +3496,5244 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3496,7889 +4015,7889 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Line --> +<polyline points="3496,6472 +4015,6472 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Line --> +<polyline points="3826,6472 +3826,5260 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Arrowhead on XXXpoint 3826 6472 - 3826 5228--> +<polyline points="3858 5372 +3826 5246 +3795 5372 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="3826,7889 +3826,6867 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Arrowhead on XXXpoint 3826 7889 - 3826 6834--> +<polyline points="3858 6978 +3826 6852 +3795 6978 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="3496,6850 +3496,7889 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5385,6944 +5149,6944 +4582,6472 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Line --> +<polyline points="5149,6944 +5149,5733 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +stroke-dasharray:10 20;"/> +<!-- Arrowhead on XXXpoint 5149 6944 - 5149 5700--> +<polyline points="5181 5844 +5149 5718 +5118 5844 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="3496,5244 +3496,6472 +" style="stroke:#000000;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5385,5716 +5385,6944 +" style="stroke:#00008f;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5291,5244 +5480,5244 +" style="stroke:#00008f;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5291,7370 +5480,7370 +" style="stroke:#00008f;stroke-width:32; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="5385,6944 +5480,6850 +5480,6377 +5574,6283 +5480,6188 +5480,5811 +5385,5716 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3023,236 +3070,283 +3070,3968 +3619,3968 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Arrowhead on XXXpoint 3070 3968 - 3653 3968--> +<polyline points="3509 4000 +3635 3968 +3509 3937 +" style="stroke:#000000;stroke-width:8;stroke-miterlimit:8; +"/> +<!-- Line --> +<polyline points="3023,377 +3070,425 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3023,566 +3070,614 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Line --> +<polyline points="3023,708 +3070,755 +" style="stroke:#000000;stroke-width:8; +stroke-linejoin:miter; stroke-linecap:butt; +"/> +<!-- Text --> +<text xml:space="preserve" x="4299" y="5433" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">size2</text> +<!-- Text --> +<text xml:space="preserve" x="4299" y="5952" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem2</text> +<!-- Text --> +<text xml:space="preserve" x="3401" y="6472" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">mem2_start</text> +<!-- Text --> +<text xml:space="preserve" x="3401" y="7889" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">mem1_start</text> +<!-- Text --> +<text xml:space="preserve" x="2929" y="8220" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">begin_as1</text> +<!-- Text --> +<text xml:space="preserve" x="2976" y="5007" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">end_as1</text> +<!-- Text --> +<text xml:space="preserve" x="2881" y="4677" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Address Space I.</text> +<!-- Text --> +<text xml:space="preserve" x="5433" y="4960" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Address Space II.</text> +<!-- Text --> +<text xml:space="preserve" x="4299" y="7039" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">size1</text> +<!-- Text --> +<text xml:space="preserve" x="4299" y="7464" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Mem1</text> +<!-- Text --> +<text xml:space="preserve" x="4299" y="6377" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">0</text> +<!-- Text --> +<text xml:space="preserve" x="4299" y="7795" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">0</text> +<!-- Text --> +<text xml:space="preserve" x="6519" y="6992" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="end">mem3_start</text> +<!-- Text --> +<text xml:space="preserve" x="6000" y="7417" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">begin_as2</text> +<!-- Text --> +<text xml:space="preserve" x="5952" y="5291" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">end_as2</text> +<!-- Text --> +<text xml:space="preserve" x="4251" y="3921" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Decoder</text> +<!-- Text --> +<text xml:space="preserve" x="4251" y="3685" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="152" text-anchor="middle">Address</text> +</g> +</svg> diff --git a/sim/ucsim/doc/sif_work.fig b/sim/ucsim/doc/sif_work.fig new file mode 100644 index 0000000..d5cd6d8 --- /dev/null +++ b/sim/ucsim/doc/sif_work.fig @@ -0,0 +1,80 @@ +#FIG 3.2 Produced by xfig version 3.2.7a +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 0 0 10237.500 2452.500 9675 3555 10260 3690 10800 3555 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 0 0 10237.500 2317.500 9675 3420 10260 3555 10800 3420 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 0 0 10237.500 2182.500 9675 3285 10260 3420 10800 3285 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 0 0 10237.500 2047.500 9675 3150 10260 3285 10800 3150 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 0 0 10237.500 1912.500 9675 3015 10260 3150 10800 3015 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 0 0 10237.500 1777.500 9675 2880 10260 3015 10800 2880 +1 2 0 1 0 7 51 -1 -1 0.000 1 0.0000 10236 2746 562 135 9674 2746 10798 2746 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 1395 5715 1395 5715 1620 5175 1620 5175 1395 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 1620 5715 1620 5715 1845 5175 1845 5175 1620 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 1845 5715 1845 5715 2070 5175 2070 5175 1845 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 2070 5715 2070 5715 2295 5175 2295 5175 2070 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 2745 5715 2745 5715 2970 5175 2970 5175 2745 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 3420 5715 3420 5715 3645 5175 3645 5175 3420 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 3645 5715 3645 5715 3870 5175 3870 5175 3645 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 3 + 2655 2295 2880 2295 2880 2070 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 6 + 2655 3870 4320 3870 4320 2070 2880 2070 2655 2295 2655 3870 +2 2 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 2295 5715 2295 5715 2520 5175 2520 5175 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 2970 5715 2970 5715 3195 5175 3195 5175 2970 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 3195 5715 3195 5715 3420 5175 3420 5175 3195 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 5175 2520 5715 2520 5715 2745 5175 2745 5175 2520 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 3870 2565 5085 2340 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 0 0 1.00 60.00 120.00 + 5085 2475 4410 2745 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 2 + 0 0 1.00 60.00 120.00 + 0 0 1.00 60.00 120.00 + 5805 2385 6795 2385 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 9675 2745 9675 3555 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 10800 2745 10800 3555 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 8145 3465 9630 3465 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3 + 0 0 1.00 60.00 120.00 + 8100 2520 10260 2520 10260 2790 +3 3 0 1 0 7 50 -1 -1 0.000 0 0 0 15 + 6975 2070 7650 1665 7965 1935 8100 2250 8505 2565 8685 3060 + 8325 3285 8145 3825 7380 3915 6660 3600 6795 3150 6480 3015 + 6480 2655 6885 2475 6750 2025 + -0.500 -0.500 -0.500 -0.500 -0.500 -0.500 -0.500 -0.500 + -0.500 -0.500 -0.500 -0.500 -0.500 -0.500 -0.500 +4 1 10 50 -1 16 12 5.8469 4 150 375 7875 3420 read\001 +4 1 0 50 -1 16 12 0.0000 4 150 435 3330 1980 prg.c\001 +4 0 0 50 -1 12 12 0.0000 4 135 1080 2745 2610 *sif=cmd;\001 +4 0 0 50 -1 12 12 0.0000 4 135 1560 2745 2820 answer= *sif;\001 +4 1 0 50 -1 16 12 0.0000 4 150 705 5445 1305 memory\001 +4 1 0 50 -1 16 12 0.0000 4 150 210 5445 2475 sif\001 +4 1 12 50 -1 16 12 0.1745 4 105 270 7380 2340 run\001 +4 1 28 50 -1 16 12 0.5236 4 195 375 7200 3510 print\001 +4 1 4 50 -1 16 12 0.3491 4 180 375 7425 2970 stop\001 +4 1 5 50 -1 16 12 6.1087 4 150 405 7875 2655 write\001 +4 1 0 50 -1 16 12 0.0000 4 195 1605 3420 4140 simulated program\001 +4 1 0 50 -1 16 12 0.0000 4 150 795 7560 1575 simulator\001 diff --git a/sim/ucsim/doc/sif_work.svg b/sim/ucsim/doc/sif_work.svg new file mode 100644 index 0000000..4999ed7 --- /dev/null +++ b/sim/ucsim/doc/sif_work.svg @@ -0,0 +1,214 @@ +<?xml version="1.0" standalone="no"?> +<!-- Creator: fig2dev Version 3.2.7a --> +<!-- CreationDate: 2019-06-14 09:02:36 --> +<!-- Magnification: 1.05 --> +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="519pt" height="192pt" + viewBox="2581 1170 8231 3043"> +<g fill="none"> +<!-- Ellipse --> +<ellipse cx="10236" cy="2746" rx="562" ry="135" + stroke="#000000" stroke-width="8px"/> +<!-- Arc --> +<path d="M 9675,3555 A 1238 1238 0 0 0 10800 3555" + stroke="#000000" stroke-width="8px"/> +<!-- Arc --> +<path d="M 9675,3420 A 1238 1238 0 0 0 10800 3420" + stroke="#000000" stroke-width="8px"/> +<!-- Arc --> +<path d="M 9675,3285 A 1238 1238 0 0 0 10800 3285" + stroke="#000000" stroke-width="8px"/> +<!-- Arc --> +<path d="M 9675,3150 A 1238 1238 0 0 0 10800 3150" + stroke="#000000" stroke-width="8px"/> +<!-- Arc --> +<path d="M 9675,3015 A 1238 1238 0 0 0 10800 3015" + stroke="#000000" stroke-width="8px"/> +<!-- Arc --> +<path d="M 9675,2880 A 1238 1238 0 0 0 10800 2880" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<rect x="5175" y="1395" width="540" height="225" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<rect x="5175" y="1620" width="540" height="225" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<rect x="5175" y="1845" width="540" height="225" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<rect x="5175" y="2070" width="540" height="225" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<rect x="5175" y="2745" width="540" height="225" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<rect x="5175" y="3420" width="540" height="225" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<rect x="5175" y="3645" width="540" height="225" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<polyline points=" 2655,2295 2880,2295 2880,2070" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<polyline points=" 2655,3870 4320,3870 4320,2070 2880,2070 2655,2295 2655,3870" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<rect x="5175" y="2295" width="540" height="225" + stroke="#000000" stroke-width="30px"/> +<!-- Line --> +<rect x="5175" y="2970" width="540" height="225" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<rect x="5175" y="3195" width="540" height="225" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<rect x="5175" y="2520" width="540" height="225" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<defs> +<clipPath id="cp0"> + <path clip-rule="evenodd" d="M 2581,1170 H 10812 V 4213 H 2581 z + M 4945,2335 5069,2343 4956,2394 5093,2345 5090,2332z"/> +</clipPath> +</defs> +<polyline points=" 3870,2565 5085,2340" clip-path="url(#cp0)" + stroke="#000000" stroke-width="8px"/> +<!-- Forward arrow to point 5085,2340 --> +<polyline points=" 4945,2335 5069,2343 4956,2394" + stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/> +<!-- Line --> +<defs> +<clipPath id="cp1"> + <path clip-rule="evenodd" d="M 2581,1170 H 10812 V 4213 H 2581 z + M 4548,2722 4425,2739 4526,2666 4401,2741 4406,2754z"/> +</clipPath> +</defs> +<polyline points=" 5085,2475 4410,2745" clip-path="url(#cp1)" + stroke="#000000" stroke-width="8px"/> +<!-- Forward arrow to point 4410,2745 --> +<polyline points=" 4548,2722 4425,2739 4526,2666" + stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/> +<!-- Line --> +<defs> +<clipPath id="cp2"> + <path clip-rule="evenodd" d="M 2581,1170 H 10812 V 4213 H 2581 z + M 6658,2355 6778,2385 6658,2415 6802,2392 6802,2378z + M 5942,2415 5822,2385 5942,2355 5798,2378 5798,2392z"/> +</clipPath> +</defs> +<polyline points=" 5805,2385 6795,2385" clip-path="url(#cp2)" + stroke="#000000" stroke-width="8px"/> +<!-- Forward arrow to point 6795,2385 --> +<polyline points=" 6658,2355 6778,2385 6658,2415" + stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/> +<!-- Backward arrow to point 5805,2385 --> +<polyline points=" 5942,2415 5822,2385 5942,2355" + stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/> +<!-- Line --> +<polyline points=" 9675,2745 9675,3555" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<polyline points=" 10800,2745 10800,3555" + stroke="#000000" stroke-width="8px"/> +<!-- Line --> +<defs> +<clipPath id="cp3"> + <path clip-rule="evenodd" d="M 2581,1170 H 10812 V 4213 H 2581 z + M 6658,2355 6778,2385 6658,2415 6802,2392 6802,2378z + M 8282,3495 8162,3465 8282,3435 8138,3458 8138,3472z"/> +</clipPath> +</defs> +<polyline points=" 8145,3465 9630,3465" clip-path="url(#cp3)" + stroke="#000000" stroke-width="8px"/> +<!-- Backward arrow to point 8145,3465 --> +<polyline points=" 8282,3495 8162,3465 8282,3435" + stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/> +<!-- Line --> +<defs> +<clipPath id="cp4"> + <path clip-rule="evenodd" d="M 2581,1170 H 10812 V 4213 H 2581 z + M 10290,2653 10260,2773 10230,2653 10253,2797 10267,2797z + M 8282,3495 8162,3465 8282,3435 8138,3458 8138,3472z"/> +</clipPath> +</defs> +<polyline points=" 8100,2520 10260,2520 10260,2790" clip-path="url(#cp4)" + stroke="#000000" stroke-width="8px"/> +<!-- Forward arrow to point 10260,2790 --> +<polyline points=" 10290,2653 10260,2773 10230,2653" + stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/> +<!-- Line --> +<polygon points=" 7650,1665 7674,1663 7696,1665 7717,1670 7736,1677 7754,1688 7771,1700 7788,1715 + 7803,1731 7818,1748 7833,1766 7847,1785 7861,1804 7875,1822 7888,1840 7902,1858 + 7915,1874 7928,1890 7941,1906 7953,1920 7965,1935 7977,1951 7987,1968 7997,1985 + 8004,2002 8011,2019 8016,2037 8021,2055 8025,2073 8028,2090 8032,2108 8036,2126 + 8041,2144 8047,2162 8054,2180 8063,2197 8074,2215 8086,2232 8100,2250 8113,2264 + 8127,2279 8142,2293 8159,2306 8176,2320 8195,2334 8215,2347 8236,2360 8257,2373 + 8279,2386 8300,2399 8322,2412 8344,2425 8365,2439 8386,2453 8406,2467 8425,2482 + 8443,2497 8460,2513 8476,2530 8491,2547 8505,2565 8518,2584 8530,2603 8542,2624 + 8553,2646 8565,2668 8576,2691 8587,2716 8598,2740 8609,2765 8620,2791 8631,2817 + 8641,2842 8651,2868 8660,2893 8668,2917 8675,2941 8681,2963 8685,2985 8688,3006 + 8689,3025 8688,3043 8685,3060 8679,3077 8670,3093 8659,3107 8645,3120 8629,3131 + 8610,3140 8590,3149 8568,3157 8545,3164 8522,3170 8498,3177 8475,3184 8452,3192 + 8430,3201 8409,3211 8389,3222 8371,3235 8354,3250 8339,3267 8325,3285 8313,3303 + 8302,3323 8293,3344 8284,3367 8277,3391 8271,3417 8267,3444 8263,3473 8259,3502 + 8257,3531 8254,3561 8251,3591 8248,3621 8243,3650 8238,3677 8231,3704 8222,3729 + 8211,3752 8198,3773 8183,3792 8165,3810 8145,3825 8126,3836 8105,3847 8083,3856 + 8059,3864 8033,3872 8006,3878 7977,3884 7948,3890 7917,3895 7886,3899 7854,3903 + 7821,3907 7788,3910 7755,3913 7721,3916 7688,3918 7655,3920 7622,3922 7590,3923 + 7559,3924 7527,3924 7497,3924 7467,3923 7438,3921 7409,3919 7380,3915 7354,3910 + 7327,3905 7300,3898 7273,3891 7245,3883 7217,3874 7188,3864 7159,3854 7129,3843 + 7099,3832 7069,3820 7039,3808 7008,3795 6978,3783 6948,3770 6918,3757 6889,3744 + 6861,3731 6834,3718 6808,3705 6783,3692 6760,3679 6739,3666 6719,3653 6701,3640 + 6685,3627 6672,3614 6660,3600 6648,3581 6640,3560 6636,3539 6637,3516 6642,3493 + 6651,3469 6662,3444 6676,3418 6692,3393 6709,3367 6725,3341 6742,3315 6757,3290 + 6771,3266 6782,3243 6791,3221 6796,3201 6799,3182 6798,3165 6795,3150 6789,3135 + 6779,3122 6767,3111 6751,3102 6733,3094 6713,3089 6691,3085 6668,3081 6644,3078 + 6620,3075 6596,3072 6574,3068 6552,3063 6533,3057 6516,3049 6502,3039 6490,3028 + 6480,3015 6472,3001 6466,2985 6461,2967 6457,2948 6454,2928 6451,2906 6449,2884 + 6447,2861 6446,2837 6446,2814 6446,2790 6447,2768 6449,2746 6452,2725 6456,2706 + 6462,2687 6470,2671 6480,2655 6491,2642 6505,2630 6521,2619 6539,2609 6560,2601 + 6583,2593 6608,2587 6634,2580 6661,2575 6689,2569 6716,2564 6743,2558 6769,2551 + 6793,2544 6815,2536 6835,2527 6852,2516 6866,2504 6877,2490 6885,2475 6890,2459 + 6893,2440 6892,2420 6889,2399 6883,2375 6875,2350 6865,2324 6853,2296 6840,2268 + 6826,2239 6812,2211 6799,2183 6786,2157 6775,2131 6766,2108 6758,2086 6753,2067 + 6750,2050 6749,2036 6750,2025 6755,2013 6763,2007 6772,2007 6784,2011 6796,2020 + 6810,2032 6825,2045 6840,2059 6857,2071 6875,2080 6896,2085 6919,2086 6945,2080 + 6975,2070 6992,2063 7010,2055 7029,2045 7049,2034 7071,2021 7094,2007 7118,1991 + 7143,1975 7169,1957 7196,1938 7223,1918 7251,1898 7280,1878 7308,1857 7337,1836 + 7365,1816 7394,1796 7421,1777 7448,1759 7475,1742 7500,1726 7525,1712 7549,1700 + 7571,1689 7592,1680 7613,1673 7632,1668" + stroke="#000000" stroke-width="8px" stroke-linejoin="bevel"/> +<!-- Text --> +<g transform="translate(7875,3420) rotate(-335)" > +<text xml:space="preserve" x="0" y="0" fill="#0000d1" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">read</text> +</g><!-- Text --> +<text xml:space="preserve" x="3330" y="1980" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">prg.c</text> +<!-- Text --> +<text xml:space="preserve" x="2745" y="2610" fill="#000000" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">*sif=cmd;</text> +<!-- Text --> +<text xml:space="preserve" x="2745" y="2820" fill="#000000" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">answer= *sif;</text> +<!-- Text --> +<text xml:space="preserve" x="5445" y="1305" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">memory</text> +<!-- Text --> +<text xml:space="preserve" x="5445" y="2475" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">sif</text> +<!-- Text --> +<g transform="translate(7380,2340) rotate(-10)" > +<text xml:space="preserve" x="0" y="0" fill="#008f00" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">run</text> +</g><!-- Text --> +<g transform="translate(7200,3510) rotate(-30)" > +<text xml:space="preserve" x="0" y="0" fill="#ffa1a1" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">print</text> +</g><!-- Text --> +<g transform="translate(7425,2970) rotate(-20)" > +<text xml:space="preserve" x="0" y="0" fill="#ff0000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">stop</text> +</g><!-- Text --> +<g transform="translate(7875,2655) rotate(-350)" > +<text xml:space="preserve" x="0" y="0" fill="#ff00ff" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">write</text> +</g><!-- Text --> +<text xml:space="preserve" x="3420" y="4140" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">simulated program</text> +<!-- Text --> +<text xml:space="preserve" x="7560" y="1575" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">simulator</text> +</g> +</svg> diff --git a/sim/ucsim/doc/simif.html b/sim/ucsim/doc/simif.html new file mode 100644 index 0000000..cb61756 --- /dev/null +++ b/sim/ucsim/doc/simif.html @@ -0,0 +1,429 @@ +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=iso-8859-2"> + <title>μCsim: Simulator interface</title> + <link rel="force-svg" href="http://berjon.com/blog/2009/07/force-svg.html"> + <script type="application/javascript">(function() +{ + function ForceSVGInHTML() + { + window.removeEventListener("load", ForceSVGInHTML, true); + var svgs = document.getElementsByTagName("svg"); + for (var i = 0; i < svgs.length; i++) { + var svg = svgs[i]; + var div = document.createElement("div"); + div.appendChild(svg.cloneNode(true)); + var dom = (new DOMParser()).parseFromString(div.innerHTML, "application/xml"); + svg.parentNode.replaceChild(document.importNode(dom.documentElement, true), svg); + } + } + window.addEventListener("load", ForceSVGInHTML, true); +})();</script> + </head> + <body> + <h1>Simulator interface</h1> + <p>Using the simulator interface the simulated program can control the + simulation, it can get information about the interface, stop simulation + and it can do console and file io.<br> + </p> + <p> <img src="sif_work.svg" border="0"></p> + <p>Interface is available behind a memory location, which can be any data + memory location which is readable and writable by the program. Program can + send command to the interface by writing one character command code into + the memory location (although some of them needs parameter) and can read + back answer from the same location.</p> + <p>The interface must be turned on before use. It means that you must + specify the address of the memory location to use. It can be done in two + ways.</p> + <p><b>Using -I option of the simulator program</b></p> + <p>-I option accepts a list of settings in form: setting=value. Know + settings are:</p> + <dl> + <dt><span style="font-family: monospace;">if</span></dt> + <dd>this setting is used to turn on the interface. Its value must be a + memory name and the address, like:<br> + <code>s51 -I if=xram[0xffff]<br> + </code>memory name must be followed by the address in square brackets. + Address can be specified in decimal, octal or hexadecimal.</dd> + <dt><span style="font-family: monospace;">in</span></dt> + <dd>value specifies name of the file which will be used by READ command.</dd> + <dt><span style="font-family: monospace;">out</span></dt> + <dd>value specifies name of the file which will be used by WRITE command.</dd> + </dl> + <p><b>Configuring virtual simif peripheral</b></p> + <p>If you check hardware elements of simulated processor with <a href="cmd_general.html#conf">conf</a> + commmand, you will see one called <b>simif</b>. Setting of this + peripheral will setup the simulator interface:</p> + <pre>0> <span style="color: #009900;">conf</span> +ucsim version 0.6-pre56 +Type of microcontroller: C52 CMOS cmos +Controller has 12 hardware element(s). + on <b>simif[0]</b> + on vcd[0] + on timer0[0] + on timer1[1] + on uart[0] + on dport[0] + on port[0] + on port[1] + on port[2] + on port[3] + on irq[0] + on timer2[2] +0> </pre> + <p>Using info command you can get state of the interface, known commands, + and other information:</p> + <pre>0> <span style="color: #009900;">info hw simif</span> +uCsim simulator interface, version 1, at (null)[0x0] +Active command: none. +Known commands: +0x5f/_ if_detect: Detect existence of interface +0x69/i commands: Get information about known commands +0x76/v if_ver: Get version of simulator interface +0x56/V sim_ver: Get version of simulator +0x40/@ if_reset: Reset interface to default state +0x49/I cmdinfo: Get information about a command +0x68/h cmdhelp: Get help about a command +0x73/s stop: Stop simulation +0x70/p print: Print character +0x78/x print_hex: Print character in hex +0x66/f fin_check: Check input file if input available +0x72/r read input file: Read character from input file +0x77/w write to output file: Write character to output file +Input file: +Output file: +...</pre> + <p>Use <a href="cmd_general.html#set_hardware">set hardware</a> command to + setup the interface:</p> + <pre>0> <span style="color: #009900;">set hw simif</span> +set hardware simif memory address +set hardware simif fin "input_file_name" +set hardware simif fout "output_file_name" +0> +</pre> + <p>To turn on the interface, use following command:</p> + <pre>0> <span style="color: #009900;">set hw simif xram 0xffff</span> +0> <span style="color: #009900;">i h simif</span> +uCsim simulator interface, version 1, at <b>xram[0xffff]</b><br>... </pre> + <p></p> + <p>following commands can be used to specify input and output files:</p> + <pre>0> <span style="color: #009900;">set hw simif fin "infile.txt"</span> +0> <span style="color: #009900;">set hw simif fout "outfile.txt"</span> +0> <span style="color: #009900;">i h simif</span> +... +Input file: <b>infile.txt</b> +Output file: <b>outfile.txt</b> +... +</pre> + <p></p> + <p><b>Access interface from simulated program</b></p> + <p>To access memory content, you have to use C variable. If address is + already known, you can setup a pointer with that address to access the + content:</p> + <pre>#define SIF_ADDRESS_SPACE_NAME "xram" +#define SIF_ADDRESS_SPACE __xdata +#define SIF_ADDRESS 0xffff + +unsigned char SIF_ADDRESS_SPACE * volatile sif;<br><br>void +main(void) +{ + sif= (unsigned char SIF_ADDRESS_SPACE *) SIF_ADDRESS; +... </pre> + <p></p> + <p>this example can be compiled with SDCC for MSC51 processor. Do not forget + the <b>volatile</b> keyword! You can define names for command characters:</p> + <pre>enum sif_command { + DETECT_SIGN = '!', // answer to detect command + SIFCM_DETECT = '_', // command used to detect the interface + SIFCM_COMMANDS = 'i', // get info about commands + SIFCM_IFVER = 'v', // interface version + SIFCM_SIMVER = 'V', // simulator version + SIFCM_IFRESET = '@', // reset the interface + SIFCM_CMDINFO = 'I', // info about a command + SIFCM_CMDHELP = 'h', // help about a command + SIFCM_STOP = 's', // stop simulation + SIFCM_PRINT = 'p', // print character + SIFCM_FIN_CHECK = 'f', // check input file for input + SIFCM_READ = 'r', // read from input file + SIFCM_WRITE = 'w', // write to output file +}; +</pre> + <p></p> + <p><b>Command: detect</b></p> + <p>Command character: _<br> + Answer: !</p> + <p>Following function can be used to detect if the interface is turned on or + not:</p> + <pre>char +detect(void) +{ + *sif= SIFCM_DETECT; + return *sif == DETECT_SIGN; +} +</pre> + <p></p> + <p><b>Command: commands</b></p> + <p>Command character: i<br> + Answer: nuof_commands, command_char_1, command_char_2, ...</p> + <p>This command can be used to retrieve all know command characters. First + answer is the number of known commands, further reads will get command + characters. Following example will read all commands:</p> + <pre>int nuof_commands; +unsigned char commands[100]; + +void +get_commands(void) +{ + int i; + *sif= SIFCM_COMMANDS; + nuof_commands= *sif; + for (i= 0; i < nuof_commands; i++) + commands[i]= *sif; +} +</pre> + <p></p> + <p><b>Command: ifver</b></p> + <p>Command character: v<br> + Answer: 1 byte version number</p> + <p>Following simple example is a function which returns the interface + version:</p> + <pre>int +get_ifversion(void) +{ + *sif= SIFCM_IFVER; + return(*sif); +} +</pre> + <p></p> + <p><b>Command: simver</b></p> + <p>Command character: V<br> + Answer: string</p> + <p>First byte of the string answer will be the length of the string, and + after the last character a zero byte will arrive. Following function can + be used to read string answer and store it (up to some limited length):</p> + <pre>unsigned char sim_version[15]; + +void +get_sim_version() +{ + unsigned char c, i, n; + + *sif= SIFCM_SIMVER; + sim_version[0]= 0; + n= *sif; + if (n) + { + i= 0; + c= *sif; + while (c && (i<14)) + { + sim_version[i++]= c; + c= *sif; + } + while (c) + c= *sif; + sim_version[i]= 0; + } +} +</pre> + <p></p> + <p><b>Command: ifreset</b></p> + <p>Command character: @<br> + Answer: -</p> + <p>This command resets the interface to default state.</p> + <p><b>Command: cmdinfo</b></p> + <p>Command character: I followed by a command character (which you would + like to get info about)<br> + Answer: array</p> + <dl> + <dt>1st byte of the answer</dt> + <dd>full length of the answer</dd> + <dt>2nd byte of the answer</dt> + <dd>number of parameters that the command needs</dd> + <dt>3rd byte of the answer</dt> + <dd>type of the answer that the command replies<br> + <dl> + <dt>0</dt> + <dd>unknown</dd> + <dt>1</dt> + <dd>one byte</dd> + <dt>2</dt> + <dd>array (of bytes): length, followed by bytes</dd> + <dt>3</dt> + <dd>string: length, characters and one zero byte</dd> + <dt>4</dt> + <dd>no answer</dd> + </dl> + </dd> + </dl> + <div><b>Command: cmdhelp</b></div> + <div><br> + </div> + <div>Command character: h followed by a command character (which you would + like to get info about)<br> + Answer: string</div> + <div><br> + </div> + <div>Returns textual information about. Following function prints + information about all commands (retrieved by "i" command, see above):</div> + <div> + <pre>enum sif_answer_type { + SIFAT_UNKNOWN = 0x00, // we don't know... + SIFAT_BYTE = 0x01, // just a byte + SIFAT_ARRAY = 0x02, // array of some bytes + SIFAT_STRING = 0x03, // a string + SIFAT_NONE = 0x04 // no answer at all +}; + +void +print_cmd_infos(void) +{ + int i, j; + unsigned char inf[5]; + for (i= 0; i < nuof_commands; i++) + { + printf("Command '%c' info:\n", commands[i]); + *sif= SIFCM_CMDINFO; + *sif= commands[i]; + inf[0]= *sif; + for (j= 0; j < inf[0]; j++) + { + inf[j+1]= *sif; + //printf(" 0x%02x", inf[j+1]); + } + printf(" need %d params, answers as ", inf[1]); + switch (inf[2]) + { + case SIFAT_UNKNOWN : printf("unknown"); break; + case SIFAT_BYTE : printf("byte"); break; + case SIFAT_ARRAY : printf("array"); break; + case SIFAT_STRING : printf("string"); break; + case SIFAT_NONE : printf("none"); break; + } + printf(": "); + *sif= SIFCM_CMDHELP; + *sif= commands[i]; + if (*sif) + { + j= *sif; + while (j) + { + putchar(j); + j= *sif; + } + } + printf("\n"); + } + +} +</pre> </div> + <div><br> + </div> + <div><b>Command: stop</b></div> + <div><br> + </div> + <div>Command character: s<br> + Answer: -</div> + <div><br> + </div> + <div>Sending this command stops the simulation.</div> + <div><br> + </div> + <div><b>Command: print</b></div> + <div><br> + </div> + <div>Command character: p followed by a character to print<br> + Answer: -</div> + <div><br> + </div> + <div>This command can be used to print out a character on the simulator + console. Following functions can be used to print a character and a + string:</div> + <div> + <pre>void +sif_putchar(char c) +{ + *sif= SIFCM_PRINT; + *sif= c; +} + +void +sif_print(char *s) +{ + while (*s) + sif_putchar(*s++); +} +</pre> </div> + <div><br> + </div> + <div><b>Command: fin_check</b></div> + <div><br> + </div> + <div>Command character: f</div> + <div>Answer: 0 (if input file is not readable), or 1 (if input file is + readable)</div> + <div><br> + </div> + <div>This command checks if the input file is readable or not.Here is a + simple function which can be used to check readability of the input file:</div> + <div> + <pre>char +sif_fin_avail() +{ + return sif_get(SIFCM_FIN_CHECK); +} +</pre><br> + </div> + <div><b>Command: read</b></div> + <div><br> + </div> + <div>Commad character: r</div> + <div>Answer: next byte from input file</div> + <div><br> + </div> + <div>This command can be used to read next byte from the input file. + Remember, name of the input file must be set before use.</div> + <div><br> + </div> + <div>Following demonstration code prints out content of the input file:</div> + <div> + <pre>void +fin_demo() +{ + char i, c; + printf("Reading input from SIMIF input file:\n"); + while (i= sif_fin_avail()) + { + c= sif_read(); + if (c > 31) + putchar(c); + } + printf("\nRead demo finished\n"); +} +</pre></div> + <div><b>Command: write</b></div> + <div><br> + </div> + <div>Command character: w, followed by a byte to write to output file</div> + <div>Answer: -</div> + <div><br> + </div> + <div>Following function can be used to write a string to the output file:</div> + <div> + <pre>void +fout_demo(char *s) +{ + while (*s) + { + *sif= SIFCM_WRITE; + *sif= *s++; + } +} +</pre>Do not forget to specify name of the output file via setting of the + simulator interface. Be careful, simulator will overwrite content of the + output file!<br> + </div> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/syntax.html b/sim/ucsim/doc/syntax.html new file mode 100644 index 0000000..a3f0cb0 --- /dev/null +++ b/sim/ucsim/doc/syntax.html @@ -0,0 +1,391 @@ +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> + <title>Command syntax of μCsim</title> + </head> + <body style=" background-color: white;"> Content: + <ul> + <li><a href="#syntax">Syntax</a> </li> + <li><a href="#expr">Expressions</a> </li> + <li><a href="#redir">Redirection</a> </li> + </ul> + <h2><a name="syntax">Command syntax of <i>μCsim</i></a></h2> + <i>μCsim</i> uses a very simple command interpreter. Command can be entered + after <i>μCsim</i> displays the prompt and interpreted when ENTER key is + pressed. Commands must start with the name of the command following + parameters. Name of the command can be abbreviated if abbreviation is + unique. Some commands have more than one names. + <p>Syntactically parameters can be a string, bit name, array, number or + symbol. Interpretation of these syntactical elements depends on actual + command. </p> + <p>If the command line can not be recognized as a known command, <i>μCsim</i> + tries to evaluate the command line as an <i>expression</i>. <a href="#expr">See + below</a> for information about operands and operators which can be used + in expressions. </p> + <h3><a name="command_name">Command names</a></h3> + Name of the command must be the first word of the command line. It is not + necessary to enter whole name if abbreviation is unique. Help command can be + used to check out if a command has more names: + <pre>> <font color="green">help run</font> +run [start [stop]] Go +Names of command: <b>go r run</b> +... +</pre> Some commands just groups other commands. These commands have a set of + so-called <i>sub-commands</i>. Sub-command must be second word in the + command line. For example: + <pre>> <font color="green">help set</font> +set <b>subcommand</b> Set, see `set' command for more help +Names of command: set +long help of set +> <font color="green">set</font> +"set" must be followed by the name of a subcommand +List of subcommands: +<b>set option</b> name|nr value + Set value of an option +<b>set error</b> on|off|unset + Set value of an error +<b>set memory</b> memory_type address data... + Place list of data into memory +<b>set bit</b> addr 0|1 Set specified bit to 0 or 1 +<b>set hardware</b> cathegory params... + Set parameters of specified hardware element +</pre> + <h3>Type of parameters</h3> + <h4><a name="string_type">String type</a></h4> + To distinguish strings and symbols, strings can be surrounded by (double) + quotes. Quotes can be omitted if command parameter is interpreted as string + and actual parameter start with a letter (so it doesn't look to be a number) + and doesn't contain space. Let's look an example: + <pre>0> <font color="green">set opt 7 <b>s51></b></font> +0s51><font color="green">set opt 7 <b>".s51> "</b></font> +0.s51> +</pre> + <h4><a name="bit_type">Bit type</a></h4> + If parameter contains a dot (.) it is treated as bit specification. Part + before the dot gives memory address and part after the dot means bit number + in the specified data. + <pre>0> <font color="green">dump <b>p1.1</b></font> + P1.1 0x90 ff 1 +0> <font color="green">dump <b>0x80.1</b></font> + P4.1 0x80 ff 1 +0> +</pre> + <h4><a name="array_type">Array type</a></h4> + Parameters contain [ character are treated as arrays. Arrays can be used to + specify hardware elements. Array index selects an object if more than one + exists: + <pre>0> <font color="green">info hw <b>port[0]</b></font> +port[0] +P0 11111111 0xff 255 . (Value in SFR register) +Pin0 11111111 0xff 255 . (Output of outside circuits) +Port0 11111111 0xff 255 . (Value on the port pins) +0> +</pre> + <h4><a name="number_type">Number type</a></h4> + Some commands accept parameters which in most cases can be numbers. Numbers + can be entered in C-style form. If the number begins with <tt><b>0x</b></tt> + or <tt><b>0X</b></tt> it is interpreted as a <i>hexadecimal</i> number. As + extension to C-style, number can be started by <b><span style="font-family: monospace;">0b</span></b>, + followed by <b><span style="font-family: monospace;">0</span></b> and <b><span + style="font-family: monospace;">1</span></b> characters. In this case it + is interpreted as <i>binary</i> number. If it begins with <tt><b>0</b></tt> + followed by digits it is interpreted as <i>octal</i> number. In other cases + it is interpreted as <i>decimal</i> number. + <h4><a name="symbol_type">Symbol type</a></h4> + If a command parameter can not be classified in other ways (doesn't start + with a digit or a quote, doesn't contain dot or [) then it will be treated + as a <b>symbol</b>. Symbols can be interpreted in several ways. + <h3>Interpretation of parameters</h3> + <h4><a name="address_param">Address parameters</a></h4> + Many commands requires memory addresses as parameters. Addresses can be + specified using number or symbol type of parameters. Value of symbols + depends on processor type. For example MCS52 family of controllers defines + more symbols than MCS51 family. + <h4><a name="number_param">Number, data parameters</a></h4> + When a command expects a number it should get a number. <font color="red">Note</font>, + that symbols is not converted to number they can be used as address only! + <h4><a name="string_param">String parameters</a></h4> + Strings can be entered without quotes if they are recognized as strings (see + above) and do not contain spaces. + <h4><a name="data_list_param">Data list parameters</a></h4> + Data list can be any space separated list of numbers and strings. If you + include a string in the list, it is broken to list of bytes where every byte + is ASCII code of a string's character. + <pre>> <font color="green">where xram "ab" 0x43</font> +0xf961 61 62 63 abc +> +</pre> + <h4><a name="memory_param">Memory parameters</a></h4> + Where memory type is expected, name of the memory should be used. Most + commands accept memory chip and address space too. See <a href="memory.html">memory + simulation</a> for more information. + <h4><a name="hw_param">Hardware element parameters</a></h4> + Hardware elements can be specified by using arrays, where array name is name + of the element and the array index selects one if more than one exists. + <h4><a name="bit_param">Bit parameters</a></h4> + Bits can be specified by several ways. One way is using bit type of command + parameter: + <pre>0> <font color="green">dump 0.2</font> + 0x00.2 0x00 00 0 +0> <font color="green">dump 0xc3.2</font> + 0xc3.2 0xc3 00 0 +0> <font color="green">dump p2.3</font> + P2.3 0xa0 ff 1 +0> +</pre> In this way, any IRAM or SFR location can be addressed as the above + example shows. + <p>Other way is using bit address either by value or by symbolic name: </p> + <pre>0> <font color="green">dump ea</font> + IE0.7 0xa8 00 0 +0> <font color="green">dump 34</font> + 0x24.2 0x24 24 1 +0> <font color="green">dump 0xc7</font> + SCON1.7 0xc0 00 0 +0> +</pre> Of course, only addressable bits can be accessed in this way. + <hr> + <h2><a name="expr">Expressions</a></h2> + If first word of the command line is not recognized as a known command, the + command line will be evaluated as an expression and the result value printed + (in decimal): + <pre>0> <font color="green">12*(34+56)</font> +1080 +0> +</pre> + <h3>Operands</h3> + Operands of the expressions can be + <ul> + <li>number; </li> + <li>memory (either address space, or memory chip); </li> + <li>or bit</li> + </ul> + <h4>Number operands</h4> + Numbers can be entered in decimal, octal (starting with 0 followed by a + number), or hexadecimal (started with 0x), or binary (started with 0b): + <pre>0> <font color="green">12</font> +12 +0> <font color="green">012</font> +10 +0> <font color="green">0x12</font> +18 +0> <font color="green">0b010101</font> +21 +0> + +</pre> Numbers must be integers (floating point is not supported) and not bigger + than the value which can be stored as <b>long int</b>. + <h4>Memory operands</h4> + Memory can be an address space location or a memory chip cell. It can be + specified in following form: + <pre>name[address]</pre> + where <i>name</i> is the name of the address space or memory chip and <i>address</i> + is an expression specifying location (index) of the cell. + <p>Registers in SFR address space can also be specified using pre-defined + names (symbols) of the registers. </p> + <pre>0> <font color="green">xram[0x543]</font> +67 +0> <font color="green">xram_chip[1347]</font> +67 +0> <font color="green">rom[12*(34+56)]</font> +56 +0> <font color="green">sp</font> +7 +0> <font color="green">rom[256*dph+dpl]</font> +88 +0> +</pre> Value of the memory operand is always a positive integer number. + <h4>Bit operands</h4> + Bit operands are evaluated to 0 or 1. Any bit of any memory location can be + specified as bit using following form: + <pre>memory.bitnumber</pre> + where <i>memory</i> is a memory location as a memory operand and <i>bitnumber</i> + is number of the bit within the specified memory cell specified as an + expression. Note, that dot (.) is part of the syntax, not an operator. + <p>Alternatively, name of the bit can be used to specify named SFR bits. </p> + <pre>0> <font color="green">p0.3</font> +1 +0> <font color="green">xram[12*(34+56)].9-2</font> +0 +0> <font color="green">it0</font> +0 +0> +</pre> + <h3>Operators</h3> + <table border="1"> + <tbody> + <tr> + <th>Type</th> + <th>Operator</th> + <th>Meaning</th> + </tr> + <tr> + <td>Primary</td> + <td><span style="font-family: monospace;">( )</span></td> + <td>Group of sub-expressions</td> + </tr> + <tr> + <td>One operand</td> + <td><span style="font-family: monospace;">+ - & ~ !</span></td> + <td>Unary plus, minus, address of, bit negate, logical not</td> + </tr> + <tr> + <td rowspan="3" colspan="1">Arithmetic</td> + <td><span style="font-family: monospace;">* / %</span></td> + <td>Multiply, divide, modulo</td> + </tr> + <tr> + <td><span style="font-family: monospace;">+ -</span></td> + <td>Add, substract</td> + </tr> + <tr> + <td><span style="font-family: monospace;"><< >></span></td> + <td>shift left, right</td> + </tr> + <tr> + <td rowspan="2" colspan="1">Logical</td> + <td><span style="font-family: monospace;">< > <= >= == !=</span></td> + <td>Comparision of two values</td> + </tr> + <tr> + <td><span style="font-family: monospace;">&& || ^^</span></td> + <td>Logical and, or, xor</td> + </tr> + <tr> + <td>Bitwise</td> + <td><span style="font-family: monospace;">& | ^</span></td> + <td>Bitwise and, or, xor</td> + </tr> + <tr> + <td>Assignment</td> + <td><span style="font-family: monospace;">= *= /= %= += -= <<= + >>= &= |= ^=</span></td> + <td>Assign to</td> + </tr> + <tr> + <td>Increment, decrement</td> + <td><span style="font-family: monospace;">++ --</span></td> + <td>Can be used in prefix or postfix style</td> + </tr> + <tr> + <td>Conditional</td> + <td><span style="font-family: monospace;">?:</span></td> + <td>Works as in C</td> + </tr> + <tr> + <td>Comma</td> + <td><span style="font-family: monospace;">,</span></td> + <td>Evaluates expression in order, results last</td> + </tr> + </tbody> + </table> + Arithmetic operators and parenthesis work as usual. + <p>Assignment operator can be used to modify memory cells and bits of the + cells. Result will be the assigned value. </p> + <pre>0> <font color="green">p0=23</font> +23 +0> <font color="green">i h port[0]</font> +port[0] +P0 00010111 0x17 23 . (Value in SFR register) +Pin0 11111111 0xff 255 . (Output of outside circuits) +Port0 00010111 0x17 23 . (Value on the port pins) +0> <font color="green">p0.0= 0</font> +0 +0> <font color="green">i h p[0]</font> +port[0] +P0 00010110 0x16 22 . (Value in SFR register) +Pin0 11111111 0xff 255 . (Output of outside circuits) +Port0 00010110 0x16 22 . (Value on the port pins) +0> <font color="green">xram[256*dph+dpl]= rom[0]</font> +108 +0> <font color="green">dump rom 0 0</font> +0x0000 6c l +0> <font color="green">dump sfr dph dph</font> +0x83 00 . +0> <font color="green">dump sfr dpl dpl</font> +0x82 00 . +0> <font color="green">dump xram 0 0</font> +0x0000 6c l +0> <font color="green">0x6c</font> +108 +0> <font color="green">dump ea</font> + IE0.7 0xa8 00 0 +0> <font color="green">ea= 1111</font> +1 +0> <font color="green">dump ea</font> + IE0.7 0xa8 80 1 +0> +</pre> When a symbolic name of the SFR is used, it results value of the named + register not the value of the symbol. "Address of" operator can be used to + get value of the symbol. + <pre>0> <font color="green">dpl</font> +0 +0> <font color="green">&dpl</font> +130 +0> <font color="green">ea</font> +1 +0> <font color="green">&ea</font> +175 +0> <font color="green">256*dph+dpl</font> +46630 +0> <font color="green">&xram[256*dph+dpl]</font> +46630 +0> +</pre> + <hr> + <h2><a name="redir">Redirection</a></h2> + Output of any command can be redirected to a file. Same syntax can be used + for this as for UNIX shell. The only difference is that <i>μCsim</i> + doesn't allow to put redirection at the beginning of the command! + <pre>$ <font color="#118811">s51 remo.hex</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +55470 words read from remo.hex +0> <font color="#118811">dump >/tmp/rom.dump rom</font> +0> <font color="#118811">quit</font> +$ <font color="#118811">cat /tmp/rom.dump</font> +0x0000 02 01 60 02 00 3c 06 07 ..`..<.. +0x0008 08 09 0a 02 2f 6b 0e 0f ..../k.. +0x0010 10 11 12 02 00 ac 16 17 ........ +0x0018 18 19 1a 1b 1c 1d 1e 1f ........ +0x0020 20 21 22 02 01 1c 26 27 !"...&' +0x0028 28 29 2a 32 2c 2d 2e 2f ()*2,-./ +0x0030 02 0f a7 02 0e 9c 02 0d ........ +0x0038 d2 02 08 41 c0 82 c0 83 ...A.... +0x0040 c0 d0 c0 e0 c0 00 a2 90 ........ +0x0048 c0 d0 c2 90 78 18 06 30 ....x..0 +$ <font color="#118811">s51 remo.hex</font> +uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt. +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. +55470 words read from remo.hex +0> <font color="#118811">dump rom 0x50 >>/tmp/rom.dump</font> +0> <font color="#118811">quit</font> +$ <font color="#118811">cat /tmp/rom.dump</font> +0x0000 02 01 60 02 00 3c 06 07 ..`..<.. +0x0008 08 09 0a 02 2f 6b 0e 0f ..../k.. +0x0010 10 11 12 02 00 ac 16 17 ........ +0x0018 18 19 1a 1b 1c 1d 1e 1f ........ +0x0020 20 21 22 02 01 1c 26 27 !"...&' +0x0028 28 29 2a 32 2c 2d 2e 2f ()*2,-./ +0x0030 02 0f a7 02 0e 9c 02 0d ........ +0x0038 d2 02 08 41 c0 82 c0 83 ...A.... +0x0040 c0 d0 c0 e0 c0 00 a2 90 ........ +0x0048 c0 d0 c2 90 78 18 06 30 ....x..0 +0x0050 03 4b 20 92 48 30 07 05 .K .H0.. +0x0058 c2 07 02 00 9d 30 08 05 .....0.. +0x0060 20 93 3a c2 08 90 08 60 .:....` +0x0068 e0 b4 ff 03 02 00 9d 04 ........ +0x0070 f0 14 f8 03 03 03 54 1f ......T. +0x0078 90 08 62 25 82 f5 82 e5 ..b%.... +0x0080 83 34 00 f5 83 e8 54 07 .4....T. +0x0088 f8 08 74 80 23 d8 fd f8 ..t.#... +0x0090 e0 30 93 07 c8 f4 58 f0 .0....X. +0x0098 02 00 9d 48 f0 d0 d0 92 ...H.... +$ +</pre> + <hr> + </body> +</html> diff --git a/sim/ucsim/doc/uCsim.txt b/sim/ucsim/doc/uCsim.txt new file mode 100644 index 0000000..8246e97 --- /dev/null +++ b/sim/ucsim/doc/uCsim.txt @@ -0,0 +1,16 @@ + ___ + / . + | _ _ _ + | | | / | / \/ \ + | | | --\ | | | | + /\_/ \___ _/ | | | | +/ + + _____ _ + / ____| (_) + _ _| | ___ _ _ __ ___ +| | | | | / __| | '_ ` _ \ +| |_| | |____\__ \ | | | | | | +\ ._,_|\_____|___/_|_| |_| |_| +| | +|_| diff --git a/sim/ucsim/doc/ucsim.1 b/sim/ucsim/doc/ucsim.1 new file mode 100644 index 0000000..5cf365c --- /dev/null +++ b/sim/ucsim/doc/ucsim.1 @@ -0,0 +1,187 @@ +.TH UCSIM 1 +.SH NAME +uCsim \- Micro\-controller simulator +.SH SYNOPSIS +.B s51|sz80|savr|sxa|shc08|spdk|sst7|sstm8|stlc +.BR \-t type +.BR \-X freq[k|M] +.BR \-C file +.BR \-e command +.BR \-c file +.BR \-Z portnum +.BR \-s file +.BR \-S options +.BR \-I options +.BR \-p prompt +.BR \-P +.BR \-g +.BR \-G +.BR \-a nr +.BR \-w +.BR \-V +.BR \-H +.BR \-h +.SH DESCRIPTION +.I s51 +command is used to simulate MCS51 controller family. +.I sz80 +command is Z80 simulator. +.PP +.B Options of the command +.TP +.B \-t type +Specifies type of the controller. Use \-H to list possible values. +.PP +.TP +.B \-X freq[k|M] +XTAL frequency in Hz, Use +.I k +or +.I M +suffix to specify frequency in kHz or MHz. +.PP +.TP +.B \-C file +Read initial commands from +.I file +and execute them. +.PP +.TP +.B \-e command +Execute +.I command +at program startup (before config file). +.PP +.TP +.B \-c file +Open command console on +.I file +(use \- for std in/out). +.PP +.TP +.B \-Z portnum +Use +.I localhost:portnum +for command console +.PP +.TP +.B \-k portnum +Use +.I localhost:portnum +for serial I/O +.PP +.TP +.B \-s file +Connect serial interface uart0 to +.I file +.PP +.TP +.B \-S options +.I options +is a comma separated list of options according to serial interface. Know options are: +.br +.I uart=nr +number of uart (default=0) +.br +.I in=file +serial input will be read from file named `file' +.br +.I out=file +serial output will be written to `file' +.br +.I port=nr +Use localhost:nr as server for serial line +.br +.I iport=nr +Use localhost:nr as server for serial input +.br +.I oport=nr +Use localhost:nr as server for serial onput +.PP +.TP +.B \-I options +.I options +is a comma separated list of options according to simulator interface. Known options are: +.br +.I if=memory[address] +turn on interface on given memory location +.br +.I in=file +specify input file for IO +.br +.I out=file +specify output file for IO +.PP +.TP +.B \-p prompt +Specify string for prompt +.PP +.TP +.B \-P +Prompt is a null ('\\0') character +.PP +.TP +.B \-o colors +List of color specification: what=colspec,... where colspec is : +separated list of color options e.g.: prompt=b:white:black (bold white +on black) +.PP +.TP +.B \-b +Black & white (non-color) console +.PP +.TP +.B \-g +Go, start simulation +.PP +.TP +.B \-G +Go, start simulation, quit on stop +.PP +.TP +.B \-a nr +Specify size of variable space (default=256) +.PP +.TP +.B \-w +Writable flash +.PP +.TP +.B \-V +Verbose mode +.PP +.TP +.B \-v +Print out version number and quit +.PP +.TP +.B \-H +Print out types of known CPUs and quit +.PP +.TP +.B \-h +Print out this help and quit +.SH EXAMPLES +None yet. +.SH "SEE ALSO" +sdcc(1), sdcdb(1). +.SH BUGS +Probably many. +.SH AUTHORS +Daniel Drotos, +Gunar Holm, +Sandeep Dutta, +Salvador Eduardo Tropea, +Josef Wolf, +Stephane Meyer, +Larry Doolittle, +Timothy Hurman, +Karl-Max Wagner, +Edmar Wienskoski Jr, +Alexandre Frey, +Kaido Karner, +Kalr Bongers, +Alexis Pavlov, +Davine Zanni, +Anton Persson, +Nicolas Lesser diff --git a/sim/ucsim/doc/vcd.html b/sim/ucsim/doc/vcd.html new file mode 100644 index 0000000..96cb191 --- /dev/null +++ b/sim/ucsim/doc/vcd.html @@ -0,0 +1,47 @@ +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=iso-8859-2"> + <title>μCsim: VCD file dumper</title> + </head> + <body> + <h1>VCD file dumper</h1> + <p>1. specify output file:<br> + <br> + 0> set hw vcd[0] file "name.vcd"<br> + <br> + 2. add locations to dump (sorry, I didn't remember correctly, bits can not + be dumped yet):<br> + <br> + 0> set hw vcd[0] add pc_odr<br> + 0> set hw vcd[0] add rom[0x500a]<br> + <br> + You can set the name of the module if you want (set hw vcd[0] module + name), it will be<br> + ucsim_vcd_0 by default.<br> + <br> + 3. start recording:<br> + <br> + 0> set hw vcd[0] start<br> + <br> + 4. run the program</p> + <p>5. you can suspend/resume recording:<br> + <br> + 0> set hw vcd[0] pause<br> + 0> set hw vcd[0] restart<br> + <br> + You can create an additional recorder with "set hw vcd[0] new id" and + setup it with "set<br> + hw vcd[id] ..." commands ("id" must be a number).<br> + <br> + 6. stop recording and close the vcd file:<br> + <br> + 0> set hw vcd[0] stop<br> + <br> + After "stop", you have to specify a new file, because "start" overwrites + the old one!<br> + <br> + For examine, I use gtkwave on linux.<br> + </p> + <hr> + </body> +</html> |
