Mercurial > hg > ede
changeset 38:9ff51da22b9b
some docs
author | james <jb302@eecs.qmul.ac.uk> |
---|---|
date | Fri, 18 Apr 2014 20:07:19 +0100 |
parents | db6b8c9552bb |
children | 0f3bd942a7d4 |
files | docs/img/emu/memory.svg docs/lyx/#emu.lyx# docs/lyx/emu.lyx docs/lyx/emu.lyx~ |
diffstat | 4 files changed, 1034 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/img/emu/memory.svg Fri Apr 18 18:58:58 2014 +0100 +++ b/docs/img/emu/memory.svg Fri Apr 18 20:07:19 2014 +0100 @@ -110,7 +110,7 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.81190476" - inkscape:cx="300.46137" + inkscape:cx="150.81328" inkscape:cy="30.992195" inkscape:document-units="px" inkscape:current-layer="layer1" @@ -128,7 +128,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -148,7 +148,7 @@ xml:space="preserve" id="flowRoot3095" style="text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;display:inline" - transform="translate(-292.10514,219.34859)"><flowRegion + transform="translate(-275.79062,218.94905)"><flowRegion id="flowRegion3097"><rect id="rect3099" width="163.69331" @@ -161,7 +161,7 @@ style="display:inline" xml:space="preserve" id="flowRoot3135" - transform="translate(-55.90035,384.54226)"><flowRegion + transform="translate(-55.90035,382.54226)"><flowRegion id="flowRegion3137"><rect id="rect3139" width="47.486629" @@ -170,7 +170,7 @@ y="522.77289" /></flowRegion><flowPara id="flowPara3141">Data</flowPara></flowRoot> <flowRoot style="display:inline" - transform="translate(2.099643,384.54226)" + transform="translate(2.099643,382.54226)" id="flowRoot3143" xml:space="preserve"><flowRegion id="flowRegion3145"><rect
--- a/docs/lyx/#emu.lyx# Fri Apr 18 18:58:58 2014 +0100 +++ b/docs/lyx/#emu.lyx# Fri Apr 18 20:07:19 2014 +0100 @@ -87,10 +87,11 @@ \end_layout \begin_layout Standard -Above is block diagram of a micro-controller taken from the original ELB816 - specification. - Implementing this system as a piece of software is the goal of this section - of the project. +Above is a block diagram of a micro-controller with the ELB816 micro-processor + at it's core. + This is taken from the original ELB816 specification. + Implementing a system similar to this as a piece of software is the goal + of this section of the project. \end_layout \begin_layout Subsection @@ -153,7 +154,7 @@ \end_layout \begin_layout Itemize -Four 16 bit-content specific (PC, SP, DPTR and TMPA) +Four 16-bit content specific (PC, SP, DPTR and TMPA) \end_layout \begin_layout Itemize @@ -161,8 +162,8 @@ \end_layout \begin_layout Standard -The general purpose and 16-bit registers can exist as a single sixteen byte - block of memory spaces with the following encoding: +The general purpose 8-bit registers and the 16-bit registers can exist as + a single sixteen byte block of memory spaces with the following encoding: \end_layout \begin_layout Standard @@ -1046,6 +1047,13 @@ \end_layout \begin_layout Standard +\begin_inset Newpage pagebreak +\end_inset + + +\end_layout + +\begin_layout Standard Below is a control protocol which allows and control of the emulators memory and execution. \end_layout @@ -1098,7 +1106,7 @@ \begin_inset Text \begin_layout Plain Layout -Command Byte +CMD byte \end_layout \end_inset @@ -1163,7 +1171,7 @@ \begin_inset Text \begin_layout Plain Layout -Execute Instruction at PC +Execute instruction at PC \end_layout \end_inset @@ -1616,7 +1624,7 @@ \begin_inset Text \begin_layout Plain Layout -0xA +0x0A \end_layout \end_inset @@ -1788,18 +1796,354 @@ \end_layout -\begin_layout Subsection -Interrupt Controller +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip \end_layout -\begin_layout Subsection -Timer +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Newpage pagebreak +\end_inset + + +\end_layout + +\begin_layout Standard +Here are pseudo-code representations of the execution control functions. +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset listings +lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},tabsize=4" +inline false +status open + +\begin_layout Plain Layout + +step ( ) +\end_layout + +\begin_layout Plain Layout + + get instruction from IR +\end_layout + +\begin_layout Plain Layout + + decode and execute instruction +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +run ( ) +\end_layout + +\begin_layout Plain Layout + + get PC +\end_layout + +\begin_layout Plain Layout + + if PC is a break point: +\end_layout + +\begin_layout Plain Layout + + end +\end_layout + +\begin_layout Plain Layout + + else: +\end_layout + +\begin_layout Plain Layout + + step( ) +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +run for length ( length ) +\end_layout + +\begin_layout Plain Layout + + counter = 0 +\end_layout + +\begin_layout Plain Layout + + get PC +\end_layout + +\begin_layout Plain Layout + + while (counter + PC) != length: +\end_layout + +\begin_layout Plain Layout + + step( ) +\end_layout + +\begin_layout Plain Layout + + end +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +free run ( ): +\end_layout + +\begin_layout Plain Layout + + loop forever: +\end_layout + +\begin_layout Plain Layout + + step( ) +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Newpage pagebreak +\end_inset + + \end_layout \begin_layout Section Emulator Implementation \end_layout +\begin_layout Standard +The Emulator is written in pure C89 to ensure as much cross compiler compatibili +ty as possible. + It source code consists of the following files: +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Tabular +<lyxtabular version="3" rows="6" columns="2"> +<features tabularvalignment="middle"> +<column alignment="center" valignment="top" width="0"> +<column alignment="left" valignment="top" width="10cm"> +<row> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +File +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Description +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +main.c +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Initializes the emulator at boot and controls execution +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +iset.h +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Declares a function for each mnemonic in the instruction set. + Declares a 256 byte instruction table +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +iset.c +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Contains a function for each mnemonic in the instruction set +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +mem.h +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Declares variables for the various memory structures. + Declares memory access function definitions +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +mem.c +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Contains memory access functions +\end_layout + +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsection +main.c +\end_layout + +\begin_layout Standard + +\end_layout + \begin_layout Section Emulator Testing \end_layout
--- a/docs/lyx/emu.lyx Fri Apr 18 18:58:58 2014 +0100 +++ b/docs/lyx/emu.lyx Fri Apr 18 20:07:19 2014 +0100 @@ -1047,6 +1047,13 @@ \end_layout \begin_layout Standard +\begin_inset Newpage pagebreak +\end_inset + + +\end_layout + +\begin_layout Standard Below is a control protocol which allows and control of the emulators memory and execution. \end_layout @@ -1789,18 +1796,354 @@ \end_layout -\begin_layout Subsection -Interrupt Controller +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip \end_layout -\begin_layout Subsection -Timer +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Newpage pagebreak +\end_inset + + +\end_layout + +\begin_layout Standard +Here are pseudo-code representations of the execution control functions. +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset listings +lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},tabsize=4" +inline false +status open + +\begin_layout Plain Layout + +step ( ) +\end_layout + +\begin_layout Plain Layout + + get instruction from IR +\end_layout + +\begin_layout Plain Layout + + decode and execute instruction +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +run ( ) +\end_layout + +\begin_layout Plain Layout + + get PC +\end_layout + +\begin_layout Plain Layout + + if PC is a break point: +\end_layout + +\begin_layout Plain Layout + + end +\end_layout + +\begin_layout Plain Layout + + else: +\end_layout + +\begin_layout Plain Layout + + step( ) +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +run for length ( length ) +\end_layout + +\begin_layout Plain Layout + + counter = 0 +\end_layout + +\begin_layout Plain Layout + + get PC +\end_layout + +\begin_layout Plain Layout + + while (counter + PC) != length: +\end_layout + +\begin_layout Plain Layout + + step( ) +\end_layout + +\begin_layout Plain Layout + + end +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +free run ( ): +\end_layout + +\begin_layout Plain Layout + + loop forever: +\end_layout + +\begin_layout Plain Layout + + step( ) +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Newpage pagebreak +\end_inset + + \end_layout \begin_layout Section Emulator Implementation \end_layout +\begin_layout Standard +The Emulator is written in pure C89 to ensure as much cross compiler compatibili +ty as possible. + It source code consists of the following files: +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Tabular +<lyxtabular version="3" rows="6" columns="2"> +<features tabularvalignment="middle"> +<column alignment="center" valignment="top" width="0"> +<column alignment="left" valignment="top" width="10cm"> +<row> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +File +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Description +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +main.c +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Initializes the emulator at boot and controls execution +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +iset.h +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Declares a function for each mnemonic in the instruction set. + Declares a 256 byte instruction table +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +iset.c +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Contains a function for each mnemonic in the instruction set +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +mem.h +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Declares variables for the various memory structures. + Declares memory access function definitions +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +mem.c +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Contains memory access functions +\end_layout + +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsection +main.c +\end_layout + +\begin_layout Standard + +\end_layout + \begin_layout Section Emulator Testing \end_layout
--- a/docs/lyx/emu.lyx~ Fri Apr 18 18:58:58 2014 +0100 +++ b/docs/lyx/emu.lyx~ Fri Apr 18 20:07:19 2014 +0100 @@ -1047,6 +1047,13 @@ \end_layout \begin_layout Standard +\begin_inset Newpage pagebreak +\end_inset + + +\end_layout + +\begin_layout Standard Below is a control protocol which allows and control of the emulators memory and execution. \end_layout @@ -1617,7 +1624,7 @@ \begin_inset Text \begin_layout Plain Layout -0xA +0x0A \end_layout \end_inset @@ -1789,18 +1796,330 @@ \end_layout -\begin_layout Subsection -Interrupt Controller +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip \end_layout -\begin_layout Subsection -Timer +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Newpage pagebreak +\end_inset + + +\end_layout + +\begin_layout Standard +Here are pseudo-code representations of the execution control functions. +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset listings +lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},tabsize=4" +inline false +status open + +\begin_layout Plain Layout + +step ( ) +\end_layout + +\begin_layout Plain Layout + + get instruction from IR +\end_layout + +\begin_layout Plain Layout + + decode and execute instruction +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +run ( ) +\end_layout + +\begin_layout Plain Layout + + get PC +\end_layout + +\begin_layout Plain Layout + + if PC is a break point: +\end_layout + +\begin_layout Plain Layout + + end +\end_layout + +\begin_layout Plain Layout + + else: +\end_layout + +\begin_layout Plain Layout + + step( ) +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +run for length ( length ) +\end_layout + +\begin_layout Plain Layout + + counter = 0 +\end_layout + +\begin_layout Plain Layout + + get PC +\end_layout + +\begin_layout Plain Layout + + while (counter + PC) != length: +\end_layout + +\begin_layout Plain Layout + + step( ) +\end_layout + +\begin_layout Plain Layout + + end +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +free run ( ): +\end_layout + +\begin_layout Plain Layout + + loop forever: +\end_layout + +\begin_layout Plain Layout + + step( ) +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Newpage pagebreak +\end_inset + + \end_layout \begin_layout Section Emulator Implementation \end_layout +\begin_layout Standard +The Emulator is written in pure C89 to ensure as much cross compiler compatibili +ty as possible. + It source code consists of the following files: +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +bigskip +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Tabular +<lyxtabular version="3" rows="6" columns="2"> +<features tabularvalignment="middle"> +<column alignment="center" valignment="top" width="0"> +<column alignment="left" valignment="top" width="10cm"> +<row> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +File +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Description +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +main.c +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Initializes the emulator at boot and controls execution +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +iset.h +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Declares a function for each mnemonic in the instruction set. + Declares a 256 byte instruction table +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +iset.c +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Contains a function for each mnemonic in the instruction set +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +mem.h +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Declares variables for the various memory structures. + Declares memory access function definitions +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +mem.c +\end_layout + +\end_inset +</cell> +<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Contains memory access functions +\end_layout + +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + +\end_layout + \begin_layout Section Emulator Testing \end_layout