Line 1... |
Line 1... |
|
|
\chapter{Tools}
|
\chapter{Tools}
|
\label{tools}
|
\label{tools}
|
|
|
|
Directory '/tools' of the project includes a few tools -- small C or Python
|
|
programs purpose-built for this project.
|
|
|
|
What follows is a brief description of each of the tools. This document
|
|
won't go into the implementation or usage details. The tools themselves have
|
|
brief usage instructions and for any further details the user must read
|
|
the source code.
|
|
|
|
|
|
|
\section{MIPS Software Simulator}
|
\section{MIPS Software Simulator}
|
\label{sw_simulator}
|
\label{sw_simulator}
|
|
|
Plasma project includes a MIPS-I simulator made by Steve Rhoads, called
|
Plasma project includes a MIPS-I simulator made by Steve Rhoads, called
|
'mlite.c'. According the the author, it was used as a golden model for the
|
'mlite.c'. According the the author, it was used as a golden model for the
|
Line 25... |
Line 35... |
vhdl test bench.
|
vhdl test bench.
|
\item Does not simulate the cache at all.
|
\item Does not simulate the cache at all.
|
\end{itemize}
|
\end{itemize}
|
|
|
Each code sample includes a DOS batch file named 'swsim.bat' that runs the
|
Each code sample includes a DOS batch file named 'swsim.bat' that runs the
|
simulator in batch mode.\\
|
simulator in batch mode. Note that the BAT file invokes a windows binary
|
|
which is included in the SVN repository and should be immediately useable
|
|
after checkout.\\
|
|
|
The program includes usage help (a short description of the command line
|
The program includes usage help (a short description of the command line
|
parameters). The source code (very simple and straighforward) is includef in
|
parameters). The source code (very simple and straighforward) is included in
|
the project. The BAT files provide an usage example. And anyone who is
|
the project. The BAT files provide an usage example. And anyone who is
|
interested and finds trouble can always contact me.
|
interested and finds trouble can always contact me.
|
|
|
For all these reasons I think it is not necessary to explain the simulator
|
For all these reasons I think it is not necessary to explain the simulator
|
in detail. Nothing to do with laziness, as you can see.\\
|
in detail. Nothing to do with laziness, as you can see.\\
|
Line 41... |
Line 53... |
simulated memory sizes and the code and data addresses.\\
|
simulated memory sizes and the code and data addresses.\\
|
|
|
The hardcoded log file name is "sw\_sim\_log.txt" and it is generated in the
|
The hardcoded log file name is "sw\_sim\_log.txt" and it is generated in the
|
same directory from which the simulator is run.\\
|
same directory from which the simulator is run.\\
|
|
|
|
\section{Configuration Package Builder Script build\_pkg.py}
|
|
\label{python_script}
|
|
|
|
This tools is used to build a simulation and synthesis configuration
|
|
package.
|
|
|
|
The generated package contains configuration constants used by the
|
|
simulation test bench \emph{'mips\_tb.vhdl'} and by the hardware demo
|
|
\emph{'c2sb\_demo.vhdl'}.
|
|
|
|
It too includes memory initialization constants containing object code,
|
|
used to initialize simulated and inferred memories, both in simulation
|
|
and in synthesis.
|
|
|
|
In the code samples, this script is used to generate two separate packages
|
|
for simulation and synthesis. Please refer to the makefiles for detailed
|
|
usage examples.
|
|
|
|
|
\section{Conversion Script bin2hdl.py}
|
\section{Conversion Script bin2hdl.py}
|
\label{python_script}
|
\label{python_script}
|
|
|
|
|
|
\begin{figure*}[ht]
|
|
\begin{center}
|
|
{\small
|
|
\framebox[7in]{
|
|
\begin{minipage}[t]{6.0in}
|
|
|
|
NOTE: This script was used in previous versions of the project -- it came
|
|
in handy to initialize byte-sliced memories when the caches were under
|
|
development.
|
|
|
|
It has been abandoned because it was far too complicated and no longer
|
|
necessary. The VHDL
|
|
templates it refers to and the script itself have been moved from the /src
|
|
directory to their own subdirectory in /tools.
|
|
|
|
It is being retained in case it becomes useful again but it is no longer
|
|
used.
|
|
|
|
\end{minipage}
|
|
}
|
|
}
|
|
\end{center}
|
|
\label{lb}
|
|
\end{figure*}
|
|
|
|
|
|
|
This Python script reads one or more binary files and 'inserts' them in a
|
This Python script reads one or more binary files and 'inserts' them in a
|
vhdl template. It makes the
|
vhdl template. It makes the
|
conversion from binary to vhdl strings and slices the data in byte columns,
|
conversion from binary to vhdl strings and slices the data in byte columns,
|
as required by the RAM implementation (in which each byte in a word is
|
as required by the RAM implementation (in which each byte in a word is
|
stored in a different RAM with a separate WE, 4 blocks in all).\\
|
stored in a different RAM with a separate WE, 4 blocks in all).\\
|