Commit 94d1363d authored by Denia Bouhired-Ferrag's avatar Denia Bouhired-Ferrag

Merge branch 'proposed-master'

parents 5988404a 475b9acc
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
\noindent \rule{\textwidth}{.1cm} \noindent \rule{\textwidth}{.1cm}
\hfill December 11, 2014 \hfill October 26, 2017
\vspace*{3cm} \vspace*{3cm}
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
%--------------------------------------------------------------- %---------------------------------------------------------------
% name % name
%--------------------------------------------------------------- %---------------------------------------------------------------
\noindent {\Large \textbf{Theodor-Adrian Stana (CERN/BE-CO-HT)}} \noindent {\Large \textbf{CERN/BE-CO-HT}}
\noindent \rule{\textwidth}{.05cm} \noindent \rule{\textwidth}{.05cm}
......
...@@ -73,6 +73,7 @@ work, see \\ ...@@ -73,6 +73,7 @@ work, see \\
11-12-2014 & 1.0 & Updated document according to converter board documentation template, added licensing 11-12-2014 & 1.0 & Updated document according to converter board documentation template, added licensing
information, updated information according to changes in HDL, added memory map information, updated information according to changes in HDL, added memory map
as appendix, removed redundant information \\ as appendix, removed redundant information \\
26-10-2017 & 1.1 & Added Test hwvertest and updated wishbone regsiter maps\\
\hline \hline
\end{tabular} \end{tabular}
} }
...@@ -183,6 +184,21 @@ for the gateware in Appendix~\ref{app:memmap}. ...@@ -183,6 +184,21 @@ for the gateware in Appendix~\ref{app:memmap}.
\section{Test logic} \section{Test logic}
\label{sec:test-logic} \label{sec:test-logic}
%--------------------------------------------------------------------------------------
% SUBSEC: Test 00
%--------------------------------------------------------------------------------------
\subsection{Test 00 -- PCB version test}
The PTS software verifies whether the version of the PCB is the one expected to
be tested with this PTS. Each PTS is prepared for a particular version of PCB
and it cannot be used to test other version of hardware.
The test reads the PCB version provided in an HWVERS register (see Annex~\ref{app:pts-regs-csr}).
If the provided version is different than the expected version, no further tests is
run and PTS is stopped.
\textbf{This test is required to pass for the PTS to run the remaining tests.}
%-------------------------------------------------------------------------------------- %--------------------------------------------------------------------------------------
% SUBSEC: Test 01 % SUBSEC: Test 01
%-------------------------------------------------------------------------------------- %--------------------------------------------------------------------------------------
......
\subsection{PTS control and status registers} \subsection{PTS control and status registers}
\label{app:pts-regs} \label{app:pts-regs-csr}
Base address: 0x000 \subsubsection{Memory map summary}
{ \rowcolors{2}{gray!25}{white}
\rowcolors{2}{white}{gray!25} \resizebox{\textwidth}{!}{
\begin{longtable}{l l l p{.5\textwidth}} \begin{tabular}{|l|l|l|l|l|}
\hline \rowcolor{gray}
\textbf{Offset} & \textbf{Reset} & \textbf{Name} \color{white} SW Offset & \color{white} Type & \color{white} Name &
& \textbf{Description} \\ \color{white} HW prefix & \color{white} C prefix\\
\hline 0x0& REG & BIDR & pts\_bidr & BIDR\\
\endfirsthead 0x4& REG & CSR & pts\_csr & CSR\\
\hline 0x8& REG & LSR & pts\_lsr & LSR\\
\hline
\endhead
\hline \hline
\endfoot \end{tabular}
0x0 & 0x54424c4f & BIDR & Board ID Register\\
0x4 & (1) & CSR & Control and Status Register\\
0x8 & (2) & LSR & Line Status Register\\
\end{longtable}
} }
\noindent Note (1): The reset value of the status bits in the CSR cannot be specified, since it is based on the \subsubsection{Register description}
the state of the on-board switches and whether an RTM is plugged in or not. Control bits in the CSR default to 0. \paragraph*{BIDR}\vspace{12pt}
\noindent Note (2): The reset value of the LSR cannot be specified, since it depends on whether a cable \rowcolors{1}{white}{white}
is plugged into the channel or not. \begin{tabular}{l l }
{\bf HW prefix:} & pts\_bidr\\
{\bf HW address:} & 0x0\\
{\bf SW prefix:} & BIDR\\
{\bf SW offset:} & 0x0\\
\end{tabular}
\subsubsection{BIDR -- Board ID Register} \vspace{12pt}
\label{app:pts-regs-bidr} Board ID Register
\vspace{11pt} \vspace{12pt}
\noindent \noindent
\resizebox{\textwidth}{!}{ \resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} } \begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
...@@ -58,18 +57,22 @@ is plugged into the channel or not. ...@@ -58,18 +57,22 @@ is plugged into the channel or not.
{\bf {\bf
BIDR BIDR
} [\emph{read-only}]: ID register bits } [\emph{read-only}]: ID register bits
\\
Reset value: 0x54424c4f
\end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small} \end{small}
\end{itemize} \end{itemize}
\paragraph*{CSR}\vspace{12pt}
\subsubsection{CSR -- Control and Status Register} \rowcolors{1}{white}{white}
\label{app:pts-regs-csr} \begin{tabular}{l l }
{\bf HW prefix:} & pts\_csr\\
{\bf HW address:} & 0x1\\
{\bf SW prefix:} & CSR\\
{\bf SW offset:} & 0x4\\
\end{tabular}
\vspace{11pt} \vspace{12pt}
Control and Status Register
\vspace{12pt}
\noindent \noindent
\resizebox{\textwidth}{!}{ \resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} } \begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
...@@ -83,7 +86,7 @@ Reset value: 0x54424c4f ...@@ -83,7 +86,7 @@ Reset value: 0x54424c4f
\hline \hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\ 15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline \hline
\multicolumn{1}{|c|}{\cellcolor{gray!25}RST} & \multicolumn{1}{|c|}{\cellcolor{gray!25}RST\_UNLOCK} & - & - & - & - & - & \multicolumn{1}{c|}{-}\\ \multicolumn{1}{|c|}{\cellcolor{gray!25}RST} & \multicolumn{1}{|c|}{\cellcolor{gray!25}RST\_UNLOCK} & \multicolumn{6}{|c|}{\cellcolor{gray!25}HWVERS[5:0]}\\
\hline \hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\ 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline \hline
...@@ -130,6 +133,13 @@ REARPT ...@@ -130,6 +133,13 @@ REARPT
\end{small} \end{small}
\item \begin{small} \item \begin{small}
{\bf {\bf
HWVERS
} [\emph{read-only}]: PCB version number
\\
6 bits representing HW/PCB version number \\ 4 MSB represent HW version number \\ 2 LSB represent number of execution \\ Eg: value 010010 represents PCB version 4.2
\end{small}
\item \begin{small}
{\bf
RST\_UNLOCK RST\_UNLOCK
} [\emph{read/write}]: Reset unlock bit } [\emph{read/write}]: Reset unlock bit
\\ \\
...@@ -170,15 +180,21 @@ I2C\_WDTO ...@@ -170,15 +180,21 @@ I2C\_WDTO
\\ \\
1 -- timeout occured \\ 0 -- no timeout \\ This bit can be cleared by writing a '1' to it 1 -- timeout occured \\ 0 -- no timeout \\ This bit can be cleared by writing a '1' to it
\end{small} \end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize} \end{itemize}
\vspace{11pt} \paragraph*{LSR}\vspace{12pt}
\subsubsection{LSR -- Line Status Register}
\label{app:pts-regs-lsr} \rowcolors{1}{white}{white}
\begin{tabular}{l l }
{\bf HW prefix:} & pts\_lsr\\
{\bf HW address:} & 0x2\\
{\bf SW prefix:} & LSR\\
{\bf SW offset:} & 0x8\\
\end{tabular}
\vspace{11pt} \vspace{12pt}
Line Status Register
\vspace{12pt}
\noindent \noindent
\resizebox{\textwidth}{!}{ \resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} } \begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
...@@ -223,9 +239,6 @@ REAR ...@@ -223,9 +239,6 @@ REAR
\\ \\
Line state at board input\\ Bit 0 -- channel 1\\ Bit 1 -- channel 2\\ etc. Line state at board input\\ Bit 0 -- channel 1\\ Bit 1 -- channel 2\\ etc.
\end{small} \end{small}
\item \begin{small}
\textbf{Unimplemented bits}: write as '0', read undefined
\end{small}
\end{itemize} \end{itemize}
......
This diff is collapsed.
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
\noindent \rule{\textwidth}{.1cm} \noindent \rule{\textwidth}{.1cm}
\hfill January 15, 2015 \hfill July 13, 2018
\vspace*{3cm} \vspace*{3cm}
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
%--------------------------------------------------------------- %---------------------------------------------------------------
% name % name
%--------------------------------------------------------------- %---------------------------------------------------------------
\noindent {\Large \textbf{Theodor-Adrian Stana (CERN/BE-CO-HT)}} \noindent {\Large \textbf{CERN/BE-CO-HT}}
\noindent \rule{\textwidth}{.05cm} \noindent \rule{\textwidth}{.05cm}
......
...@@ -119,7 +119,7 @@ focuses on installing the test system (scripts, preparing shortcuts, etc.) on th ...@@ -119,7 +119,7 @@ focuses on installing the test system (scripts, preparing shortcuts, etc.) on th
\label{sec:rack} \label{sec:rack}
To setup the rack for the PTS system, we will need to insert an RTM Interface Tester To setup the rack for the PTS system, we will need to insert an RTM Interface Tester
card to the back side of the ELMA crate placed inside the 19'' rack. You will need card into the back of the ELMA crate placed inside the 19'' rack. You will need
an RTM Interface Tester card to set up the system, so this would be a good time to an RTM Interface Tester card to set up the system, so this would be a good time to
obtain one. obtain one.
...@@ -151,6 +151,9 @@ system to gain remote access to the laptop, the installation of the system can a ...@@ -151,6 +151,9 @@ system to gain remote access to the laptop, the installation of the system can a
on the laptop directly. However, the steps related to network drivers and configuration on the laptop directly. However, the steps related to network drivers and configuration
should be followed in order to have a properly working PTS system. should be followed in order to have a properly working PTS system.
Also note that the admin account should be named \verb=pts-administrator=. This account
name is important as it is embedded in the PTS scripts (Password \verb=pts-admin=).
The guide should be followed until \textbf{step 17} of section \textbf{Set up the PTS user account}. The guide should be followed until \textbf{step 17} of section \textbf{Set up the PTS user account}.
After this step, the guide is SVEC-related and need not be followed. We will continue with After this step, the guide is SVEC-related and need not be followed. We will continue with
the details in the next section to test our system and network was properly installed. the details in the next section to test our system and network was properly installed.
...@@ -171,7 +174,8 @@ the details in the next section to test our system and network was properly inst ...@@ -171,7 +174,8 @@ the details in the next section to test our system and network was properly inst
Escape character is '^]'. Escape character is '^]'.
login:admin login:admin
password: ADMIN password: ADMIN
%> %>
$
\end{verbatim} \end{verbatim}
\vspace{11pt} \vspace{11pt}
\item Make sure the ELMA crate has gateware version 2.31 or higher on it. In the SysMon Telnet prompt: \item Make sure the ELMA crate has gateware version 2.31 or higher on it. In the SysMon Telnet prompt:
...@@ -220,12 +224,12 @@ We will detail here the simplest of the two, downloading the ready-made archive. ...@@ -220,12 +224,12 @@ We will detail here the simplest of the two, downloading the ready-made archive.
See Appendix~\ref{app:build} for details on the second. See Appendix~\ref{app:build} for details on the second.
\begin{enumerate} \begin{enumerate}
\item Log in to the \verb=pts= user on the laptop \item Log in to the \verb=pts-administrator= user on the laptop
\item Open up a terminal window, download the PTS folder structure tarball from OHWR \item Open up a terminal window, download the PTS folder structure tarball from OHWR
to the home folder of the \verb=pts= user and extract the archive: to the home folder of the \verb=pts= user and extract the archive:
\begin{verbatim} \begin{verbatim}
cd ~ cd ~
wget http://www.ohwr.org/attachments/download/3777/ubuntu.tar.gz wget https://www.ohwr.org/attachments/5822/ubuntu.tar.gz
tar xzvf ubuntu.tar.gz tar xzvf ubuntu.tar.gz
\end{verbatim} \end{verbatim}
Note that you can also copy the archive from a USB stick instead of downloading it from OHWR. Note that you can also copy the archive from a USB stick instead of downloading it from OHWR.
...@@ -259,7 +263,7 @@ See Appendix~\ref{app:build} for details on the second. ...@@ -259,7 +263,7 @@ See Appendix~\ref{app:build} for details on the second.
\begin{verbatim} \begin{verbatim}
chmod a+w * chmod a+w *
\end{verbatim} \end{verbatim}
\item Now we that have the test scripts on the system we can create a dedicated \item Now that we have the test scripts on the system we can create a dedicated
user that will be used to run the PTS for the CONV-TTL-BLO. Open up Ubuntu's user that will be used to run the PTS for the CONV-TTL-BLO. Open up Ubuntu's
\textbf{User Accounts} window (click the \verb=pts= user account name at the top-right \textbf{User Accounts} window (click the \verb=pts= user account name at the top-right
side of the screen), unlock this window by providing the \verb=pts= user account's side of the screen), unlock this window by providing the \verb=pts= user account's
...@@ -286,9 +290,9 @@ See Appendix~\ref{app:build} for details on the second. ...@@ -286,9 +290,9 @@ See Appendix~\ref{app:build} for details on the second.
\begin{verbatim} \begin{verbatim}
cd ~ cd ~
cp .bashrc .bashrc.old cp .bashrc .bashrc.old
cp /home/pts/ubuntu/ttlbl/config/bashrc.pts .bashrc cp /home/pts-administrator/ubuntu/ttlbl/config/bashrc.pts .bashrc
cd ~/Desktop/ cd ~/Desktop/
cp /home/pts/ubuntu/ttlbl/config/*.desktop . cp /home/pts-administrator/ubuntu/ttlbl/config/*.desktop .
\end{verbatim} \end{verbatim}
\item Right-click on the terminal icon in the launcher bar at the left and click \textbf{Lock to Launcher} \item Right-click on the terminal icon in the launcher bar at the left and click \textbf{Lock to Launcher}
\item Close the terminal window \item Close the terminal window
...@@ -298,7 +302,7 @@ See Appendix~\ref{app:build} for details on the second. ...@@ -298,7 +302,7 @@ See Appendix~\ref{app:build} for details on the second.
\begin{itemize} \begin{itemize}
\item on the Desktop, right-click and select \textbf{Change Desktop Background} \item on the Desktop, right-click and select \textbf{Change Desktop Background}
\item hit the \textbf{+} under Wallpapers \item hit the \textbf{+} under Wallpapers
\item navigate to \verb=/home/pts/ubuntu/ttlbl/config/= \item navigate to \verb=/home/pts-administrator/ubuntu/ttlbl/config/=
\item select \verb=ttlbl-background.png= as the background image \item select \verb=ttlbl-background.png= as the background image
\item make sure the scaling of the image is set to \textbf{Zoom} \item make sure the scaling of the image is set to \textbf{Zoom}
\end{itemize} \end{itemize}
...@@ -355,12 +359,16 @@ In order to build a test system from scratch, follow these steps: ...@@ -355,12 +359,16 @@ In order to build a test system from scratch, follow these steps:
git clone git://ohwr.org/level-conversion/conv-ttl-blo/conv-ttl-blo-tst.git git clone git://ohwr.org/level-conversion/conv-ttl-blo/conv-ttl-blo-tst.git
\end{verbatim} \end{verbatim}
\end{small} \end{small}
\item Run \verb=make= in the \verb=pts-fm/= folder, setting the options as appropriate \item Run \verb=make= in the \verb=fm/pts/= folder, setting the options as appropriate
in your case: in your case:
\begin{verbatim} \begin{verbatim}
cd conv-ttl-blo-tst/fm/ cd conv-ttl-blo-tst/fm/pts
make # ... set options here ... make # ... set options here ...
\end{verbatim} \end{verbatim}
\item Copy the entire \verb=./ubuntu= folder to the \verb=pts-administrator= home directory. Type:
\begin{verbatim}
cp -r ./ubuntu /home/pts-administrator/
\end{verbatim}
\end{enumerate} \end{enumerate}
This will generate an archive similar to that downloaded in Section~\ref{sec:environment}, This will generate an archive similar to that downloaded in Section~\ref{sec:environment},
......
This diff is collapsed.
\subsection{PTS control and status registers}
\label{subsec:wbgen:pts}
\subsubsection{Memory map summary}
\rowcolors{2}{gray!25}{white}
\resizebox{\textwidth}{!}{
\begin{tabular}{|l|l|l|l|l|}
\rowcolor{RoyalPurple}
\color{white} SW Offset & \color{white} Type & \color{white} Name &
\color{white} HW prefix & \color{white} C prefix\\
0x0& REG & BIDR & pts\_bidr & BIDR\\
0x4& REG & CSR & pts\_csr & CSR\\
0x8& REG & LSR & pts\_lsr & LSR\\
\hline
\end{tabular}
}
\subsubsection{Register description}
\paragraph*{BIDR}\vspace{12pt}
\rowcolors{1}{white}{white}
\begin{tabular}{l l }
{\bf HW prefix:} & pts\_bidr\\
{\bf HW address:} & 0x0\\
{\bf SW prefix:} & BIDR\\
{\bf SW offset:} & 0x0\\
\end{tabular}
\vspace{12pt}
Board ID Register
\vspace{12pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{8}{|c|}{\cellcolor{RoyalPurple!25}BIDR[31:24]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{RoyalPurple!25}BIDR[23:16]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{8}{|c|}{\cellcolor{RoyalPurple!25}BIDR[15:8]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{8}{|c|}{\cellcolor{RoyalPurple!25}BIDR[7:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
{\bf
BIDR
} [\emph{read-only}]: ID register bits
\end{small}
\end{itemize}
\paragraph*{CSR}\vspace{12pt}
\rowcolors{1}{white}{white}
\begin{tabular}{l l }
{\bf HW prefix:} & pts\_csr\\
{\bf HW address:} & 0x1\\
{\bf SW prefix:} & CSR\\
{\bf SW offset:} & 0x4\\
\end{tabular}
\vspace{12pt}
Control and Status Register
\vspace{12pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{1}{|c|}{\cellcolor{RoyalPurple!25}I2C\_WDTO} & \multicolumn{1}{|c|}{\cellcolor{RoyalPurple!25}I2C\_ERR} & \multicolumn{6}{|c|}{\cellcolor{RoyalPurple!25}RTM[5:0]}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{8}{|c|}{\cellcolor{RoyalPurple!25}SWITCH[7:0]}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{1}{|c|}{\cellcolor{RoyalPurple!25}RST} & \multicolumn{1}{|c|}{\cellcolor{RoyalPurple!25}RST\_UNLOCK} & \multicolumn{6}{|c|}{\cellcolor{RoyalPurple!25}HWVERS[5:0]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{1}{|c}{-} & - & - & \multicolumn{1}{|c|}{\cellcolor{RoyalPurple!25}REARPT} & \multicolumn{1}{|c|}{\cellcolor{RoyalPurple!25}TTLPT} & \multicolumn{1}{|c|}{\cellcolor{RoyalPurple!25}RLEDT} & \multicolumn{1}{|c|}{\cellcolor{RoyalPurple!25}STLEDT} & \multicolumn{1}{|c|}{\cellcolor{RoyalPurple!25}CHLEDT}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
{\bf
CHLEDT
} [\emph{read/write}]: Channel pulse LED enable
\\
1 -- Enable channel LED sequencing \\ 0 -- No effect
\end{small}
\item \begin{small}
{\bf
STLEDT
} [\emph{read/write}]: Status LED enable
\\
1 -- Enable front panel bicolor LED sequencing \\ 0 -- No effect
\end{small}
\item \begin{small}
{\bf
RLEDT
} [\emph{read/write}]: Rear pulse LED line
\\
1 -- Set LED lines high \\ 0 -- No effect
\end{small}
\item \begin{small}
{\bf
TTLPT
} [\emph{read/write}]: TTL test enable
\\
1 -- Enable pulse generation from CH1 \\ 0 -- No effect
\end{small}
\item \begin{small}
{\bf
REARPT
} [\emph{read/write}]: Rear pulse enable
\\
1 -- Enable rear panel pulse generation \\ 0 -- No effect
\end{small}
\item \begin{small}
{\bf
HWVERS
} [\emph{read-only}]: PCB version number
\\
6 bits representing HW/PCB version number \\ 4 MSB represent HW version number \\ 2 LSB represent number of execution \\ Eg: value 010010 represents PCB version 4.2
\end{small}
\item \begin{small}
{\bf
RST\_UNLOCK
} [\emph{read/write}]: Reset unlock bit
\\
1 -- Reset bit unlocked \\ 0 -- Reset bit locked
\end{small}
\item \begin{small}
{\bf
RST
} [\emph{read/write}]: Reset bit -- active only if RST_UNLOCK is 1
\\
1 -- initiate logic reset \\ 0 -- no reset
\end{small}
\item \begin{small}
{\bf
SWITCH
} [\emph{read-only}]: switches
\\
1 - switch is ON \\ 0 - switch is OFF
\end{small}
\item \begin{small}
{\bf
RTM
} [\emph{read-only}]: RTM detection lines
\\
1 - line active \\ 0 - line inactive
\end{small}
\item \begin{small}
{\bf
I2C\_ERR
} [\emph{read/write}]: I2C communication error
\\
1 -- attempted to address non-existing address \\ 0 -- idle \\ This bit can be cleared by writing a '1' to it
\end{small}
\item \begin{small}
{\bf
I2C\_WDTO
} [\emph{read/write}]: I2C communication watchdog timeout error
\\
1 -- timeout occured \\ 0 -- no timeout \\ This bit can be cleared by writing a '1' to it
\end{small}
\end{itemize}
\paragraph*{LSR}\vspace{12pt}
\rowcolors{1}{white}{white}
\begin{tabular}{l l }
{\bf HW prefix:} & pts\_lsr\\
{\bf HW address:} & 0x2\\
{\bf SW prefix:} & LSR\\
{\bf SW offset:} & 0x8\\
\end{tabular}
\vspace{12pt}
Line Status Register
\vspace{12pt}
\noindent
\resizebox{\textwidth}{!}{
\begin{tabular}{>{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} >{\centering\arraybackslash}p{1.5cm} }
31 & 30 & 29 & 28 & 27 & 26 & 25 & 24\\
\hline
\multicolumn{1}{|c}{-} & - & - & - & - & - & - & \multicolumn{1}{c|}{-}\\
\hline
23 & 22 & 21 & 20 & 19 & 18 & 17 & 16\\
\hline
\multicolumn{1}{|c}{-} & - & - & - & - & - & - & \multicolumn{1}{c|}{-}\\
\hline
15 & 14 & 13 & 12 & 11 & 10 & 9 & 8\\
\hline
\multicolumn{6}{|c|}{\cellcolor{RoyalPurple!25}REAR[5:0]} & \multicolumn{2}{|c|}{\cellcolor{RoyalPurple!25}FRONTINV[3:2]}\\
\hline
7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
\hline
\multicolumn{2}{|c|}{\cellcolor{RoyalPurple!25}FRONTINV[1:0]} & \multicolumn{6}{|c|}{\cellcolor{RoyalPurple!25}FRONT[5:0]}\\
\hline
\end{tabular}
}
\begin{itemize}
\item \begin{small}
{\bf
FRONT
} [\emph{read-only}]: Front panel channel input state
\\
Line state at board input\\ Bit 0 -- channel 1\\ Bit 1 -- channel 2\\ etc.
\end{small}
\item \begin{small}
{\bf
FRONTINV
} [\emph{read-only}]: Front panel INV-TTL input state
\\
Line state at board input\\ Bit 0 -- channel 1\\ Bit 1 -- channel 2\\ etc.
\end{small}
\item \begin{small}
{\bf
REAR
} [\emph{read-only}]: Rear panel input state
\\
Line state at board input\\ Bit 0 -- channel 1\\ Bit 1 -- channel 2\\ etc.
\end{small}
\end{itemize}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
-- File : .\pts_regs.vhd -- File : .\pts_regs.vhd
-- Author : auto-generated by wbgen2 from .\pts_regs.wb -- Author : auto-generated by wbgen2 from .\pts_regs.wb
-- Created : 06/19/17 17:23:25 -- Created : 10/27/17 10:49:32
-- Standard : VHDL'87 -- Standard : VHDL'87
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
-- THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE .\pts_regs.wb -- THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE .\pts_regs.wb
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<property xil_pn:name="Change Device Speed To" xil_pn:value="-3" xil_pn:valueState="default"/> <property xil_pn:name="Change Device Speed To" xil_pn:value="-3" xil_pn:valueState="default"/>
<property xil_pn:name="Change Device Speed To Post Trace" xil_pn:value="-3" xil_pn:valueState="default"/> <property xil_pn:name="Change Device Speed To Post Trace" xil_pn:value="-3" xil_pn:valueState="default"/>
<property xil_pn:name="Combinatorial Logic Optimization" xil_pn:value="false" xil_pn:valueState="default"/> <property xil_pn:name="Combinatorial Logic Optimization" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Compile EDK Simulation Library" xil_pn:value="false" xil_pn:valueState="non-default"/> <property xil_pn:name="Compile EDK Simulation Library" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Compile SIMPRIM (Timing) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/> <property xil_pn:name="Compile SIMPRIM (Timing) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Compile UNISIM (Functional) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/> <property xil_pn:name="Compile UNISIM (Functional) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Compile XilinxCoreLib (CORE Generator) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/> <property xil_pn:name="Compile XilinxCoreLib (CORE Generator) Simulation Library" xil_pn:value="true" xil_pn:valueState="default"/>
......
...@@ -154,10 +154,9 @@ entity pts is ...@@ -154,10 +154,9 @@ entity pts is
-- Switches -- Switches
sw_gp_n_i : in std_logic_vector(7 downto 0); sw_gp_n_i : in std_logic_vector(7 downto 0);
sw_multicast_n_i : in std_logic_vector(3 downto 0); sw_multicast_n_i : in std_logic_vector(3 downto 0);
-- PCB version recognition -- PCB version recognition
pcbrev_i : in std_logic_vector(5 downto 0); pcbrev_i : in std_logic_vector(5 downto 0);
-- RTM lines -- RTM lines
rtmm_i : in std_logic_vector(2 downto 0); rtmm_i : in std_logic_vector(2 downto 0);
...@@ -1900,9 +1899,11 @@ end generate gen_rear_test_logic; ...@@ -1900,9 +1899,11 @@ end generate gen_rear_test_logic;
end if; end if;
end if; end if;
end process p_led_seq; end process p_led_seq;
max_led_seq <= to_unsigned(30,5) when pulse_led_en = '1' else to_unsigned(24,5); -- cycle 24 times for status leds -- cycle 24 times for status leds
-- 30 times for pulse leds -- 30 times for pulse leds
max_led_seq <= to_unsigned(30,5) when pulse_led_en = '1' else to_unsigned(24,5);
-- Sequence the front-panel LEDs based on the sequence counter -- Sequence the front-panel LEDs based on the sequence counter
front_led_seq <= "0000000001" when (pulse_led_en = '1') and (led_seq = 1) else front_led_seq <= "0000000001" when (pulse_led_en = '1') and (led_seq = 1) else
"0000000010" when (pulse_led_en = '1') and (led_seq = 2) else "0000000010" when (pulse_led_en = '1') and (led_seq = 2) else
......
...@@ -20,6 +20,7 @@ all: ...@@ -20,6 +20,7 @@ all:
cp ubuntu/$(BOARD)/pyts/pts.py ubuntu/$(BOARD)/pts cp ubuntu/$(BOARD)/pyts/pts.py ubuntu/$(BOARD)/pts
cp ubuntu/$(BOARD)/pyts/jpts.py ubuntu/$(BOARD)/jpts cp ubuntu/$(BOARD)/pyts/jpts.py ubuntu/$(BOARD)/jpts
cp ubuntu/$(BOARD)/pyts/one.py ubuntu/$(BOARD)/one cp ubuntu/$(BOARD)/pyts/one.py ubuntu/$(BOARD)/one
ln -s pyts/hwvertest.py ubuntu/$(BOARD)/hwvertest.py
ln -s pyts/dac_vcxo_pll.py ubuntu/$(BOARD)/test01.py ln -s pyts/dac_vcxo_pll.py ubuntu/$(BOARD)/test01.py
ln -s pyts/leds.py ubuntu/$(BOARD)/test02.py ln -s pyts/leds.py ubuntu/$(BOARD)/test02.py
ln -s pyts/ttl_pulse_switch.py ubuntu/$(BOARD)/test03.py ln -s pyts/ttl_pulse_switch.py ubuntu/$(BOARD)/test03.py
...@@ -32,9 +33,9 @@ all: ...@@ -32,9 +33,9 @@ all:
mkdir -p ubuntu/$(BOARD)/boot mkdir -p ubuntu/$(BOARD)/boot
mv ubuntu/$(BOARD)/shell/program ubuntu/$(BOARD)/boot mv ubuntu/$(BOARD)/shell/program ubuntu/$(BOARD)/boot
mv ubuntu/$(BOARD)/shell/flash ubuntu/$(BOARD)/boot mv ubuntu/$(BOARD)/shell/flash ubuntu/$(BOARD)/boot
wget -P ubuntu/$(BOARD)/boot http://www.ohwr.org/attachments/download/3696/pts.bit wget -P ubuntu/$(BOARD)/boot http://www.ohwr.org/attachments/5468/pts-v4.bit
wget -P ubuntu/$(BOARD)/boot http://www.ohwr.org/attachments/download/3710/flash_load.bit wget -P ubuntu/$(BOARD)/boot http://www.ohwr.org/attachments/download/3710/flash_load.bit
wget -P ubuntu/$(BOARD)/boot http://www.ohwr.org/attachments/download/3515/golden-v0.2_release-v3.0.bin wget -P ubuntu/$(BOARD)/boot http://www.ohwr.org/attachments/5788/golden-v0.3_release-v4.1.bin
chmod a+x ubuntu/$(BOARD)/shell/* chmod a+x ubuntu/$(BOARD)/shell/*
chmod a+x ubuntu/$(BOARD)/boot/* chmod a+x ubuntu/$(BOARD)/boot/*
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Version=1.0 Version=1.0
Name=Copy Log to USB Name=Copy Log to USB
Comment=Copy log and info files to USB key Comment=Copy log and info files to USB key
Exec=gnome-terminal --title "Copy to USB Key" -e "bash -c 'cp /home/pts/ubuntu/ttlbl/log/ttlbl* /media/pts/log'" Exec=gnome-terminal --title "Copy to USB Key" -e "bash -c 'cp /home/pts-administrator/ubuntu/ttlbl/log/ttlbl* /media/pts-administrator/log'"
Icon=/usr/share/icons/Humanity/apps/48/gnome-session-switch.svg Icon=/usr/share/icons/Humanity/apps/48/gnome-session-switch.svg
Terminal=false Terminal=false
Type=Application Type=Application
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Version=1.0 Version=1.0
Name=VME OFF Name=VME OFF
Comment=Switch off crate Comment=Switch off crate
Exec=/home/pts/ubuntu/ttlbl/shell/men-off Exec=/home/pts-administrator/ubuntu/ttlbl/shell/men-off
Icon=/usr/share/icons/LoginIcons/apps/48/system-shutdown.svg Icon=/usr/share/icons/LoginIcons/apps/48/system-shutdown.svg
Terminal=true Terminal=true
Type=Application Type=Application
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Version=1.0 Version=1.0
Name=VME ON Name=VME ON
Comment=Switch on crate Comment=Switch on crate
Exec=/home/pts/ubuntu/ttlbl/shell/men-on Exec=/home/pts-administrator/ubuntu/ttlbl/shell/men-on
Icon=/usr/share/icons/LoginIcons/apps/48/view-refresh.svg Icon=/usr/share/icons/LoginIcons/apps/48/view-refresh.svg
Terminal=true Terminal=true
Type=Application Type=Application
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
Version=1.0 Version=1.0
Name=Run One PTS CONV-TTL-BLO Test Name=Run One PTS CONV-TTL-BLO Test
Comment=Automated testing for the CONV-TTL-BLO board Comment=Automated testing for the CONV-TTL-BLO board
Exec=gnome-terminal --geometry 81x32+0+0 --title "PTS Run One Window" -e "bash -c 'cd /home/pts/ubuntu/ttlbl/;./one'" Exec=gnome-terminal --geometry 81x32+0+0 --title "PTS Run One Window" -e "bash -c 'cd /home/pts-administrator/ubuntu/ttlbl/;./one'"
Icon=/home/pts/ubuntu/ttlbl/config/pts-ico-2.png Icon=/home/pts-administrator/ubuntu/ttlbl/config/pts-ico-2.png
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Utility;Application; Categories=Utility;Application;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Version=1.0 Version=1.0
Name=Make log.tar.gz USB zip Name=Make log.tar.gz USB zip
Comment=Make tarball from log data on USB key Comment=Make tarball from log data on USB key
Exec=/home/pts/ubuntu/ttlbl/shell/tar-log Exec=/home/pts-administrator/ubuntu/ttlbl/shell/tar-log
Icon=/usr/share/icons/Humanity/devices/48/gnome-dev-zipdisk.svg Icon=/usr/share/icons/Humanity/devices/48/gnome-dev-zipdisk.svg
Terminal=true Terminal=true
Type=Application Type=Application
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Version=1.0 Version=1.0
Name=PTS Expert Tools Name=PTS Expert Tools
Comment=PTS Utilities Comment=PTS Utilities
Exec=/usr/bin/nautilus /home/pts/ubuntu/ttlbl/config/ExpertTools/ Exec=/usr/bin/nautilus /home/pts-administrator/ubuntu/ttlbl/config/ExpertTools/
Icon=/usr/share/icons/Humanity/apps/48/gconf-editor.svg Icon=/usr/share/icons/Humanity/apps/48/gconf-editor.svg
Terminal=false Terminal=false
Type=Application Type=Application
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
Version=1.0 Version=1.0
Name=Run PTS CONV-TTL-BLO Name=Run PTS CONV-TTL-BLO
Comment=Automated testing for the CONV-TTL-BLO board Comment=Automated testing for the CONV-TTL-BLO board
Exec=gnome-terminal --geometry 81x32+0+0 --title "PTS Main Window" -e "bash -c 'cd /home/pts/ubuntu/ttlbl/; ./pts'" Exec=gnome-terminal --geometry 81x32+0+0 --title "PTS Main Window" -e "bash -c 'cd /home/pts-administrator/ubuntu/ttlbl/; ./pts'"
Icon=/home/pts/ubuntu/ttlbl/config/pts-ico-2.png Icon=/home/pts-administrator/ubuntu/ttlbl/config/pts-ico-2.png
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Utility;Application; Categories=Utility;Application;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Version=1.0 Version=1.0
Name=Show PTS Info Name=Show PTS Info
Comment=Show PTS info Comment=Show PTS info
Exec=bash -c "cd /home/pts/ubuntu/ttlbl/shell/; ./show-info" Exec=bash -c "cd /home/pts-administrator/ubuntu/ttlbl/shell/; ./show-info"
Icon=/usr/share/icons/Humanity/apps/48/xfce-system-info.svg Icon=/usr/share/icons/Humanity/apps/48/xfce-system-info.svg
Terminal=false Terminal=false
Type=Application Type=Application
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Version=1.0 Version=1.0
Name=Show PTS Log Name=Show PTS Log
Comment=Show PTS log Comment=Show PTS log
Exec=bash -c "cd /home/pts/ubuntu/ttlbl/shell/; ./show-log" Exec=bash -c "cd /home/pts-administrator/ubuntu/ttlbl/shell/; ./show-log"
Icon=/usr/share/icons/Humanity/apps/48/xfce-man.svg Icon=/usr/share/icons/Humanity/apps/48/xfce-man.svg
Terminal=false Terminal=false
Type=Application Type=Application
......
...@@ -66,11 +66,11 @@ def main(bus,tname,inf,log): ...@@ -66,11 +66,11 @@ def main(bus,tname,inf,log):
""" """
tests : Flash chip IC20 tests : Flash chip IC20
uses : golden-v0.2_release-v3.0.bin and flashtest.py uses : golden-v0.3_release-v4.1.bin and flashtest.py
""" """
GWVERS_RELEASE = 3.0 GWVERS_RELEASE = 4.1
GWVERS_GOLDEN = 0.2 GWVERS_GOLDEN = 0.3
# Set the precision of gateware versions based on the number of digits the # Set the precision of gateware versions based on the number of digits the
# fractional part thereof has; this is done to avoid exceptions in the # fractional part thereof has; this is done to avoid exceptions in the
......
##_______________________________________________________________________________________________
##
## CONV-TTL-BLO PTS
##
## CERN,BE/CO-HT
##_______________________________________________________________________________________________
##
##-----------------------------------------------------------------------------------------------
##
## CONV-TTL-BLO pcb version
##
##-----------------------------------------------------------------------------------------------
##
## Description Test whether the version of PCB is the expected one
##
##
## Authors Maciej Lipinski (maciej.lipinski@cern.ch)
## Website http://www.ohwr.org/projects/pts
## Date 17/08/2017
##-----------------------------------------------------------------------------------------------
##
##------------------------------------------------------------------------------------------------
## GNU LESSER GENERAL PUBLIC LICENSE
## ------------------------------------
## This source file is free software; you can redistribute it and/or modify it under the terms of
## the GNU Lesser General Public License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
## This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
## without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## See the GNU Lesser General Public License for more details.
## You should have received a copy of the GNU Lesser General Public License along with this
## source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
##-------------------------------------------------------------------------------------------------
##-------------------------------------------------------------------------------------------------
## Import
##-------------------------------------------------------------------------------------------------
# Import system modules
import sys
sys.path.append("log/")
import time
import os, errno, re, sys, struct
import os.path
import traceback
import glob
import binascii
# Import common modules
from ctypes import *
from ptsexcept import *
from vv_pts import *
from ptsdefine import *
##-------------------------------------------------------------------------------------------------
## main --
##-------------------------------------------------------------------------------------------------
def main(bus,tname,inf,log):
"""
tests : Hardware version
uses : pts.bit and hwvertest.py
"""
HWVERS = 4.1
pel = PTS_ERROR_LOGGER(inf,log)
try:
# Read PCB version: a 6 bits representing HW/PCB version number
# 4 MSB represent HW version number (major)
# 2 LSB represent number of execution (minor)
# Eg: value 010010 represents PCB version 4.2
hwvers = (bus.vv_read(CSR) & 0x3F00) >> CSR_HWVERS_OFS
maj = int(hwvers >> 2)
min = float(hwvers & 0x03)
min /= 10
hwvers = maj + min
# and now check if appropriate
if (hwvers == HWVERS):
msg = "HW/PCB version correct: %2.1f\n" % (hwvers)
inf.write(msg)
else:
msg = "ERROR: HW/PCBe version (%2.1f) incorrect - expected %2.1f" % (hwvers, HWVERS)
pel.set(msg)
print "-->%s" % msg
return pel.get()
except BusException, e:
raise PtsError("SKT Exception: %s" % (e))
except BusWarning, e:
raise PtsError("SKT Warning: %s" % (e))
...@@ -193,65 +193,99 @@ if __name__ == '__main__': ...@@ -193,65 +193,99 @@ if __name__ == '__main__':
except BusWarning, e: except BusWarning, e:
print "Warning:Bus Exception: %s" % (e) print "Warning:Bus Exception: %s" % (e)
# Start running the tests. # Test version of HW/PCB before running any other tests
for t in tns: tname = "hwvertest"
try:
# First load a firmware and read back a register to confirm correct load.
if bus.vv_load() == 0:
msg = "INFO: Found CONV-TTL-BLO board in slot %d\n" % (lun)
inf.write(msg + '\n')
# The test is passed the test name, the log and info files and the
# bus object. The test program returns the number of errors that
# occured. If no errors occur, the test PASSes, otherwise it FAILs.
cc = run_test(tname,bus,inf,log)
if cc == 0:
msg = "PASS: %s" % (tname)
log.write(msg + '\n')
inf.write(msg + '\n')
print msg
else:
msg = "FAIL: %s->%s" % (tname, lnk_ptr(tname))
log.write(msg + '\n')
inf.write(msg + '\n')
print msg
tname = "test%02d" % t[0] except Exception, e:
pyt = "%s/%s.py" % (dir, tname) if options.debug:
print e
traceback.print_exc()
if path.exists(pyt) and path.isfile(pyt) and access(pyt, R_OK): msg = "FAIL: %s->%s (%s)" % (tname, lnk_ptr(tname), e)
log.write(msg + '\n')
inf.write(msg + '\n')
print msg
for n in range(t[1]): # Start running the tests, only if the HW/PCB version is OK
if cc == 0:
for t in tns:
if n == 10: tname = "test%02d" % t[0]
msg = "Printing suppresses after 10 runs" pyt = "%s/%s.py" % (dir, tname)
print msg
log.write('\n' + msg + '\n')
inf.write('\n' + msg + '\n')
if n < 10: if path.exists(pyt) and path.isfile(pyt) and access(pyt, R_OK):
msg = "Run:%d Begin:%s" % (n+1,tname)
print msg
log.write('\n' + msg + '\n')
inf.write('\n' + msg + '\n')
try: for n in range(t[1]):
# First load a firmware and read back a register to confirm correct load.
if bus.vv_load() == 0:
msg = "INFO: Found CONV-TTL-BLO board in slot %d\n" % (lun)
inf.write(msg + '\n')
# Each test is passed the test name, the log and info files and the if n == 10:
# bus object. The test program is expected to return the number of msg = "Printing suppresses after 10 runs"
# errors that occured. If no errors occur, the test PASSes, otherwise print msg
# it FAILs. log.write('\n' + msg + '\n')
cc = run_test(tname,bus,inf,log) inf.write('\n' + msg + '\n')
if cc == 0:
msg = "PASS: %s" % (tname) if n < 10:
log.write(msg + '\n') msg = "Run:%d Begin:%s" % (n+1,tname)
inf.write(msg + '\n')
print msg print msg
else: log.write('\n' + msg + '\n')
msg = "FAIL: %s->%s" % (tname, lnk_ptr(tname)) inf.write('\n' + msg + '\n')
try:
# First load a firmware and read back a register to confirm correct load.
if bus.vv_load() == 0:
msg = "INFO: Found CONV-TTL-BLO board in slot %d\n" % (lun)
inf.write(msg + '\n')
# Each test is passed the test name, the log and info files and the
# bus object. The test program is expected to return the number of
# errors that occured. If no errors occur, the test PASSes, otherwise
# it FAILs.
cc = run_test(tname,bus,inf,log)
if cc == 0:
msg = "PASS: %s" % (tname)
log.write(msg + '\n')
inf.write(msg + '\n')
print msg
else:
msg = "FAIL: %s->%s" % (tname, lnk_ptr(tname))
log.write(msg + '\n')
inf.write(msg + '\n')
print msg
except Exception, e:
if options.debug:
print e
traceback.print_exc()
msg = "FAIL: %s->%s (%s)" % (tname, lnk_ptr(tname), e)
log.write(msg + '\n') log.write(msg + '\n')
inf.write(msg + '\n') inf.write(msg + '\n')
print msg print msg
except Exception, e: if n < 10:
if options.debug: msg = "Run:%d End:%s\n" % (n+1,tname)
print e print msg
traceback.print_exc() log.write(msg + '\n')
inf.write(msg + '\n')
msg = "FAIL: %s->%s (%s)" % (tname, lnk_ptr(tname), e)
log.write(msg + '\n')
inf.write(msg + '\n')
print msg
if n < 10:
msg = "Run:%d End:%s\n" % (n+1,tname)
print msg
log.write(msg + '\n')
inf.write(msg + '\n')
# Close the bus and the files # Close the bus and the files
bus.vv_close() bus.vv_close()
......
...@@ -63,9 +63,13 @@ import re ...@@ -63,9 +63,13 @@ import re
sys.path.append('.') sys.path.append('.')
sys.path.append("pyts/") sys.path.append("pyts/")
# Import here ptsdefine.py, to avoid "uncaught" exceptions later on # Import here ptsdefine.py, to avoid "uncaught" exceptions later on
from ptsexcept import *
from vv_pts import *
from ptsdefine import * from ptsdefine import *
##------------------------------------------------------------------------------------------------- ##-------------------------------------------------------------------------------------------------
## Method to turn on the VME crate. ## Method to turn on the VME crate.
##------------------------------------------------------------------------------------------------- ##-------------------------------------------------------------------------------------------------
...@@ -104,6 +108,7 @@ if __name__ == '__main__': ...@@ -104,6 +108,7 @@ if __name__ == '__main__':
# Turn off the VME crate # Turn off the VME crate
men_off() men_off()
bus = SKT(ELMASLOT)
# Scan the first barcode # Scan the first barcode
while True: while True:
sn1 = raw_input("--> Scan the 1st barcode: ") sn1 = raw_input("--> Scan the 1st barcode: ")
...@@ -168,7 +173,7 @@ if __name__ == '__main__': ...@@ -168,7 +173,7 @@ if __name__ == '__main__':
time.sleep(1) time.sleep(1)
# ... power-cycle the crate # ... power-cycle the crate
print "VME Crate power-cycle..." print "VME crate power-cycle..."
men_off() men_off()
time.sleep(5) time.sleep(5)
men_on() men_on()
...@@ -184,16 +189,59 @@ if __name__ == '__main__': ...@@ -184,16 +189,59 @@ if __name__ == '__main__':
subprocess.call("grep PASS log/*.log", shell=True, stdout=sys.stdout, stderr=sys.stderr) subprocess.call("grep PASS log/*.log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("grep FAIL log/*.log", shell=True, stdout=sys.stdout, stderr=sys.stderr) subprocess.call("grep FAIL log/*.log", shell=True, stdout=sys.stdout, stderr=sys.stderr)
# Save results on USB key... # Save results on local folder...
print "\nSaving test results on USB key" print "\nSaving test results in /home/pts-administrator/pts/log/tblo"
try: try:
subprocess.call("mkdir -p /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr) subprocess.call("mkdir -p /home/pts-administrator/pts/log/tblo", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("cp log/*.log /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr) subprocess.call("cp log/*.log /home/pts-administrator/pts/log/tblo", shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call("cp log/*.inf /media/pts/log", shell=True, stdout=sys.stdout, stderr=sys.stderr) subprocess.call("cp log/*.inf /home/pts-administrator/pts/log/tblo", shell=True, stdout=sys.stdout, stderr=sys.stderr)
except e: except e:
print "ERROR: No access to USB key at /media/pts" print "ERROR: No access to directory /home/pts-administrator/pts/tblo"
print e print e
#-------------------------------------------------------------------------------
# Reading board unique ID and storing to separate log file
#-------------------------------------------------------------------------------
# ... power-cycle the crate
print "VME Crate power-cycle..."
men_off()
time.sleep(3)
men_on()
time.sleep(10)
#Read unique board ID
IDMS = bus.vv_read(UIDREGMS)
IDLS = bus.vv_read(UIDREGLS)
#Generate log file
# Generate output file named according to current time
fname = time.strftime("serial-num-CTDAH-%Y-%m-%d", time.localtime()) + ".txt"
ret = subprocess.call(["ls /home/pts-administrator/pts/log/tblo | grep " + fname], shell=True, stdout=None, stderr=None)
#print ("%d" % ret)
if (ret != 0):
f = open("/home/pts-administrator/pts/log/tblo/" + fname, "w")
print(" File not found ... Create new one \n ")
f.write("\n")
f.write("CONV-TTL-BLO Upgrade log created on %s \n" % time.strftime("%Y-%m-%d-%Hh%Mm%Ss", time.localtime()))
f.write("--------------------------------------------------------------------------------- \n")
f.write("Barcode 1 | Barcode 2 | PCB ID |\n")
f.write("--------------------------------------------------------------------------------- \n")
f.close()
print("Upgrade log can be found in /home/pts-administrator/pts/log/tblo/%s \n" % fname)
print ("Board unique ID can be found in /home/pts-administrator/pts/log/tblo/%s \n" % fname)
f = open("/home/pts-administrator/pts/log/tblo/" + fname, "a")
f.write("%s \t %s \t %x%x\n" % (sn1, sn2, IDMS, IDLS) )
f.close()
#-------------------------------------------------------------------------------
# We're done, turn off the VME crate # We're done, turn off the VME crate
print "\nTesting completed!" print "\nTesting completed!"
men_off() men_off()
......
...@@ -58,10 +58,7 @@ CSR_STLEDT_OFS = 1 ...@@ -58,10 +58,7 @@ CSR_STLEDT_OFS = 1
CSR_RLEDT_OFS = 2 CSR_RLEDT_OFS = 2
CSR_TTLPT_OFS = 3 CSR_TTLPT_OFS = 3
CSR_REARPT_OFS = 4 CSR_REARPT_OFS = 4
CSR_TSTCVCC_OFS = 5 CSR_HWVERS_OFS = 8
CSR_TSTCMUXEN_OFS = 6
CSR_TSTCS0_OFS = 7
CSR_TSTCS1_OFS = 8
CSR_RST_UNLOCK_OFS = 14 CSR_RST_UNLOCK_OFS = 14
CSR_RST_OFS = 15 CSR_RST_OFS = 15
CSR_SWITCH_OFS = 16 CSR_SWITCH_OFS = 16
...@@ -74,11 +71,16 @@ LSR = 0x008 ...@@ -74,11 +71,16 @@ LSR = 0x008
LSR_FRONT_OFS = 0 LSR_FRONT_OFS = 0
LSR_FRONTINV_OFS = 6 LSR_FRONTINV_OFS = 6
LSR_REAR_OFS = 10 LSR_REAR_OFS = 10
LSR_REARFS_OFS = 26
# 1-Wire base address, used in therm_id.py # 1-Wire base address, used in therm_id.py
TEMP_1WIRE_BASE = 0x010 TEMP_1WIRE_BASE = 0x010
# 1-Wire unique ID
UIDREGLS = 0xac # 1-wire chip Unique ID - LSB
UIDREGMS = 0xb0 # 1-wire chip Unique ID - MSB
# DAC and clock info registers and offsets, used in dac_vcxo_pll.py # DAC and clock info registers and offsets, used in dac_vcxo_pll.py
PLL_DAC_BASE = 0X020 PLL_DAC_BASE = 0X020
VCXO_DAC_BASE = 0x080 VCXO_DAC_BASE = 0x080
......
...@@ -153,6 +153,20 @@ def main(bus, tname, inf, log): ...@@ -153,6 +153,20 @@ def main(bus, tname, inf, log):
chans = ['1', '2', '3', '4', '5', '6', 'A', 'B', 'C', 'D'] chans = ['1', '2', '3', '4', '5', '6', 'A', 'B', 'C', 'D']
try: try:
# Ask the user to make the daisy-chain
print("Please plug in the patch board for front panel daisy-chaining:\n")
reply = raw_input("Is the patch board plugged-in? (yes/no) ")
while True:
if "yes" in reply.lower():
break
if "no" in reply.lower():
msg = "ERROR: No daisy-chain on front panel"
pel.set(msg)
return pel.get()
else:
reply = raw_input('Please type "yes" or "no" to continue: ')
# Initialize a pulse counter object # Initialize a pulse counter object
pc = CPulseCounter(bus, PULSE_CNT_BASE) pc = CPulseCounter(bus, PULSE_CNT_BASE)
......
#!/bin/bash #!/bin/bash
xc3sprog -c xpc flash_load.bit xc3sprog -c xpc flash_load.bit
xc3sprog -c xpc -I golden-v0.2_release-v3.0.bin:w:0:bin xc3sprog -c xpc -I golden-v0.3_release-v4.1.bin:w:0:bin
#!/bin/bash #!/bin/bash
xc3sprog -c xpc pts.bit xc3sprog -c xpc pts-v4.bit
#!/bin/bash #!/bin/bash
cd cd
cd /media/pts cd /media/pts-administrator
rm -f log.tar.gz rm -f log.tar.gz
tar cvzf log.tar.gz log tar cvzf log.tar.gz log
cd cd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment