1 |
223 |
maximiq |
|
2 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
3 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
4 |
|
|
%NEW CHAPTER NEW CHAPTER NEW CHAPTER NEW CHAPTER NEW CHAPTER%
|
5 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
6 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
7 |
|
|
|
8 |
|
|
\chapter{Software}
|
9 |
|
|
|
10 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
11 |
|
|
%NEW SECTION NEW SECTION NEW SECTION NEW SECTION NEW SECTION%
|
12 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
13 |
|
|
|
14 |
|
|
Para transferir el diseño del usuario a la FPGA, PHR se sirve de las funciones de \emph{xc3sprog}\footnote{http://xc3sprog.sourceforge.net/}, un conjunto de aplicaciones de licencia libre que funciona en linea de comandos y que puede programar varios dispositivos mediante JTAG. Su nombre hace referencia a que inicialmente fue diseñado para la familia de FPGA Spartan-3 de Xilinx. Sin embargo se ha extendido el manejo a otros tipos de dispositivos que incluyen otras FPGAs, CPLDs, XCF flash PROMs, microprocesadores AVRs de Atmel y memorias flash SPI. Xc3sprog soporta varios cables JTAG, incluyendo cables de puerto paralelo y programadores USB.
|
15 |
|
|
|
16 |
|
|
No obstante su funcionalidad, xc3sprog puede resultar no intuitivo para el usuario principiante, por lo que se ofrece una interfaz gráfica para invocar a xc3sprog de una manera muy simple.
|
17 |
|
|
|
18 |
|
|
\section{PHR GUI}
|
19 |
|
|
|
20 |
|
|
La Fig. \ref{gui:interfaz} muestra la ventana de la aplicación a la que se denomina \emph{PHR GUI}. Actualmente se encuentra en su versión 0.1 y está disponible para los sistemas operativos GNU/Linux y Windows.
|
21 |
|
|
|
22 |
|
|
\begin{figure}[h!]
|
23 |
|
|
\begin{center}
|
24 |
|
|
\includegraphics[width=11cm]{./img/gui/phr-gui.png}
|
25 |
|
|
\end{center}
|
26 |
|
|
\caption[Interfaz gráfica de usuario]{Interfaz gráfica de usuario PHR GUI v0.1.}
|
27 |
|
|
\label{gui:interfaz}
|
28 |
|
|
\end{figure}
|
29 |
|
|
|
30 |
|
|
|
31 |
|
|
\subsection{Funciones básicas}
|
32 |
|
|
|
33 |
|
|
El software permite la realización de tres tareas básicas:
|
34 |
|
|
|
35 |
|
|
\begin{description}
|
36 |
|
|
\item[Comprobar conexión] Detecta los dispositivos en la cadena JTAG y los muestra. Cuando se conecta la PHR a través de OOCDLink el sofware lista a la FPGA y a la PROM:
|
37 |
|
|
|
38 |
|
|
\begin{lstlisting}
|
39 |
|
|
...
|
40 |
|
|
JTAG loc.: 0 IDCODE: 0x02218093 Desc: XC3S200A Rev: A IR length: 6
|
41 |
|
|
JTAG loc.: 1 IDCODE: 0xd5045093 Desc: XCF02S Rev: M IR length: 8
|
42 |
|
|
...
|
43 |
|
|
\end{lstlisting}
|
44 |
|
|
|
45 |
|
|
\item[Configurar la FPGA] Transfiere un diseño sintetizado en el formato BIT de Xilinx a la FPGA. Los datos son volátiles.
|
46 |
|
|
|
47 |
|
|
\begin{lstlisting}
|
48 |
|
|
...
|
49 |
|
|
Using built-in device list
|
50 |
|
|
Using built-in cable list
|
51 |
|
|
Cable ftdi type ftdi VID 0x0403 PID 0x6010 dbus data 00 enable 0b cbus data 00 data 00
|
52 |
|
|
Using FTD2XX, Using JTAG frequency 1200000
|
53 |
|
|
JTAG chainpos: 0 Device IDCODE = 0x02218093 Desc: XC3S200A
|
54 |
|
|
Created from NCD file: test1_top.ncd;UserID=0xFFFFFFFF
|
55 |
|
|
Target device: 3s200avq100
|
56 |
|
|
Created: 2014/03/19 18:31:15
|
57 |
|
|
Bitstream length: 1196128 bits
|
58 |
|
|
DNA is 0x95cde80efb9ba0fe
|
59 |
|
|
done. Programming time 1044.1 ms
|
60 |
|
|
USB transactions: Write 84 read 9 retries 0
|
61 |
|
|
\end{lstlisting}
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
\item[Programar la PROM] Transfiere un diseño sintetizado en el formato BIT de Xilinx a la PROM. Los datos se guardan incluso cuando el circuito es desconectado de la alimentación.
|
65 |
|
|
|
66 |
|
|
\begin{lstlisting}
|
67 |
|
|
...
|
68 |
|
|
JTAG chainpos: 1 Device IDCODE = 0xd5045093 Desc: XCF02S
|
69 |
|
|
Erasing......done
|
70 |
|
|
Erase time 3129.2 ms
|
71 |
|
|
Programming does not end at block boundary (nbits = 1196128), padding
|
72 |
|
|
|
73 |
|
|
Programming block 0/ 293 at XCF frame 0x0000.
|
74 |
|
|
...
|
75 |
|
|
Programming block 292/ 293 at XCF frame 0x2480.done
|
76 |
|
|
Programming time 2802.2 ms
|
77 |
|
|
|
78 |
|
|
Verify block 0/ 293 at XCF frame 0x0000
|
79 |
|
|
...
|
80 |
|
|
Verify block 278/ 293 at XCF frame 0x22c0
|
81 |
|
|
VerSuccess! Verify time 1893.1 ms
|
82 |
|
|
USB transactions: Write 1815 read 906 retries 0
|
83 |
|
|
|
84 |
|
|
\end{lstlisting}
|
85 |
|
|
|
86 |
|
|
\end{description}
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
\subsection{Obtención de PHR GUI}
|
90 |
|
|
|
91 |
|
|
El software PHR GUI se puede descargar de la sección de Descargas en sitio web del proyecto en OpenCores:
|
92 |
|
|
|
93 |
|
|
\texttt{http://opencores.org/project,phr,descargas}.
|
94 |
|
|
|
95 |
|
|
Asimismo se puede obtener la \emph{Guía de instalacion y uso} de la interfaz donde se explica mejor todo lo referente a la aplicación.
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
|