Difference between revisions of "CasperTutorial01"

From AstroBaki
Jump to navigationJump to search
Line 267: Line 267:
  
 
Connect the blocks as per the diagram at the beginning of this section.
 
Connect the blocks as per the diagram at the beginning of this section.
 +
 +
 +
 +
  
 
\section{Simulating}
 
\section{Simulating}
Line 272: Line 276:
 
The design can be simulated with clock-for-clock accuracy directly from within
 
The design can be simulated with clock-for-clock accuracy directly from within
 
Simulink. Set the number of clock cycles that you'd like to simulate and press
 
Simulink. Set the number of clock cycles that you'd like to simulate and press
the play button in the top toolbar.
+
the play button in the top toolbar:
  
 
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig27.png}\end{figure}
 
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig27.png}\end{figure}
Line 279: Line 283:
 
will complete in the blink of an eye for this small design with just 10 clock
 
will complete in the blink of an eye for this small design with just 10 clock
 
cycles.  
 
cycles.  
 
 
You can double-click on the scopes to see what the signals look like on those
 
You can double-click on the scopes to see what the signals look like on those
lines. For example, the one connected to the counter should look like this:
+
lines. For example, the one connected to the counter should look like:
  
 
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig28.png}\end{figure}
 
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig28.png}\end{figure}
Line 291: Line 294:
 
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig29.png}\end{figure}
 
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig29.png}\end{figure}
  
Once you have verified that that design functions as you'd like, you're ready
+
Once you have verified that the design functions as you'd like, you're ready
to compile for the FPGA...
+
to compile for the FPGA.
 +
 
 +
 
 +
 
 +
 
  
 
\section{Compiling}
 
\section{Compiling}
  
Essentially, you have constructed three completely separate little instruments.
+
You have constructed essentially three completely separate little instruments.
You have a flashing LED, a counter which you can start/stop/reset from software
+
There is a flashing LED, a counter you can start/stop/reset from software,
and also an adder. These components are all clocked off the same 100MHz system
+
and an adder. These components are driven by the same 100MHz clock, but they operate independently.  
clock crystal, but they will operate independently.  
 
  
In order to compile this to an FPGA bitstream, type bee\_xps on the Matlab
+
In order to compile this to an FPGA bitstream, type "bee\_xps" on the Matlab
command line. Leave all options on defaults. Ensure that the listed design is
+
command line. Leave all options on defaults. Ensure that the listed design under System Generator Design Name is
the one you want to compile (System Generator Design Name). If it is not, click
+
the one you want to compile. If it is not, click
anywhere on your design such that it is the highlighted window, then click gcs.
+
anywhere on your design (making it the highlighted window), then click gcs (for Get Current System).
To start the process, simply click RUN XPS.
+
To start the process, click "RUN XPS":
  
 
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig30.png}\end{figure}
 
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig30.png}\end{figure}
  
Compile time is approximately 15 minutes on the little blue computers. When
+
Compile time will vary by computer (on the computer we tried, it took 15 minutes). When
complete, you should receive a popup box like this:
+
complete, you should see a popup box:
  
 
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig31.png}\end{figure}
 
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig31.png}\end{figure}
  
\section{Transferring your bitstream to your ROACH board}
+
 
 +
 
 +
 
 +
 
 +
 
 +
\section{Transferring the Bitstream to ROACH}
  
 
If you navigate to the directory containing your *.mdl file, you
 
If you navigate to the directory containing your *.mdl file, you
will find a subfolder with the same name as your Simulink design.
+
will find a directory with the same name as your Simulink design.
You will find your bitstreams inside the folder called bit\_files. There are
+
In that directory, you will find another directory "bit\_files" that holds your bitstreams.
two files with names of the form  
+
There should be two files with names of the form  
 
<design\_name>\_<start\_compile\_time>.XXX.
 
<design\_name>\_<start\_compile\_time>.XXX.
The *.bit is the raw FPGA bitstream that you could load manually using a Xilinx
+
The *.bit is the raw FPGA bitstream that can be manually loaded using a Xilinx
JTAG programmer. Of interest to us now is the *.bof file. This is a BORPH
+
JTAG programmer. Instead, we'll opt to use the *.bof file--a BORPH
executable. We will transfer this to your ROACH board now.
+
executable. Let's transfer this file to your ROACH board now.
  
 
To transfer files to ROACH, you can use any program capable of doing Secure Copy over SSH
 
To transfer files to ROACH, you can use any program capable of doing Secure Copy over SSH
 
Protocol (SCP) transfers.  On Linux, scp is the standard tool.
 
Protocol (SCP) transfers.  On Linux, scp is the standard tool.
 +
You will need to place your *.bof file in the /boffiles directory of the ROACH filesystem, and make it executable.
 +
If your ROACH is configured to have its own file system and you are running Linux, this may be as simple as:
 +
\begin{verbatim}
 +
bash$ scp *.bof root@<roach-ip>:/boffiles
 +
bash$ ssh root@<roach-ip>
 +
root@roach020112:~# chmod a+x /boffiles/*.bof
 +
\end{verbatim}
 +
 +
 +
  
You will then login to the Linux server wsserv that boots the ROACH boards and
 
hosts their filesystem. The ROACH filesystem lives in /srv/roach\_boot/etch/.
 
  
In the root folder of this filesystem is a directory called /boffiles. ROACH
 
boards look in here for executable BORPH files. You will need to transfer your
 
bof file into this directory and make it executable. Navigate to /srv/roach\_boot/etch/boffiles. This
 
directory is shared amongst all the ROACH boards, so you will notice a list of
 
everyone else's bof files too.
 
  
 
\section{Connecting to your ROACH board}
 
\section{Connecting to your ROACH board}
  
\subsection{Booting your ROACH}
+
\subsection{Boot the ROACH}
  
To watch ROACH boot, you need to connect to it using a serial port. Under Linux, minicom is  
+
If you want to watch ROACH boot, you need to connect to it using a serial port. Under Linux, minicom is  
 
a standard tool for communicating over the serial port.  On Windows, try HyperTerminal.
 
a standard tool for communicating over the serial port.  On Windows, try HyperTerminal.
 
Set the serial connection to use your serial port (usually of the form /dev/tty* on Linux or
 
Set the serial connection to use your serial port (usually of the form /dev/tty* on Linux or
 
com1 on Windows) at 115200 baud, 8N1 with no flow control.
 
com1 on Windows) at 115200 baud, 8N1 with no flow control.
 
\subsection{Turn the ROACH on}
 
  
 
You will be greeted with a printout similar to this one:
 
You will be greeted with a printout similar to this one:
Line 379: Line 391:
 
\end{verbatim}
 
\end{verbatim}
  
This is ROACH's version of a BIOS along with some basic PPC health printouts.
+
This is ROACH's version of a BIOS along with some basic CPU health printouts.
 
Press any key here to stop the automatic boot process. This is the state of the
 
Press any key here to stop the automatic boot process. This is the state of the
 
ROACH boards when shipping. You can configure it differently should you please.
 
ROACH boards when shipping. You can configure it differently should you please.
Line 391: Line 403:
 
where to find the filesystem.  
 
where to find the filesystem.  
  
After Linux has completed its boot process, you will be greeted with a Debian prompt.
+
After Linux has completed its boot process, you will be greeted with a Debian Linux prompt.
  
 
\begin{verbatim}
 
\begin{verbatim}
Line 398: Line 410:
 
roach020112 login:   
 
roach020112 login:   
 
\end{verbatim}
 
\end{verbatim}
 +
 +
\subsection{SSH into ROACH}
  
 
You can connect to your ROACH board by SSHing directly into it. Under Linux, use the command "ssh".
 
You can connect to your ROACH board by SSHing directly into it. Under Linux, use the command "ssh".
Line 411: Line 425:
  
 
We are now ready to start working with the ROACH board.
 
We are now ready to start working with the ROACH board.
 +
 +
 +
 +
 +
 +
  
 
\section{Communicating directly using BORPH}
 
\section{Communicating directly using BORPH}

Revision as of 15:13, 26 March 2010