📄 slides.tex
字号:
% Slides for the L4/SPARC presentation on 23 May 2000.% by Patryk Zadarnowski, pat@jantar.org\documentclass[dvips,online,helvetica]{chaksem}\usepackage[T1]{fontenc}\usepackage[fleqn]{amsmath}\usepackage{alltt}\usepackage{amssymb}\usepackage{stmaryrd}\usepackage{pstricks,pst-node,pst-plot}\usepackage{graphics}\RequirePackage[dvips]{epsfig}% misc%\renewcommand{\ttdefault}{cmtt}\newcommand{\code}[1]{\texttt{#1}}% names%\newcommand{\CToHS}{\textsc{c${\to}$hs}}% hacks%\makeatletter\newcommand{\fstoversnd}[2]{% \newif\ifouterm@th \ifmmode\outerm@thtrue\else\outerm@thfalse\fi \setbox0=\hbox{\ifouterm@th$#1$\else#1\fi}%% \unhcopy0\hskip-\wd0% % doesn't work in math mode #1\hskip-\wd0% % this does \hbox to\wd0{\hfil\ifouterm@th$#2$\else#2\fi\hfil}% }\makeatother% symbols%\newcommand{\reepsilon}{\epsilon}\newcommand{\reconc}{\mathbin{\triangleright}}\newcommand{\reor}{\mathbin{\fstoversnd{{\bowtie}}{|}}}\newcommand{\realt}{\mathbin{\fstoversnd{{\bowtie}}{\|}}}\newcommand{\restar}{\mathbin{\varoast}}\newcommand{\replus}{\mathbin{\varoplus}}\newcommand{\request}{\mathbin{\textsf{?}}}% PSTricks stuff\newpsobject{showgrid}{psgrid}{subgriddiv=1,griddots=3,gridlabels=5pt}\psset{unit=1ex, % scale with font linewidth=.6pt} % lines shouldn't be too heavy\newgray{dgray}{.5}\newgray{fglightgray}{.8}%\newgray{fglightgray}{.65} % value for ETL's projector\newgray{bggray}{.8}\newcmykcolor{lightgreen}{.25 0 .25 0}\newcmykcolor{ultralightgreen}{.12 0 .12 0}\newcmykcolor{lightmag}{.05 .25 0 0}\newcmykcolor{altlightgreen}{.3 0 .1 0}\newcmykcolor{lightyellow}{0 0 .5 0}\newcmykcolor{magg}{.3 1 0 0}\newcmykcolor{dgreen}{1 0 .6 .3}\newcmykcolor{dblue}{1 1 0 .3}\newcmykcolor{lightblue}{.5 .5 0 .1}\newcmykcolor{ultralightblue}{.12 .12 0 0}\newcmykcolor{dorange}{0 .6 .8 .3}\newcommand{\bgcolbox}[2]{% \psframebox[fillcolor=#1,linestyle=none,fillstyle=solid]{#2}}\let\emcol=\dorange\let\headcol=\dblue% chaksem config%\let\toprulecol=\emcol\let\botrulecol=\headcol\newcommand{\ukernel}{$\mu$kernel}\newcommand{\X}[1]{% \begin{slitemize} \item #1 \end{slitemize}} % Title\begin{document}\begin{slide} \begin{center} \huge {\dblue Sulima Hardware Simulator}\\ \Large Patryk Zadarnowski\\ \small \texttt{patrykz@cse.unsw.edu.au}\\ \par\vfill \begin{figure}[htb] \begin{center} \leavevmode \epsfxsize = .3\textwidth \epsfbox{sulima.eps} \end{center} \end{figure} \par\vfill University of New South Wales, Australia\\ \end{center}% \vspace*{-.5\bigskipamount}\end{slide}% Overview\begin{slide} \heading{Overview} A complete hardware simulator with the following features: {\headcol Goals:} \begin{slumerate} \item easy extendability \item portability \item complete support for MIPS III \item complete simulation of the real U4600 hardware \end{slumerate} \X{the first three achieved} \X{the fourth found impractical}\end{slide}% Outline\begin{slide} \heading{Outline} \begin{slumerate} \item architecture \item device interface \item event interface \item scheduling \item checkpointing \item interpreter-grade CPU simulation \item future directions \end{slumerate}\end{slide}% 1. Architecture \begin{slide} \heading{Architecture} An architecture of independant modules (C++ objects) interfaced by and arranged at runtime using a Tcl script. {\headcol Module Hierarchy:} \begin{slitemize} \item {\tt BasicModule}\\ infrastructure common to the Sulima module and the runtime modules, also creates a Tcl namespace under ``{\tt sim::}'' \begin{slitemize} \item {\tt Sulima}\\ configuration and other functionality required implicitely. Created automatically by the Tcl {\tt init} function. \item {\tt Module}\\ adds common Tcl interfaces {\tt install\_module}, {\tt reset}, {\tt checkpoint} and the runtime and checkpointing constructors. May be easily extended; eg. state snooping, annotations. \end{slitemize} \end{slitemize}\end{slide}% 1. Architecture - cont'd\begin{slide} \begin{slitemize} \item {\tt Module} \begin{slitemize} \item {\tt CPU}\\ implements the RR schedular, destination for interrupts, asynchronous event queues and a clock, synchronized automatically with clocks in other {\tt CPU} modules. \begin{slitemize} \item {\tt MIPS64Cpu}\\ implements a MIPS III CPU state, including all registers, caches and TLBs, therefore faciliating on-the-fly switching between different-grade simulators. Derived modules don't have to use these but must synchronize their state on request. For example, caches and TLBs are better maintained directly by each CPU simulator. Also interfaces with a {\tt MIPS64Bus}. Byte order ignored, and must be handled by each CPU module seperately. \begin{slitemize} \item {\tt Koala}\\ an interpreter-based simulator of the R4600/R4700 CPU. Cycle-level accuracy possible (because single-issue), but currently only partially implemented due to lack of documentation \end{slitemize} \end{slitemize} \end{slitemize} \end{slitemize}\end{slide}% 1. Architecture - cont'd\begin{slide} \begin{slitemize} \item {\tt Module} \begin{slitemize} \item {\tt MIPS64Bus}\\ MIPS64-specific memory interface (sysctl, botched)\\ MIPS64-specific interrupt events\\ memory is a 64bit wide array and therefore not affected by the host byte order \begin{slitemize} \item {\tt MIPS64SimpleBus}\\ a simple bus with memory controller for a single region of RAM mapped at PA 0, four banks of devices mapped at fixed (high) addresses, and the system console. Four status registers: memory size (ro), console data (rw) interrupt mask and cause (rw) and bus error address (ro)) \item {\tt GT\_64010A}\\ incomplete \end{slitemize} \item {\tt ROM} \item {\tt MT48Tx2} \end{slitemize} \end{slitemize}\end{slide}% 1. Architecture - cont'd\begin{slide} \begin{slitemize} \item {\tt Device}\\ (not derived from {\tt Module}, but in practice all devices except for a trivial null device used as space fillers are implemented as modules.) \begin{slitemize} \item {\tt ROM} \item {\tt MT48Tx2} \item {\tt MIPS64SimpleBus::Registers} \item {\tt GT\_64010A::Registers} \item {\tt GT\_64010A::Null} \end{slitemize} \end{slitemize}\end{slide}% 2. Device Interface\begin{slide} \heading{Device Interface} {\tt Device} is parametized on bus width. Each device implements two interfaces:{\footnotesize\begin{verbatim} ClockValue read(CPU& cpu, UInt64 addr, UInt64* buf, int size); ClockValue write(CPU& cpu, UInt64 addr, const UInt64* buf, int size);\end{verbatim}} Bus error can be extracted from the returned value using{\footnotesize\begin{verbatim} bool is_bus_error(ClockValue latency); ClockValue bus_latency(ClockValue latency);\end{verbatim}} (stored in the sign bit). {\headcol Example:} \X {\tt ROM}\end{slide}% 3. Event interface\begin{slide} \heading{Asynchronous Event Queues} Handles asynchronous interrupts, scheduling events, and anything else (eg. an event can be defined for collecting some kind of statistics every 1000 cycles, and added to the simulator without modifying any of the other modules.) Also allows devices to inject interrupt events into the CPU event queues. Implemented as a queue attached to each clock (CPU). After each fetch-execute cycle, the CPU is expected to call {\tt Clock::poll} which will invoke all pending events. Each event is a class derived from {\tt Event}, with {\tt Event::invoke} overloaded to perform the desired action. The time of the event is assigned to the event on construction, and an event object is destroyed by {\tt Clock::poll} after invoking. {\headcol Example:} \X {\tt CPU::InterruptEvent}\end{slide}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -