reorganize everything

This commit is contained in:
Dennis Gunia
2024-06-24 20:38:02 +02:00
parent ea1069e59c
commit 1ed6034d99
3867 changed files with 16188 additions and 13447 deletions

View File

@@ -0,0 +1,90 @@
SDCC Binary Kit Install Help
----------------------------
For Linux users:
================
To install:
* Extract the binary kit to a temporary directory.
This will create a new directory called 'sdcc-4.2.0' in the temporary directory.
cd ~
mkdir tmp
cd tmp
tar xjf path/to/binary/kit/sdcc-4.2.0-i386-unknown-linux2.5.tar.bz2
* Change to the sdcc directory and copy all files to /usr/local
cd sdcc-4.2.0
cp -r * /usr/local
This will install sdcc binaries into: /usr/local/bin/
header files into: /usr/local/share/sdcc/include/
non-free header files into: /usr/local/share/sdcc/non-free/include/
library files into: /usr/local/share/sdcc/lib/
non-free library files into: /usr/local/share/sdcc/non-free/lib/
and documentation into: /usr/local/share/sdcc/doc/
You can test the install by entering:
/usr/local/bin/sdcc -v
This should return sdcc's version number.
Even if the default search paths look into /usr/local, sdcc is fully
relocatable. Try `sdcc --print-search-dirs` if you have problems with header
or library files. See sdccman.pdf for more detailed information.
For Windows 9X/NT/2000/XP/Vista/7/8 users:
==========================================
To install:
* If you would like to keep a copy of your previous version,
rename the directory where it's installed first
* Run sdcc-4.2.0-setup.exe for 32 bit Windows or
Run sdcc-4.2.0-x64-setup.exe for 64 bit Windows
By default this will install sdcc binaries into: C:\Program Files\SDCC\bin\
header files into: C:\Program Files\SDCC\include\
non-free header files into: C:\Program Files\SDCC\non-free\include\
library files into: C:\Program Files\SDCC\lib\
non-free library files into: C:\Program Files\SDCC\non-free\lib\
and documentation into: C:\Program Files\SDCC\doc\
You can test the install by opening a DOS box and entering:
sdcc -v
This should return sdcc's version number.
sdcc for windows is fully relocatable. Try `sdcc --print-search-dirs` if you
have problems with header or library files. See sdccman.pdf for more
detailed information.
For Mac OS X users:
===================
To install:
* Extract the binary kit to a temporary directory.
This will create a new directory called 'sdcc-4.2.0' in the temporary directory.
cd ~
mkdir tmp
cd tmp
tar xjf path/to/binary/kit/sdcc-4.2.0-x86_64-apple-macosx.tar.bz2
* Change to the sdcc directory and copy all files to /Developer/sdcc
cp -r sdcc /Developer/sdcc
This will install sdcc binaries into: /Developer/sdcc/bin/
header files into: /Developer/sdcc/share/sdcc/include/
non-free header files into: /Developer/sdcc/share/sdcc/non-free/include/
library files into: /Developer/sdcc/share/sdcc/lib/
non-free library files into: /Developer/sdcc/share/sdcc/non-free/lib/
and documentation into: /Developer/sdcc/share/sdcc/doc/
You can test the install by entering:
/Developer/sdcc/bin/sdcc -v
This should return sdcc's version number.
Even if the default search paths look into /usr/local, sdcc is fully
relocatable. Try `sdcc --print-search-dirs` if you have problems with header
or library files. See sdccman.pdf for more detailed information.

View File

@@ -0,0 +1,130 @@
SDCC - free open source, retargettable, optimizing ANSI-C compiler
------------------------------------------------------------------
Welcome to SDCC, free open source, retargettable, optimizing ANSI C
compiler suite that targets a growing list of processors including the
Intel MCS-51 based microprocessors (8031, 8032, 8051, 8052, etc.), Maxim
(formerly Dallas) DS80C390 variants, Freescale (formerly Motorola) HC08
based (hc08, s08), Zilog Z80 based MCUs (Z80, Z80N, Z180, SM83 (e.g. Game Boy),
Rabbit 2000, Rabbit 2000A/3000, Rabbit 3000A, TLCS-90), STMicroelectronics STM8
and Padauk PDK14 and PDk15.
Work is in progress on supporting the Padauk PDK13 and MOS 6502 targets.
There are unmaintained Microchip PIC16 and PIC18 targets.
It can be retargeted for other microprocessors.
See share/sdcc/doc/INSTALL.txt for the installation instructions for
the binary kits.
See the share/sdcc/doc directory for more documentation.
See http://sdcc.sourceforge.net/ for the latest information on sdcc.
Licenses:
~~~~~~~~~
SDCC compiler suite is a collection of several components derived from
different sources with different FOSS licenses. See the sdccman.pdf
document, chapter "SDCC Suite Licenses" for details.
The code or object files generated by SDCC suite are not licensed, so
they can be used in FLOSS or proprietary (closed source) applications.
The great majority of sdcc run-time libraries are licensed under the
GPLv2+LE which allows linking of sdcc run time libraries with
proprietary (closed source) applications.
Exception are pic device libraries and header files which are derived
from Microchip header (.inc) and linker script (.lkr) files. Microchip
requires that "The header files should state that they are only to be
used with authentic Microchip devices" which makes them incompatible
with the GPL. Pic device libraries and header files are located at
non-free/lib and non-free/include directories respectively. Sdcc should
be run with the --use-non-free command line option in order to include
the potentially non-free header files and libraries.
However: Many think that the Microchip requirement is not legally enforceable,
arguing that the header files only contain noncopyrightable facts.
See:
http://www.gnu.org/copyleft/gpl.html
http://sourceforge.net/apps/trac/sdcc/wiki/SDCC%20Library%20Licenses
Support:
~~~~~~~~
SDCC compiler suite is a collaborative effort between a group of
volunteers. Please feel free to report bugs via the Sourceforge bug
tracker, or to ask questions on the user mailing list. See:
http://sourceforge.net/tracker/?atid=100599&group_id=599&func=browse
http://sourceforge.net/mail/?group_id=599
Notes:
* The ds400, pic14 and pic16 are currently experimental, but work is in
progress. Please check http://sdcc.sourceforge.net/snap.php for snapshots.
* The TININative, avr and xa51 targets are no longer maintained.
Roadmap:
~~~~~~~~
COPYING - GPL v2
debugger/ - sdcdb debugger
device/ - Device libraries and examples
doc/ - sdcc and target specific documentation
sdas/ - Assemblers and linkers, derived from asxxxx
sim/ - ucsim simulator
src/ - Source to the C compiler and targets
support/ - Libraries and apps that may not be provided by your system.
Authors and interested persons:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Sandeep Dutta (sandeep AT users.sourceforge.net)
* Jean Loius-VERN <jlvern AT writeme.com>
* Daniel Drotos <drdani AT mazsola.iit.uni-miskolc.hu>
* Kevin Vigor <kevin AT vigor.nu>
* Johan Knol <johan.knol AT iduna.nl>
* Scott Dattalo <scott AT dattalo.com>
* Karl Bongers <karl AT turbobit.com>
* Bernhard Held <bernhard AT bernhardheld.de>
* Frieder Ferlemann <frieder.ferlemann AT web.de>
* Jesus Calvino-Fraga <jesusc AT ece.ubc.ca>
* Borut Razem <borut.razem AT siol.net>
* Vangelis Rokas <vrokas AT otenet.gr>
* Erik Petrich <epetrich AT ivorytower.norman.ok.us>
* Paul Stoffregen <paul AT pjrc.com>
* Michael Hope <michaelh AT juju.net.nz> <nz_michaelh AT yahoo.com>
* Maarten Brock <sourceforge.brock AT dse.nl>
* Raphael Neider <RNeider AT web.de>
* Hans-Juergen Dorn <hans.dorn AT apl-landau.de>
* Klaus Flittner <klaus_flittner AT gmx.de>
* Philipp Klaus Krause <pkk AT spth.de>
* Leland Morrison <enigmalee.AT.sourceforget.net>
* Molnar Karoly <molnarkaroly AT users.sf.net>
* Ben Shi <powerstudio1st AT 163.com>
SDCC includes code from:
* Alan Baldwin <baldwin AT shop-pdp.kent.edu>
Initial version of ASXXXX and ASLINK.
* John Hartman <noice AT noicedebugger.com>
Porting ASXXXX and ASLINK for 8051.
* Dmitry S. Obukhov <dso AT usa.net>
malloc and serial I/O routines.
* Pascal Felber
Some of the Z80 related files are borrowed from the Gameboy
Development Kit (GBDK).
* The GCC development team http://gcc.gnu.org/
for GNU C preprocessor, the basis of sdcpp preprocessor and
gcc test suite, partially included into the SDCC regression test suite
* The GNU Binutils development team http://www.gnu.org/software/binutils/
for GNU Binutils, the basis of sdbinutils
* Boost Community http://www.boost.org/
for Boost C++ libraries used in sdcc compiler
* Timo Bingmann http://idlebox.net/2007/stx-btree/
for TX B+ Tree C++ Template Classes used in sdcc compiler
* Malini Dutta <malini AT mediaone.net>
Sandeep's wife, for her patience and support.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -0,0 +1,59 @@
<html>
<head>
<meta content="text/html; charset=ISO-8859-2" http-equiv="content-type">
<title>&mu;Csim: Code Analyser</title>
</head>
<body bgcolor="white">
<h1>Code analyser</h1>
<p>The code analyser analyses the memory of the simulated microprocessor and
tries to figure out which address contains valid instruction.</p>
<p>The analyser starts from the known hardware vectors (reset, IRQs etc.)
and follows the possible execution paths through jumps, branches and
calls marking data as code and adding variables as necessary. Execution
paths that are indirect, indexed or otherwise computed are not followed
initially but will be analysed when, or if, execution reaches them.</p>
<p>If code is known to exist elsewhere in memory and is not reachable
without being run explicitly (such as by the "<code>run <i>addr</i></code>"
command) you can use "<code>analyse <i>addr</i></code>" to ask the analyser
to look there. This is not persistent however. Whenever data is loaded
or "<code>analyse</code>" run with no <i>addr</i> argument all the analyser
state is reset and recreated from the known vectors so any explicit
"<code>analyse <i>addr</i></code>" needs to be rerun if required.</p>
<p>Variables created by the analyser always start with a dot. Such variables
cannot be created by the "<code>var</code>" command and are not listed by
"<code>info var</code>" (although can be using "<code>info var .</code>") but
otherwise work like any other variable with one exception. If you create
a new variable for the exact same memory location the analyser's variable
will be silently removed.</p>
<pre>0&gt; <font color="#118811">dump .loop$21</font>
0x081f8 &lt;.loop$21&gt;:
0x081f8 d6 81 da ld A,(0x81da &lt;.bit0_isset$19&gt;,X)
0x081fb d7 00 3d ld (0x003d,X),A
0x081fe 5a decw X
0x081ff 26 f7 jrne 0x81f8 &lt;.loop$21&gt;
0&gt; <font color="#118811">var copy_data .loop$21</font>
0&gt; <font color="#118811">dump .loop$21</font>
dump [/format] memory_type [start [stop [bytes_per_line]]] | dump bit...
Dump memory of specified type or bit(s)
0&gt; <font color="#118811">dump copy_data</font>
0x081f8 &lt;copy_data&gt;:
0x081f8 d6 81 da ld A,(0x81da &lt;.bit0_isset$19&gt;,X)
0x081fb d7 00 3d ld (0x003d,X),A
0x081fe 5a decw X
0x081ff 26 f7 jrne 0x81f8 &lt;copy_data&gt;
</pre>
<hr>
</body>
</html>

View File

@@ -0,0 +1,248 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Creator: fig2dev Version 3.2.8b -->
<!-- CreationDate: 2023-01-02 18:09:30 -->
<!-- Magnification: 1.05 -->
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="497pt" height="421pt"
viewBox="2025 -2421 7884 6679">
<g fill="none">
<!-- Line -->
<rect x="6795" y="1440" width="540" height="1170" fill="#00d1d1"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="6795" y="270" width="540" height="1170" fill="#00d1d1"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="6795" y="-900" width="540" height="1170" fill="#00d1d1"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="6795" y="-2070" width="540" height="1170" fill="#00d1d1"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<polyline points=" 3375,-1440 3375,4140"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="6075" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="5940" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="5805" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="5670" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="5535" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="5400" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="5265" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="5130" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<polyline points=" 5940,2835 5985,2790 6030,2790 6075,2745 6120,2790 6165,2790 6210,2835"
stroke="#000000" stroke-width="8px"/>
<!-- Text -->
<text xml:space="preserve" x="6075" y="3060" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">10</text>
<!-- Text -->
<text xml:space="preserve" x="5265" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="5400" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="5535" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="5670" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="5805" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="5940" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="6075" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">11</text>
<!-- Line -->
<polyline points=" 3285,4140 3465,4140"
stroke="#000000" stroke-width="30px"/>
<!-- Line -->
<defs>
<clipPath id="cp0">
<path clip-rule="evenodd" d="M 2025,-2421 H 9909 V 4258 H 2025 z
M 4948,2985 5068,3015 4948,3045 5092,3022 5092,3008z"/>
</clipPath>
</defs>
<polyline points=" 5085,3015 3420,3015" clip-path="url(#cp0)"
stroke="#000000" stroke-width="8px" stroke-dasharray="40 40"/>
<!-- Backward arrow to point 5085,3015 -->
<polyline points=" 4948,2985 5068,3015 4948,3045"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<polyline points=" 3330,3060 3420,3060"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<polyline points=" 3330,2970 3420,2970"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<polygon points=" 5940,-1350 5940,2025 6300,2385 6300,-1710"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<defs>
<clipPath id="cp1">
<path clip-rule="evenodd" d="M 2025,-2421 H 9909 V 4258 H 2025 z
M 6437,-1500 6317,-1530 6437,-1560 6293,-1537 6293,-1523z
M 6658,-1560 6778,-1530 6658,-1500 6802,-1523 6802,-1537z"/>
</clipPath>
</defs>
<polyline points=" 6795,-1530 6300,-1530" clip-path="url(#cp1)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 6300,-1530 -->
<polyline points=" 6437,-1500 6317,-1530 6437,-1560"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 6795,-1530 -->
<polyline points=" 6658,-1560 6778,-1530 6658,-1500"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp2">
<path clip-rule="evenodd" d="M 2025,-2421 H 9909 V 4258 H 2025 z
M 6437,-330 6317,-360 6437,-390 6293,-367 6293,-353z
M 6658,-390 6778,-360 6658,-330 6802,-353 6802,-367z"/>
</clipPath>
</defs>
<polyline points=" 6795,-360 6300,-360" clip-path="url(#cp2)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 6300,-360 -->
<polyline points=" 6437,-330 6317,-360 6437,-390"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 6795,-360 -->
<polyline points=" 6658,-390 6778,-360 6658,-330"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp3">
<path clip-rule="evenodd" d="M 2025,-2421 H 9909 V 4258 H 2025 z
M 6437,885 6317,855 6437,825 6293,848 6293,862z
M 6658,825 6778,855 6658,885 6802,862 6802,848z"/>
</clipPath>
</defs>
<polyline points=" 6795,855 6300,855" clip-path="url(#cp3)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 6300,855 -->
<polyline points=" 6437,885 6317,855 6437,825"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 6795,855 -->
<polyline points=" 6658,825 6778,855 6658,885"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp4">
<path clip-rule="evenodd" d="M 2025,-2421 H 9909 V 4258 H 2025 z
M 6437,2055 6317,2025 6437,1995 6293,2018 6293,2032z
M 6658,1995 6778,2025 6658,2055 6802,2032 6802,2018z"/>
</clipPath>
</defs>
<polyline points=" 6795,2025 6300,2025" clip-path="url(#cp4)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 6300,2025 -->
<polyline points=" 6437,2055 6317,2025 6437,1995"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 6795,2025 -->
<polyline points=" 6658,1995 6778,2025 6658,2055"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp5">
<path clip-rule="evenodd" d="M 2025,-2421 H 9909 V 4258 H 2025 z
M 6045,2342 6075,2222 6105,2342 6082,2198 6068,2198z
M 6658,1995 6778,2025 6658,2055 6802,2032 6802,2018z"/>
</clipPath>
</defs>
<polyline points=" 6075,2700 6075,2205" clip-path="url(#cp5)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 6075,2205 -->
<polyline points=" 6045,2342 6075,2222 6105,2342"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp6">
<path clip-rule="evenodd" d="M 2025,-2421 H 9909 V 4258 H 2025 z
M 7530,-1933 7560,-2053 7590,-1933 7567,-2077 7553,-2077z
M 6658,1995 6778,2025 6658,2055 6802,2032 6802,2018z"/>
</clipPath>
</defs>
<polyline points=" 7560,2610 7560,-2070" clip-path="url(#cp6)"
stroke="#000000" stroke-width="8px" stroke-dasharray="10 30"/>
<!-- Forward arrow to point 7560,-2070 -->
<polyline points=" 7530,-1933 7560,-2053 7590,-1933"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<polyline points=" 7335,2610 7920,2610"
stroke="#000000" stroke-width="8px" stroke-dasharray="10 30"/>
<!-- Line -->
<polyline points=" 7335,1440 7920,1440"
stroke="#000000" stroke-width="8px" stroke-dasharray="10 30"/>
<!-- Line -->
<polyline points=" 7335,270 7920,270"
stroke="#000000" stroke-width="8px" stroke-dasharray="10 30"/>
<!-- Line -->
<polyline points=" 7335,-900 7920,-900"
stroke="#000000" stroke-width="8px" stroke-dasharray="10 30"/>
<!-- Line -->
<polyline points=" 3285,-1530 3465,-1530"
stroke="#000000" stroke-width="30px"/>
<!-- Line -->
<defs>
<clipPath id="cp7">
<path clip-rule="evenodd" d="M 2025,-2421 H 9909 V 4258 H 2025 z
M 5758,330 5878,360 5758,390 5902,367 5902,353z
M 3782,390 3662,360 3782,330 3638,353 3638,367z"/>
</clipPath>
</defs>
<polyline points=" 3645,360 5895,360" clip-path="url(#cp7)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 5895,360 -->
<polyline points=" 5758,330 5878,360 5758,390"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 3645,360 -->
<polyline points=" 3782,390 3662,360 3782,330"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<polyline points=" 3375,990 3465,900 3465,450 3555,360 3465,270 3465,-90 3375,-180"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<polyline points=" 3375,-180 3375,990"
stroke="#000000" stroke-width="30px"/>
<!-- Text -->
<text xml:space="preserve" x="2835" y="4185" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">begin_as</text>
<!-- Text -->
<text xml:space="preserve" x="3240" y="3060" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">bank selector</text>
<!-- Text -->
<text xml:space="preserve" x="6120" y="-1800" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">banker</text>
<!-- Text -->
<text xml:space="preserve" x="7065" y="-2250" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">Banks (in big chip)</text>
<!-- Text -->
<text xml:space="preserve" x="7695" y="-1665" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">chip size=</text>
<!-- Text -->
<text xml:space="preserve" x="7695" y="-1425" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">Nr. of banks * bank_size</text>
<!-- Text -->
<text xml:space="preserve" x="7965" y="2655" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">start of bank 0</text>
<!-- Text -->
<text xml:space="preserve" x="7965" y="1485" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">start of bank 1</text>
<!-- Text -->
<text xml:space="preserve" x="7965" y="315" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">start of bank 2</text>
<!-- Text -->
<text xml:space="preserve" x="7965" y="-855" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">start of bank 3</text>
<!-- Text -->
<text xml:space="preserve" x="2790" y="-1755" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">Address Space</text>
<!-- Text -->
<text xml:space="preserve" x="2880" y="-1485" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">end_as</text>
<!-- Text -->
<text xml:space="preserve" x="3285" y="1035" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">banked_start</text>
<!-- Text -->
<text xml:space="preserve" x="5040" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">selection mask:</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Creator: fig2dev Version 3.2.8b -->
<!-- CreationDate: 2023-01-02 17:59:14 -->
<!-- Magnification: 1.05 -->
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="373pt" height="331pt"
viewBox="2025 -981 5907 5239">
<g fill="none">
<!-- Line -->
<rect x="4725" y="-585" width="540" height="1170" fill="#00d1d1"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="5400" y="-585" width="540" height="1170" fill="#00d1d1"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="6075" y="-585" width="540" height="1170" fill="#00d1d1"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="6750" y="-585" width="540" height="1170" fill="#00d1d1"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<polyline points=" 3375,1080 3375,4140"
stroke="#000000" stroke-width="8px"/>
<!-- Text -->
<text xml:space="preserve" x="4995" y="90" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">chip</text>
<!-- Text -->
<text xml:space="preserve" x="5670" y="90" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">chip</text>
<!-- Text -->
<text xml:space="preserve" x="6345" y="90" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">chip</text>
<!-- Text -->
<text xml:space="preserve" x="7020" y="90" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">chip</text>
<!-- Line -->
<polyline points=" 3285,1080 3465,1080"
stroke="#000000" stroke-width="30px"/>
<!-- Line -->
<polyline points=" 3285,4140 3465,4140"
stroke="#000000" stroke-width="30px"/>
<!-- Line -->
<polyline points=" 3375,2520 3465,2430 3465,1980 3555,1890 3465,1800 3465,1440 3375,1350"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<polyline points=" 3375,1350 3375,2520"
stroke="#000000" stroke-width="30px"/>
<!-- Line -->
<defs>
<clipPath id="cp0">
<path clip-rule="evenodd" d="M 2025,-981 H 7932 V 4258 H 2025 z
M 6000,1802 6030,1682 6060,1802 6037,1658 6023,1658z
M 3782,1920 3662,1890 3782,1860 3638,1883 3638,1897z"/>
</clipPath>
</defs>
<polyline points=" 3645,1890 6030,1890 6030,1665" clip-path="url(#cp0)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 6030,1665 -->
<polyline points=" 6000,1802 6030,1682 6060,1802"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 3645,1890 -->
<polyline points=" 3782,1920 3662,1890 3782,1860"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<polygon points=" 5085,1665 6930,1665 7245,1350 4770,1350"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<defs>
<clipPath id="cp1">
<path clip-rule="evenodd" d="M 2025,-981 H 7932 V 4258 H 2025 z
M 5025,1213 4995,1333 4965,1213 4988,1357 5002,1357z
M 4965,722 4995,602 5025,722 5002,578 4988,578z"/>
</clipPath>
</defs>
<polyline points=" 4995,585 4995,1350" clip-path="url(#cp1)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 4995,1350 -->
<polyline points=" 5025,1213 4995,1333 4965,1213"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 4995,585 -->
<polyline points=" 4965,722 4995,602 5025,722"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp2">
<path clip-rule="evenodd" d="M 2025,-981 H 7932 V 4258 H 2025 z
M 5700,1213 5670,1333 5640,1213 5663,1357 5677,1357z
M 5640,722 5670,602 5700,722 5677,578 5663,578z"/>
</clipPath>
</defs>
<polyline points=" 5670,585 5670,1350" clip-path="url(#cp2)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 5670,1350 -->
<polyline points=" 5700,1213 5670,1333 5640,1213"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 5670,585 -->
<polyline points=" 5640,722 5670,602 5700,722"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp3">
<path clip-rule="evenodd" d="M 2025,-981 H 7932 V 4258 H 2025 z
M 6375,1213 6345,1333 6315,1213 6338,1357 6352,1357z
M 6315,722 6345,602 6375,722 6352,578 6338,578z"/>
</clipPath>
</defs>
<polyline points=" 6345,585 6345,1350" clip-path="url(#cp3)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 6345,1350 -->
<polyline points=" 6375,1213 6345,1333 6315,1213"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 6345,585 -->
<polyline points=" 6315,722 6345,602 6375,722"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp4">
<path clip-rule="evenodd" d="M 2025,-981 H 7932 V 4258 H 2025 z
M 7050,1213 7020,1333 6990,1213 7013,1357 7027,1357z
M 6990,722 7020,602 7050,722 7027,578 7013,578z"/>
</clipPath>
</defs>
<polyline points=" 7020,585 7020,1350" clip-path="url(#cp4)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 7020,1350 -->
<polyline points=" 7050,1213 7020,1333 6990,1213"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 7020,585 -->
<polyline points=" 6990,722 7020,602 7050,722"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<rect x="7785" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="7650" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="7515" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="7380" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="7245" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="7110" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="6975" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="6840" y="2880" width="135" height="225"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<polyline points=" 7650,2835 7695,2790 7740,2790 7785,2745 7830,2790 7875,2790 7920,2835"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<defs>
<clipPath id="cp5">
<path clip-rule="evenodd" d="M 2025,-981 H 7932 V 4258 H 2025 z
M 7247,1560 7127,1530 7247,1500 7103,1523 7103,1537z
M 6990,722 7020,602 7050,722 7027,578 7013,578z"/>
</clipPath>
</defs>
<polyline points=" 7785,2700 7785,1530 7110,1530" clip-path="url(#cp5)"
stroke="#000000" stroke-width="8px"/>
<!-- Forward arrow to point 7110,1530 -->
<polyline points=" 7247,1560 7127,1530 7247,1500"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp6">
<path clip-rule="evenodd" d="M 2025,-981 H 7932 V 4258 H 2025 z
M 7247,1560 7127,1530 7247,1500 7103,1523 7103,1537z
M 6658,2985 6778,3015 6658,3045 6802,3022 6802,3008z"/>
</clipPath>
</defs>
<polyline points=" 6795,3015 3420,3015" clip-path="url(#cp6)"
stroke="#000000" stroke-width="8px" stroke-dasharray="40 40"/>
<!-- Backward arrow to point 6795,3015 -->
<polyline points=" 6658,2985 6778,3015 6658,3045"
stroke="#000000" stroke-width="8px" stroke-miterlimit="8"/>
<!-- Line -->
<polyline points=" 3330,3060 3420,3060"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<polyline points=" 3330,2970 3420,2970"
stroke="#000000" stroke-width="8px"/>
<!-- Text -->
<text xml:space="preserve" x="3285" y="2520" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">banked_start</text>
<!-- Text -->
<text xml:space="preserve" x="2835" y="4185" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">begin_as</text>
<!-- Text -->
<text xml:space="preserve" x="2880" y="1125" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">end_as</text>
<!-- Text -->
<text xml:space="preserve" x="2790" y="810" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">Address Space</text>
<!-- Text -->
<text xml:space="preserve" x="7785" y="3060" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">10</text>
<!-- Text -->
<text xml:space="preserve" x="6975" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="7110" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="7245" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="7380" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="7515" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="7650" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">0</text>
<!-- Text -->
<text xml:space="preserve" x="7785" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">11</text>
<!-- Text -->
<text xml:space="preserve" x="6750" y="3330" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">selection mask:</text>
<!-- Text -->
<text xml:space="preserve" x="5985" y="-810" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">Banks (in multi chips)</text>
<!-- Text -->
<text xml:space="preserve" x="6030" y="1620" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="middle">banker</text>
<!-- Text -->
<text xml:space="preserve" x="3240" y="3060" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="end">bank selector</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -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>

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@@ -0,0 +1,218 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>Commands of μCsim</title>
</head>
<body style="background-color: white;">
<h1>Command reference of <i>&#956;Csim</i></h1>
<!--GENERAL--> <a href="cmd_general.html">General commands and information</a>
<ul>
<li><a href="cmd_general.html#analyse"><b>analyse</b> Analyse code</a></li>
<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#version"><b>version</b> Print version of the
program</a></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><a href="cmd_general.html#info_variables"><b>info variables</b></a></li>
<li><a href="cmd_general.html#info_history"><b>info history</b></a></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"><b>timer add</b></a> </li>
<li><a href="cmd_general.html#timer_delete"><b>timer delete</b></a> </li>
<li><a href="cmd_general.html#timer_get"><b>timer get</b></a> </li>
<li><a href="cmd_general.html#timer_start"><b>timer start</b></a> </li>
<li><a href="cmd_general.html#timer_stop"><b>timer stop</b></a> </li>
<li><a href="cmd_general.html#timer_set"><b>timer set</b></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 </a></li>
<li><a href="cmd_memory.html#memory"><b>memory</b> Manage address spaces,
memory chips and address decoders</a>
<ul>
<li><b>memory create</b></li>
<ul>
<li><a href="cmd_memory.html#memory_createchip"><b>memory create chip</b></a></li>
</ul>
<ul>
<li><a href="cmd_memory.html#memory_createaddressspace"><b>memory
create addressspace</b></a></li>
<li><a href="cmd_memory.html#memory_createaddressdecoder"><b>memory
create addressdecoder</b></a></li>
<li><b>memory create banker</b></li>
<li><b>memory create bank</b></li>
<li><b>memory create bander</b></li>
</ul>
<li>memory remove</li>
<ul>
<li><a href="cmd_memory.html#memory_remove_chip">memory remove chip</a>
</ul>
</ul>
<ul>
<li><a href="cmd_memory.html#memory_info"><b>memory info</b></a></li>
<li><b>memory cell</b></li>
</ul>
<ul>
</ul>
<ul>
<ul>
</ul>
</ul>
</li>
<li><b><a href="cmd_memory.html#var">var</a></b></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>
<li><a href="cmd_exec.html#history"><b>history</b> Print and manage execution history</a>
<ul><li><a href="cmd_exec.html#history_">history</a></li>
<li><a href="cmd_exec.html#history_info">history information</a></li>
<li><a href="cmd_exec.html#history_list">history list</a></li>
<li><a href="cmd_exec.html#history_clear">history clear</a></li>
</ul>
</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>
<li><a href="cmd_bp.html#display"><b>display</b> Set expression to show on breakpoint</a></li>
<li><a href="cmd_bp.html#undisplay"><b>undisplay</b> Remove display expression</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>

View File

@@ -0,0 +1,214 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>Breakpoints commands of &#956;Csim</title>
</head>
<body style=" background-color: white;">
<!-- BREAKPOINTS -->
<h2>Commands of <i>&#956;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">ucsim_51 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
&gt; <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
&gt; <font color="#118811">break 0x160</font>
Breakpoint 1 at 0x000160: CLR P1.0
&gt; <font color="#118811">tbreak 8 2</font>
Breakpoint 2 at 0x000008: MOV R7,A
&gt; <font color="#118811">g</font>
Simulation started, PC=0x000000
Stop at 000160: (4) Breakpoint
F 000160
&gt; </pre>
Breakpoint hits can be made more noticeable by printing a beep character on
the console. This function can be turned on by <a href="cmd_general.html#set_option">setting
the option</a> <b>beep_break</b> (FALSE by default).<br>
<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>&gt; <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
&gt; <font color="#118811">clear 160</font>
No breakpoint at 0000a0
&gt; <font color="#118811">clear 0x160</font>
&gt; <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
&gt; </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>[breakpoint-nr] script</i></h3>
</a>
<p>Attach a script to a breakpoint. Breakpoint number can
be omitted if only one breakpoint exists. Breakpoint numbers can be
checked by <a href="cmd_general.html#info_breakpoints">info
breakpoint</a> command. Script is command or a list of commands
separated by ; character. It will be executed when the specified
breakpoint is hit. If the text of the script is printed before execution
is controlled by the option <b>echo_script</b>, which is FALSE by
default. See <a href="cmd_general.html#set_option">set option</a> command
how to set it.</p>
<hr>
<!-- ----------------------------------------------------------------- -->
<a name="display">
<h3>display <i>[[/format] expr]</i></h3>
</a>
Set expression to be displayed when simulation stops on a
breakpoint.
<p><i>/format</i> option can be used to specify print format for the
expression. For meaning of the options, see <a href="cmd_general.html#expression">expression</a> command.</p>
<p>If no <i>expr</i> argument is given, all defined expressions
are listed and evaluated and values are printed.</p>
<pre>0&gt; <font color="#118811">disp R7</font>
0&gt; <font color="#118811">disp ACC</font>
0&gt; <font color="#118811">b 0x10</font>
Breakpoint 1 at 0x000010 (cond="")
0x0010 F? ff MOV R7,A
0&gt; <font color="#118811">display</font>
1: R7 = 107
2: ACC = 0
0&gt; <font color="#118811">run</font>
Simulation started, PC=0x000000
Stop at 0x000010: (104) Breakpoint
R0 R1 R2 R3 R4 R5 R6 R7
41 58 fc c9 8b bc 95 00
@R0 76 v ACC= 0x00 0 . B= 0x00
@R1 73 s PSW= 0x00 CY=0 AC=0 OV=0 P=0
SP 0x07 -> 00 95 bc 8b c9 fc 58 41
DPTR= 0x0000 @DPTR= 0x83 131 .
0x0010 F ff MOV R7,A
F 0x000010
Simulated 192 ticks (1.736e-05 sec)
Host usage: 0.007306 sec, rate=0.002376
1: R7 = 0
2: ACC = 0
0&gt;
</pre>
<hr>
<!-- ----------------------------------------------------------------- -->
<a name="undisplay">
<h3>undisplay <i>[nr]</i></h3>
</a>
Remove selected, or all (if no <i>nr</i> argument is specified)
expression from display list. To check out id number of an
expression, use <a href="#display">display</a> command without arguments.
<hr>
</body>
</html>

View File

@@ -0,0 +1,383 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>Dump commands of &#956;Csim</title>
</head>
<body style="background-color: white;">
<h2>Dump commands of &#956;Csim</h2>
<a name="dump">
<h3>dump <i>[/format] memory_type [start [end [bytes_per_line]]]</i>
<br>
dump <i>bit...</i></h3>
</a>
The first form can be used get the contents of memory while the second form can be
used to check the value of one or more bits.
<blockquote>
<a name="dump_memory">
<h4>dump <i>[/format] memory_name [start [end
[bytes_per_line]]]</i></h4>
</a>
Dump a memory region.
<p>The optional <b>/format</b> specifies how memory is to be dumped.
<dl>
<dt><b>/b</b> - binary</dt>
<dd>Dumps raw binary data. The output MUST be redirected to a file.</dd>
<dt><b>/h</b> - hexadecimal</dt>
<dd>Dumps data in a tabular hexadecimal format with an accompanying
table of equivalent characters to the right.</dd>
<dt><b>/i</b> - ihex</dt>
<dd>Dumps data in ihex format.</dd>
<dt><b>/s</b> - string</dt>
<dd>Dumps a single, null terminated string starting at <b>start</b>.</dd>
</dl>
If no <b>format</b> is given dump uses a "smart" mode. This will disassemble
where the <a href="analyzer.html"> code analyzer</a> has identified executable
code otherwise it is similar to
the hexadecimal format except that where labels (vars that name an address)
are found they are shown between the address and data and where HW
registers (vars that name an address AND specify the full bit range)
are found that address is shown on a line of its own and the data is
given as binary, character, hex, unsigned decimal and, if the high bit
is set, signed decimal. Note that smart mode only applies if
<b>memory_name</b> is an address space since vars can only be set for
cells within an address space. If <b>memory_name</b> is a chip the
output is the same as hexadecimal (<b>/h</b>) output.
</p>
<p><b>memory_name</b> specifies
memory. It can be the 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>
<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 locations are dumped. If both <b>start</b> and <b>end</b>
are omitted then the next 64 memory locations will be dumped out. Every
time when dump command is used the address of the last dumped memory
location is stored and next dump command automatically continues at
the next address.
</p>
<p><b>bytes_per_line</b> 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">ucsim_51</font>
uCsim 0.6-pre34, 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.
&gt; <font color="#118811">dump regs</font>
regs[0x0] R0 0b00001000 0x08 '.' 8
regs[0x1] R1 0b01110000 0x70 'p' 112
regs[0x2] R2 0b11010100 0xd4 '.' 212 (212)
regs[0x3] R3 0b10110010 0xb2 '.' 178 (178)
regs[0x4] R4 0b10001010 0x8a '.' 138 (138)
regs[0x5] R5 0b00101001 0x29 ')' 41
regs[0x6] R6 0b01010100 0x54 'T' 84
regs[0x7] R7 0b01001000 0x48 'H' 72
&gt; <font color="#118811">dump rom 0</font>
0x0000 00 00 00 00 00 00 00 00 ........
0x0008 00 00 00 00 00 00 00 00 ........
0x0010 00 00 00 00 00 00 00 00 ........
0x0018 00 00 00 00 00 00 00 00 ........
0x0020 00 00 00 00 00 00 00 00 ........
0x0028 00 00 00 00 00 00 00 00 ........
0x0030 00 00 00 00 00 00 00 00 ........
0x0038 00 00 00 00 00 00 00 00 ........
0x0040 00 00 00 00 00 00 00 00 ........
0x0048 00 00 00 00 00 00 00 00 ........
&gt; <font color="#118811">var label1 rom 0x0016</font>
&gt; <font color="#118811">var reg1 rom[0x0020][7:0]</font>
&gt; <font color="#118811">var reg2 rom[0x0021][7:0]</font>
&gt; <font color="#118811">dump rom 0</font>
0x0000 00 00 00 00 00 00 00 00 ........
0x0008 00 00 00 00 00 00 00 00 ........
0x0010 00 00 00 00 00 00 ......
0x0016 label1 00 00 00 00 00 00 00 00 ........
0x001e 00 00 ..
0x0020 reg1 0b00000000 0x00 '.' 0
0x0021 reg2 0b00000000 0x00 '.' 0
0x0022 00 00 00 00 00 00 00 00 ........
0x002a 00 00 00 00 00 00 00 00 ........
0x0032 00 00 00 00 00 00 00 00 ........
0x003a 00 00 00 00 00 00 00 00 ........
0x0042 00 00 00 00 00 00 00 00 ........
0x004a 00 00 00 00 00 00 ......
&gt;
</pre>
<pre>$ <font color="#118811">ucsim_51</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.
&gt; 55470 words read from remo.hex
55470 words read from remo.hex
&gt; <font color="#118811">run</font>
Simulation started, PC=0x000000
Stop at 0x000515: (105) User stopped
F 0x000515
&gt; <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.. .:.
&gt; <font color="#118811">du xram 10 20 10</font>
0x000a ff 01 00 fa 01 01 40 01 01 44 ......@..D
0x0014 01 .
&gt; <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......
&gt;
</pre>
<hr>
<a name="dump_bit">
<h4>dump <i>bit_name...</i></h4>
</a>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&gt; <font color="#118811">dump AC P1.2 0x21</font>
0xd6 AC: 0b0 0x00 '.' 0
0x90.2 0b-----1-- 0x01 '.' 1
0x24.1 0b------0- 0x00 '.' 0
0&gt;
</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">ucsim_51 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
&gt; <font color="#118811">wc remo</font>
0013da 52 65 6d 6f Remo
&gt; <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..
&gt; </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">ucsim_51 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
&gt; <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
&gt; </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 analyzer
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">ucsim_51 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
&gt; <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
&gt; <font color="#118811">br 0x180</font>
&gt; <font color="#118811">tbr 0x189</font>
&gt; <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
&gt; </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 asterisk (<b>*</b>) which means
that the listed address is not marked by the code analyzer. <b>dis</b>
lists marked instructions only so asterisk 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">ucsim_51 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&gt; <font color="#118811">set opt irq_stop 1</font>
0&gt; <font color="#118811">go</font>
Simulation started, PC=0x000000
Stop at 000023: (5) Interrupt
F 000023
0&gt; <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&gt;
</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">ucsim_51 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&gt; <font color="#118811">set opt irq_stop 1</font>
0&gt; <font color="#118811">go</font>
Simulation started, PC=0x000000
Stop at 000023: (5) Interrupt
F 000023
0&gt; <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&gt;
</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">ucsim_51 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&gt; <font color="#118811">set opt irq_stop 1</font>
0&gt; <font color="#118811">go</font>
Simulation started, PC=0x000000
Stop at 000023: (5) Interrupt
F 000023
0&gt; <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&gt;
</pre>
<hr>
</body>
</html>

View File

@@ -0,0 +1,264 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>Execution commands of &#956;Csim</title>
</head>
<body bgcolor="white">
<h2>Execution commands of <i>&#956;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">./ucsim_51</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.
&gt; <font color="#118811">b 0x10</font>
Breakpoint 1 at 0x000010: MOV R7,A
&gt; <font color="#118811">b 0x20</font>
Breakpoint 2 at 0x000020: MOV R7,A
&gt; <font color="#118811">run 0x10</font>
Warning: maybe not instruction at 0x000010
Simulation started, PC=0x000010
Stop at 0x000020: (104) Breakpoint
F 0x000020
&gt;
</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">ucsim_51 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
&gt; <font color="#118811">g</font>
Simulation started
&gt; <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
&gt; <font color="#118811">stop</font>
006ac5 24 a5 ADD A,#a5
&gt;
</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">ucsim_51 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
&gt; <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
&gt; </pre>
<p> 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.</p>
<p>Number of steps can be specified in different units. If no unit is
appended to step number then it will be interpreted as number of
instruction. Other know units are:</p>
<dl>
<dt> s, sec</dt>
<dd>Simulated execution time in seconds.</dd>
<dt>ms, msec</dt>
<dd>Simulated execution time in milliseconds.</dd>
<dt>us, usec</dt>
<dd>Simulated execution time in microseconds.</dd>
<dt>ns, nsec</dt>
<dd>Simulated execution time in nanoseconds.</dd>
<dt>vclk</dt>
<dd>Number of virtual clock counts.</dd>
<dt>fclk, fetch</dt>
<dd>Number of fetches.</dd>
<dt>rclk, read</dt>
<dd>Number of memory read operations.</dd>
<dt>wclk, write</dt>
<dd>Number of memory write operations.</dd>
</dl>
<br>
<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">ucsim_51 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
&gt; <font color="#118811">run 0 0x172</font>
000172 79 04 MOV R1,#04
&gt; <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
&gt; <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
&gt; <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
&gt; </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>$ ucsim_51
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.
&gt; <font color="#118811">pc</font>
* 000000 ff MOV R7,A
&gt; <font color="#118811">pc 123</font>
* 00007b ff MOV R7,A
&gt; <font color="#118811">sopt debug t </font>
&gt; <font color="#118811">pc 32</font>
Warning: maybe not instruction at 000020
* 000020 ff MOV R7,A
&gt; </pre>
<hr>
<h3><a name="history">history</a></h3>
History command can be used to inspect and manipulate history of executed
instructions. It accepts following subcommands:
<p><a href="#history_">history</a> <br>
history <a href="#history_information">information</a> <br>
history <a href="#history_list">list</a> <br>
history <a href="#history_clear">clear</a> </p>
<blockquote>
<h4><a name="history_">history</a></h4>
This command (without a subcommand) prints out last 10 elements of the
command history in disassembled form.
<pre>0&gt; <font color="#118811">hist</font>
? 0x0211 78 LD A,B
? 0x0212 de 22 SBC A,#0x22
? 0x0214 38 f7 JR C,#-9
? 0x0216 c9 RET
? 0x0109 c3 04 02 JP #0x0204
? 0x0204 3e 00 LD A,#0x00
? 0x0206 cf RST 8
? 0x0008 fb EI
? 0x0009 ed 4d RETI
? 0x0207 76 HALT
0&gt;
</pre>
<hr>
<h4><a name="history_information">history information</a></h4>
Print out information about execution history.
<pre>0&gt; <font color="#118811">hist info</font>
len: 100
used: 100
insts: 100
0&gt;
</pre>
<b>Len</b> is size of the history, <b>used</b> shows how many slots are
filled, <b>insts</b> is number of the instructions recorded by the
history.
<hr>
<h4><a name="history_list">history list [nr]</a> <br>
history print [nr]</h4>
This command is the same as the <a href="#history_">history</a> command
but it accepts a parameter which specifies how many records to print
(defaults to 10):
<pre>0&gt; <font color="#118811">hist list 3</font>
? 0x0008 fb EI
? 0x0009 ed 4d RETI
? 0x0207 76 HALT
0&gt; <font color="#118811">hist list 30</font>
? 0x020e 79 LD A,C
? 0x020f d6 33 sub #0x33
? 0x0211 78 LD A,B
? 0x0212 de 22 SBC A,#0x22
? 0x0214 38 f7 JR C,#-9
? 0x020d 03 INC BC
? 0x020e 79 LD A,C
? 0x020f d6 33 sub #0x33
? 0x0211 78 LD A,B
? 0x0212 de 22 SBC A,#0x22
? 0x0214 38 f7 JR C,#-9
? 0x020d 03 INC BC
? 0x020e 79 LD A,C
? 0x020f d6 33 sub #0x33
? 0x0211 78 LD A,B
? 0x0212 de 22 SBC A,#0x22
? 0x0214 38 f7 JR C,#-9
? 0x020d 03 INC BC
? 0x020e 79 LD A,C
? 0x020f d6 33 sub #0x33
? 0x0211 78 LD A,B
? 0x0212 de 22 SBC A,#0x22
? 0x0214 38 f7 JR C,#-9
? 0x0216 c9 RET
? 0x0109 c3 04 02 JP #0x0204
? 0x0204 3e 00 LD A,#0x00
? 0x0206 cf RST 8
? 0x0008 fb EI
? 0x0009 ed 4d RETI
? 0x0207 76 HALT
0&gt;
</pre>
<hr>
<h4><a name="history_clear">history clear</a></h4>
This command clears the history, it deletes all recorded elements.
<pre>0&gt; <font color="#118811">hist list 3</font>
? 0x0008 fb EI
? 0x0009 ed 4d RETI
? 0x0207 76 HALT
0&gt; <font color="#118811">hist clear</font>
0&gt; <font color="#118811">hist info</font>
len: 100
used: 0
insts: 0
0&gt;
</pre>
</blockquote>
<!--OK-->
</body>
</html>

View File

@@ -0,0 +1,865 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>General commands of ?Csim</title>
</head>
<body style=" background-color: white;">
<h2>General commands of <i>&#956;Csim</i></h2>
<h3><a name="analyse">analyse|analyze [<i>addr</i>]</a></h3>
<p>Runs the <a href="analyzer.html">analyser</a> to identify code.
If an address is given it is taken as the starting point and the results
added to any existing analysis. If no address is given or a file is loaded
into memory using the <a href="cmd_memory.html#file">file,load</a> command
any existing analysis is cleared and a new one created using all the known
hardware vectors as starting points.</p>
<h3><a name="conf">conf</a></h3>
Conf command can be used to display different kind of information about <i>&#956;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&gt; <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&gt;
</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="version">version</a></h3>
Print out the version of the program.
<pre>0&gt; <font color="#118811">ver</font>
0.6-pre58
0&gt;
</pre>
<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&gt; <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&gt; <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&gt;
</pre> Some commands have more than one name which can produce interesting
result:
<pre>0&gt; <font color="#118811">? t r</font>
timer delete id Delete a timer
timer start id Start a timer
0&gt;
</pre> It looks that names of listed subcommands start with no "r" but take a
closer look on that commands:
<pre>0&gt; <font color="#118811">? t d</font>
timer delete id Delete a timer
Names of command: delete remove
long help of timer delete
0&gt; <font color="#118811">? t start</font>
timer start id Start a timer
Names of command: run start
long help of timer run
0&gt; </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.
<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">ucsim_51</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.
&gt; <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">ucsim_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&gt; <font color="#118811">exec "/tmp/x"</font>
1&gt; 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&gt; quit
0&gt;
</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&gt; <font color="#118811">expr 1+2</font>
3
0&gt; <font color="#118811">expr xram[256*dph+dpl]= &amp;sp</font>
129
0&gt;
</pre>
Following formats are supported:
<ul>
<li><b>x</b> hexadecimal</li>
<li><b>X</b> hexadecimal prefixed with <tt>0x</tt></li>
<li><b>0</b> 8 characted long hexadecimal prefixed with <tt>0x</tt></li>
<li><b>d</b> signed decimal</li>
<li><b>o</b> octal</li>
<li><b>u</b> unsigned decimal</li>
<li><b>b</b> binary</li>
<li><b>B</b> logical value as one bit</li>
<li><b>L</b> logical value in T/F form</li>
<li><b>c</b> chacter constant in 'c' form (non-printable values are
escaped in c syntax)</li>
</ul>
If more then one format character is used then all requested form will be
printed:
<pre>0&gt; <font color="#118811">expr /bx 123</font>
00000000000000000000000001111011
7b
0&gt; </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. Children are listed under the parent:
<pre>0&gt; <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&gt; </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">ucsim_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&gt; <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&gt; </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">ucsim_51 -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&gt; <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&gt;
</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">ucsim_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&gt; <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&gt; <font color="#118811">set opt 4 1</font>
0&gt; <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&gt; <font color="#118811">exec "/tmp/x"</font>
1&gt; 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&gt;
0&gt;
</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">ucsim_51 -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.
&gt; <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
&gt; <font color="#118811">set opt debug f</font>
Ambiguous option name, use number instead
&gt; <font color="#118811">set opt 3 f</font>
&gt; <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)
&gt; </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
be 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&gt; <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&gt; <font color="#118811">set mem sfr pcon 0x34</font>
0x87 34 4
0&gt; <font color="#118811">set mem xram_chip 1 2</font>
0x0001 02 .
0&gt; </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">ucsim_51 </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.
&gt; <font color="#118811">set bit tf1 1</font>
0x88 80 .
&gt; <font color="#118811">set bit 130 0</font>
0x80 fb .
&gt; <font color="#118811">set bit pcon.2 1</font>
0x87 04 .
&gt; <font color="#118811">set bit 10.7 1</font>
0x0a 80 .
&gt;
</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&gt; <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&gt; <font color="#118811">set hw port[0] 12</font>
0&gt; <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&gt; <font color="#118811">set hw port[0] 23</font>
0&gt; <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&gt; <font color="#118811">set hw irq[0] 12</font>
Nothing to do
0&gt;
</pre> </blockquote>
<hr>
<h3><a name="state">state</a></h3>
State of the simulator and the simulated microcontroller:
<pre>&gt; <font color="#118811">state</font>
CPU state= OK PC= 0x009c6c XTAL= 1.10592e+07
Operation since last reset= (51682412 vclks)
Inst= 51682412 Fetch= 51682412 Read= 0 Write= 0
Total time since last reset= 56.079 sec (620188944 clks)
Time in isr = 0 sec (0 clks) 0%
Time in idle= 0 sec (0 clks) 0%
Max value of stack pointer= 0x000007, avg= 0x000003
Simulation: stopped
&gt;
</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 lines inform about maximum value of the stack pointer and a "not
very well" calculated average value of it, and if the simulation is
running or stopped. </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">ucsim_51 -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
&gt; <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
&gt; <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
&gt; <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
&gt; <font color="#118811">res</font>
&gt; <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
&gt; </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_memory">memory</a> <br>
info <a href="#info_variables">variables</a> <br>
info <a href="#info_history">history</a> </p>
<blockquote>
<h4><a name="info_breakpoints">info breakpoints</a></h4>
This subcommand prints out information about breakpoints:
<pre>0&gt; <font color="#118811">b 12</font>
Breakpoint 1 at 0x00000c: MOV R7,A
0&gt; <font color="#118811">tb 43</font>
Breakpoint 2 at 0x00002b: MOV R7,A
0&gt; <font color="#118811">b sfr w 0x80</font>
0&gt; <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&gt;
</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">ucsim_51 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
&gt; <font color="#118811">sopt stopit 1</font>
&gt; <font color="#118811">g</font>
5
* 000023 02 01 1c LJMP 011c
&gt; <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
&gt; </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">ucsim_avr 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.
&gt; 83 words read from test_arith.hex
83 words read from test_arith.hex
&gt; <font color="#118811">run</font>
Stop at 0x000047: (105) User stopped
F 0x000047
&gt; <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
&gt;
</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">ucsim_z80</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&gt; <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&gt;
</pre>
<h5>Registers of XA family</h5>
<pre>$ <font color="#118811">ucsim_xa</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&gt; <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&gt;
</pre>
<h5>Registers of HC08 family</h5>
<pre>$ <font color="#118811">ucsim_m68hc08</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&gt; <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&gt;
</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">ucsim_51 -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&gt; <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&gt; <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&gt; <font color="#118811">i h t[0]</font>
timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0
0&gt; <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&gt;
</pre> Timer #2 differs a little bit from other timers of MCS51:
<pre>$ <font color="#118811">ucsim_51 -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&gt; <font color="#118811">i h timer0</font>
timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0
0&gt; <font color="#118811">i h t[2]</font>
timer2[2] 0x0000 reload 0x0000 timer OFF irq=0 dis prio=0
0&gt;
</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">ucsim_51 ~/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 itunder certain conditions; type `show c' for details.55470 words read from /home/staff/drdani/remo.hex0&gt; <font color="#118811">set opt irq_stop true</font>0&gt; <font color="#118811">r</font>Simulation started, PC=0x000000Stop at 0x000023: (2) InterruptF 0x0000230&gt; <font color="#118811">i s</font>OP SP before-after L DATA/ADDR INSTRUCTION
call 0x000022-0x000024 2 0x002976 0x022a 12 29 76 LCALL 2976call 0x000024-0x000026 2 0x002379 0x2976 12 23 79 LCALL 2379call 0x000026-0x000028 2 0x003612 0x2517 12 36 12 LCALL 3612intr 0x000028-0x00002a 2 0x000023 0x366f 20 0c 02 JB 21.4,36740&gt; </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">ucsim_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&gt; <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 -&gt; rom_chip 0x0000 activated
0 iram 0x00 0x7f -&gt; iram_chip 0x00 activated
0 sfr 0x80 0xff -&gt; sfr_chip 0x00 activated
0 xram 0x0000 0xffff -&gt; xram_chip 0x0000 activated
0&gt;
</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 "-&gt;" 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&gt; <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 -&gt; rom_chip 0x0000 activated
0 iram 0x0000 0x007f -&gt; iram_chip 0x00 activated
0&gt;
</pre>
<hr>
<h4><a name="info_variables">info variables [[/filter] search]</a></h4>
Print out information about variables. Variable is memory location which
has a name. It can be created by <a href="cmd_memory.html#var">var</a>
command and several variables are created by the simulator. Optionally the
search string can be specified in the command to search for it in variable
names.
<p>Optional /filter parameter can be used to select variables according
to place where they were defined:</p>
<ul><li>/p List predefined variables only,</li>
<li>/u Print user defined variables,</li>
<li>/d List variables from debug info (cdb) file</li>
</ul>
<pre>0&gt; <font color="#118811">info var a</font>
pa rom[0xf000] = 00000000
Data register of pa
sim_real_time simif_0_cfg[0xa] = 00000000
Real time since reset in msec (int, RO)
sim_reason simif_0_cfg[0x5] = 00000000
Reason of last stop (int, RO)
sim_start simif_0_cfg[0x2] = 00000000
WR: start simulation, RD: true if running
sim_xtal simif_0_cfg[0x6] = 00a8c000
Xtal frequency in Hz (int, RW)
0&gt; <font color="#118811">var abc</font>
0&gt; <font color="#118811">i v a</font>
abc variables[0x00] = 00000000
pa rom[0xf000] = 00000000
Data register of pa
sim_real_time simif_0_cfg[0xa] = 00000000
Real time since reset in msec (int, RO)
sim_reason simif_0_cfg[0x5] = 00000000
Reason of last stop (int, RO)
sim_start simif_0_cfg[0x2] = 00000000
WR: start simulation, RD: true if running
sim_xtal simif_0_cfg[0x6] = 00a8c000
Xtal frequency in Hz (int, RW)
0&gt;
</pre>
First word is the name of the variable, followed by memory and the
address, last word is the actual value in hexadecimal. Predefined
variables have a short description which is printed in next line.
<hr>
<h4><a name="info_history">info history</a></h4>
This command is the same as <a href="cmd_exec.html#history_information">history
information</a>. </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 symbolic 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&gt; <font color="#118811">tim a 3</font>
0&gt; <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&gt; <font color="#118811">tim a "a"</font>
0&gt; <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&gt;
</pre> </blockquote>
<hr>
</body>
</html>

View File

@@ -0,0 +1,342 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>Memory manipulation commands of &#956;Csim</title>
</head>
<body style=" background-color: white;">
<h2>Memory manipulation commands of &#956;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>&gt; <font color="#118811">file "../../remo.hex"</font>
55470 words read from ../../remo.hex
&gt;
</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">ucsim_51 -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.
&gt; <font color="#118811">do
:03000000020003F8
:1000030075812078207600D8FC900000AE83AF8203
:100013009000001200416005E4F0A380F690009F79
:1000230012004A9000A312004A9000A712006890A1
:1000330000AD12006875D0001200B50200B3EF6581
:10004300827003EE658322E493F8740193F97402DA
:1000530093FE740393F5828E83E869700122E4931F
:10006300F6A30880F4E493FC740193FD740293FEF9
:10007300740393FF740493F8740593F582888312D1
:100083000041700122E493A3A883A9828C838D820B
:10009300F0A3AC83AD828883898280E3212100B5FC
:1000A300212100B5000000B500B5000000B500B582
:0200B30080FECD
:1000B5007520117501AA850120750102850120228F
:00000001FF</font>
197 bytes loaded
&gt; </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">ucsim_51</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.
&gt; <font color="#118811">fill xram 12 0x12 0x56</font>
&gt; <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 .
&gt; </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 sequences. &#956;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">ucsim_51</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.
&gt; <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
&gt; <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
&gt; <font color="#118811">Where xram "d ani"</font>
0x0019 64 20 61 6e 69 d ani
&gt; </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 specified as the
last parameter. </p>
<pre>$ <font color="#118811">ucsim_51</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&gt; hole
0x0000 65535
0&gt; <font color="#118811">hole xram</font>
0&gt; <font color="#118811">fill xram 0x100 0x1ff 11</font>
0&gt; <font color="#118811">hole xram 50 11</font>
0x0100 255
0&gt; <font color="#118811">fill xram 0x500 0x600 11</font>
0&amp;ht; <font color="#118811">hole xram 50 11</font>
0x0100 255
0x0500 256
0&gt; <font color="#118811">rom[0x200]=1</font>
1
0&gt; <font color="#118811">hole</font>
0x0000 511
0x0201 65022
0&gt; </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 length
(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><a href="#memory_create">memory create</a><br>
<a href="#memory_remove">memory remove</a><br>
<a href="#memory_info">memory info</a><br>
memory cell</p>
<a name="memory_create">
<h3>memory create</h3>
</a>
<p>This set of commands can be used to create new memory objects. It
requires a subcommand, which can be:</p>
<p><a href="#memory_create_chip">memory create chip</a><br>
<a href="#memory_create_addressspace">memory create addressspace</a><br>
<a href="#memory_create_addressdecoder">memory create addressdecoder</a><br>
<a href="#memory_create_banker">memory create banker</a><br>
<a href="#memory_create_bank">memory create bank</a><br>
<a href="#memory_create_bander">memory create bander</a></p>
<p><a name="memory_createchip"></a></p>
<blockquote><a name="memory_createchip"> </a><a name="memory_create_chip">
<h4>memory create chip <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_create_addressspace">
<h4>memory create as|addressspace|addr|addrs|addrspace|aspace <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>ucsim_51</b>,
<b>ucsim_avr</b>, etc.) define necessary address spaces for themself, so
this command is not needed.
<hr> <a name="memory_create_addressdecoder">
<h4>memory create
ad|addrdec|addrdecoder|addressdec|addressdecoder|adec|adecoder <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" area is mapped: </p>
<pre>$ <font color="#118811">ucsim_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&gt; <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 -&gt; rom_chip 0x0000 activated
0 iram 0x00 0x7f -&gt; iram_chip 0x00 activated
0 sfr 0x80 0xff -&gt; sfr_chip 0x00 activated
0 xram 0x0000 0xffff -&gt; xram_chip 0x0000 activated
0&gt; <font color="#118811">mem cchip myram 0x1000 8</font>
0&gt; <font color="#118811">mem createaddressdecoder xram 1234 2000 myram 15</font>
0&gt; <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 -&gt; rom_chip 0x0000 activated
0 iram 0x00 0x7f -&gt; iram_chip 0x00 activated
0 sfr 0x80 0xff -&gt; sfr_chip 0x00 activated
0 xram 0x0000 0x04d1 -&gt; xram_chip 0x0000 activated
1 xram 0x04d2 0x07d0 -&gt; myram 0x00f activated
2 xram 0x07d1 0xffff -&gt; xram_chip 0x07d1 activated
0&gt;
</pre> It is easy to share chip area between address spaces:
<pre>$ <font color="#118811">ucsim_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&gt; <font color="#118811">mem createaddressdecoder rom 0 0xfff xram_chip 0xf000</font>
0&gt; <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 -&gt; xram_chip 0xf000 activated
1 rom 0x1000 0xffff -&gt; rom_chip 0x1000 activated
0 iram 0x00 0x7f -&gt; iram_chip 0x00 activated
0 sfr 0x80 0xff -&gt; sfr_chip 0x00 activated
0 xram 0x0000 0xffff -&gt; xram_chip 0x0000 activated
0&gt; <font color="#118811">rom[0]=0xab</font>
171
0&gt; <font color="#118811">xram[0xf000]</font>
171
0&gt;
</pre>
<hr> <a name="memory_create_banker">
<h4>memory create banker <i>switcher_addressspace switcher_address
switcher_mask banked_addressspace start end</i></h4>
</a>This command creates a "banker", which is a controllable dynamic
address decoder. This means that some part of an address space can be
mapped to different chips and the actual map is controlled by a memory
location.<br>
This command specifies the range of the address space and the control.<br>
Following parameters specify the controller:<br>
<ul>
<li><b>switcher_addressspace</b> address space where the controller
memory location is.</li>
<li><b>switcher_address</b> address of the controller.</li>
<li><b>switcher_mask</b> mask of the bits which select a chip. This
parameter specifies, how many banks will be used, so how many chips
will be needed. </li>
</ul>
Following parameters specify the address space and range which is covered
by this address decoder:<br>
<ul>
<li><b>banked_asddressspace</b> name of the address space which will be
banked.</li>
<li><b>start</b> start address of the area, and</li>
<li><b>end</b> and address of the area which will be banked.</li>
</ul>
<hr> <a name="memory_create_bank">
<h4>memory create bank <i>addressspace begin bank_nr chip begin</i></h4>
</a> Bank.
<hr> <a name="memory_create_bander">
<h4>memory create bander <i>addressspace begin end chip begin
bits_per_chip [distance]</i></h4>
</a> Bander. </blockquote>
<hr>
<a name="memory_remove">
<h3>memory remove|rm|del</h3>
</a>
This set of commands can be used to remove some memory object. It
requires a subcommand, which can be:
<p><a href="#memory_remove_chip">memory remove chip</a> </p>
<blockquote>
<a name="memory_remove_chip">
<h4>memory remove chip <i>id</i></h4>
</a>
This command deletes the specified memory chip from the
simulator. All address decoders that points to this chip will be
deleted too.
</blockquote>
<hr>
<a name="memory_info">
<h3>memory info</h3>
</a> This command is same as <a href="cmd_general.html#info_memory">info
memory</a>.
<hr> <a name="var">
<h3>var name [memory addr]</h3>
</a> This command assigns a name to a memory location. This name can be used
in <a href="cmd_general.html#expression">expression</a>s as variable. If
memory is not specified, next yet unnamed location will be used from a
special address space, called <b>variables</b>. This address space have 256
locations by default (32 bit each), but the size can be specified using <a
href="invoke.html">-a option</a> of the simulator program.
<pre>0&gt; <font color="#118811">var abc</font>
0&gt; <font color="#118811">i v abc</font>
abc variables[0x00] = 00000000
0&gt; <font color="#118811">abc=12</font>
12
0&gt; <font color="#118811">expr /b abc</font>
00000000000000000000000000001100
0&gt;
</pre>
Memory location can be specified in two forms:
<pre>0&gt; <font color="#118811">var vname rom 45</font>
0&gt; <font color="#118811">i var vname</font>
vname rom[0x002d] = 73d4d3c4
0&gt; <font color="#118811">var other rom[45]</font>
0&gt; <font color="#118811">i v other</font>
other rom[0x002d] = 73d4d3c4
0&gt;
</pre>
<hr> <a name="var">
<h3>rmvar name</h3>
</a> This command removes a variable.
<pre>0&gt; <font color="#118811">rmvar abc</font>
No such variable
</pre>
</body>
</html>

View File

@@ -0,0 +1,588 @@
<html>
<head>
<meta content="text/html; charset=ISO-8859-2" http-equiv="content-type">
<title>Removed commands of &mu;Csim</title>
</head>
<body bgcolor="white">
<h2>Removed commands of &mu;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">ucsim_51 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
&gt; <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
&gt; <font color="#118811">bse wi f 6</font>
&gt; <font color="#118811">g</font>
4
000170 7f 00 MOV R7,#00
&gt; </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>&gt; <font color="#118811">bl</font>
D 2(2) 000180 02 LJMP 022a
F 1(1) 000006 wi
&gt; <font color="#118811">bde ri 6</font>
No ri breakpoint at 000006
&gt; <font color="#118811">bde wi 6</font>
&gt; <font color="#118811">bl</font>
D 2(2) 000180 02 LJMP 022a
&gt; </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>&gt; <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
&gt; <font color="#118811">ba</font>
&gt; <font color="#118811">bl</font>
&gt; </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">ucsim_51 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
&gt; <font color="#118811">sopt stopit 1</font>
&gt; <font color="#118811">g</font>
5
* 000023 02 01 1c LJMP 011c
&gt; <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 .
&gt; </pre>
First lines on the list (labeled with Px) are value of SFRs which are
internal latch registers. Second lines (labeled 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 (labeled 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">ucsim_51 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
&gt; <font color="#118811">sopt stopit 1</font>
&gt; <font color="#118811">g</font>
5
* 000023 02 01 1c LJMP 011c
&gt; <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 ................
&gt; <font color="#118811">ds p1 0x87</font>
P1 fe 254 .
000087 00 0 .
&gt; <font color="#118811">ds p2 ip scon</font>
P2 ff 255 .
IP 15 21 .
SCON 7e 126 ~
&gt; </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">ucsim_51</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.
&gt; <font color="#118811">ds rcap2l</font>
&gt; <font color="#118811">q</font>
$ <font color="#118811">ucsim_51 -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.
&gt; <font color="#118811">ds rcap2l</font>
RCAP2L 00 0 .
&gt; </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">ucsim_51</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.
&gt; <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
&gt; </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>&gt; <font color="#118811">sp 1 0x0f</font>
&gt; <font color="#118811">ss p1 0x55</font>
000090 55 U
&gt; <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 .
&gt; <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
&gt; </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">ucsim_51 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
&gt; <font color="#118811">b 0x187</font>
&gt; <font color="#118811">sopt stopit y</font>
&gt; <font color="#118811">g</font>
Simulation started, PC=0x000000
Stop at 000187: (4) Breakpoint
F 000187
&gt; </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 be undefined.
<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 instruction at the 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">ucsim_51 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
&gt; <font color="#118811">g</font>
Simulation started, PC=0x000000
Stop at 00019c: (7) User stopped
F 00019c
&gt; <font color="#118811">si 20 Dani DAni</font>
000014 44 61 6e 69 44 41 6e 69 DaniDAni
&gt; <font color="#118811">wi dani</font>
000014 44 61 6e 69 Dani
000018 44 41 6e 69 DAni
&gt; <font color="#118811">Wi Dani</font>
000014 44 61 6e 69 Dani
&gt; <font color="#118811">wi dani\0</font>
000018 44 41 6e 69 00 DAni.
&gt; </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">ucsim_51 -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.
&gt; <font color="#118811">gopt</font>
verbose TRUE Verbose flag.
stopit FALSE Stop if interrupt accepted.
debug FALSE Debug flag.
&gt; <font color="#118811">gopt stopit</font>
stopit FALSE Stop if interrupt accepted.
&gt; </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">ucsim_51 -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.
&gt; <font color="#118811">gopt</font>
verbose TRUE Verbose flag.
stopit FALSE Stop if interrupt accepted.
debug FALSE Debug messages appears on this console.
&gt; <font color="#118811">sopt debug t</font>
&gt; <font color="#118811">gopt</font>
verbose TRUE Verbose flag.
stopit FALSE Stop if interrupt accepted.
debug TRUE Debug messages appears on this console.
&gt; </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">ucsim_51</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.
&gt; <font color="#118811">si 10 dani\040hej-ho</font>
00000a 64 61 6e 69 20 68 65 6a 2d 68 6f dani hej-ho
&gt; </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>&gt; <font color="#118811">si 20 1 2 0xi 3 4</font>
Bad data 0xi
000014 01 02 ..
&gt; </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">ucsim_51</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.
&gt; <font color="#118811">ss p1 0</font>
000090 00 .
&gt; </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">ucsim_51</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.
&gt; <font color="#118811">sb 0x23.5 1</font>
&gt; <font color="#118811">db 0x23.5</font>
000023 23.5 1
&gt; <font color="#118811">sb p3.3 0</font>
&gt; <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 .
&gt; <font color="#118811">sb tr1 0</font>
&gt; <font color="#118811">db tr1</font>
000088 TR1 0
&gt; <font color="#118811">sb tr1 1</font>
&gt; <font color="#118811">db tr1</font>
000088 TR1 1
&gt; </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">ucsim_51</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.
&gt; <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 .
&gt; <font color="#118811">ss p1 0x55</font>
000090 55 U
&gt; <font color="#118811">sp 1 0x0f</font>
&gt; <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 .
&gt; </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">ucsim_51</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.
&gt; <font color="#118811">fi 11 0x34 44</font>
&gt; <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 ........
&gt; </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>

View File

@@ -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>

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@@ -0,0 +1,129 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>&#956;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>

View File

@@ -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>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,118 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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 Padauk. 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>ucsim_51</b>, <b>ucsim_avr</b>, <b>ucsim_hc08</b>, <b>ucsim_xa</b>,
<b>ucsim_z80, 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 analyzer</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 I/O</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. It can also be used to
replay events from a VCD file in order to simulate external events.</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>
<p><b>Microcontroller specific features</b> </p>
<ul>
<li><a href="stm8/index.html">STM8</a></li>
</ul>
<h2><a name="dev">Developers</a></h2>
<ul>
<li><a href="testing.html">Regression Testing</a></li>
</ul>
<hr>
<table border="0">
<tbody>
<tr>
<td><a href="mailto:drdani@mazsola.iit.uni-miskolc.hu"><img src="post.jpg"
border="0" align="top"></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>

View File

@@ -0,0 +1,233 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>&#956;Csim: Invokation</title>
</head>
<body style=" background-color: white;">
<h1>Starting the simulator</h1>
There are separate programs to simulate different microcontroller families:
<p>Intel MCS51 family is simulated by <b>ucsim_51</b> <br>
Philips XA processor is simulated by <b>ucsim_xa</b> <br>
Atmel AVR processor is simulated by <b>ucsim_avr</b> <br>
Zilog Z80 family is simulated by <b>ucsim_z80</b> <br>
Toshiba TLCS90 processor is simulated by <b>ucsim_tlcs</b> <br>
Rabbit family is simulated by <b>ucsim_rxk</b> <br>
Motorola M68HC08 processor is simulated by <b>ucsim_m68hc08</b> <br>
Motorola MC6800 processor is simulated by <b>ucsim_m6800</b> <br>
Motorola MC6809 processor family is simulated by <b>ucsim_m6809</b><br>
Motorola MC68HC11 processor is simulated by <b>ucsim_m68hc11</b> <br>
Motorola MC68HC12 processor is simulated by <b>ucsim_m68hc12</b> <br>
MOS MOS6502 processor is simulated by <b>ucsim_mos6502</b> <br>
ST ST7 processor is simulated by <b>ucsim_st7</b> <br>
ST STM8 family is simulated by <b>ucsim_stm8</b> <br>
Padauk family is simulated by <b>ucsim_pdk</b><br>
p1516 processor is simulated by <b>ucsim_p1516</b>
</p>
<p>The simulator can be started in the following way: </p>
<p><tt><font color="blue">$</font> ucsim_51 [-hHVvPgGwlbB] [-p prompt] [-t CPU] [-X
freq[k|M]] [-R seed] [-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><tt><b>-R seed</b></tt></dt>
<dd>Set seed value for the random number generator.</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>&#956;Csim</i> can serve multiple consoles. You can get a console
by simply telnet into machine running <i>&#956;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,raw</b></tt>
</dt>
<dd>Using this option you can specify different files for input and output
streams that <i>&#956;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> ucsim_51 -p "s51&gt; "
<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&gt; </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_label</span> label
color in memory dump (2<sup>nd</sup> column)</li>
<li><span style="font-family: monospace;">dump_number</span> color of
numerical part of the dump (3<sup>rd</sup> column)</li>
<li><span style="font-family: monospace;">dump_char</span> color of
textual part of the dump (4<sup>th</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><tt>-l</tt></b></dt>
<dd>Use colors of light theme (default is dark)</dd>
<dt><b><span style="font-family: monospace;">-b</span></b></dt>
<dd>Black &amp; white (non-color) console.</dd>
<dt><tt><b>-B</b></tt></dt>
<dd>Beep on breakpoints. Print out a beep character to the
console when a breakpoint hits.</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>

View File

@@ -0,0 +1,102 @@
<html>
<head>
<meta content="text/html; charset=ISO-8859-2" http-equiv="content-type">
<title>Memory simulation in &mu;Csim</title>
</head>
<body>
<h1>Memory simulation in <i>&mu;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 &mu;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>Memory banking (or bank-switching) is a method to extend amount
of memory accessible by the CPU. Full amount of the memory which
is available for the CPU at a time is limited by the size if the
address space and can not be enlarged. But the address decoder can
dynamically change the map between some part of addresses and
memory chips. Dynamically mapped part of the address space becomes
<i>banked</i> this way. Banked addresses can be mapped to
different memory chips (or different part of a bigger chip)
according to an extra information called bank
selection. Selection is stored in a register and writable by the
software. Selector register should be at an address which is
non-banked. Selection is defined by a binary coded data, and
size of this data determines how many banks available behind the
banked addresses. Banks can store either code or data but using
them need support by the compiler.
</p>
<p>Banks in separate chips:</p>
<p><img src="bank_multichip.svg" alt="[Banks in multi chips]" border="0"></p>
<p>Banks in a single chip:</p>
<p><img src="bank_bigchip.svg" alt="[Banks in big chip]" border="0"></p>
<h3><a name="banding">Bit banding</a></h3>
<p>Banding...</p>
<hr>
</body>
</html>

View File

@@ -0,0 +1,72 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>&#956;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>&#956;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> ucsim_51 -Z 5555 foo.hex
</pre> In this case ucsim_51 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> ucsim_51 -Z 5555 foo.hex &amp;
</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> ucsim_51 -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.
&gt;
</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 (by kill) 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> ucsim_51 -Z 5555 foo.hex -c /dev/tty
</pre>
<hr>
</body>
</html>

View File

@@ -0,0 +1,37 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
<title>&#956;Csim: News</title>
</head>
<body>
<h1>News</h1>
<h2>version 0.7</h2>
<ul>
<li>Bugfixes.</li>
<li>New <b style="font-family: monospace;">raw</b> suboption for -S, <a
href="invoke.html">see details</a>.</li>
</ul>
<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>New simulators: TLCS90, pdk, M6809</li>
<li>New simulators: PicoBlaze, MCS6502, MC6800, Rabbit</li>
<li>Simulator interface</li>
<li>Memory banking</li>
<li>Bit banding</li>
<li>Serial line simulation for STM8</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 files</li>
<li>Variables</li>
<li>Colors</li>
<li>Execution history</li>
</ul>
<hr>
</body>
</html>

View File

@@ -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>&gt; <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
&gt; </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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

View File

@@ -0,0 +1,126 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>&#956;Csim: Serial Interfaces</title>
</head>
<body style="background-color: 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 even can be a real serial line of the computer:
<pre><font color="blue">$</font> ucsim_51 -s/dev/ttyS1
</pre>
<p><img src="serial_comport.svg"></p>
<p>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>
<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> ucsim_51 -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>
<p> Every character sent out by the simulated program appears in the
"terminal" window and every character you type in there will be received
by the simulated controller's serial line.</p>
<p><b><i>Notes</i></b></p>
<p>-s option is deprecated, it is recommended to use -S instead. Option -S
provides more features and flexibility but it requires to use different
syntax:</p>
<p>-S subopt1,subopt2,...</p>
<p>Known suboptions are:</p>
<ul>
<li>uart=nr<br>
This option specifies ID of the uart that following options will be
attached to. Default is 0.</li>
<li>in=filename<br>
Specified file will be used as input for the uart. When simulated uart
is able to receive, it will get content of this file.</li>
<li>out=filename<br>
Specified file will be used as output for the uart. When simulated uart
sends a byte, it will be written into this file.</li>
<li>port=nr<br>
Specified port number will be listened for incoming connections (TCP
server) and if connected, the socket will be used as both input and
output for the uart.</li>
<li>iport=nr<br>
Specified port number will be listened for incoming connections (TCP
server) and if connected, the socket will be used as input of the uart.</li>
<li>oport=nr<br>
Specified port number will be listened for incoming connections (TCP
server) and if connected, the socket will be used as output of the uart.</li>
<li>raw<br>
Raw, non-interactive communication will be performed on both input and
output files. Default is interactive (non-raw) mode.</li>
</ul>
Input and output file can be a regular file or a special one, for example
pipe (fifo) or a TCP socket. If a file is a tty, the simulator will assume
that a terminal is connected and will start an interactive session. TCP
socket is treated as a tty, and telnet protocol is used to control the
terminal settings. This can be turned off by <b>raw</b> suboption. If <b>raw</b>
is used, simulator will not perform any terminal control and will not
use/interpret telnet protocol commands.<br>
<br>
<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-&gt;2 and 2-1: 2-&gt;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> ucsim_51 -Sin=2-1,out=1-2,raw program_1_.hex
<font color="blue">term2 $</font> <font color="magenta"># start sim "2"</font>
<font color="blue">term2 $</font> ucsim_51 -Sout=2-1,in=1-2,raw 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 useful 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 &gt;tee_2 # monitor 1-&gt;2
<font color="blue">xterm2 $</font> cat 2_tee|tee /dev/tty &gt;tee_1 # monitor 2-&gt;1
</pre> </li>
<li>Now you can start simulators (on two other terminals:)
<pre><font color="blue">xterm3 $</font> ucsim_51 -Sin=tee_1,out=1_tee,raw program_1_.hex
<font color="blue">xterm4 $</font> ucsim_51 -Sin=tee_2,out=2_tee,raw program_2_.hex
</pre> </li>
<li>Start your apps and listen what they are talking about. </li>
</ol>
<hr>
</body>
</html>

View File

@@ -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>

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -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 &#62;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 &#62;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>

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Creator: fig2dev Version 3.2.8b -->
<!-- CreationDate: 2022-02-27 19:00:14 -->
<!-- Magnification: 1 -->
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="353pt" height="227pt"
viewBox="2763 3588 5874 3777">
<g fill="none">
<!-- Line -->
<polygon points=" 2775,4875 3075,3600 5325,3600 5625,4875" fill="#0000b0"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="3150" y="3750" width="2100" height="975" rx="105" fill="#ffffff"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="2775" y="4875" width="2850" height="450" fill="#87cfff"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="2775" y="5325" width="2850" height="825" fill="#00d1d1"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<rect x="7350" y="6000" width="1275" height="900" fill="#00b0b0"
stroke="#000000" stroke-width="8px"/>
<!-- Line -->
<defs>
<clipPath id="cp0">
<path clip-rule="evenodd" d="M 2763,3588 H 8637 V 7365 H 2763 z
M 5172,5670 5292,5700 5172,5730 5336,5711 5336,5690z
M 4920,5403 4950,5283 4980,5403 4961,5240 4940,5240z"/>
</clipPath>
</defs>
<polyline points=" 4950,5250 4950,5700 5325,5700" clip-path="url(#cp0)"
stroke="#000000" stroke-width="15px"/>
<!-- Forward arrow to point 5325,5700 -->
<polyline points=" 5172,5670 5292,5700 5172,5730"
stroke="#000000" stroke-width="15px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 4950,5250 -->
<polyline points=" 4920,5403 4950,5283 4980,5403"
stroke="#000000" stroke-width="15px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp1">
<path clip-rule="evenodd" d="M 2763,3588 H 8637 V 7365 H 2763 z
M 4122,5070 4242,5100 4122,5130 4286,5111 4286,5090z
M 4020,4728 4050,4608 4080,4728 4061,4565 4040,4565z"/>
</clipPath>
</defs>
<polyline points=" 4050,4575 4050,5100 4275,5100" clip-path="url(#cp1)"
stroke="#000000" stroke-width="15px"/>
<!-- Forward arrow to point 4275,5100 -->
<polyline points=" 4122,5070 4242,5100 4122,5130"
stroke="#000000" stroke-width="15px" stroke-miterlimit="8"/>
<!-- Backward arrow to point 4050,4575 -->
<polyline points=" 4020,4728 4050,4608 4080,4728"
stroke="#000000" stroke-width="15px" stroke-miterlimit="8"/>
<!-- Line -->
<defs>
<clipPath id="cp2">
<path clip-rule="evenodd" d="M 2763,3588 H 8637 V 7365 H 2763 z
M 4122,5070 4242,5100 4122,5130 4286,5111 4286,5090z
M 5778,5672 5656,5688 5757,5616 5611,5694 5619,5714z"/>
</clipPath>
</defs>
<polyline points=" 5625,5700 5653,5689 5671,5682 5693,5674 5720,5663 5752,5652 5787,5639 5825,5625
5864,5611 5904,5598 5943,5585 5981,5573 6018,5562 6053,5553 6085,5546 6114,5541
6141,5538 6166,5537 6187,5539 6207,5543 6225,5550 6243,5560 6260,5573 6276,5588
6291,5606 6305,5626 6319,5649 6333,5674 6346,5700 6359,5727 6371,5755 6383,5784
6395,5814 6406,5843 6416,5872 6425,5900 6433,5928 6440,5955 6446,5981 6450,6006
6452,6030 6452,6053 6450,6075 6446,6095 6439,6115 6430,6135 6419,6154 6405,6172
6390,6191 6372,6209 6352,6227 6331,6244 6309,6262 6286,6279 6262,6296 6239,6314
6216,6331 6194,6349 6173,6367 6153,6385 6135,6403 6120,6422 6106,6442 6095,6462
6086,6482 6079,6503 6075,6525 6073,6547 6073,6570 6074,6594 6077,6619 6082,6645
6087,6673 6094,6701 6101,6731 6110,6761 6119,6791 6128,6822 6138,6853 6149,6884
6160,6914 6171,6943 6183,6971 6195,6998 6208,7023 6221,7046 6235,7067 6250,7085
6265,7101 6282,7114 6300,7125 6318,7133 6337,7138 6358,7142 6381,7143 6404,7143
6429,7142 6455,7139 6483,7135 6511,7130 6540,7124 6570,7118 6600,7111 6630,7103
6661,7095 6691,7086 6721,7077 6751,7068 6780,7059 6808,7050 6835,7040 6861,7030
6886,7020 6910,7010 6933,6999 6954,6987 6975,6975 6996,6960 7017,6944 7037,6925
7058,6904 7078,6881 7098,6856 7119,6828 7141,6797 7162,6765 7184,6731 7206,6696
7228,6661 7248,6627 7268,6593 7286,6563 7302,6535 7316,6510 7327,6490 7336,6475
7350,6450" clip-path="url(#cp2)"
stroke="#000000" stroke-width="15px" stroke-linejoin="bevel"/>
<!-- Backward arrow to point 5625,5700 -->
<polyline points=" 5778,5672 5656,5688 5757,5616"
stroke="#000000" stroke-width="15px" stroke-miterlimit="8"/>
<!-- Text -->
<text xml:space="preserve" x="2850" y="5100" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="bold" font-size="144" text-anchor="start">OS</text>
<!-- Text -->
<text xml:space="preserve" x="2850" y="5550" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="bold" font-size="144" text-anchor="start">HW</text>
<!-- Text -->
<text xml:space="preserve" x="3225" y="3975" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="bold" font-size="144" text-anchor="start">App</text>
<!-- Text -->
<text xml:space="preserve" x="4350" y="5175" fill="#000000" font-family="Courier" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">/dev/ttyS1</text>
<!-- Text -->
<g transform="translate(7650,6750) rotate(-90)" >
<text xml:space="preserve" x="0" y="0" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">UART</text>
</g><!-- Text -->
<text xml:space="preserve" x="5850" y="7350" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">Serial cable</text>
<!-- Text -->
<text xml:space="preserve" x="7575" y="5925" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">Equipment</text>
<!-- Text -->
<g transform="translate(5550,6000) rotate(-90)" >
<text xml:space="preserve" x="0" y="0" fill="#000000" font-family="Helvetica" font-style="normal" font-weight="normal" font-size="144" text-anchor="start">UART</text>
</g><!-- Text -->
<text xml:space="preserve" x="3225" y="4275" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="bold" font-size="144" text-anchor="start">ucsim_51 \</text>
<!-- Text -->
<text xml:space="preserve" x="3300" y="4500" fill="#0000ff" font-family="Courier" font-style="normal" font-weight="bold" font-size="144" text-anchor="start">-s/dev/ttyS1</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -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>

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -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>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,412 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
<title>&#956;Csim: Simulator interface</title>
</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>ucsim_51 -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&gt; <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&gt; </pre>
<p>Using info command you can get state of the interface, known commands,
and other information:</p>
<pre>0&gt; <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&gt; <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&gt;
</pre>
<p>To turn on the interface, use following command:</p>
<pre>0&gt; <span style="color: #009900;">set hw simif xram 0xffff</span>
0&gt; <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&gt; <span style="color: #009900;">set hw simif fin "infile.txt"</span>
0&gt; <span style="color: #009900;">set hw simif fout "outfile.txt"</span>
0&gt; <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
volatile unsigned char SIF_ADDRESS_SPACE * 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 &lt; 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 &amp;&amp; (i&lt;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 &lt; nuof_commands; i++)
{
printf("Command '%c' info:\n", commands[i]);
*sif= SIFCM_CMDINFO;
*sif= commands[i];
inf[0]= *sif;
for (j= 0; j &lt; 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 &gt; 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>

View File

@@ -0,0 +1,267 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Features of the STM8 Simulator</title>
</head>
<body>
<h1>Features of the STM8 Simulator</h1>
<h2>Cycle Counts</h2>
Instruction timings are correct and take into account pipeline overlaps
and stall cycles. The only known exceptions are HALT, WFI and WFE which
are either not yet implemented or, in the case of HALT, only partially
and minimally implemented.
<h3>Notes on Documention</h3>
<h4>PM0044 Section 5.3 Pipelined execution examples</h4>
<p>There are some errors in these tables. See the trace outputs in the
<a href="#exanal">Example Analyses</a> section below for details.</p>
<h4>PM0044 Section 7.4 Instruction Set</h4>
<p>The cycle counts shown for instructions in PM0044 section 7 are one less
than the actual counts because the first decode cycle of an instruction
normally overlaps with the last execution cycle of the preceding
instruction.</p>
<h3>Stall Cycle Detection</h3>
<p>Error/warning event reporting of stall cycles is available should timings
be important in your application.
<pre>0&gt; <font color="#118811">show error</font>
Error: non-classified [on/ON]
[...]
Error: stm8 [off/OFF]
Warning: pipeline [unset/OFF]
Warning: decode_stall [unset/OFF]
Warning: fetch_stall [unset/OFF]
[...]</pre>
<p>These are off by default but may be enabled as required either as a group:
<pre>0&gt; <font color="#118811">set error pipeline</font></pre>
or individually:
<pre>0&gt; <font color="#118811">set error decode_stall on</font>
0&gt; <font color="#118811">set error fetch_stall on</font></pre>
</p>
<h3>Cycle and Pipeline Analysis</h3>
<p>The simulator is able to generate detailed analyses of execution showing timings
for each instruction executed including pipeline overlaps and stalls. This is controlled
via the <em>pipetrace</em> feature of the STM8 CPU module. The output is in the form
of a self-contained HTML document that can be opened with a browser or imported into
other application documentation.</p>
<p>To generate a pipeline analysis:</p>
<ul>
<li>Set the title for the next pipetrace to be opened.
<pre>0&gt; <font color="#118811">set hw cpu pipetrace title "..."</font></pre>
</li>
<li>Replace the embedded default styling with a stylesheet link to the given URL.
<pre>0&gt; <font color="#118811">set hw cpu pipetrace style "<i>url</i>"</font></pre>
</li>
<li>Open the given file, write the header (including title and stylesheet) and
continue writing the pipeline analysis as instructions are executed.
<pre>0&gt; <font color="#118811">set hw cpu pipetrace start "<i>path</i>"</font></pre>
</li>
<li>Set folding of the analysis on (the default) or off. Folding causes the cycle
count to be reset to zero (moving the output back to the left) after every
pipeline flush (i.e. after every branch, jump or call). It is recommended you
leave this on unless you have <em>very</em> wide paper or are single stepping
and annotating the analysis between steps.
<pre>0&gt; <font color="#118811">set hw cpu pipetrace fold [on|off]</font></pre>
</li>
<li>Pause writing the pipeline analysis. The output file remains open but nothing
will be written to as instructions are executed.
<pre>0&gt; <font color="#118811">set hw cpu pipetrace pause</font></pre>
</li>
<li>Insert the given text into the current pipeline analysis. The text is
inserted verbatim and may contain HTML markup. If the output is not
paused the cycle count for the analysis is set back to zero so that the
next instruction output will be moved back to the left (the first cycle
after the inserted text does however overlap the last cycle before the
inserted text as normal).
<pre>0&gt; <font color="#118811">set hw cpu pipetrace data "<i>text</i>"</font></pre>
</li>
<li>Resume a paused pipeline analysis. Instruction execution will update the
analysis output again. Resuming a paused analysis resets the cycle count
to zero so that the next instruction output is moved back to the left.
(The next cycle may or may not overlap the last cycle before the pause
depending on whether or not any instructions were executed while the
output was paused.)
<pre>0&gt; <font color="#118811">set hw cpu pipetrace resume</font></pre>
</li>
<li>Stop the pipeline analysis and close the output file. No further analysis will
occur until a new analysis file is started.
<pre>0&gt; <font color="#118811">set hw cpu pipetrace stop</font></pre>
</li>
</ul>
<a name="exanal"></a>
<h3>Example Analyses</h3>
<h4>Documented Examples</h4>
<p>These are taken from the examples in ST's &ldquo;PM0044 Programming Manual&rdquo;
section &ldquo;5.3 Pipelined execution examples&rdquo; and are generated by
the test <a href="test.asm">stm8.src/test/stm8-cycles/test.asm</a>
using the &ldquo;pipetrace&rdquo;functionality described above.</p>
<p>Note that there are some errors in the examples in section 5.3. These are noted in
the output below and the differences confirmed on HW.</p>
<ul>
<li><a href="test.table3.html">
PM0044 5.4 Table 3. Example with exact number of cycles
</a>
<li><a href="test.table6.html">
PM0044 5.4.1 Table 8. Optimized pipeline example - execution from Flash
</a>
<li><a href="test.table8.html">
PM0044 5.4.2 Table 6. Optimized pipeline example - execution from RAM
</a>
<li><a href="test.table10.html">
PM0044 5.4.3 Table 10. Pipeline with Call/Jump
</a>
<li><a href="test.table12.html">
PM0044 5.4.4 Table 12. Example of stalled pipeline
</a>
</ul>
<h4>Additional Examples</h4>
<p>The DIV instruction is special in that it takes a variable number of cycles and
is interruptible.</p>
<ul>
<li><a href="test.div.html">
Examples of DIV execution
</a>
<li><a href="test.int_div.html">
Examples of interrupted DIV execution
</a> (not currently implemented)
</ul>
<p>Other instructions, each run individually starting from an empty pipeline and
showing the overlap with the following instruction.</p>
<ul>
<li><a href="test.instrs.html">
Examples of individual instruction execution
</a>
</ul>
<h3>Hardware Cycle Counting</h3>
<p>Actual cycle counts may be obtained from hardware for comparison using a combination
of <a href="https://stm8-binutils-gdb.sourceforge.io">stm8-gdb</a>, openocd and an STLink
or other openocd/SWIM compatible debugger. Set the master and CPU clocks to be equivalent
and use one of the target's timers to count cycles.</p>
<p>For instance:</p>
<blockquote><pre>
$ openocd -f interface/stlink.cfg -f target/stm8s003.cfg &amp;
$ stm8-gdb
[...]
(gdb) target extended-remote :3333
(gdb) set $DM_CSR2 = 0x7f99
(gdb) set $DM_ENFCTR = 0x7f9a
(gdb) set $CLK_CKDIVR = 0x50c6
(gdb) set $CLK_PCKENR1 = 0x50c7
(gdb) set $TIM2_CR1 = 0x5300
(gdb) set $TIM2_EGR = 0x5306
(gdb) set $TIM2_CNTRH = 0x530c
(gdb) set $TIM2_CNTRL = 0x530d
(gdb) set $TIM2_PSCR = 0x530e
(gdb) define cycles
dont-repeat
# Freeze TIM2 when CPU is stalled by DM
set {unsigned char}$DM_ENFCTR = 0xfd
# Set HSIDIV = 0, CPUDIV = 0
set {unsigned char}$CLK_CKDIVR = 0x00
# Set TIM2 prescalar to 0 so f_CK_CNT matches f_MASTER (and hence f_CPU)
set {unsigned char}$TIM2_PSCR = 0x00
# Clear count and update config
set {unsigned char}$TIM2_EGR = 1
set {unsigned char}$TIM2_CNTRH = 0xff
set {unsigned char}$TIM2_CNTRL = 0xff
# Enable counter
set {unsigned char}$TIM2_CR1 = 0x01
# Enable clock gate
set {unsigned char}$CLK_PCKENR1 = 0x20
# Set PC
# N.B. Do not attempt to flush the decoder by writing to DM_CSR2. It upsets
# openocd which is then unable to set breakpoints.
set $pc = $arg0
#set {unsigned char}$DM_CSR2 = 0x81
# Set a HW breakpoint, run, then clear
monitor bp $arg1 1 hw
cont
monitor rbp $arg1
set $_tmp = {unsigned short}$TIM2_CNTR
disass/r $arg0,$arg1
printf "%u cycles\n", $_tmp
end
(gdb) document cycles
Set PC to the first address, set a HW break at the second address,
run and report how many cycles (as reported by $TIM2_CNTR) it took.
The target is assumed to be halted initially.
end
(gdb) monitor reset halt
target halted due to debug-request, pc: 0x00008000
(gdb) x/3i 0x811c
0x811c: ldw X,#0xfc00 ;0xfc00
0x811f: ld A,#0x80 ;0x80
0x8121: div X,A
(gdb) cycles 0x811c 0x8122
target halted due to debug-request, pc: 0x00008000
breakpoint set at 0x00008122
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00008122 in ?? ()
Dump of assembler code from 0x811c to 0x8122:
0x0000811c: ae fc 00 ldw X,#0xfc00 ;0xfc00
0x0000811f: a6 80 ld A,#0x80 ;0x80
0x00008121: 62 div X,A
End of assembler dump.
14 cycles
</pre></blockquote>
<p>Don't forget that there will be an initial pipeline fetch cycle
before the first instruction can be decoded, there may be stall
cycles, multiple instructions (mostly) overlap by one cycle (which is
assumed in the timings given by PM0044), and you may have interrupts
that should be disabled.</p>
</body>
</html>

View File

@@ -0,0 +1,484 @@
; For an STM8S003
TIM4_CR1 =: 0x5340
TIM4_IER =: 0x5343
TIM4_EGR =: 0x5345
TIM4_ARR =: 0x5348
.macro codebndry
.$.end =: .
.bndry 4
.$.diff =: . - .$.end
. = . - .$.diff
.rept .$.diff
nop
.endm
.endm
.macro areabndry n
.$.end =: .
.bndry n
.ifne . - .$.end
. = . - 1
.byte 0
.endif
.endm
.area _CODE (REL,CON)
int reset
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
int no_action
no_action:
iret
codebndry
.area INITIALIZER (REL,CON)
.area CODE (REL,CON)
codebndry
reset:
; PM0044 5.4 Conventions, table 3
; N.B. PM004 cannot be right. Table 3 disagrees with the section 7 documentation for ADDW.
; Table 4 has cycle counts for ADDW that disagree with the time graph on the right.
jra table3
codebndry
table3: ldw x,[0x50]
addw x,#20
ld a,[0x30]
table3_end:
; PM0044 5.4.1 Optimized pipeline example, table 6
; N.B. Table 6 has the final F3 load one cycle too early surely?
jra table6
codebndry
table6: neg a
xor a, 0x10
ld a, #20
sub a, 0x1000
inc a
ld xl, a
srl a
swap a
sla 0x15
cp a, #0xfe
mov 0x100, #11
mov 0x101, #22
table6_end:
; PM0044 5.4.2 Optimize pipeline example - execution from RAM, table 8 (requires copy to RAM)
table8_copy:
ldw x, #table8_end - table8_start
jreq table8_copy_end
table8_copy_loop:
ld a, (table8_start - 1, x)
ld (0x100 - 1, x), a
decw x
jrne table8_copy_loop
table8_copy_end:
call 0x100
codebndry
.area INITIALIZER
codebndry
table8_start:
jra table8
codebndry
table8: neg a
xor a, 0x10
ld a, #20
sub a, 0x1000
inc a
ld xl, a
srl a
swap a
sla 0x15
cp a, #0xfe
ret
table8_end:
codebndry
.area CODE
codebndry
; PM0044 5.4.3 Pipeline with Call/Jump, table 10
jra table10
codebndry
table10:
inc a
jp label
ldw x, [0x5432]
label: neg a
call label2
ldw x, [0x5432]
ldw x, [0x7895]
label2: incw x
table10_end:
; PM0044 5.4.4 Pipeline stalled, table 12
clr a
ld 0x10, a
ld 0x20, a ; Table 12 doesn't include any setup...
jra table12
codebndry
table12:
sub sp, #20
ld a, #20
btjt 0x10, #5, to ; Table 12 assumes not taken
inc a
btjf 0x20, #3, to ; Table 12 assumes taken
nop
ldw x, [0x5432]
ldw x, [0x1234]
to: incw y
ld a, (x)
table12_end:
; DIV tests - available ST docs simply say "2-17 cycles"
.macro timed_div dividend divisor ?aligned
jra aligned
codebndry
aligned:
ldw x, #dividend
ld a, #divisor
div x, a
end_'aligned:
.endm
timed_div 0x8000,0x80
timed_div 0x8000,0x40
timed_div 0x8000,0x20
timed_div 0x8000,0x10
timed_div 0x8000,0x08
timed_div 0x8000,0x04
timed_div 0x8000,0x02
timed_div 0x8000,0x01
timed_div 0x8000,0x80
timed_div 0x4000,0x80
timed_div 0x2000,0x80
timed_div 0x1000,0x80
timed_div 0x0800,0x80
timed_div 0x0400,0x80
timed_div 0x0200,0x80
timed_div 0x0100,0x80
timed_div 0x0080,0x80
timed_div 0x0040,0x80
timed_div 0x0020,0x80
timed_div 0x0010,0x80
timed_div 0x0008,0x80
timed_div 0x0004,0x80
timed_div 0x0002,0x80
timed_div 0x0001,0x80
timed_div 0x0000,0x80
timed_div 63, 8
timed_div 64, 8
timed_div 65, 8
.macro timed_divw dividend divisor ?aligned
jra aligned
codebndry
aligned:
ldw x, #dividend
ldw y, #divisor
divw x, y
end_'aligned:
.endm
timed_divw 0x8000, 1
; Interrupted div
jra test_idiv
codebndry
test_idiv:
bset TIM4_IER, #0
bset TIM4_EGR, #0
mov TIM4_ARR, #8
ldw x, #255
ld a, #10
mov TIM4_CR1, #0x0f
div x, a
; Exercising all code in stm8.cc + inst.cc
.macro timed_op op operand1 operand2a operand2b ?aligned
jra aligned
codebndry
aligned:
.narg .narg
.ifeq .narg - 4
op operand1,operand2a,operand2b
.else
.ifeq .narg - 3
op operand1,operand2a
.else
.ifeq .narg - 2
op operand1
.else
op
.endif
.endif
.endif
end_'aligned:
.endm
; a, shortmem, longmem,
; (X), (shortoff,X), (longoff,X)
; (Y), (shortoff,Y), (longoff,Y)
; (shortoff,SP)
; ([shortptr.w],X), ([longptr.w],X)
; ([shortptr.w],X), ([longptr.w],X)
; ([shortptr.w],Y)
.macro timed_class_1 op
timed_op op a
timed_op op 0xf5
timed_op op 0xf5c2
.irp reg,X,Y
timed_op op (reg)
timed_op op (0xf5,reg)
timed_op op (0xf5c2,reg)
.endm
timed_op op (0xf5,SP)
timed_op op [0xf5]
timed_op op [0xf5c2]
timed_op op ([0xf5],X)
timed_op op ([0xf5c2],X)
timed_op op ([0xf5],Y)
.endm
; a <- #byte, shortmem, longmem,
; (X), (shortoff,X), (longoff,X)
; (Y), (shortoff,Y), (longoff,Y)
; (shortoff,SP)
; ([shortptr.w],X), ([longptr.w],X)
; ([shortptr.w],X), ([longptr.w],X)
; ([shortptr.w],Y)
.macro timed_class_2 op
timed_op op a,#0x55
timed_op op a,0x10
timed_op op a,0x1000
.irp reg,X,Y
timed_op op a,(reg)
timed_op op a,(0x10,reg)
timed_op op a,(0x1000,reg)
.endm
timed_op op a,(0x10,SP)
timed_op op a,[0x10]
timed_op op a,[0x1000]
timed_op op a,([0x10],X)
timed_op op a,([0x1000],X)
timed_op op a,([0x10],Y)
.endm
; SP <- #byte
.macro timed_class_sp_imm op
timed_op op sp,#0x55
.endm
; X, Y
.macro timed_class_xy op
timed_op op X
timed_op op Y
.endm
; Bit addressed
.macro timed_class_bit op
timed_op op 0x1000,#2
.endm
; Inherent
.macro timed_class_inh op
timed_op op
.endm
timed_class_2 adc
timed_class_2 add
timed_op addw X,#0x1000
timed_op addw X,0x1000
timed_op addw X,(0x10,SP)
timed_op addw Y,#0x1000
timed_op addw Y,0x1000
timed_op addw Y,(0x10,SP)
timed_class_sp_imm addw
timed_class_2 and
timed_class_bit bccm
timed_class_2 bcp
timed_class_bit bcpl
;break
timed_class_bit bres
timed_class_bit bset
;btjf - covered by table 12 above
;btjt - covered by table 12 above
;call - uses common fetchea code
;callf
;callr
timed_class_inh ccf
timed_class_1 clr
timed_class_xy clrw
timed_class_2 cp
timed_op cpw X,#0x55
timed_op cpw X,0x10
timed_op cpw X,0x1000
timed_op cpw X,(Y)
timed_op cpw X,(0x10,Y)
timed_op cpw X,(0x1000,Y)
timed_op cpw X,(0x10,SP)
timed_op cpw X,[0x10]
timed_op cpw X,[0x1000]
timed_op cpw X,([0x10],Y)
timed_op cpw Y,([0x1000],X)
timed_class_1 cpl
timed_class_xy cplw
timed_class_1 dec
timed_class_xy decw
; ;div - covered above
; ;divw - covered above
timed_op exg a,xl
timed_op exg a,yl
timed_op exg a,0x1000
timed_op exgw x,y
;halt
timed_class_1 inc
timed_class_xy incw
;int
;iret
;jp -covered by table 10 above
;jpf
;jra
;jrxx
timed_class_2 ld
timed_op ld 0x10,a
timed_op ld 0x1000,a
timed_op ld (X),a
timed_op ld (0x10,X),a
timed_op ld (0x1000,X),a
timed_op ld (Y),a
timed_op ld (0x10,Y),a
timed_op ld (0x1000,Y),a
timed_op ld (0x10,SP),a
timed_op ld [0x10],a
timed_op ld [0x1000],a
timed_op ld ([0x10],X),a
timed_op ld ([0x1000],X),a
timed_op ld ([0x10],Y),a
timed_op ldf a,0x500000
timed_op ldf a,(0x500000,X)
timed_op ldf a,(0x500000,Y)
timed_op ldf a,([0x5000],X)
timed_op ldf a,([0x5000],Y)
timed_op ldf a,[0x5000]
timed_op ldw X,#0x55
timed_op ldw X,0x10
timed_op ldw X,0x1000
timed_op ldw X,(X)
timed_op ldw X,(0x10,X)
timed_op ldw X,(0x1000,X)
timed_op ldw X,(0x10,SP)
timed_op ldw X,[0x10]
timed_op ldw X,[0x1000]
timed_op ldw X,([0x10],X)
timed_op ldw X,([0x1000],X)
timed_op mov 0x8000,#0xAA
timed_op mov 0x80,0x10
timed_op mov 0x8000,0x1000
timed_op mul x,a
timed_class_1 neg
timed_class_xy negw
timed_op nop
timed_class_2 or
;pop
;popw
;push
;pushw
timed_class_inh rcf
;ret
;retf
; timed_class_inh rim
timed_class_1 rlc
timed_class_xy rlcw
timed_class_xy rlwa
timed_class_1 rrc
timed_class_xy rrcw
timed_class_xy rrwa
timed_class_inh rvf
timed_class_2 sbc
timed_class_inh scf
; timed_class_inh sim
timed_op subw X,#0x5500
timed_op subw X,0x1000
timed_op subw X,(0x10,SP)
timed_op ldw Y,X
timed_op ldw 0x10,X
timed_op ldw 0x1000,X
timed_op ldw (X),Y
timed_op ldw (0x10,X),Y
timed_op ldw (0x1000,X),Y
timed_op ldw (0x10,SP),X
timed_op ldw [0x10],X
timed_op ldw [0x1000],X
timed_op ldw ([0x10],X),Y
timed_op ldw ([0x1000],X),Y
timed_class_1 sla
timed_class_xy slaw
timed_class_1 sll
timed_class_xy sllw
timed_class_1 sra
timed_class_xy sraw
timed_class_1 srl
timed_class_xy srlw
timed_class_2 sub
timed_class_sp_imm sub
timed_class_1 swap
timed_class_xy swapw
timed_class_1 tnz
timed_class_xy tnzw
;trap
;wfe
;wfi
timed_class_2 xor
dividend = 0x8000
.rept 15
timed_div dividend,0x02
dividend = dividend >> 1
.endm
dividend = 0x10000
.rept 15
timed_div dividend-1,0x02
dividend = dividend >> 1
.endm
timed_div 0x2000 0x02
timed_div 0x2040 0x02
timed_div 0x2048 0x02
timed_div 0x2148 0x02
timed_div 0x21c8 0x02
timed_div 45831 94
end:
halt
.area _DATA

View File

@@ -0,0 +1,473 @@
<html>
<head>
<title>DIV tests - available ST docs simply say '2-17 cycles'</title>
<script>
function toggle(id) {
var obj = document.getElementById(id);
if (obj.style.display === 'none')
obj.style.display = 'block';
else
obj.style.display = 'none';
}
</script>
<style>
.pipetrace { margin: 1em 0; }
.pipetrace, .pipetrace td { border: 1px solid black; border-collapse: collapse; padding: 0 0.2em; white-space: nowrap; }
.pipetrace thead { background-color: #d2d2d2; position: sticky; top: 0; }
.pipetrace thead th { border: none; box-shadow: inset -1px -1px #000; }
.pipetrace tr:nth-child(even) { background-color: #f2f2f2; }
.pipetrace td { min-width: 1.6em; }
.pipetrace td.instr:before { content: ""; }
.pipetrace td.instr { width: 9.5em; }
.pipetrace td.Sbus:before { content: " S₀"; }
.pipetrace td.Sfetch:before { content: " S₁"; }
.pipetrace td.Sraw:before { content: " S₂"; }
.pipetrace td:before { content: attr(class); }
.pipetrace td.D { background-color: lawngreen; }
.pipetrace td.E { background-color: navajowhite; }
.pipetrace td.Sbus { background-color: red; }
.pipetrace td.Sfetch { background-color: red; }
.pipetrace td.Sraw { background-color: red; }
.pipetrace td.X, .pipetrace td.Flushed { background-color: red; }
.pipetrace td span:after { content: attr(class); }
.pipetrace td span { padding: 0 0.2em; margin: 0 0 0 0.1em; }
.pipetrace td span.FS { background-color: lightgrey; }
.pipetrace td span.F { background-color: lightskyblue; }
#pipetrace_legend { border: none; background-color: white; position: fixed; bottom: 0; right: 0; }
#pipetrace_legend tr:first-of-type { font-weight: bold; }
#pipetrace_legend td { text-align: center; }
#pipetrace_legend td.defn { text-align: left; }
#pipetrace_legend td.defn:before { content: ""; }
</style>
</head>
<body onload="toggle('pipetrace_legend')">
<h1>DIV tests - available ST docs simply say '2-17 cycles'</h1>
<table id="pipetrace_legend" class="pipetrace">
<tr><td colspan="2">Legend</td></tr>
<tr><td class="D" /><td class="defn">Decode</td></tr>
<tr><td class="E" /><td class="defn">Execute</td></tr>
<tr><td><span class="F" /></td><td class="defn">Fetch</td></tr>
<tr><td class="X" /><td class="defn">Flush</td></tr>
<tr><td><span class="FS" /></td><td class="defn">Fetch Stall - space in prefetch buffer but bus busy</td></tr>
<tr><td class="Sbus" /><td class="defn">Decode Stall - bus busy</td></tr>
<tr><td class="Sfetch" /><td class="defn">Decode Stall - insufficient data in prefetch buffer</td></tr>
<tr><td class="Sraw" /><td class="defn">Decode Stall - read after write</td></tr>
</table>
<p>The stated cycle count would seem to imply binary long division and
this is how the STM8 emulator in ucsim currently treats div for.
cycle counting. However the cycles measured on actual hardware
suggest this is not correct.
</p>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08100</td><td class="instr">ldw X,#0x8000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08103</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08105</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08108</td><td class="instr">ldw X,#0x8000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0810b</td><td class="instr">ld A,#0x40</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0810d</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08110</td><td class="instr">ldw X,#0x8000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08113</td><td class="instr">ld A,#0x20</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08115</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08118</td><td class="instr">ldw X,#0x8000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0811b</td><td class="instr">ld A,#0x10</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0811d</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08120</td><td class="instr">ldw X,#0x8000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08123</td><td class="instr">ld A,#0x08</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08125</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08128</td><td class="instr">ldw X,#0x8000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0812b</td><td class="instr">ld A,#0x04</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0812d</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08130</td><td class="instr">ldw X,#0x8000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08133</td><td class="instr">ld A,#0x02</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08135</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08138</td><td class="instr">ldw X,#0x8000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0813b</td><td class="instr">ld A,#0x01</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0813d</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08140</td><td class="instr">ldw X,#0x8000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08143</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08145</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08148</td><td class="instr">ldw X,#0x4000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0814b</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0814d</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08150</td><td class="instr">ldw X,#0x2000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08153</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08155</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08158</td><td class="instr">ldw X,#0x1000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0815b</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0815d</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08160</td><td class="instr">ldw X,#0x0800</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08163</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08165</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08168</td><td class="instr">ldw X,#0x0400</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0816b</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0816d</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08170</td><td class="instr">ldw X,#0x0200</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08173</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08175</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08178</td><td class="instr">ldw X,#0x0100</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0817b</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0817d</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08180</td><td class="instr">ldw X,#0x0080</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08183</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08185</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08188</td><td class="instr">ldw X,#0x0040</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0818b</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0818d</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08190</td><td class="instr">ldw X,#0x0020</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08193</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08195</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08198</td><td class="instr">ldw X,#0x0010</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0819b</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0819d</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x081a0</td><td class="instr">ldw X,#0x0008</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081a3</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081a5</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x081a8</td><td class="instr">ldw X,#0x0004</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081ab</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081ad</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x081b0</td><td class="instr">ldw X,#0x0002</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081b3</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081b5</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x081b8</td><td class="instr">ldw X,#0x0001</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081bb</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081bd</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x081c0</td><td class="instr">ldw X,#0x0000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081c3</td><td class="instr">ld A,#0x80</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081c5</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x081c8</td><td class="instr">ldw X,#0x003f</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081cb</td><td class="instr">ld A,#0x08</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081cd</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th><th class="n">9</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x081d0</td><td class="instr">ldw X,#0x0040</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081d3</td><td class="instr">ld A,#0x08</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081d5</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x081d8</td><td class="instr">ldw X,#0x0041</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081db</td><td class="instr">ld A,#0x08</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081dd</td><td class="instr">div X,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th>
</thead>
</table>
</a>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x081e0</td><td class="instr">ldw X,#0x8000</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x081e3</td><td class="instr">ldw Y,#0x0001</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E"></td><td class=" E" /></tr>
<tr><td>0x081e7</td><td class="instr">divw X,Y</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th>
</thead>
</table>
</a>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,74 @@
<html>
<head>
<title>Interrupted div</title>
<script>
function toggle(id) {
var obj = document.getElementById(id);
if (obj.style.display === 'none')
obj.style.display = 'block';
else
obj.style.display = 'none';
}
</script>
<style>
.pipetrace { margin: 1em 0; }
.pipetrace, .pipetrace td { border: 1px solid black; border-collapse: collapse; padding: 0 0.2em; white-space: nowrap; }
.pipetrace thead { background-color: #d2d2d2; position: sticky; top: 0; }
.pipetrace thead th { border: none; box-shadow: inset -1px -1px #000; }
.pipetrace tr:nth-child(even) { background-color: #f2f2f2; }
.pipetrace td { min-width: 1.6em; }
.pipetrace td.instr:before { content: ""; }
.pipetrace td.instr { width: 9.5em; }
.pipetrace td.Sbus:before { content: " S₀"; }
.pipetrace td.Sfetch:before { content: " S₁"; }
.pipetrace td.Sraw:before { content: " S₂"; }
.pipetrace td:before { content: attr(class); }
.pipetrace td.D { background-color: lawngreen; }
.pipetrace td.E { background-color: navajowhite; }
.pipetrace td.Sbus { background-color: red; }
.pipetrace td.Sfetch { background-color: red; }
.pipetrace td.Sraw { background-color: red; }
.pipetrace td.X, .pipetrace td.Flushed { background-color: red; }
.pipetrace td span:after { content: attr(class); }
.pipetrace td span { padding: 0 0.2em; margin: 0 0 0 0.1em; }
.pipetrace td span.FS { background-color: lightgrey; }
.pipetrace td span.F { background-color: lightskyblue; }
#pipetrace_legend { border: none; background-color: white; position: fixed; bottom: 0; right: 0; }
#pipetrace_legend tr:first-of-type { font-weight: bold; }
#pipetrace_legend td { text-align: center; }
#pipetrace_legend td.defn { text-align: left; }
#pipetrace_legend td.defn:before { content: ""; }
</style>
</head>
<body onload="toggle('pipetrace_legend')">
<h1>Interrupted div</h1>
<table id="pipetrace_legend" class="pipetrace">
<tr><td colspan="2">Legend</td></tr>
<tr><td class="D" /><td class="defn">Decode</td></tr>
<tr><td class="E" /><td class="defn">Execute</td></tr>
<tr><td><span class="F" /></td><td class="defn">Fetch</td></tr>
<tr><td class="X" /><td class="defn">Flush</td></tr>
<tr><td><span class="FS" /></td><td class="defn">Fetch Stall - space in prefetch buffer but bus busy</td></tr>
<tr><td class="Sbus" /><td class="defn">Decode Stall - bus busy</td></tr>
<tr><td class="Sfetch" /><td class="defn">Decode Stall - insufficient data in prefetch buffer</td></tr>
<tr><td class="Sraw" /><td class="defn">Decode Stall - read after write</td></tr>
</table>
<p>(Not currently implemented.)</p>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td>0x08201</td><td class="instr">div X,A</td><td class=" D"></td><td class=" E"></td><td class=" E"></td><td class=" E"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th>
</thead>
</table>
</a>
</body>
</html>

View File

@@ -0,0 +1,92 @@
<html>
<head>
<title>PM0044 5.4.3 Pipeline with Call/Jump, table 10</title>
<script>
function toggle(id) {
var obj = document.getElementById(id);
if (obj.style.display === 'none')
obj.style.display = 'block';
else
obj.style.display = 'none';
}
</script>
<style>
.pipetrace { margin: 1em 0; }
.pipetrace, .pipetrace td { border: 1px solid black; border-collapse: collapse; padding: 0 0.2em; white-space: nowrap; }
.pipetrace thead { background-color: #d2d2d2; position: sticky; top: 0; }
.pipetrace thead th { border: none; box-shadow: inset -1px -1px #000; }
.pipetrace tr:nth-child(even) { background-color: #f2f2f2; }
.pipetrace td { min-width: 1.6em; }
.pipetrace td.instr:before { content: ""; }
.pipetrace td.instr { width: 9.5em; }
.pipetrace td.Sbus:before { content: " S₀"; }
.pipetrace td.Sfetch:before { content: " S₁"; }
.pipetrace td.Sraw:before { content: " S₂"; }
.pipetrace td:before { content: attr(class); }
.pipetrace td.D { background-color: lawngreen; }
.pipetrace td.E { background-color: navajowhite; }
.pipetrace td.Sbus { background-color: red; }
.pipetrace td.Sfetch { background-color: red; }
.pipetrace td.Sraw { background-color: red; }
.pipetrace td.X, .pipetrace td.Flushed { background-color: red; }
.pipetrace td span:after { content: attr(class); }
.pipetrace td span { padding: 0 0.2em; margin: 0 0 0 0.1em; }
.pipetrace td span.FS { background-color: lightgrey; }
.pipetrace td span.F { background-color: lightskyblue; }
#pipetrace_legend { border: none; background-color: white; position: fixed; bottom: 0; right: 0; }
#pipetrace_legend tr:first-of-type { font-weight: bold; }
#pipetrace_legend td { text-align: center; }
#pipetrace_legend td.defn { text-align: left; }
#pipetrace_legend td.defn:before { content: ""; }
</style>
</head>
<body onload="toggle('pipetrace_legend')">
<h1>PM0044 5.4.3 Pipeline with Call/Jump, table 10</h1>
<table id="pipetrace_legend" class="pipetrace">
<tr><td colspan="2">Legend</td></tr>
<tr><td class="D" /><td class="defn">Decode</td></tr>
<tr><td class="E" /><td class="defn">Execute</td></tr>
<tr><td><span class="F" /></td><td class="defn">Fetch</td></tr>
<tr><td class="X" /><td class="defn">Flush</td></tr>
<tr><td><span class="FS" /></td><td class="defn">Fetch Stall - space in prefetch buffer but bus busy</td></tr>
<tr><td class="Sbus" /><td class="defn">Decode Stall - bus busy</td></tr>
<tr><td class="Sfetch" /><td class="defn">Decode Stall - insufficient data in prefetch buffer</td></tr>
<tr><td class="Sraw" /><td class="defn">Decode Stall - read after write</td></tr>
</table>
<p>PM0044 table 10 shows a fetch stall in the first execution cycle
of the call (cycle 7) however it should be possible for a fetch
to take place since pushing the return address only busies the
data bus (and STM8 is a Harvard architecture with unified address
space so the data and program are separate buses).</p>
<p>Also note that since the flush happens on the last execute cycle
of the call (unlike the jp) there is no overlap and we mark
the following cycle as a decode stall. Technically this is correct
but table 10 does not and says the call takes 3 cycles which
ignores the unavoidable stall cycle. The later instruction documentation
for call says it takes 4 cycles which is presumed to include the
stall cycle that follows it.</p>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x080c4</td><td class="instr">inc A</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080c5</td><td class="instr">jp 0x80cc</td><td class="" /><td class="" /><td class=" D X"></td><td class=" E" /></tr>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x080cc</td><td class="instr">neg A</td><td class="" /><td class="" /><td class="" /><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080cd</td><td class="instr">call 0x80d8</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E"><span class="F" /></td><td class=" E X" /></tr>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x080d8</td><td class="instr">incw X</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=""></td><td class=" D Sfetch"><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th><th class="n">9</th><th class="n">10</th><th class="n">11</th>
</thead>
</table>
</a>
</body>
</html>

View File

@@ -0,0 +1,94 @@
<html>
<head>
<title>PM0044 5.4.4 Pipeline stalled, table 12</title>
<script>
function toggle(id) {
var obj = document.getElementById(id);
if (obj.style.display === 'none')
obj.style.display = 'block';
else
obj.style.display = 'none';
}
</script>
<style>
.pipetrace { margin: 1em 0; }
.pipetrace, .pipetrace td { border: 1px solid black; border-collapse: collapse; padding: 0 0.2em; white-space: nowrap; }
.pipetrace thead { background-color: #d2d2d2; position: sticky; top: 0; }
.pipetrace thead th { border: none; box-shadow: inset -1px -1px #000; }
.pipetrace tr:nth-child(even) { background-color: #f2f2f2; }
.pipetrace td { min-width: 1.6em; }
.pipetrace td.instr:before { content: ""; }
.pipetrace td.instr { width: 9.5em; }
.pipetrace td.Sbus:before { content: " S₀"; }
.pipetrace td.Sfetch:before { content: " S₁"; }
.pipetrace td.Sraw:before { content: " S₂"; }
.pipetrace td:before { content: attr(class); }
.pipetrace td.D { background-color: lawngreen; }
.pipetrace td.E { background-color: navajowhite; }
.pipetrace td.Sbus { background-color: red; }
.pipetrace td.Sfetch { background-color: red; }
.pipetrace td.Sraw { background-color: red; }
.pipetrace td.X, .pipetrace td.Flushed { background-color: red; }
.pipetrace td span:after { content: attr(class); }
.pipetrace td span { padding: 0 0.2em; margin: 0 0 0 0.1em; }
.pipetrace td span.FS { background-color: lightgrey; }
.pipetrace td span.F { background-color: lightskyblue; }
#pipetrace_legend { border: none; background-color: white; position: fixed; bottom: 0; right: 0; }
#pipetrace_legend tr:first-of-type { font-weight: bold; }
#pipetrace_legend td { text-align: center; }
#pipetrace_legend td.defn { text-align: left; }
#pipetrace_legend td.defn:before { content: ""; }
</style>
</head>
<body onload="toggle('pipetrace_legend')">
<h1>PM0044 5.4.4 Pipeline stalled, table 12</h1>
<table id="pipetrace_legend" class="pipetrace">
<tr><td colspan="2">Legend</td></tr>
<tr><td class="D" /><td class="defn">Decode</td></tr>
<tr><td class="E" /><td class="defn">Execute</td></tr>
<tr><td><span class="F" /></td><td class="defn">Fetch</td></tr>
<tr><td class="X" /><td class="defn">Flush</td></tr>
<tr><td><span class="FS" /></td><td class="defn">Fetch Stall - space in prefetch buffer but bus busy</td></tr>
<tr><td class="Sbus" /><td class="defn">Decode Stall - bus busy</td></tr>
<tr><td class="Sfetch" /><td class="defn">Decode Stall - insufficient data in prefetch buffer</td></tr>
<tr><td class="Sraw" /><td class="defn">Decode Stall - read after write</td></tr>
</table>
<h2>Errata</h2>
<ul>
<li>Table 12 shows the BTJT as taking 1 decode, 2 execute cycles but the
later documention for the instruction implies the second execution
cycle is only used if the branch is taken - and this isn't.
</li>
<li>Table 12 has a jump in time (cycles) from 4 straight to 7.
</li>
<li>The last instruction is shown one cycle early in table 12. The decode stall
should line up with the execution cycle of the previous instruction
as the description above the table says.
</li>
</ul>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x080e0</td><td class="instr">sub SP,#0x14</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080e2</td><td class="instr">ld A,#0x14</td><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080e4</td><td class="instr">btjt 0x0010,#5,0x80f8</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080e9</td><td class="instr">inc A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080ea</td><td class="instr">btjf 0x0020,#3,0x80f8</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E X"></td><td class=" E" /></tr>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x080f8</td><td class="instr">incw Y</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080fa</td><td class="instr">ld A,(X)</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D Sraw"><span class="F" /></td><td class=" D"></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th><th class="n">9</th><th class="n">10</th><th class="n">11</th><th class="n">12</th>
</thead>
</table>
</a>
</body>
</html>

View File

@@ -0,0 +1,88 @@
<html>
<head>
<title>PM0044 5.4 Conventions, table 3</title>
<script>
function toggle(id) {
var obj = document.getElementById(id);
if (obj.style.display === 'none')
obj.style.display = 'block';
else
obj.style.display = 'none';
}
</script>
<style>
.pipetrace { margin: 1em 0; }
.pipetrace, .pipetrace td { border: 1px solid black; border-collapse: collapse; padding: 0 0.2em; white-space: nowrap; }
.pipetrace thead { background-color: #d2d2d2; position: sticky; top: 0; }
.pipetrace thead th { border: none; box-shadow: inset -1px -1px #000; }
.pipetrace tr:nth-child(even) { background-color: #f2f2f2; }
.pipetrace td { min-width: 1.6em; }
.pipetrace td.instr:before { content: ""; }
.pipetrace td.instr { width: 9.5em; }
.pipetrace td.Sbus:before { content: " S₀"; }
.pipetrace td.Sfetch:before { content: " S₁"; }
.pipetrace td.Sraw:before { content: " S₂"; }
.pipetrace td:before { content: attr(class); }
.pipetrace td.D { background-color: lawngreen; }
.pipetrace td.E { background-color: navajowhite; }
.pipetrace td.Sbus { background-color: red; }
.pipetrace td.Sfetch { background-color: red; }
.pipetrace td.Sraw { background-color: red; }
.pipetrace td.X, .pipetrace td.Flushed { background-color: red; }
.pipetrace td span:after { content: attr(class); }
.pipetrace td span { padding: 0 0.2em; margin: 0 0 0 0.1em; }
.pipetrace td span.FS { background-color: lightgrey; }
.pipetrace td span.F { background-color: lightskyblue; }
#pipetrace_legend { border: none; background-color: white; position: fixed; bottom: 0; right: 0; }
#pipetrace_legend tr:first-of-type { font-weight: bold; }
#pipetrace_legend td { text-align: center; }
#pipetrace_legend td.defn { text-align: left; }
#pipetrace_legend td.defn:before { content: ""; }
</style>
</head>
<body onload="toggle('pipetrace_legend')">
<h1>PM0044 5.4 Conventions, table 3</h1>
<table id="pipetrace_legend" class="pipetrace">
<tr><td colspan="2">Legend</td></tr>
<tr><td class="D" /><td class="defn">Decode</td></tr>
<tr><td class="E" /><td class="defn">Execute</td></tr>
<tr><td><span class="F" /></td><td class="defn">Fetch</td></tr>
<tr><td class="X" /><td class="defn">Flush</td></tr>
<tr><td><span class="FS" /></td><td class="defn">Fetch Stall - space in prefetch buffer but bus busy</td></tr>
<tr><td class="Sbus" /><td class="defn">Decode Stall - bus busy</td></tr>
<tr><td class="Sfetch" /><td class="defn">Decode Stall - insufficient data in prefetch buffer</td></tr>
<tr><td class="Sraw" /><td class="defn">Decode Stall - read after write</td></tr>
</table>
<h2>Errata</h2>
<ul>
<li>The LDW shown in PM0044 table 3 is missing a decode cycle.
<br/>
(Confirmed on HW)
</li>
<li>The ADDW shown in PM0044 table 3 has one too many decode cycles.
<br/>
(Confirmed on HW)
</li>
<li>The LD shown in PM0044 table 3 is missing a decode cycle.
</ul>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x0808c</td><td class="instr">ldw X,[0x50.w]</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" D"></td><td class=" D"></td><td class=" D"></td><td class=" E" /></tr>
<tr><td>0x0808f</td><td class="instr">addw X,#0x0014</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E"></td><td class=" E" /></tr>
<tr><td>0x08092</td><td class="instr">ld A,[0x30.w]</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" D"></td><td class=" D"></td><td class=" D"><span class="FS" /></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th><th class="n">9</th><th class="n">10</th><th class="n">11</th><th class="n">12</th><th class="n">13</th>
</thead>
</table>
</a>
</body>
</html>

View File

@@ -0,0 +1,85 @@
<html>
<head>
<title>PM0044 5.4.1 Optimized pipeline example - execution from flash, table 6</title>
<script>
function toggle(id) {
var obj = document.getElementById(id);
if (obj.style.display === 'none')
obj.style.display = 'block';
else
obj.style.display = 'none';
}
</script>
<style>
.pipetrace { margin: 1em 0; }
.pipetrace, .pipetrace td { border: 1px solid black; border-collapse: collapse; padding: 0 0.2em; white-space: nowrap; }
.pipetrace thead { background-color: #d2d2d2; position: sticky; top: 0; }
.pipetrace thead th { border: none; box-shadow: inset -1px -1px #000; }
.pipetrace tr:nth-child(even) { background-color: #f2f2f2; }
.pipetrace td { min-width: 1.6em; }
.pipetrace td.instr:before { content: ""; }
.pipetrace td.instr { width: 9.5em; }
.pipetrace td.Sbus:before { content: " S₀"; }
.pipetrace td.Sfetch:before { content: " S₁"; }
.pipetrace td.Sraw:before { content: " S₂"; }
.pipetrace td:before { content: attr(class); }
.pipetrace td.D { background-color: lawngreen; }
.pipetrace td.E { background-color: navajowhite; }
.pipetrace td.Sbus { background-color: red; }
.pipetrace td.Sfetch { background-color: red; }
.pipetrace td.Sraw { background-color: red; }
.pipetrace td.X, .pipetrace td.Flushed { background-color: red; }
.pipetrace td span:after { content: attr(class); }
.pipetrace td span { padding: 0 0.2em; margin: 0 0 0 0.1em; }
.pipetrace td span.FS { background-color: lightgrey; }
.pipetrace td span.F { background-color: lightskyblue; }
#pipetrace_legend { border: none; background-color: white; position: fixed; bottom: 0; right: 0; }
#pipetrace_legend tr:first-of-type { font-weight: bold; }
#pipetrace_legend td { text-align: center; }
#pipetrace_legend td.defn { text-align: left; }
#pipetrace_legend td.defn:before { content: ""; }
</style>
</head>
<body onload="toggle('pipetrace_legend')">
<h1>PM0044 5.4.1 Optimized pipeline example - execution from flash, table 6</h1>
<table id="pipetrace_legend" class="pipetrace">
<tr><td colspan="2">Legend</td></tr>
<tr><td class="D" /><td class="defn">Decode</td></tr>
<tr><td class="E" /><td class="defn">Execute</td></tr>
<tr><td><span class="F" /></td><td class="defn">Fetch</td></tr>
<tr><td class="X" /><td class="defn">Flush</td></tr>
<tr><td><span class="FS" /></td><td class="defn">Fetch Stall - space in prefetch buffer but bus busy</td></tr>
<tr><td class="Sbus" /><td class="defn">Decode Stall - bus busy</td></tr>
<tr><td class="Sfetch" /><td class="defn">Decode Stall - insufficient data in prefetch buffer</td></tr>
<tr><td class="Sraw" /><td class="defn">Decode Stall - read after write</td></tr>
</table>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x08098</td><td class="instr">neg A</td><td class=""><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x08099</td><td class="instr">xor A,0x10</td><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0809b</td><td class="instr">ld A,#0x14</td><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0809d</td><td class="instr">sub A,0x1000</td><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080a0</td><td class="instr">inc A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E" /></tr>
<tr><td>0x080a1</td><td class="instr">ld XL,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E" /></tr>
<tr><td>0x080a2</td><td class="instr">srl A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E" /></tr>
<tr><td>0x080a3</td><td class="instr">swap A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080a4</td><td class="instr">sla 0x15</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"></td><td class=" E" /></tr>
<tr><td>0x080a6</td><td class="instr">cp A,#0xfe</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080a8</td><td class="instr">mov 0x0100,#0x0b</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x080ac</td><td class="instr">mov 0x0101,#0x16</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th><th class="n">9</th><th class="n">10</th><th class="n">11</th><th class="n">12</th><th class="n">13</th><th class="n">14</th>
</thead>
</table>
</a>
</body>
</html>

View File

@@ -0,0 +1,83 @@
<html>
<head>
<title>PM0044 5.4.2 Optimize pipeline example - execution from RAM, table 8</title>
<script>
function toggle(id) {
var obj = document.getElementById(id);
if (obj.style.display === 'none')
obj.style.display = 'block';
else
obj.style.display = 'none';
}
</script>
<style>
.pipetrace { margin: 1em 0; }
.pipetrace, .pipetrace td { border: 1px solid black; border-collapse: collapse; padding: 0 0.2em; white-space: nowrap; }
.pipetrace thead { background-color: #d2d2d2; position: sticky; top: 0; }
.pipetrace thead th { border: none; box-shadow: inset -1px -1px #000; }
.pipetrace tr:nth-child(even) { background-color: #f2f2f2; }
.pipetrace td { min-width: 1.6em; }
.pipetrace td.instr:before { content: ""; }
.pipetrace td.instr { width: 9.5em; }
.pipetrace td.Sbus:before { content: " S₀"; }
.pipetrace td.Sfetch:before { content: " S₁"; }
.pipetrace td.Sraw:before { content: " S₂"; }
.pipetrace td:before { content: attr(class); }
.pipetrace td.D { background-color: lawngreen; }
.pipetrace td.E { background-color: navajowhite; }
.pipetrace td.Sbus { background-color: red; }
.pipetrace td.Sfetch { background-color: red; }
.pipetrace td.Sraw { background-color: red; }
.pipetrace td.X, .pipetrace td.Flushed { background-color: red; }
.pipetrace td span:after { content: attr(class); }
.pipetrace td span { padding: 0 0.2em; margin: 0 0 0 0.1em; }
.pipetrace td span.FS { background-color: lightgrey; }
.pipetrace td span.F { background-color: lightskyblue; }
#pipetrace_legend { border: none; background-color: white; position: fixed; bottom: 0; right: 0; }
#pipetrace_legend tr:first-of-type { font-weight: bold; }
#pipetrace_legend td { text-align: center; }
#pipetrace_legend td.defn { text-align: left; }
#pipetrace_legend td.defn:before { content: ""; }
</style>
</head>
<body onload="toggle('pipetrace_legend')">
<h1>PM0044 5.4.2 Optimize pipeline example - execution from RAM, table 8</h1>
<table id="pipetrace_legend" class="pipetrace">
<tr><td colspan="2">Legend</td></tr>
<tr><td class="D" /><td class="defn">Decode</td></tr>
<tr><td class="E" /><td class="defn">Execute</td></tr>
<tr><td><span class="F" /></td><td class="defn">Fetch</td></tr>
<tr><td class="X" /><td class="defn">Flush</td></tr>
<tr><td><span class="FS" /></td><td class="defn">Fetch Stall - space in prefetch buffer but bus busy</td></tr>
<tr><td class="Sbus" /><td class="defn">Decode Stall - bus busy</td></tr>
<tr><td class="Sfetch" /><td class="defn">Decode Stall - insufficient data in prefetch buffer</td></tr>
<tr><td class="Sraw" /><td class="defn">Decode Stall - read after write</td></tr>
</table>
<a title="Click for legend">
<table class="pipetrace" onclick="toggle('pipetrace_legend')">
<tbody>
<tr><td /><td class="Flushed" /></tr>
<tr><td>0x00104</td><td class="instr">neg A</td><td class=""><span class="F" /></td><td class=" D Sfetch"><span class="F" /></td><td class=" D Sfetch"><span class="F" /></td><td class=" D Sfetch"><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x00105</td><td class="instr">xor A,0x10</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="FS" /></td><td class=" E" /></tr>
<tr><td>0x00107</td><td class="instr">ld A,#0x14</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D Sfetch"><span class="F" /></td><td class=" D Sfetch"><span class="F" /></td><td class=" D Sfetch"><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x00109</td><td class="instr">sub A,0x1000</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="FS" /></td><td class=" E" /></tr>
<tr><td>0x0010c</td><td class="instr">inc A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D Sfetch"><span class="F" /></td><td class=" D Sfetch"><span class="F" /></td><td class=" D Sfetch"><span class="F" /></td><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0010d</td><td class="instr">ld XL,A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0010e</td><td class="instr">srl A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x0010f</td><td class="instr">swap A</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="F" /></td><td class=" E" /></tr>
<tr><td>0x00110</td><td class="instr">sla 0x15</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="FS" /></td><td class=" E" /></tr>
<tr><td>0x00112</td><td class="instr">cp A,#0xfe</td><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class="" /><td class=" D"><span class="FS" /></td><td class=" E" /></tr>
</tbody>
<thead>
<tr><th>Address</th><th>Instruction</th><th class="n">1</th><th class="n">2</th><th class="n">3</th><th class="n">4</th><th class="n">5</th><th class="n">6</th><th class="n">7</th><th class="n">8</th><th class="n">9</th><th class="n">10</th><th class="n">11</th><th class="n">12</th><th class="n">13</th><th class="n">14</th><th class="n">15</th><th class="n">16</th><th class="n">17</th><th class="n">18</th><th class="n">19</th><th class="n">20</th><th class="n">21</th>
</thead>
</table>
</a>
</body>
</html>

View File

@@ -0,0 +1,411 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>Command syntax of &#956;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>&#956;Csim</i></a></h2>
<i>&#956;Csim</i> uses a very simple command interpreter. Command can be entered
after <i>&#956;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>&#956;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>&gt; <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>&gt; <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
&gt; <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... or bitspec data
Place list of data into memory
<b>set bit</b> bitspec data Set specified bit(s)
<b>set hardware</b> category 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&gt; <font color="green">set opt 7 <b>s51&gt;</b></font>
0s51&gt;<font color="green">set opt 7 <b>".s51&gt; "</b></font>
0.s51&gt;
</pre>
<h4><a name="bit_type">Bit type</a></h4>
If a parameter contains a dot (.) or a colon contained in square brackets ([...:...])
it is treated as a bit specification. If there is a dot the part before the dot gives
the memory address and part after the dot gives the bit number. The bracketed form is
used to specify a range of bits.
<pre>0&gt; <font color="green">dump <b>p1.1</b></font>
P1.1 0x90 ff 1
0&gt; <font color="green">dump <b>0x80.1</b></font>
P4.1 0x80 ff 1
0&gt;
</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&gt; <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&gt;
</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.<br>
<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>&gt; <font color="green">where xram "ab" 0x43</font>
0xf961 61 62 63 abc
&gt;
</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&gt; <font color="green">dump 0.2</font>
0x00000.2 0
0&gt; <font color="green">dump 0xc3.2</font>
0x000c3.2 1
0&gt; <font color="green">var a_reg rom[0x1000]</font>
0&gt; <font color="green">dump a_reg[7:0]</font>
0x01000 a_reg 0b11110111 0xf7 '.' 247 ( -9)
0&gt; <font color="green">dump a_reg[5:2]</font>
0x01000[5:2] a_reg[5:2] 0b--1101-- 0x0d '.' 13 ( -3)
0&gt; <font color="green">var some_bits rom[0x1000][5:2]</font>
0&gt; <font color="green">dump some_bits</font>
0x01000[5:2] some_bits 0b--1101-- 0x0d '.' 13 ( -3)
0&gt; <font color="green">dump some_bits[4:3]</font>
0x01000[4:3] a_reg[4:3] 0b---10--- 0x02 '.' 2 ( -2)
0&gt;
</pre>
<p>Note that in the above the <code>[4:3]</code> <em>overrides</em> the
<code>[5:2]</code> defined for the var and <code>some_bits[4:3]</code>means
bits 4 through 3 of the value stored at 0x1000. It does <em>not</em> mean
take the bits defined by the var and then take a subset of those bits.
Note also that the output does not tell us we are looking at <code>some_bit</code>
(because we're not) but since we have a var set for the address as a whole
it does tell us that we are looking at a subset of <code>a_reg</code>.</p>
<p>In this way, any IRAM or SFR location can be addressed as the above
example shows.</p>
<p>Other way is using bit address either by value or by symbolic name: </p>
<pre>0&gt; <font color="green">dump ea</font>
IE0.7 0xa8 00 0
0&gt; <font color="green">dump 34</font>
0x24.2 0x24 24 1
0&gt; <font color="green">dump 0xc7</font>
SCON1.7 0xc0 00 0
0&gt;
</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&gt; <font color="green">12*(34+56)</font>
1080
0&gt;
</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&gt; <font color="green">12</font>
12
0&gt; <font color="green">012</font>
10
0&gt; <font color="green">0x12</font>
18
0&gt; <font color="green">0b010101</font>
21
0&gt;
</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>. Numbers can be
specified in ascii form too: <b>'a'</b>, result will be ascii code of the
character. This form accepts C style escapes, for example: <b>'\n'</b> or <b>'\033'</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&gt; <font color="green">xram[0x543]</font>
67
0&gt; <font color="green">xram_chip[1347]</font>
67
0&gt; <font color="green">rom[12*(34+56)]</font>
56
0&gt; <font color="green">sp</font>
7
0&gt; <font color="green">rom[256*dph+dpl]</font>
88
0&gt;
</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&gt; <font color="green">p0.3</font>
1
0&gt; <font color="green">xram[12*(34+56)].9-2</font>
0
0&gt; <font color="green">it0</font>
0
0&gt;
</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;">+ - &amp; ~ !</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;">&lt;&lt; &gt;&gt;</span></td>
<td>shift left, right</td>
</tr>
<tr>
<td rowspan="2" colspan="1">Logical</td>
<td><span style="font-family: monospace;">&lt; &gt; &lt;= &gt;= == !=</span></td>
<td>Comparison of two values</td>
</tr>
<tr>
<td><span style="font-family: monospace;">&amp;&amp; || ^^</span></td>
<td>Logical and, or, xor</td>
</tr>
<tr>
<td>Bitwise</td>
<td><span style="font-family: monospace;">&amp; | ^</span></td>
<td>Bitwise and, or, xor</td>
</tr>
<tr>
<td>Assignment</td>
<td><span style="font-family: monospace;">= *= /= %= += -= &lt;&lt;=
&gt;&gt;= &amp;= |= ^=</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&gt; <font color="green">p0=23</font>
23
0&gt; <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&gt; <font color="green">p0.0= 0</font>
0
0&gt; <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&gt; <font color="green">xram[256*dph+dpl]= rom[0]</font>
108
0&gt; <font color="green">dump rom 0 0</font>
0x0000 6c l
0&gt; <font color="green">dump sfr dph dph</font>
0x83 00 .
0&gt; <font color="green">dump sfr dpl dpl</font>
0x82 00 .
0&gt; <font color="green">dump xram 0 0</font>
0x0000 6c l
0&gt; <font color="green">0x6c</font>
108
0&gt; <font color="green">dump ea</font>
IE0.7 0xa8 00 0
0&gt; <font color="green">ea= 1111</font>
1
0&gt; <font color="green">dump ea</font>
IE0.7 0xa8 80 1
0&gt;
</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&gt; <font color="green">dpl</font>
0
0&gt; <font color="green">&amp;dpl</font>
130
0&gt; <font color="green">ea</font>
1
0&gt; <font color="green">&amp;ea</font>
175
0&gt; <font color="green">256*dph+dpl</font>
46630
0&gt; <font color="green">&amp;xram[256*dph+dpl]</font>
46630
0&gt;
</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>&#956;Csim</i>
doesn't allow to put redirection at the beginning of the command!
<pre>$ <font color="#118811">ucsim_51 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&gt; <font color="#118811">dump &gt;/tmp/rom.dump rom</font>
0&gt; <font color="#118811">quit</font>
$ <font color="#118811">cat /tmp/rom.dump</font>
0x0000 02 01 60 02 00 3c 06 07 ..`..&lt;..
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 !"...&amp;'
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">ucsim_51 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&gt; <font color="#118811">dump rom 0x50 &gt;&gt;/tmp/rom.dump</font>
0&gt; <font color="#118811">quit</font>
$ <font color="#118811">cat /tmp/rom.dump</font>
0x0000 02 01 60 02 00 3c 06 07 ..`..&lt;..
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 !"...&amp;'
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>

View File

@@ -0,0 +1,152 @@
<html>
<head>
<meta content="text/html; charset=ISO-8859-2" http-equiv="content-type">
<title>&mu;Csim: Regression Testing</title>
</head>
<body bgcolor="white">
<h1>Regression Testing</h1>
<h2>Running Tests</h2>
<p>If you are making changes to &mu;Csim you should both run tests
to ensure nothing breaks and write new tests to ensure your changes
work and do not get broken in the future!</p>
<p>In all cases the tests are run using the locally built simulators.
i.e. you need to have completed a successful build before you can
test it! Tests produce output when run which is captured to a file
and compared with baseline output held in the source tree. If there
are any differences they are output and the test is considered
failed. In that case either the code needs to be changed to correct
the output or the baseline needs to be updated to reflect the new
expected output. Only when there are no differences to the baseline
can tests be said to have passed.</p>
<h3>All Tests</h3>
<p>To run all tests run <code>make test</code> in the top-level
<code>ucsim</code> directory.<br />
E.g.:
<pre>.../ucsim$ <font color="#118811">make test</font></pre>
</p>
<h3>For a Single MCU</h3>
<p>To run tests for a single MCU type run <code>make test</code>
in the directory for that simulator.<br />
E.g.:
<pre>.../ucsim/s51.src$ <font color="#118811">make test</font></pre>
or run <code>make</code> in the <code>test</code> subdirectory.<br />
E.g.:
<pre>.../ucsim/s51.src/test$ <font color="#118811">make</font></pre>
</p>
<p>Note that tests for functionality generic to all simulators and that
does not depend on a particular MCU type lives in
<code>sim.src/test</code> and should be run there. These tests require
at least one simulator to have been built but unless there is only one
it is indeterminate which simulator will be used.</p>
<h3>Running a Single Test</h3>
<p>To run a single test run <code>make <i>test_name</i></code>
in the <code>test</code> subdirectory of the relevant simulator. E.g.:
<pre>.../ucsim/s51.src/test$ <font color="#118811">make config</font></pre>
In this case the test is run verbosely and the commands executed by make
are displayed. In all other cases only the final differences to baseline
(if any) are displayed.</p>
<h3>Updating the Baselines</h3>
<p>If changes to the simulator code base lead to changes in test outputs
<em>and these changes are as expected</em> then the baselines should be
updated to match the new output by copying the contents of the <code>out</code>
directories to the corresponding <code>baseline</code> directories.</p>
<p>To update all baselines run <code>make baseline</code> in the top-level
<code>ucsim</code> directory.<br />
<p>To update baselines for a single MCU type run <code>make baseline</code>
in the directory for that simulator.<br />
<p>If you need to update the baseline for a single test you should copy the
relevant files manually.</p>
<p><em>Remember that the updated baselines form part of your changes and
need to be committed or submitted as part of your patch!</em></p>
<h2>Writing Tests</h2>
<ol>
<li>Create a directory named after your test under the relevant simulator's
<code>test</code> directory:
</li>
<li>Place the data needed for your test, <code>.cmd</code> files, <code>.asm</code>
or <code>C</code> files etc, in your test directory:
</li>
<li>Create a <code>baseline</code> directory in your test directory:
</li>
<li>Create an empty file in the <code>baseline</code> directory for each
output that your test generates:
</li>
<li>Create a <code>Makefile</code> that lists the output(s) to be generated,
the recipes to create them and which includes <code>test-lib.mk</code>:
</li>
<li>Run your test, verify the contents of the <code>out</code> directory
and then copy it to the <code>baseline</code> directory:
</li>
</ol>
<pre>
.../ucsim/s51.src/test$ <font color="#118811">mkdir <i>name</i></font>
.../ucsim/s51.src/test$ <font color="#118811">cd <i>name</i></font>
.../ucsim/s51.src/test/<i>name</i>$ <font color="#118811">vim test.{cmd,asm}</font>
.../ucsim/s51.src/test/<i>name</i>$ <font color="#118811">mkdir baseline</font>
.../ucsim/s51.src/test/<i>name</i>$ <font color="#118811">touch baseline/<i>stdout</i></font>
.../ucsim/s51.src/test/<i>name</i>$ <font color="#118811">cat &gt; Makefile &lt;&lt;EOF</font>
OUTPUTS = <i>stdout</i>
<i>stdout</i>: <i>mytest</i>.ihx <i>mytest</i>.cmd
$(call run-sim)
include test-lib.mk
EOF
.../ucsim/s51.src/test/<i>name</i>$ <font color="#118811">cd ..</font>
.../ucsim/s51.src/test$ <font color="#118811">make <i>name</i></font>
.../ucsim/s51.src/test$ <font color="#118811">cp -r <i>name</i>/out <i>name</i>/baseline/.</font></pre>
<p><code>test-lib.mk</code> takes care of building any <code>.ihx</code> files
needed from corresponding <code>.asm</code> or <code>.c</code> files.
The call to <code>run-sim</code> will invoke the simulator with the
<code>.ihx</code> and <code>.cmd</code> prerequisites, capturing the
output.</p>
<p>If there are no <code>.cmd</code> prerequisites and there is no
<code>-e</code> in the arguments to <code>run-sim</code> it
will add a <code>-g</code> argument to start the simulator running.
It is assumed there is at least one <code>.ihx</code> file in the
prerequisites in this case and that it places code at the reset
address.</p>
<p>If you wish to pass arguments of your own to the simulator these
can be given as arguments to run-sim. This can be used to pass commands
with the <code>-e</code> option rather than using a <code>.cmd</code> file
for instance, as is done with the config tests.</p>
<p>If you create any other output from within the simulator you should
specify a pathname starting with <code>out/</code>. Anything written
to the <code>out</code> directory will be compared to the baseline
when the test is complete.</p>
</p>
<hr>
</body>
</html>

View File

@@ -0,0 +1,194 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
<title>&#956;Csim: VCD file dumper</title>
</head>
<body style="background-color: white;">
<h1>VCD file I/O</h1>
<p>Initially there is one vcd defined called "vcd[0]" (or just "vcd").
You can create an additional vcds with "set hw vcd[0] new <i>id</i>" and
configure it with "set hw vcd[<i>id</i>] ..." commands ("<i>id</i>" must
be an integer).</p>
<h2>Output (event logging)</h2>
<p>The vcd module creates VCD files compatible with industry standards and
readable with open source tools such as gtkwave and sigrok/pulseview.</p>
<p>(N.B. sigrok/pulseview only supports VCD files containing events that
are 1 bit wide only.)</p>
<ol>
<li>Specify output file<br>
<pre>
0&gt; <font color="#118811">set hw vcd[0] output "name.vcd"</font>
</pre>
<p>Alternatively specify no, or an empty, output file or use the
"view" command and the simulator will attempt to invoke
<a href="http://gtkwave.sourceforge.net/">gtkwave</a>
directly.</p>
<pre>
0&gt; <font color="#118811">set hw vcd[0] output ""</font>
0&gt; <font color="#118811">set hw vcd[0] view</font>
</pre>
</li>
<li>Add locations to dump<br>
<pre>
0&gt; <font color="#118811">set hw vcd[0] add pc_odr</font>
0&gt; <font color="#118811">set hw vcd[0] add rom[0x500a].3</font>
</pre>
You can set the name of the module if you want (set hw vcd[0] module
name), it will be ucsim_vcd_0 by default.<br>
<br>
</li>
<li>Check the configuration<br>
<pre>
0&gt; <font color="#118811">info hw vcd[0]</font>
vcd[0] value change dump
Modul: ucsim_vcd_0
Started: no
Paused: no
File: name.vcd
Mode: output
Time scale: auto set on start
Start time: 0.000000000000000 s
Last event: 0.000000000000000 s
Simul time: 0.000000000000000 s
Variables:
Address Symbol
rom[0x0500a][7:0] pc_odr
rom[0x0500a].3
</pre>
</li>
<li>Start recording<br>
<pre>
0&gt; <font color="#118811">set hw vcd[0] start</font>
</pre>
</li>
<li>Run the program<br>
<br>
</li>
<li>You can pause/resume recording<br>
<pre>
0&gt; <font color="#118811">set hw vcd[0] pause</font>
0&gt; <font color="#118811">set hw vcd[0] restart</font>
</pre>
<p>While the vcd is paused no changes are recorded in the
output and values will show as unknown when the VCD is viewed
by something such as
<a href="http://gtkwave.sourceforge.net/">gtkwave</a>.</p>
<p>If you set pausetime then the time recorded as unknown
will be limited to the specified time and time beyond that
will simply not exist as far as the VCD is concerned.
This may be used to compress pause gaps in the VCD for the
sake of viewers which are not able to do this themselves.</p>
<pre>
0&gt; <font color="#118811">set hw vcd[0] pausetime 300 ns</font>
</pre>
</li>
<li>Stop recording and close the VCD file<br>
<pre>
0&gt; <font color="#118811">set hw vcd[0] stop</font>
</pre>
</li>
</ol>
<h2>Input (event replay)</h2>
<ol>
<li>Define any variables used by the input file<br>
<pre>
0&gt; <font color="#118811">var loc1 rom[0x5001]</font>
</pre>
</li>
<li>Specify input file<br>
<pre>
0&gt; <font color="#118811">set hw vcd[0] input "name.vcd"</font>
</pre>
</li>
<li>Adjust the base time<br>
By default time 0 in the VCD file corresponds to the simulator time
when the vcd is started. You can adjust this by setting the start time
of the vcd. For instance, to move the VCD events 750 ns into the future
you would use
<pre>
0&gt; <font color="#118811">set hw vcd[0] starttime 750 ns</font>
</pre>
<p>This can be done at any time, regardless of whether the vcd is started,
paused or even part way through.</p>
<p>Note that the argument to starttime is the amount to add or subtract
from the current start time not an absolute time.</p>
<br>
</li>
<li>Start the replay<br>
<pre>
0&gt; <font color="#118811">set hw vcd[0] start</font>
<pre>
</li>
<li>Check the configuration<br>
N.B. The VCD file's header is only parsed when the vcd is started.
Until then the configuration details are unknown.<br>
<pre>
0&gt; <font color="#118811">info hw vcd[0]</font>
vcd[0] value change dump
Modul: ucsim_vcd_0
Started: YES
Paused: no
File: name.vcd
Mode: input
Break: disabled
Time scale: 1 ns
Start time: 0.000000000000000 s
Next event: 0.000000000000000 s
Simul time: 0.000000000000000 s
Variables:
Address Symbol
rom[0x0500a] pc_odr
rom[0x0500a].3
</pre>
</li>
<li>Run the program<br>
<br>
</li>
<li>Pause/resume replay<br>
<pre>
0&gt; <font color="#118811">set hw vcd[0] pause</font>
0&gt; <font color="#118811">set hw vcd[0] restart</font>
</pre>
<p>While the replay is paused any cycles used by the simulator
are ignored by vcd and do NOT advance you towards the next
event.</p>
<br>
</li>
<li>Toggle the break flag as required<br>
<pre>
0&gt; <font color="#118811">set hw vcd[0] break</font>
</pre>
<p>The break flag causes vcd to generate a break each an event
is replayed giving you the opportunity to check that your program
responds to it correctly.</p>
<br>
</li>
<li>Stop the replay and close the VCD file<br>
<pre>
0&gt; <font color="#118811">set hw vcd[0] stop</font>
</pre>
</li>
</ol>
</body>
</html>