Changeset 525 for Deliverables/D4.1/ITP-Paper/itp-2011.tex

Ignore:
Timestamp:
Feb 15, 2011, 6:04:05 PM (8 years ago)
Message:

lots of changes

File:
1 edited

Legend:

Unmodified
 r524 % Real clock' for I/O and timers The O'Caml emulator has code for handling timers, I/O and interrupts (these are not yet ported to the Matita emulator). All three of these features interact with each other in subtle ways. For instance, interrupts can fire' when an input is detected on the processor's UART port, and, in certain modes, timers reset when a high signal is detected on one of the MCS-51's communication pins. To accurately model timers, we must modify the central \texttt{status} record of the emulator to keep track of the current time: \begin{quote} \begin{lstlisting} type time = int type status = { ... clock: time; ... } \end{lstlisting} \end{quote} Before every execution step, the \texttt{clock} is incremented by the number of processor cycles that the instruction just fetched will take to execute. The processor then executes the instruction, followed by the code implementing the timers. % Discuss I/O %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%