1 |
11 |
khatib |
%% $Log: not supported by cvs2svn $
|
2 |
|
|
%% Revision 1.12 2001/04/09 21:05:33 jamil
|
3 |
|
|
%% FIFO buffers calculations added
|
4 |
|
|
%%
|
5 |
|
|
%% Revision 1.11 2001/04/04 20:53:32 jamil
|
6 |
|
|
%% Registers naming changed
|
7 |
|
|
%%
|
8 |
|
|
%% Revision 1.10 2001/04/03 19:15:20 jamil
|
9 |
|
|
%% Design files and Synchronization sections added
|
10 |
|
|
%% Block diagrams modified
|
11 |
|
|
%%
|
12 |
|
|
%% Revision 1.9 2001/02/19 21:27:55 jamil
|
13 |
|
|
%% AbortFrame direction fixed
|
14 |
|
|
%%
|
15 |
|
|
%% Revision 1.8 2001/02/13 19:42:40 jamil
|
16 |
|
|
%% document update
|
17 |
|
|
%%
|
18 |
2 |
khatib |
\documentclass[a4paper,11pt]{article}
|
19 |
|
|
\usepackage{fancyheadings}
|
20 |
|
|
\usepackage{lastpage}
|
21 |
|
|
\pagestyle{fancy}
|
22 |
|
|
|
23 |
11 |
khatib |
\usepackage[dvips]{graphicx}
|
24 |
|
|
|
25 |
2 |
khatib |
%% defined commands
|
26 |
|
|
\newcommand{\openhw}{\mbox{\textbf{\textit{OpenHW}}}}
|
27 |
|
|
\newcommand{\opendesign}{\mbox{\textbf{\textit{OpenDesign}}}}
|
28 |
|
|
\newcommand{\openipcore}{\mbox{\textbf{\textit{OpenIPCore}}}}
|
29 |
11 |
khatib |
\newcommand{\opencores}{\mbox{\textbf{\textit{www.OpenCores.org~}}}}
|
30 |
2 |
khatib |
|
31 |
|
|
%% addcomment command: Author name: Comments
|
32 |
|
|
\newcommand{\addcomment}[2]{\rule{1ex}{1ex} \emph{Comment by \textbf{#1}: #2 }\rule{1ex}{1ex}}
|
33 |
|
|
|
34 |
|
|
%% addauthor command: Author name : List of changes: date: contact address
|
35 |
|
|
\newcommand{\addauthor}[4]{#1 & #2 & #3 & #4 \\ \hline}
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
%% Optional suffix or prefix
|
40 |
|
|
\newcommand{\prefix}[1]{[\textit{#1\_}]}
|
41 |
|
|
\newcommand{\suffix}[1]{[\textit{\_#1}]}
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
\author{Jamil Khatib}
|
46 |
|
|
\title{HDLC controller core}
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
%% Hyphenation list %%
|
51 |
|
|
\hyphenation{OpenIP OpenIPCore OpenHW OpenDesign OpenCores ISP CPLD FPGA CAD VHDL hard-ware soft-ware DSP ASIC}
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
%%Headers & footers
|
55 |
|
|
\lhead{\uppercase\rightmark}
|
56 |
|
|
\chead{}
|
57 |
|
|
\rhead{\bfseries \opencores Project}
|
58 |
|
|
\lfoot{HDLC controller}
|
59 |
|
|
\cfoot{}
|
60 |
|
|
\rfoot{\thepage~ of \pageref{LastPage}}
|
61 |
|
|
\setlength{\headrulewidth}{0.4pt}
|
62 |
|
|
\setlength{\footrulewidth}{0.4pt}
|
63 |
|
|
|
64 |
|
|
%% begin Document
|
65 |
|
|
\begin{document}
|
66 |
|
|
%% Cover page
|
67 |
|
|
\maketitle
|
68 |
|
|
|
69 |
|
|
\begin{center}(C) Copyright 2001 Jamil Khatib.\end{center}
|
70 |
|
|
|
71 |
|
|
\thispagestyle{empty}
|
72 |
|
|
|
73 |
|
|
\newpage
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
%%Table of contents page
|
77 |
|
|
\tableofcontents
|
78 |
|
|
|
79 |
|
|
\newpage
|
80 |
|
|
|
81 |
|
|
\section{List of authors and changes}
|
82 |
|
|
|
83 |
|
|
\begin{tabular}{|l|l|l|l|l|}
|
84 |
|
|
\hline
|
85 |
|
|
Name & Changes & Date & Contact address\\
|
86 |
|
|
\hline
|
87 |
|
|
\hline
|
88 |
|
|
|
89 |
|
|
\addauthor{Jamil Khatib}{Initial release}{9-1-2001}{khatib@ieee.org}
|
90 |
11 |
khatib |
\addauthor{Jamil Khatib}{TX interface added, Spec improved}{27-1-2001}{khatib@ieee.org}
|
91 |
|
|
\addauthor{Jamil Khatib}{External FIFO buffer added}{3-2-2001}{khatib@ieee.org}
|
92 |
|
|
\addauthor{Jamil Khatib}{Registers and CPU interface added}{8-2-2001}{khatib@ieee.org}
|
93 |
|
|
\addauthor{Jamil Khatib}{Drop bit, TDM interface are added}{9-2-2001}{khatib@ieee.org}
|
94 |
|
|
\addauthor{Jamil Khatib}{More design descriptions added}{2-4-2001}{khatib@ieee.org}
|
95 |
|
|
\addauthor{Jamil Khatib}{FIFO buffers calculations added}{9-4-2001}{khatib@ieee.org}
|
96 |
2 |
khatib |
%% use add author command here
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
\end{tabular}
|
100 |
|
|
|
101 |
|
|
\newpage
|
102 |
|
|
|
103 |
|
|
%%- New section -%%
|
104 |
|
|
%%------------------------------------------%%
|
105 |
|
|
\section{Project Definition}
|
106 |
|
|
|
107 |
|
|
\subsection{Introduction}
|
108 |
11 |
khatib |
HDLC protocol is used as a data link of most of the current communication systems like ISDN, Frame Relay etc. HDLC is a family of protocols that varies in address size, control field, FCS and no. of data bits.
|
109 |
2 |
khatib |
|
110 |
|
|
%\subsection{Definition}
|
111 |
|
|
|
112 |
|
|
\subsection{Objectives}
|
113 |
|
|
The aim of this project is to develop the basic HDLC functionalities to be used by many communication systems.
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
%%- New section -%%
|
117 |
|
|
%%------------------------------------------%%
|
118 |
|
|
\section{Specifications}
|
119 |
|
|
|
120 |
11 |
khatib |
\subsection{System Features Specification}
|
121 |
|
|
\begin{enumerate}
|
122 |
|
|
\item Synchronous operation
|
123 |
|
|
\item 8 bit parallel back-end interface
|
124 |
|
|
\item Use external RX and TX clocks
|
125 |
|
|
\item Start and end of frame pattern generation
|
126 |
|
|
\item Start and end of frame pattern checking
|
127 |
|
|
\item Idle pattern generation and detection (all ones)
|
128 |
|
|
\item Zero insertion and removal for transparent transmission.
|
129 |
|
|
\item Abort pattern generation and checking (7 ones)
|
130 |
|
|
\item Address insertion and detection by software
|
131 |
|
|
\item CRC generation and checking (CRC-16 or CRC-32 can be used which is configurale at the code top level)
|
132 |
|
|
\item FIFO buffers and synchronization (External)
|
133 |
|
|
\item Byte aligned data (if data is not aligned to 8-bits error signal is reported to the backend interface)
|
134 |
|
|
\item Q.921, LAPD and LAPB compliant.
|
135 |
|
|
\item The core should not have internal configuration registers or counters, instead it provides all the signals to implement external registers.
|
136 |
|
|
\item There is No limit on the Maximum frame size as long as the backend can read and write data (depends on the external FIFO size)
|
137 |
|
|
\item Bus connection is not supported directly (TxEN and RxEN pins can be used for that reason)
|
138 |
|
|
\item Retransmission is not supported when there is collision in the Bus connection mode.
|
139 |
|
|
\item This controller is used for low speed application only (relative to the backend bus).
|
140 |
|
|
\item Supports connection to TDM core via backend interface and software control for time slot selection and control (signaling ,etc.) generation.
|
141 |
|
|
\item Backend interface uses the Wishbone bus interface which can be connected directly to the system or via FIFO buffer.
|
142 |
|
|
\item Optional External FIFO buffers, configuration and status registers.
|
143 |
|
|
\item The core will be made of two levels of hierarchies, the basic functionality and the Optional interfaces and buffers.
|
144 |
|
|
\end{enumerate}
|
145 |
2 |
khatib |
|
146 |
|
|
\subsection{External Interfaces}
|
147 |
|
|
|
148 |
|
|
\subsubsection{Receive Channel}
|
149 |
|
|
|
150 |
|
|
\begin{tabular}{|l|l|l|}
|
151 |
|
|
\hline
|
152 |
|
|
Signal name& Direction& Description\\
|
153 |
|
|
\hline
|
154 |
|
|
\hline
|
155 |
6 |
khatib |
Control interface & & \\
|
156 |
|
|
\hline
|
157 |
|
|
\hline
|
158 |
|
|
Rst & Input & System asynchronous reset(active low)\\
|
159 |
|
|
\hline
|
160 |
|
|
\hline
|
161 |
2 |
khatib |
Serial Interface & & \\
|
162 |
|
|
\hline
|
163 |
|
|
\hline
|
164 |
|
|
RxClk & Input & Receive Clock\\
|
165 |
|
|
Rx & Input& Receive Data\\
|
166 |
6 |
khatib |
RxEn & Input & RX enable (active high)\\
|
167 |
2 |
khatib |
\hline
|
168 |
|
|
\hline
|
169 |
|
|
Back-end Interface & &\\
|
170 |
|
|
\hline
|
171 |
|
|
\hline
|
172 |
|
|
RxD[7:0]& Output& Receive data bus\\
|
173 |
6 |
khatib |
ValidFrame& Output& Valid Frame indication during all frame bytes transfer\\
|
174 |
|
|
FrameErr& Output& Error in the received data (lost bits)\\
|
175 |
2 |
khatib |
Aborted& Output& Aborted Frame\\
|
176 |
11 |
khatib |
Read& Input& Read byte\\
|
177 |
2 |
khatib |
Ready& Output& Valid data exists\\
|
178 |
|
|
\hline
|
179 |
|
|
\end{tabular}
|
180 |
|
|
|
181 |
|
|
\subsubsection{Back-end interface mapping to Wishbone SoC bus}
|
182 |
6 |
khatib |
The HDLC receive backend interface can be used as a slave core or master according to the below mapping. The core supports SINGLE READ Cycle only using 8-bit data bus without address lines. The choice between master and slave is left for the system integrator and must do the configuration and glue logic as defined in the tables.
|
183 |
2 |
khatib |
|
184 |
11 |
khatib |
\begin{figure}[!h]
|
185 |
|
|
\includegraphics[angle=0,width=\textwidth,scale=.5]{wishlogo.ps}
|
186 |
|
|
\label{Logo}
|
187 |
|
|
\end{figure}
|
188 |
6 |
khatib |
|
189 |
2 |
khatib |
\begin{tabular}{|l|l|}
|
190 |
|
|
\hline
|
191 |
|
|
Signal Name& Wishbone signal\\
|
192 |
|
|
\hline
|
193 |
|
|
\hline
|
194 |
|
|
Master Configuration connected to FIFO&\\
|
195 |
|
|
\hline
|
196 |
6 |
khatib |
RxClk & CLK\_I\\
|
197 |
|
|
Rst & not RST\_I\\
|
198 |
|
|
RxD[7:0]& DAT\_O(7:0)\\
|
199 |
2 |
khatib |
ValidFrame& STB\_O\\
|
200 |
6 |
khatib |
ValidFrame& CYC\_O\\
|
201 |
2 |
khatib |
ReadByte& ACK\_I and not RTY\_I\\
|
202 |
6 |
khatib |
Ready& WE\_O\\
|
203 |
|
|
FrameERR& TAG0\_O\\
|
204 |
|
|
Aborted& TAG1\_O\\
|
205 |
2 |
khatib |
\hline
|
206 |
|
|
Slave FIFO(two-clock domain FIFO)&\\
|
207 |
|
|
\hline
|
208 |
6 |
khatib |
Data[7:0]& DAT\_I(7:0)\\
|
209 |
2 |
khatib |
Chip Select& STB\_I\\
|
210 |
11 |
khatib |
STB\_I and not FullFlag& ACK\_O\\
|
211 |
2 |
khatib |
FullFlag& RTY\_O\\
|
212 |
|
|
Write& WE\_I\\
|
213 |
|
|
\hline
|
214 |
|
|
Slave Configuration &\\
|
215 |
|
|
\hline
|
216 |
6 |
khatib |
RxClk & CLK\_I\\
|
217 |
|
|
Rst & not RST\_I\\
|
218 |
|
|
RxD[7:0]& DAT\_O(7:0)\\
|
219 |
|
|
ValidFrame& TAG0\_O\\
|
220 |
|
|
ReadByte& not WE\_I\\
|
221 |
|
|
Ready& not RTY\_O\\
|
222 |
|
|
STB\_I and not WR\_I& ACK\_O\\
|
223 |
|
|
FrameERR& TAG1\_O\\
|
224 |
|
|
Aborted& TAG2\_O\\
|
225 |
2 |
khatib |
\hline
|
226 |
|
|
\end{tabular}
|
227 |
|
|
|
228 |
|
|
|
229 |
|
|
\subsubsection{Transmit Channel}
|
230 |
11 |
khatib |
\begin{tabular}{|l|l|l|}
|
231 |
|
|
\hline
|
232 |
|
|
Signal name& Direction& Description\\
|
233 |
|
|
\hline
|
234 |
|
|
\hline
|
235 |
|
|
Control interface & & \\
|
236 |
|
|
\hline
|
237 |
|
|
\hline
|
238 |
|
|
Rst & Input & System asynchronous reset(active low)\\
|
239 |
|
|
\hline
|
240 |
|
|
\hline
|
241 |
|
|
Serial Interface & & \\
|
242 |
|
|
\hline
|
243 |
|
|
\hline
|
244 |
|
|
TxClk & Input & Transmit Clock\\
|
245 |
|
|
Tx & Output & Transmit Data\\
|
246 |
|
|
TxEn & Input & TX enable (active high)\\
|
247 |
|
|
\hline
|
248 |
|
|
\hline
|
249 |
|
|
Back-end Interface & &\\
|
250 |
|
|
\hline
|
251 |
|
|
\hline
|
252 |
|
|
TxD[7:0]& Input & Transmit data bus\\
|
253 |
|
|
ValidFrame& Input& Valid Frame indication during all frame bytes transfer\\
|
254 |
|
|
AbortedTrans& Output& Error in the transmitted data (Abort pattern was generated)\\
|
255 |
|
|
AbortFrame& Input& Abort Frame\\
|
256 |
|
|
Write& Input& Write byte\\
|
257 |
|
|
Ready& Output& Can accept new data\\
|
258 |
|
|
\hline
|
259 |
|
|
\end{tabular}
|
260 |
2 |
khatib |
|
261 |
|
|
|
262 |
11 |
khatib |
\subsubsection{Back-end interface mapping to Wishbone SoC bus}
|
263 |
|
|
The HDLC receive backend interface can be used as a slave core or master according to the below mapping. The core supports SINGLE WRITE Cycle only using 8-bit data bus without address lines. The choice between master and slave is left for the system integrator and must do the configuration and glue logic as defined in the tables.
|
264 |
2 |
khatib |
|
265 |
|
|
|
266 |
11 |
khatib |
\begin{tabular}{|l|l|}
|
267 |
|
|
\hline
|
268 |
|
|
Signal Name& Wishbone signal\\
|
269 |
|
|
\hline
|
270 |
|
|
\hline
|
271 |
|
|
Master Configuration connected to FIFO&\\
|
272 |
|
|
\hline
|
273 |
|
|
TxClk & CLK\_I\\
|
274 |
|
|
Rst & not RST\_I\\
|
275 |
|
|
TxD[7:0]& DAT\_I(7:0)\\
|
276 |
|
|
Write& ACK\_I and not RTY\_I\\
|
277 |
|
|
Ready& not WE\_O\\
|
278 |
|
|
AbortedTrans& TAG0\_O\\
|
279 |
|
|
ValidFrame& TAG1\_I\\
|
280 |
|
|
AbortFrame& TAG0\_I\\
|
281 |
|
|
Always Active & CYC\_O\\
|
282 |
|
|
Always Active & STB\_O\\
|
283 |
|
|
\hline
|
284 |
|
|
Slave FIFO(two-clock domain FIFO)&\\
|
285 |
|
|
\hline
|
286 |
|
|
Data[7:0]& DAT\_I(7:0)\\
|
287 |
|
|
EmptyFlag& RTY\_O\\
|
288 |
|
|
Read& WE\_I\\
|
289 |
|
|
WE\_I and not EmptyFlag& ACK\_O\\
|
290 |
|
|
ChipSelect& STB\_I\\
|
291 |
|
|
\hline
|
292 |
|
|
Slave Configuration &\\
|
293 |
|
|
\hline
|
294 |
|
|
TxClk & CLK\_I\\
|
295 |
|
|
Rst & not RST\_I\\
|
296 |
|
|
TxD[7:0]& DAT\_I(7:0)\\
|
297 |
|
|
ValidFrame& STB\_I\\
|
298 |
|
|
Write& WE\_I\\
|
299 |
|
|
Ready& not RTY\_O\\
|
300 |
|
|
STB\_I and WR\_I& ACK\_O\\
|
301 |
|
|
AbortFrame& TAG0\_I\\
|
302 |
|
|
AbortedTrans& TAG0\_O\\
|
303 |
|
|
\hline
|
304 |
|
|
\end{tabular}
|
305 |
|
|
|
306 |
|
|
|
307 |
|
|
\subsubsection{CPU interface}
|
308 |
|
|
This interface is used when the FIFO and registers are included in the Core. This interface is compatible to WishBone slave bus interface that supports single read/write cycles and block cycles. The interface supports the following wishbone signals.
|
309 |
|
|
|
310 |
|
|
\begin{tabular}{|l|l|}
|
311 |
|
|
\hline
|
312 |
|
|
Signal& Note\\
|
313 |
|
|
\hline
|
314 |
|
|
\hline
|
315 |
|
|
RST\_I& Reset\\
|
316 |
|
|
CLK\_I& Clock\\
|
317 |
|
|
ADR\_I(2:0)& 3-bit address line\\
|
318 |
|
|
DAT\_O(7:0)& 8-bit receive data\\
|
319 |
|
|
DAT\_I(7:0)& 8-bit transmit data\\
|
320 |
|
|
WE\_I& Read/write\\
|
321 |
|
|
STB\_I& Strobe\\
|
322 |
|
|
ACK\_O& Acknowledge\\
|
323 |
|
|
CYC\_I& Cycle\\
|
324 |
|
|
TAG0\_O& TxDone interrupt\\
|
325 |
|
|
TAG1\_O& RxReady interrupt\\
|
326 |
|
|
\hline
|
327 |
|
|
\end{tabular}
|
328 |
|
|
|
329 |
2 |
khatib |
%%- New section -%%
|
330 |
|
|
%%------------------------------------------%%
|
331 |
|
|
\section{Design description}
|
332 |
|
|
|
333 |
11 |
khatib |
|
334 |
|
|
\subsection{Receive Channel}
|
335 |
|
|
|
336 |
|
|
\subsubsection{Design notes}
|
337 |
|
|
|
338 |
|
|
Receive channel provides interface to the backend via a simple handshake protocol that can be used to connect the controller to either a shared memory or FIFO buffer. This protocol uses the hand shack protocol of the Wishbone SoC bus.
|
339 |
|
|
|
340 |
|
|
Receive channel supports only 8-bits aligned data. Each frame starts with a starting flag (01111110) and ends with starting flag (01111110). Since the receipt ion is synchronous only, the channel uses the external clock and a byte must be read from the channel within the first 7 clock pulses after the ready signal is asserted. If no data is read during this period (while ValidFrame signal is active) FrameErr is signaled reported to the backend as long the ValidFrame is active. FrameErr is signaled also when non 8-bit aligned data is received and when FCS error is found.
|
341 |
|
|
|
342 |
|
|
\subsubsection{Timing}
|
343 |
|
|
|
344 |
|
|
|
345 |
|
|
\subsection{Transmit Channel}
|
346 |
|
|
Transmit channel provides interface to the backend via a simple handshake protocol that can be used to connect the controller to either a shared memory or FIFO buffer. This protocol uses the handshack protocol of the Wishbone SoC bus.
|
347 |
|
|
|
348 |
|
|
Transmit channel supports only 8-bits aligned data. Each frame starts with a starting flag (01111110) and ends with starting flag (01111110). Since the transmission is synchronous only, the channel uses the external clock and a byte must be written to the channel within the first 7 clock pulses after the ready signal is asserted. If no data is inserted during this period (while ValidFrame signal is active) abort pattern is transmitted and reported to the backend via AboredTrans signal as long the ValidFrame is active.
|
349 |
|
|
|
350 |
|
|
|
351 |
|
|
\subsubsection{Design notes}
|
352 |
|
|
|
353 |
|
|
\subsubsection{Timing}
|
354 |
|
|
The channel starts accepting data after asserting the ValidFrame signal. This signal can control no of idle pattern bits (e.g. if this signal is de-asserted for 8 bits only a single Idle pattern (8 ones) is inserted). Valid Frame signal must be asserted for 8 clocks after any valid write operation.
|
355 |
|
|
|
356 |
|
|
\subsection{External FIFO and registers}
|
357 |
|
|
The controller has optional external FIFO buffers, one for data to be transmitted and one for data to be received. Status and control registers are available to control these FIFOs. These two blocks (FIFOs and registers) are built around the HDLC controller core which make them optional if the core is to be used in different kind of applications.
|
358 |
|
|
The current implementation supports the following configuration:
|
359 |
|
|
The size of the Transmit and receive FIFOs is $(8\times 128)$ bits which enables 128 maximum HDLC frame size.
|
360 |
|
|
|
361 |
|
|
The transmit buffer is used to prevent underflow while transmitting bytes to the line. All bytes will be available once the transmit is enabled. The Receive buffer is used to provide data burst transfer to the Back end interface which prevents the back end from reading each byte alone. The FIFO size is suitable for operating frequencies 2.048MHz on the serial interface and 50 MHz on the back end interface. Other frequencies can operate if the delay between HDLC frames is less than the delay needed for the back end to empty the internal FIFO (the next calculations is an example to be applied for different frequencies)
|
362 |
|
|
|
363 |
|
|
7 bits (minimum bits between HDLC Frames) / 2.048MHz = 3.418 us
|
364 |
|
|
|
365 |
|
|
128 Bytes (Maximum frame size) / 50MHz = 2.56 us
|
366 |
|
|
|
367 |
|
|
|
368 |
|
|
These FIFOs are implemented on Single port memory. Two interrupt lines are used, one to signal transmission done and one to request transfer of received frame to memory. These interrupts are also reflected in Status registers to support polling mode for the controller.
|
369 |
|
|
|
370 |
|
|
|
371 |
|
|
|
372 |
|
|
\subsection{Registers}
|
373 |
|
|
All internal registers are 8-bit width.
|
374 |
|
|
\subsubsection{Transmit}
|
375 |
|
|
|
376 |
|
|
\begin{tabular}{l l}
|
377 |
|
|
\textbf{Tx Status and Control Register: Tx\_SC} & Offset Address = 0x0\\
|
378 |
|
|
\end{tabular}\\
|
379 |
|
|
|
380 |
|
|
\begin{tabular}{|l||c|c|c|c|c|c|c|c|}
|
381 |
|
|
\hline
|
382 |
|
|
\hline
|
383 |
|
|
BIT & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
|
384 |
|
|
\hline
|
385 |
|
|
FIELD &N/A &N/A &FCSen & FIFOOverflow& Aborted& TxAbort& TxEnable& TxDone\\
|
386 |
|
|
\hline
|
387 |
|
|
RESET & 0& 0& 0& 0& 0& 0& 0& 0\\
|
388 |
|
|
\hline
|
389 |
|
|
R/W & RO& RO& WO& RO& RO& WO& WO& RO\\
|
390 |
|
|
\hline
|
391 |
|
|
\end{tabular}\\
|
392 |
|
|
|
393 |
|
|
\begin{tabular}{l l}
|
394 |
|
|
\textbf{Tx FIFO buffer register: Tx\_Buffer} & Offset Address = 0x1\\
|
395 |
|
|
\end{tabular}\\
|
396 |
|
|
|
397 |
|
|
\begin{tabular}{|l||c|}
|
398 |
|
|
\hline
|
399 |
|
|
\hline
|
400 |
|
|
BIT & 7-0\\
|
401 |
|
|
\hline
|
402 |
|
|
FIELD & Transmit Data byte\\
|
403 |
|
|
\hline
|
404 |
|
|
RESET & 0x0\\
|
405 |
|
|
\hline
|
406 |
|
|
R/W & WO\\
|
407 |
|
|
\hline
|
408 |
|
|
\end{tabular}
|
409 |
|
|
|
410 |
|
|
\subsubsection{Receive}
|
411 |
|
|
|
412 |
|
|
\begin{tabular}{l l}
|
413 |
|
|
\textbf{Rx Status and Control Register: Rx\_SC} & Offset Address = 0x2\\
|
414 |
|
|
\end{tabular}\\
|
415 |
|
|
|
416 |
|
|
\begin{tabular}{|l||c|c|c|c|c|c|c|c|}
|
417 |
|
|
\hline
|
418 |
|
|
\hline
|
419 |
|
|
BIT & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0\\
|
420 |
|
|
\hline
|
421 |
|
|
FIELD &N/A &N/A &N/A & FIFOOverflow& Aborted& FrameError& Drop& RxReady\\
|
422 |
|
|
\hline
|
423 |
|
|
RESET & 0& 0& 0& 0& 0& 0& 0& 0\\
|
424 |
|
|
\hline
|
425 |
|
|
R/W & RO& RO& RO& RO& RO& RO& WO& RO\\
|
426 |
|
|
\hline
|
427 |
|
|
\end{tabular}\\
|
428 |
|
|
|
429 |
|
|
|
430 |
|
|
\begin{tabular}{l l}
|
431 |
|
|
\textbf{Rx FIFO buffer register: Rx\_Buffer} & Offset Address = 0x3\\
|
432 |
|
|
\end{tabular}\\
|
433 |
|
|
|
434 |
|
|
\begin{tabular}{|l||c|}
|
435 |
|
|
\hline
|
436 |
|
|
\hline
|
437 |
|
|
BIT & 7-0\\
|
438 |
|
|
\hline
|
439 |
|
|
FIELD & Received Data byte\\
|
440 |
|
|
\hline
|
441 |
|
|
RESET & 0x0\\
|
442 |
|
|
\hline
|
443 |
|
|
R/W & RO\\
|
444 |
|
|
\hline
|
445 |
|
|
\end{tabular}\\
|
446 |
|
|
|
447 |
|
|
\begin{tabular}{l l}
|
448 |
|
|
\textbf{Rx Frame length: Rx\_Len} & Offset Address = 0x4\\
|
449 |
|
|
\end{tabular}\\
|
450 |
|
|
|
451 |
|
|
\begin{tabular}{|l||c|}
|
452 |
|
|
\hline
|
453 |
|
|
\hline
|
454 |
|
|
BIT & 7-0\\
|
455 |
|
|
\hline
|
456 |
|
|
FIELD & Frame Length\\
|
457 |
|
|
\hline
|
458 |
|
|
RESET & 0x0\\
|
459 |
|
|
\hline
|
460 |
|
|
R/W & RO\\
|
461 |
|
|
\hline
|
462 |
|
|
\end{tabular}\\
|
463 |
|
|
|
464 |
|
|
\subsection{Transmit Frame}
|
465 |
|
|
\begin{itemize}
|
466 |
|
|
\item The CPU should check TxDone (in Tx status register 0x0) bit of it is '1' or wait for TxDone interrupt. TxDone bit is reset to '0' after the first write to Tx FIFO Buffer register (0x1).
|
467 |
|
|
\item The CPU should write frame data bytes to Tx FIFO buffer register (0x1).
|
468 |
|
|
\item After writing all data bytes to TX buffer register, the CPU should write '1' to TxEnable to enable data transmission to the line. After writing to this bit no further write operation to Tx FIFO buffer register is allowed till TxDone is set (all writes will be ignored).
|
469 |
|
|
\item It is optional for the CPU to check the status bits of Tx status register.
|
470 |
|
|
\end{itemize}
|
471 |
|
|
|
472 |
|
|
\subsection{Receive Frame}
|
473 |
|
|
\begin{itemize}
|
474 |
|
|
\item The controller sets RxReady bit in Rx Status and control register (0x2) and sets the TxReady interrupt line to indicate valid frame in internal buffer is available.
|
475 |
|
|
\item It is recommended that the CPU read the Rx Status and control register (0x3).
|
476 |
|
|
\item The CPU should read the Frame length register (0x4) to check the size of the frame. The value of this regiter is valid only after the RxReady bit is set and remains valid till the first read from the Data buffer.
|
477 |
|
|
\item The CPU should read Rx FIFO buffer register (0x3) Frame length times to get all frame bytes. Performing extra reads (read from empty buffer) produces invalid data.
|
478 |
|
|
\item If the CPU does not read all frame bytes as soon as possible the internal buffer will overflow and FIFOOverflow bit will be set and the current frame should be dropped. No further read operations should be attempted till RxReady bit is set again and RxReady interrupt is signaled indicating new available frame.
|
479 |
|
|
\item The software can drop entire frame from the Receive FIFO buffer by writing 1 to drop bit in the status and control receive register (0x3). This is suitable for dropping bad frames (for any reason) or frames with incorrect addresses.
|
480 |
|
|
\end{itemize}
|
481 |
|
|
|
482 |
|
|
\subsection{Connection to TDM controller}
|
483 |
|
|
This controller can get/send data from/to TDM controller through software control. The software configures the TDM controller to select the channel. It adds/removes the address and control information fields of the HDLC frame. Then passes the data field between the two controllers through optional DMA transfer.
|
484 |
|
|
|
485 |
|
|
\subsection{Clocks Synchronization}
|
486 |
|
|
Since the core can operate in different clock domains (The serial line domain and the backend interface domain), all control signals pass through two flip flops to reduce the metastability. These Flip Flops are clocked with the same clock of the interface that read these signals.
|
487 |
|
|
|
488 |
|
|
|
489 |
2 |
khatib |
\subsection{Diagrams}
|
490 |
11 |
khatib |
\begin{figure}[!h]
|
491 |
|
|
\includegraphics[angle=0,width=\textwidth]{HDLC_top.ps}
|
492 |
|
|
\caption{HDLC core}\label{Core}
|
493 |
|
|
\end{figure}
|
494 |
2 |
khatib |
|
495 |
11 |
khatib |
\begin{figure}[!h]
|
496 |
|
|
\includegraphics[angle=0,width=\textwidth]{HDLC_cont.ps}
|
497 |
|
|
\caption{HDLC controller}\label{controller}
|
498 |
|
|
\end{figure}
|
499 |
2 |
khatib |
|
500 |
|
|
|
501 |
|
|
%%- New section -%%
|
502 |
|
|
%%------------------------------------------%%
|
503 |
|
|
\section{Testing and verifications}
|
504 |
|
|
|
505 |
|
|
|
506 |
|
|
\begin{tabular}{|l|l|l|}
|
507 |
|
|
\hline
|
508 |
|
|
Requirement & Test method & Validation method \\
|
509 |
|
|
\hline
|
510 |
|
|
\hline
|
511 |
|
|
Interface timing & &\\
|
512 |
|
|
\hline
|
513 |
|
|
& & \\
|
514 |
|
|
\hline
|
515 |
|
|
\hline
|
516 |
|
|
Functionality & & \\
|
517 |
|
|
\hline
|
518 |
|
|
\end{tabular}
|
519 |
|
|
\subsection{Simulation and Test benches}
|
520 |
|
|
|
521 |
|
|
\subsection{Verification techniques and algorithms}
|
522 |
|
|
|
523 |
|
|
\subsection{Test plans}
|
524 |
|
|
|
525 |
|
|
%%- New section -%%
|
526 |
|
|
%%------------------------------------------%%
|
527 |
|
|
\section{Implementations}
|
528 |
11 |
khatib |
The design is implemented using the VHDL language. The design is divided into three main blocks, serial Receive channel, Serial Transmit channel and the Top blocks.
|
529 |
|
|
The Receive and Transmit serial channels perform the HDLC
|
530 |
|
|
functionality. The Top blocks perform the FCS calculation (Which is
|
531 |
|
|
either FCS-16 or FCS-32), the frame buffering the interface with the
|
532 |
|
|
back end system and the synchronization between the clocks. The FCS and Buffering can be changed by replacing the corresponding files.
|
533 |
2 |
khatib |
|
534 |
|
|
\subsection{Scripts, files and any other information}
|
535 |
11 |
khatib |
\begin{tabular}{|l|l|}
|
536 |
|
|
\hline
|
537 |
|
|
RX & \\
|
538 |
|
|
\hline
|
539 |
|
|
RxChannel.vhd & Top Rx Channel \\
|
540 |
|
|
Rxcont.vhd & Rx Controller \\
|
541 |
|
|
Zero\_detect.vhd & Zero detect and serial to parallel \\
|
542 |
|
|
flag\_detect.vhd & Flag detection \\
|
543 |
|
|
\hline
|
544 |
|
|
TX & \\
|
545 |
|
|
\hline
|
546 |
|
|
TxChannel.vhd & Top Tx channel \\
|
547 |
|
|
TXcont.vhd & Tx Controller\\
|
548 |
|
|
zero\_ins.vhd & Zero insertion and parallel to serial \\
|
549 |
|
|
flag\_ins.vhd & Flag insertion \\
|
550 |
|
|
\hline
|
551 |
|
|
Top & \\
|
552 |
|
|
\hline
|
553 |
|
|
TxBuff.vhd& Tx buffer\\
|
554 |
|
|
TxFCS.vhd & Tx FCS-16\\
|
555 |
|
|
TxSync.vhd & Tx synchronization\\
|
556 |
|
|
RxBuff.vhd& Rx buffer\\
|
557 |
|
|
RxFCS.vhd & Rx FCS-16\\
|
558 |
|
|
RxSync.vhd & Rx synchronization\\
|
559 |
|
|
WB\_IF.vhd & WishBone interface\\
|
560 |
|
|
hdlc.vhd & Top HDLC controller\\
|
561 |
|
|
\hline
|
562 |
|
|
\end{tabular}
|
563 |
2 |
khatib |
|
564 |
11 |
khatib |
|
565 |
|
|
|
566 |
|
|
|
567 |
2 |
khatib |
\subsection{Design conventions and coding styles}
|
568 |
|
|
|
569 |
|
|
%%- New section -%%
|
570 |
|
|
%%------------------------------------------%%
|
571 |
|
|
\section{Reviews and comments}
|
572 |
|
|
|
573 |
|
|
%%- New section -%%
|
574 |
|
|
%%------------------------------------------%%
|
575 |
|
|
\section{References}
|
576 |
|
|
|
577 |
|
|
|
578 |
|
|
\end{document}
|