my $term;
if (-t) {
- $term = Term::ReadLine->new('DECEL REPL');
- say "DECEL PRE-RELEASE\n";
+ $term = Term::ReadLine->new('YULE REPL');
+ say "YULE REPL\n";
}
my $port = Device::SerialPort->new($ARGV[0] // '/dev/ttyUSB1') or die "$!";
my $compiler = App::Scheme79asm::Compiler->new;
my $compiler_out = $compiler->compile_string($sexp);
- say 'Compiler says: ', dump_sexp($compiler_out);
+# say 'Compiler says: ', dump_sexp($compiler_out);
my $asm = App::Scheme79asm->new(addr_bits => 13);
my $asm_output;
$asm->print_binary16($asm_fh);
close $asm_fh;
- say "Writing: ", join ' ', uc join ' ', unpack '(H2)*', $asm_output;
+# say "Writing: ", join ' ', uc join ' ', unpack '(H2)*', $asm_output;
my $bytes_written = $port->write($asm_output);
my $bytes_to_write = length $asm_output;
die "Only wrote $bytes_written instead of $bytes_to_write" unless $bytes_written == $bytes_to_write;
my ($count_in, $string_in) = $port->read(5000);
my @memory = unpack 'n*', $string_in;
- say 'Received: ', uc join ' ', unpack '(H2)*', $string_in;
+# say 'Received: ', uc join ' ', unpack '(H2)*', $string_in;
unshift @memory, 0, 0, (1<<13), (1<<13);
princ $compiler, \@memory, 6;
say '';
\end{itemize}
The REPL is therefore the entry point of YULE as a whole. An end-user
-who does not intend to extend YULE can plug in an iCEstick with the
-processor, and run the REPL. Then the user can write expressions in
-the REPL and get their values back. Besides being the entry point, the
-REPL serves as a convenient way to test that the entire system is
-working. An expression typed in the REPL goes through the compiler and
-assembler, and then is sent to the processor. It goes through the
-three stages of the processor (reading the expression into memory,
-evaluating the contents of the memory, writing a memory dump).
+who does not intend to extend YULE can plug in a USB device containing
+the YULE processor, and run the REPL. Then the user can write
+expressions in the REPL and get their values back. Besides being the
+entry point, the REPL serves as a convenient way to test that the
+entire system is working. An expression typed in the REPL goes through
+the compiler and assembler, and then is sent to the processor. It goes
+through the three stages of the processor (reading the expression into
+memory, evaluating the contents of the memory, writing a memory dump).
The hardware and software components of YULE have been tested to
ensure they function correctly. There is an automated test suite
and prints the result for the user to see.
\end{itemize}
-\clearpage
\section{Hardware}
The hardware part is built from 8 modules:
is enabled if and only if the GC clock is enabled and the GC's
\texttt{step\_eval} output is high.
-\clearpage
\subsection{GC}
\begin{figure}
\centering\includegraphics[height=4.88cm]{gc.eps}
paper except that the ROM is widened by one bit to indicate whether
the EVAL is finished evaluating the expression.
-\clearpage
\subsection{Writer}
\begin{figure}
\centering\includegraphics[height=2.26cm]{writer.eps}
This module is not part of the original design in \cite{lambda}, as
that paper did not concern itself with input and output.
-\clearpage
\subsection{Reader}
\begin{figure}
\centering\includegraphics[height=2.22cm]{reader.eps}
This module is not part of the original design in \cite{lambda}, as
that paper did not concern itself with input and output.
-\clearpage
\subsection{Putting the hardware together}
The components described above are managed by the controller, which
provides them with clock enable signals. The controller is a state
\texttt{00 07}, which is a list with car \texttt{00 00} and cdr
\texttt{20 02}, and the pretty printer prints \texttt{(nil . t)}.
-\clearpage
An example REPL session is:
\begin{lstlisting}
\item The REPL's pretty printer interpets this string starting with
\texttt{2005}, which means \texttt{(SYMBOL 5)}. The pretty printer
looks in the compiler's mapping and finds that the 5th symbol was
- 3, and so the REPL prints
+ 2, and so the REPL prints
\begin{lstlisting}
-3
+2
*
\end{lstlisting}
user can input another expression.
\end{enumerate}
+\begin{figure}
+ \centering\includegraphics[height=7cm]{repl.png}
+ \caption{What the user types and sees in this example}
+\end{figure}
+
\chapter{Conclusions}
A Lisp machine processor has been built using the original design and
techniques presented in \cite{lambda}. It has been extended with input