Commit 722ce2ed authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

updated vbcp_wb documentation

parent 1253636a
No preview for this file type
......@@ -48,11 +48,11 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="588.86994"
inkscape:cy="95.305709"
inkscape:zoom="0.98994949"
inkscape:cx="364.34629"
inkscape:cy="-103.38712"
inkscape:document-units="px"
inkscape:current-layer="g6096"
inkscape:current-layer="layer1"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
......@@ -518,16 +518,23 @@
sodipodi:linespacing="125%"
id="text5884"
y="429.46619"
x="335.83987"
x="382.80508"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
style="font-size:8px"
style="font-size:8px;text-align:center;text-anchor:middle"
y="429.46619"
x="335.83987"
x="382.80508"
sodipodi:role="line"
id="tspan5888">I<tspan
style="font-size:65.00091553%;text-align:center;text-anchor:middle;baseline-shift:super"
id="tspan4982">2</tspan>C stop condition</tspan><tspan
style="font-size:8px;text-align:center;text-anchor:middle"
y="439.46619"
x="382.80508"
sodipodi:role="line"
id="tspan5888">wb_ack <tspan
style="font-style:italic"
id="tspan5890">or </tspan>wb_err</tspan></text>
id="tspan4978"><tspan
style="font-style:italic;text-align:center;text-anchor:middle"
id="tspan4980">or </tspan>wb_err</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
......@@ -598,5 +605,44 @@
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#TriangleOutM)" />
</g>
</g>
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:none;marker-end:url(#TriangleOutM)"
d="m 471.20592,377.33341 c 10.27232,-16.15369 9.24609,-32.50218 0,-48.9924"
id="path4984"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="382.80508"
y="429.46619"
id="text5864"
sodipodi:linespacing="125%"><tspan
id="tspan5866"
sodipodi:role="line"
x="382.80508"
y="429.46619"
style="font-size:8px;text-align:center;text-anchor:middle">I<tspan
id="tspan5868"
style="font-size:65.00091553%;text-align:center;text-anchor:middle;baseline-shift:super">2</tspan>C stop condition</tspan><tspan
id="tspan5870"
sodipodi:role="line"
x="382.80508"
y="439.46619"
style="font-size:8px;text-align:center;text-anchor:middle"><tspan
id="tspan5872"
style="font-style:italic;text-align:center;text-anchor:middle">or </tspan>wb_err</tspan></text>
<text
sodipodi:linespacing="125%"
id="text5874"
y="351.1088"
x="479.57578"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
style="font-size:8px"
y="351.1088"
x="479.57578"
id="tspan5876"
sodipodi:role="line">wb_ack = '1'</tspan></text>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="451"
height="61.578125"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="writemregs.svg">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="230.46688"
inkscape:cy="-2.6005284"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="1855"
inkscape:window-height="1176"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0">
<inkscape:grid
type="xygrid"
id="grid2987"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="-59.5px"
originy="-849.5px" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-59.5,-141.28406)">
<rect
style="opacity:0.98999999;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
id="rect2989"
width="50"
height="50"
x="70"
y="152.36218" />
<rect
style="opacity:0.98999999;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
id="rect3765"
width="140"
height="50"
x="190"
y="152.36218" />
<rect
y="152.36218"
x="120"
height="50"
width="70"
id="rect3767"
style="opacity:0.98999999;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<rect
style="opacity:0.98999999;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
id="rect3771"
width="140"
height="50"
x="360"
y="152.36218" />
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="95.024414"
y="175.45352"
id="text3773"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3775"
x="95.024414"
y="175.45352"
style="font-weight:bold;text-align:center;text-anchor:middle">I<tspan
style="font-size:65.00091553%;font-weight:bold;text-align:center;text-anchor:middle;baseline-shift:super"
id="tspan3777">2</tspan>C</tspan><tspan
sodipodi:role="line"
x="95.024414"
y="187.95352"
style="font-weight:bold;text-align:center;text-anchor:middle"
id="tspan3114">address</tspan></text>
<text
sodipodi:linespacing="125%"
id="text3779"
y="174.84021"
x="155.09033"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
style="font-weight:bold;text-align:center;text-anchor:middle"
y="174.84021"
x="155.09033"
id="tspan3781"
sodipodi:role="line">Wishbone</tspan><tspan
style="font-weight:bold;text-align:center;text-anchor:middle"
y="187.34021"
x="155.09033"
sodipodi:role="line"
id="tspan3785">address</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="259.77783"
y="181.09021"
id="text3787"
sodipodi:linespacing="125%"><tspan
id="tspan3791"
sodipodi:role="line"
x="259.77783"
y="181.09021"
style="font-weight:bold;text-align:center;text-anchor:middle">Data word 0</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="429.93652"
y="181.09021"
id="text3799"
sodipodi:linespacing="125%"><tspan
id="tspan3801"
sodipodi:role="line"
x="429.93652"
y="181.09021"
style="font-weight:bold;text-align:center;text-anchor:middle">Data word 7</tspan></text>
<text
sodipodi:linespacing="125%"
id="text3803"
y="181.09021"
x="345.06348"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
style="font-weight:bold;text-align:center;text-anchor:middle"
y="181.09021"
x="345.06348"
sodipodi:role="line"
id="tspan3805">...</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 70,202.36218 -10,0 0,-50 10,0"
id="path3807"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path3809"
d="m 500,202.36218 10,0 0,-50 -10,0"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<text
sodipodi:linespacing="125%"
id="text3811"
y="181.70352"
x="61.40625"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
style="font-weight:bold"
y="181.70352"
x="61.40625"
id="tspan3813"
sodipodi:role="line">S</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="501.47217"
y="181.70352"
id="text3821"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3823"
x="501.47217"
y="181.70352"
style="font-weight:bold">P</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="83.744141"
y="147.36218"
id="text3829"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3831"
x="83.744141"
y="147.36218"
style="font-size:8px">7 bits</tspan></text>
<text
sodipodi:linespacing="125%"
id="text3833"
y="147.36218"
x="137.60742"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
y="147.36218"
x="137.60742"
id="tspan3835"
sodipodi:role="line"
style="font-size:8px">16 bits</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="242.77588"
y="147.36218"
id="text3837"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3839"
x="242.77588"
y="147.36218"
style="font-size:8px">32 bits</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="412.77588"
y="147.36218"
id="text3845"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3847"
x="412.77588"
y="147.36218"
style="font-size:8px">32 bits</tspan></text>
</g>
</svg>
No preview for this file type
......@@ -42,6 +42,8 @@
\hline
26-06-2013 & 0.01 & First draft \\
14-08-2013 & 0.02 & Second draft \\
22-10-2013 & 0.03 & Added \textit{Access commands} section, updated document according to
changes in protocol \\
\hline
\end{tabular}
}
......@@ -125,10 +127,11 @@ Wishbone master interface ports, prefixed with \textit{wbm}.
scl\_i & 1 & SCL line input \\
scl\_o & 1 & SCL line output \\
i2c\_addr\_i & 7 & VBCP slave address on ELMA VBCP bus \\
i2c\_done\_o & 1 & High for one clk\_i cycle when an VBCP transfer is finished \\
i2c\_err\_o & 1 & High for one clk\_i cycle when an error occurs in the ELMA protocol
or an attempt is made to access an non-existing register on the
Wishbone bus \\
tip\_o & 1 & Transfer In Progress \newline
'1' -- I$^2$C address sent by SysMon matches that of the VBCP slave \newline
'0' -- after transfer has completed and VBCP slave is idle \\
err\_o & 1 & Error bit, high for one \textit{clk\_i} cycle when the Wishbone address
the SysMon tries to access is invalid \\
wbm\_stb\_o & 1 & Wishbone data strobe output \\
wbm\_cyc\_o & 1 & Wishbone valid cycle output \\
wbm\_sel\_o & 4 & Wishbone byte select output \\
......@@ -192,66 +195,16 @@ Wishbone master interface ports, prefixed with \textit{wbm}.
After proper synthesis and download to the FPGA, a Telnet or serial connection
should be made to the SysMon board. Commands can then be sent to the boards via
the SysMon. The two commands relevant for accessing board registers are \textit{readreg}
and \textit{writereg}, outlined in Table~\ref{tbl:cmds}.
\begin{table}[h]
\caption{The \textit{readreg} and \textit{writereg} commands}
\label{tbl:cmds}
\centerline
{
\begin{tabular}{l p{.6\textwidth}}
\hline
\multicolumn{1}{c}{\textbf{Command}} & \multicolumn{1}{c}{\textbf{Description}} \\
\hline
writereg \textit{slot reg val} & Writes the \textit{hex} value \textit{val} to register number
\textit{reg} of board in slot number \textit{slot} \\
readreg \textit{slot reg} & Returns the value of register number \textit{reg} of
board in slot number \textit{slot} \\
\hline
\end{tabular}
}
\end{table}
Register (\textit{reg}) numbers in these commands are decimal numbers starting from 1.
The SysMon translates \textit{reg} numbers into word-aligned addresses, thus in order
to obtain the actual register addres, the following relation should be used:
\begin{center}
$ addr = (reg-1)*4 $
\end{center}
Table~\ref{tbl:reg} shows the \textit{reg} numbers of registers in the address
space 0x00 to 0x20.
\begin{table}[h]
\caption{Translating \textit{reg} numbers to addresses}
\label{tbl:reg}
\centerline
{
\begin{tabular}{c c}
\hline
\textbf{\textit{reg}} & \textbf{Address} \\
\hline
1 & 0x00 \\
2 & 0x04 \\
3 & 0x08 \\
4 & 0x0C \\
5 & 0x10 \\
6 & 0x14 \\
7 & 0x18 \\
8 & 0x1C \\
9 & 0x20 \\
\hline
\end{tabular}
}
\end{table}
the SysMon. The two commands relevant for this basic test are \textit{readreg}
and \textit{writereg}. These and other commands relevant for accessing board
registers are outlined in Section~\ref{sec:vbcp-cmds}.
The example below shows how to connect to an ELMA crate at IP address 1.2.3.4,
obtaining the value of a register at address 0x10 in a board in VME slot 2,
writing the hex value 0x1234 to the same register and reading it back to check for
proper modification.
\pagebreak
\begin{verbatim}
$ telnet 1.2.3.4
Trying 1.2.3.4...
......@@ -259,21 +212,24 @@ Connected to 1.2.3.4.
Escape character is '^]'.
login:user
password:**********
%>readreg 2 5
%>readreg 2 10
Read Data: 00ABCDEF
%>writereg 2 5 1234
%>writereg 2 10 1234
Done!
%>readreg 2 5
%>readreg 2 10
Read Data: 00001234
\end{verbatim}
%==============================================================================
% SEC: Protocol
%==============================================================================
\pagebreak
\section{The VME Board Control Protocol}
\label{sec:vbcp}
%------------------------------------------------------------------------------
\subsection{Protocol details}
\label{sec:vbcp-prot}
The VME backplane provides two serial lines (\textit{SERCLK} and \textit{SERDAT})
on the P1 connector. These lines can be used to access boards placed in a VME
slots to control them, in cases where the VME interface is not implemented.
......@@ -311,6 +267,56 @@ the transfer direction changes and the SysMon will read the four data
bytes sent by the VME board. As with the write transfer, the data bytes
are sent by the VME board in big-endian order.
%------------------------------------------------------------------------------
\subsection{Access commands}
\label{sec:vbcp-cmds}
In order to send data to a VME board using VBCP, a user connects to the SysMon
via Telnet and sends commands which the SysMon translates into I$^2$C accesses
as outlined in the previous section. The commands supported by the \textit{vbcp\_wb}
module are shown in Table~\ref{tbl:cmds}.
\begin{table}[h]
\caption{The \textit{readreg} and \textit{writereg} commands}
\label{tbl:cmds}
\centerline
{
\begin{tabular}{l p{.6\textwidth}}
\hline
\multicolumn{1}{c}{\textbf{Command}} & \multicolumn{1}{c}{\textbf{Description}} \\
\hline
writereg slot addr val & Writes the \textit{hex} value \textit{val} to hex address
\textit{addr} of board in slot number \textit{slot} \\
writemregs slot addr v1 .. v8 & This command is similar to the \textit{writereg}
command, but it allows writing up to eight different values
to the same Wishbone register. The values are given in hexadecimal
format and are separate by spaces \\
readreg slot addr & Returns the value of register at hex address \textit{addr} of
board in slot number \textit{slot} \\
\hline
\end{tabular}
}
\end{table}
One noteworthy subject here is the \textit{writemregs} command. This command allows
writing more up to eight words to the same Wishbone register. It is useful
when one wants to use a Wishbone register as a proxy for accessing an on-board
peripheral where large amounts of data are to be written. An external memory is a
good example of such a peripheral.
\begin{figure}
\centerline{\includegraphics[width=\textwidth]{fig/writemregs}}
\caption{SysMon write using \textit{writemregs}}
\label{fig:writemregs}
\end{figure}
In principle, the \textit{writemregs} is a \textit{writereg} with multiple data words
packed together, as outlined in Figure~\ref{fig:writemregs}. In this figure, each data word
is split in four bytes as outlined in Figure~\ref{fig:sysmon-wr}, with an ACK sent by
the VME board after every byte.
As Figure~\ref{fig:writemregs} shows, the data words are sent in little-endian order,
word 0 is sent first, followed by word 1 and so forth, until word 7.
%==============================================================================
% SEC: Implem
......
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