Difference between revisions of "CasperTutorial01"
From AstroBaki
Jump to navigationJump to search (Created page with '<latex> \documentclass[10pt]{article} \setlength\parindent{0 in} \setlength\parskip{0.1 in} \usepackage{fullpage} \usepackage{amsmath} \usepackage{graphicx} \begin{document} \be…') |
|||
Line 18: | Line 18: | ||
\section{Introduction} | \section{Introduction} | ||
− | In this tutorial, you will create a simple Simulink design using | + | In this tutorial, you will create a simple Simulink design using the standard |
− | Xilinx System Generator blockset | + | Xilinx System Generator blockset and library blocks specific to ROACH. |
At the end of this tutorial, you will have a BORPH executable file (a BOF file) | At the end of this tutorial, you will have a BORPH executable file (a BOF file) | ||
− | and you will know how to interact with your running hardware design using | + | and you will know how to interact with a ROACH board your running hardware design using |
BORPH. | BORPH. | ||
− | \section{ | + | \section{Creating Your Design} |
− | + | Create a new model: Start Matlab and open Simulink (by typing simulink | |
− | + | on the Matlab command line). | |
− | |||
− | \ | + | \subsection{Create a new model} |
− | + | \begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig2.png}\end{figure} | |
− | |||
− | \ | + | \subsubsection{Add Xilinx System Generator and XSG Core Config blocks} |
− | |||
− | + | All CASPER designs must have two blocks: a System Generator and an XSP Core Config. | |
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig3.png}\end{figure} | \begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig3.png}\end{figure} | ||
− | + | Locate the Xilinx | |
− | Blockset | + | Blockset Library's Basic Elements subsection and drag a System Generator |
− | token onto your new file. | + | token onto your new file. You should not configure this block directly; the XSG |
− | core config from the BEE XPS System Blockset library to do | + | core config from the BEE XPS System Blockset library to do it for you: |
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig4.png}\end{figure} | \begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig4.png}\end{figure} | ||
Line 53: | Line 50: | ||
library. This library contains all the board-specific components colloquially | library. This library contains all the board-specific components colloquially | ||
called Yellow Blocks. | called Yellow Blocks. | ||
− | + | DSP blocks are found in the CASPER DSP library and have other colors. | |
− | DSP | ||
− | |||
Double click on the XSG core config block that you just added. Set it for | Double click on the XSG core config block that you just added. Set it for | ||
− | ROACH: SX95t with sys\_clk as the clock source. sys\_clk is an | + | ROACH: SX95t with sys\_clk as the clock source. sys\_clk is an on-board 100MHz |
− | crystal. | + | crystal oscillator. Click OK. This will go off and configure the System Generator block which you previously |
+ | added. | ||
− | + | For the curious, the available clocking options include: | |
− | |||
− | |||
\begin{itemize} | \begin{itemize} | ||
− | \item sys\_clk: | + | \item sys\_clk: use onboard 100MHz crystal connected to the FPGA |
− | \item sys\_clk2x: | + | \item sys\_clk2x: use frequency-doubled version of sys\_clk generated using a Phase Locked Loop (PLL) set by a Digital Clock Manager (DCM) on the FPGA |
− | \item arb\_clk: | + | \item arb\_clk: use clock generated from sys\_clk using a DCM (rounded to nearest integer within range of DCM's abilities) |
− | \item aux\_clk (usr\_clk | + | \item aux\_clk (a.k.a. usr\_clk): use external clock input to board through SMA connector. PLL'd versions also available |
− | \item adcX\_clk: | + | \item adcX\_clk: use sample clock from attached ADC board. For some ADCs (iADC, KATADC), this is 1/4 of sampling rate. You need to use this option if you are using an ADC |
\end{itemize} | \end{itemize} | ||
\begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig5.png}\end{figure} | \begin{figure}[h!]\centering\includegraphics[scale=.5]{tut1_fig5.png}\end{figure} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
\subsection{Flashing LED} | \subsection{Flashing LED} | ||
− | To demonstrate the basic use of hardware interfaces, we will | + | To demonstrate the basic use of hardware interfaces, we will add a flashing LED. |
With the FPGA running at 100MHz, the most significant bit (msb) of a 27 bit | With the FPGA running at 100MHz, the most significant bit (msb) of a 27 bit | ||
counter will toggle every 0.745 seconds. We can output this bit to an LED on | counter will toggle every 0.745 seconds. We can output this bit to an LED on |