URL
https://opencores.org/ocsvn/tdm/tdm/trunk
Subversion Repositories tdm
[/] [tdm/] [web_uploads/] [tdm_project.html] - Rev 8
Compare with Previous | Blame | View Log
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <HTML> <META NAME="GENERATOR" CONTENT="TtH 2.67"> <H3 align=center>Jamil Khatib </H3> <title> TDM controller core</title> <H1 align="center">TDM controller core </H1> <p> <center>(C) Copyright 2001 Jamil Khatib.</center> <p> <H1>Contents </H1><A href="#tth_sEc1" >1 List of authors and changes</A><br> <A href="#tth_sEc2" >2 Project Definition</A><br> <A href="#tth_sEc2.1" >2.1 Introduction</A><br> <A href="#tth_sEc2.2" >2.2 Objectives</A><br> <A href="#tth_sEc3" >3 Specifications</A><br> <A href="#tth_sEc3.1" >3.1 System Features Specification</A><br> <A href="#tth_sEc3.2" >3.2 External Interfaces</A><br> <A href="#tth_sEc3.2.1" >3.2.1 Back-end interface mapping to Wishbone SoC bus</A><br> <A href="#tth_sEc3.2.2" >3.2.2 CPU interface</A><br> <A href="#tth_sEc4" >4 Internal Blocks</A><br> <A href="#tth_sEc5" >5 Design description</A><br> <A href="#tth_sEc5.1" >5.1 ST-Bus interface</A><br> <A href="#tth_sEc5.1.1" >5.1.1 Design notes</A><br> <A href="#tth_sEc5.1.2" >5.1.2 Timing</A><br> <A href="#tth_sEc5.2" >5.2 External FIFO</A><br> <A href="#tth_sEc5.2.1" >5.2.1 Notes</A><br> <A href="#tth_sEc5.3" >5.3 ISDN support</A><br> <A href="#tth_sEc5.4" >5.4 Registers</A><br> <A href="#tth_sEc5.4.1" >5.4.1 Transmit</A><br> <A href="#tth_sEc5.4.2" >5.4.2 Receive</A><br> <A href="#tth_sEc5.5" >5.5 Diagrams</A><br> <A href="#tth_sEc6" >6 Testing and verifications</A><br> <A href="#tth_sEc6.1" >6.1 Simulation and Test benches</A><br> <A href="#tth_sEc6.2" >6.2 Verification techniques and algorithms</A><br> <A href="#tth_sEc6.3" >6.3 Test plans</A><br> <A href="#tth_sEc7" >7 Implementations</A><br> <A href="#tth_sEc7.1" >7.1 Scripts, files and any other information</A><br> <A href="#tth_sEc7.2" >7.2 Design conventions and coding styles</A><br> <A href="#tth_sEc8" >8 Reviews and comments</A><br> <A href="#tth_sEc9" >9 References</A><br> <p> <H2><A NAME="tth_sEc1"> 1</A> List of authors and changes</H2> <p> <TaBle border> <tr><td>Name </td><td>Changes </td><td>Date </td><td>Contact address</td></tr><tr><td> <tr><td>Jamil Khatib </td><td>Initial release </td><td>3-2-2001 </td><td>khatib@ieee.org </td></tr> <tr><td>Jamil Khatib </td><td>General review and CPU interface added </td><td>10-2-2001 </td><td>khatib@ieee.org </td></tr> <tr><td>Jamil Khatib </td><td>ISDN support added </td><td>3-4-2001 </td><td>khatib@ieee.org </td></tr> <tr><td>Jamil Khatib </td><td>Buffer Calculations added </td><td>9-4-2001 </td><td>khatib@ieee.org </td></tr></TaBle> <p> <H2><A NAME="tth_sEc2"> 2</A> Project Definition</H2> <p> <H3><A NAME="tth_sEc2.1"> 2.1</A> Introduction</H3> Time devision multiplexing is a scheme used to communicate between systems or devices via shared interface lines. Each device or system gets the access to this interface in a single time slot. <p> <H3><A NAME="tth_sEc2.2"> 2.2</A> Objectives</H3> The aim of this project is to develop the basic TDM functionalities to be used by many communication systems like ISDN, E1, T1 and voice codecs. <p> <H2><A NAME="tth_sEc3"> 3</A> Specifications</H2> <p> <H3><A NAME="tth_sEc3.1"> 3.1</A> System Features Specification</H3> <OL type="1"> <li> Supports E1 bit rate and time slots (32 time slots or 32 DS0 channels at bit rate 2.048Mbps) <li> Supports ST-Bus (Serial Telecom bus) interface. <li> Routes time slots to/from HDLC controller via the backend interface and software support or to/from memory. <li> Supports read for all or partial TDM slots from the ST-bus. <li> Supports write for all or partial TDM slots to ST-bus. <li> It supports N×64 mode (i.e. it supports sampling (or writing) to N consecutive time slots) <li> Supports two serial lines one input and one output. <li> Can be connected to other ST-Bus compatible devices via serial or star configurations. <li> If no data is available for transmission it sends all ones. <li> Backend interface uses the Wishbone bus interface which can be connected directly to the system or via FIFO buffer. <li> Optional External FIFO buffer, configuration and status registers. <li> The core will be made of two levels of hierarchies, the basic functionality and the Optional interfaces and buffers which makes it easy to add extra serial lines by duplicating the TDM controllers in parallel. <li> ISDN (2B+D) support can be supported by adding three parallel HDLC controllers on the first three time slots. </OL> <p> <H3><A NAME="tth_sEc3.2"> 3.2</A> External Interfaces</H3> <p> <TaBle border> <tr><td>Signal name</td><td>Direction</td><td>Description</td></tr><tr><td> <tr><td>Control interface </td><td></td><td></td></tr><tr><td> <tr><td>Rst_n </td><td>Input </td><td>System asynchronous reset (active low)</td></tr> <tr><td>Size[4:0] </td><td>Input </td><td>Number of time slots (Can be fixed)</td></tr><tr><td> <tr><td>Serial Interface (ST-Bus)</td><td></td><td></td></tr><tr><td> <tr><td>C2 </td><td>Input </td><td>Bus Clock</td></tr> <tr><td>DSTi </td><td>Input</td><td>Receive serial Data</td></tr> <tr><td>DSTo </td><td>Output </td><td>Transmit serial Data</td></tr> <tr><td>F0_n </td><td>Input </td><td>Framing pulse (active low)</td></tr> <tr><td>F0od_n </td><td>Output </td><td>Delayed Framing pulse (active low)</td></tr><tr><td> <tr><td>Back-end Interface (Received)</td><td></td><td></td></tr><tr><td> <tr><td>RxD[7:0]</td><td>Output</td><td>Receive data bus</td></tr> <tr><td>RxValidData</td><td>Output</td><td>Valid Data</td></tr> <tr><td>FrameErr</td><td>Output</td><td>Error in the received data</td></tr> <tr><td>Read</td><td>Input</td><td>Read byte</td></tr> <tr><td>Ready</td><td>Output</td><td>Valid data exists</td></tr><tr><td> <tr><td>Back-end Interface (Transmited)</td><td></td><td></td></tr><tr><td> <tr><td>TxD[7:0]</td><td>Input</td><td>Transmit data bus</td></tr> <tr><td>TxValidData</td><td>Input</td><td>Valid Data</td></tr> <tr><td>Write</td><td>Input</td><td>Write byte</td></tr> <tr><td>Ready</td><td>Output</td><td>Ready to get data</td></tr></TaBle> <p> <H4><A NAME="tth_sEc3.2.1"> 3.2.1</A> Back-end interface mapping to Wishbone SoC bus</H4> The TDM backend interface is divided into two parts one for receive and one for transmit.It can be used as a slave core or master according to the below mapping. The core supports SINGLE READ/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. <br> <p> <p><A NAME="tth_fIg1"> </A> <a href="wishlogo.ps">Figure</a><A NAME="Logo"> </A><p> <TaBle border> <tr><td>Signal Name</td><td>Wishbone signal</td></tr><tr><td> <tr><td>Master Configuration connected to FIFO</td><td>Receive channel</td></tr> <tr><td>C2 </td><td>CLK_I</td></tr> <tr><td>Rst </td><td>not RST_I</td></tr> <tr><td>RxD[7:0]</td><td>DAT_O(7:0)</td></tr> <tr><td>RxValidData</td><td>STB_O</td></tr> <tr><td>RxValidData</td><td>CYC_O</td></tr> <tr><td>Read</td><td>ACK_I and not RTY_I</td></tr> <tr><td>Ready</td><td>WE_O</td></tr> <tr><td>FrameERR</td><td>TAG0_O</td></tr> <tr><td>Slave FIFO(two-clock domain FIFO)</td><td></td></tr> <tr><td>Data[7:0]</td><td>DAT_I(7:0)</td></tr> <tr><td>Chip Select</td><td>STB_I</td></tr> <tr><td>STB_I and not FullFlag</td><td>ACK_O</td></tr> <tr><td>FullFlag</td><td>RTY_O</td></tr> <tr><td>Write</td><td>WE_I</td></tr> <tr><td>Slave Configuration </td><td></td></tr> <tr><td>C2 </td><td>CLK_I</td></tr> <tr><td>Rst </td><td>not RST_I</td></tr> <tr><td>RxD[7:0]</td><td>DAT_O(7:0)</td></tr> <tr><td>RxValidData</td><td>TAG0_O</td></tr> <tr><td>ReadByte</td><td>not WE_I</td></tr> <tr><td>Ready</td><td>not RTY_O</td></tr> <tr><td>STB_I and not WR_I</td><td>ACK_O</td></tr> <tr><td>FrameERR</td><td>TAG1_O</td></tr></TaBle> <p> <TaBle border> <tr><td>Signal Name</td><td>Wishbone signal</td></tr><tr><td> <tr><td>Master Configuration connected to FIFO</td><td>Transmit channel</td></tr><tr><td> <tr><td>C2 </td><td>CLK_I</td></tr> <tr><td>Rst </td><td>not RST_I</td></tr> <tr><td>TxD[7:0]</td><td>DAT_I(7:0)</td></tr> <tr><td>Write</td><td>ACK_I and not RTY_I</td></tr> <tr><td>Ready</td><td>not WE_O</td></tr> <tr><td>TxValidData</td><td>TAG0_I</td></tr> <tr><td>Always Active </td><td>CYC_O</td></tr> <tr><td>Always Active </td><td>STB_O</td></tr> <tr><td>Slave FIFO(two-clock domain FIFO)</td><td></td></tr> <tr><td>Data[7:0]</td><td>DAT_I(7:0)</td></tr> <tr><td>EmptyFlag</td><td>RTY_O</td></tr> <tr><td>Read</td><td>WE_I</td></tr> <tr><td>WE_I and not EmptyFlag</td><td>ACK_O</td></tr> <tr><td>ChipSelect</td><td>STB_I</td></tr> <tr><td>Slave Configuration </td><td></td></tr> <tr><td>C2 </td><td>CLK_I</td></tr> <tr><td>Rst </td><td>not RST_I</td></tr> <tr><td>TxD[7:0]</td><td>DAT_I(7:0)</td></tr> <tr><td>TxValidData</td><td>STB_I</td></tr> <tr><td>Write</td><td>WE_I</td></tr> <tr><td>Ready</td><td>not RTY_O</td></tr> <tr><td>STB_I and WR_I</td><td>ACK_O</td></tr></TaBle> <p> <H4><A NAME="tth_sEc3.2.2"> 3.2.2</A> CPU interface</H4> 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. <p> <TaBle border> <tr><td>Signal</td><td>Note</td></tr><tr><td> <tr><td>RST_I</td><td>Reset</td></tr> <tr><td>CLK_I</td><td>Clock</td></tr> <tr><td>ADR_I(2:0)</td><td>3-bit address line</td></tr> <tr><td>DAT_O(7:0)</td><td>8-bit receive data</td></tr> <tr><td>DAT_I(7:0)</td><td>8-bit transmit data</td></tr> <tr><td>WE_I</td><td>Read/write</td></tr> <tr><td>STB_I</td><td>Strobe</td></tr> <tr><td>ACK_O</td><td>Acknowledge</td></tr> <tr><td>CYC_I</td><td>Cycle</td></tr> <tr><td>RTY_O</td><td>Retry</td></tr> <tr><td>TAG0_O</td><td>TxDone interrupt</td></tr> <tr><td>TAG1_O</td><td>RxReady interrupt</td></tr></TaBle> <p> <H2><A NAME="tth_sEc4"> 4</A> Internal Blocks</H2> <p> <H2><A NAME="tth_sEc5"> 5</A> Design description</H2> <p> <H3><A NAME="tth_sEc5.1"> 5.1</A> ST-Bus interface</H3> The TDM controller interfaces to the TDM lines via serial telecom bus. The interface uses the external input clock (2.048MHz) for all of the internal serial logic. It detects the incoming framing pulse to synchronize the sampling and transmission of bits. The core reads and writes only the specified number of TDM channels (8-bits) by the size bus (No. of channels register). In the transmission mode the output pin should be disabled after writing the configured time slots. It generates also the output delayed framing pulse after it samples all the specified bits (TDM channels). This feature can be used to cascade controllers for different TDM channels. <p> <H4><A NAME="tth_sEc5.1.1"> 5.1.1</A> Design notes</H4> <p> <H4><A NAME="tth_sEc5.1.2"> 5.1.2</A> Timing</H4> <p> <H3><A NAME="tth_sEc5.2"> 5.2</A> External FIFO</H3> 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 TDM controller core which make them optional if the core is to be used in different kind of applications. <p> The current implementation supports the following configuration: The size of the Transmit and receive FIFOs is (8×32) bits which enables the whole TDM frame to be buffered. <p> The transmit buffer is used to prevent underflow while transmitting bytes to the line. All bytes will be available once the transmit is enabled. If the transmit FIFO is empty the core will transmit ones. 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 20 MHz on the back end interface. Other frequencies can operate if the back end can read the entire TDM frame before the first byte of the next frame is written (the next calculations is an example to be applied for different frequencies) <p> 8 bits (Time needed to receive the first byte of the next frame) / 2.048MHz = 3.9 us <p> 32 Bytes (Maximum frame size) / 20MHz = 1.6 us <p> These FIFOs are implemented on Single port memory. It is the responsibility of the external interface to write/read data to/from the FIFOs. TxDone and RxRdy interrupts are generated when the Tx buffer is empty and Rx buffer has data respectively . <p> <H4><A NAME="tth_sEc5.2.1"> 5.2.1</A> Notes</H4> <UL> <p> <li> <b>Transmit Operation:</b> If the transmit FIFO is empty not enough data bytes is available according to no. of channels (caused by incomplete burst transfer, the core sets the Aborted bit in the TX status and control register and sends all ones in the transmit serial line. <p> <li> <b>Transmit Operation:</b> The back end (software) should write data to the Tx buffer register according to the configured number of time slots. The transmission will start only after the specified number of slots are available in the buffer other wise Aborted bit of the Tx Status register will be set and all ones will be transmitted in this slot. <p> <li> <b>Receive Operation:</b> When Receive FIFO is full It drops the second FIFO contents and sets overflow bit in the Rx Status and Control register. <p> <li> <b>Receive Operation:</b> When RxRdy Interrupt is asserted (or RxRdy bit is set) the back end interface (software) must read the specified number of slots from the Rx Data buffer register or the buffer will not be marked as empty. </UL> <p> <H3><A NAME="tth_sEc5.3"> 5.3</A> ISDN support</H3> In order to provide (2B+D) ISDN support three HDLC controllers should be used on three time slots. The serial data the of first three time slots will enter (or get out) directly to (from) the three parallel HDLC controllers if HDLCen bit is set in the Tx Status and Control register. The HDLC controllers will be managed through the enable signals (each controller will be enabled on its corresponding time slot). These HDLC controllers will set in parallel with the Rx and Tx buffers (as shown in the figure) which still can be used even if the ISDN mode is enabled. <p> <p><A NAME="tth_fIg1"> </A> <a href="tdm_ISDN_top.ps">Figure</a> <center>Figure 1: ISDN support</center><A NAME="isdn"> </A> <p> <p> <H3><A NAME="tth_sEc5.4"> 5.4</A> Registers</H3> All internal registers are 8-bit width. <p> <H4><A NAME="tth_sEc5.4.1"> 5.4.1</A> Transmit</H4> <p> <TaBle> <tr><td><b>Tx Status and Control Register: Tx_SC</b> </td><td>Offset Address = 0x0</td></tr></TaBle> <br> <p> <TaBle border><tr><td> <tr><td>BIT </td><td align="center">7 </td><td align="center">6 </td><td align="center">5 </td><td align="center">4 </td><td align="center">3 </td><td align="center">2 </td><td align="center">1 </td><td align="center">0</td></tr> <tr><td>FIELD </td><td align="center">N/A </td><td align="center">N/A </td><td align="center">N/A </td><td align="center">N/A</td><td align="center">HDLCen</td><td align="center">Aborted</td><td align="center">TxEnable</td><td align="center">TxReady(empty)</td></tr> <tr><td>RESET </td><td align="center">0</td><td align="center">0</td><td align="center">0</td><td align="center">0</td><td align="center">0</td><td align="center">0</td><td align="center">0</td><td align="center">0</td></tr> <tr><td>R/W </td><td align="center">RO</td><td align="center">RO</td><td align="center">RO</td><td align="center">RO</td><td align="center">WO</td><td align="center">RO</td><td align="center">WO</td><td align="center">RO</td></tr></TaBle> <br> <p> <TaBle> <tr><td><b>Tx FIFO buffer register: Tx_Buffer</b> </td><td>Offset Address = 0x1</td></tr></TaBle> <br> <p> <TaBle border><tr><td> <tr><td>BIT </td><td align="center">7-0</td></tr> <tr><td>FIELD </td><td align="center">Transmit Data byte</td></tr> <tr><td>RESET </td><td align="center">0x0</td></tr> <tr><td>R/W </td><td align="center">WO</td></tr></TaBle> <p> <H4><A NAME="tth_sEc5.4.2"> 5.4.2</A> Receive</H4> <p> <TaBle> <tr><td><b>Rx Status and Control Register: Rx_SC</b> </td><td>Offset Address = 0x2</td></tr></TaBle> <br> <p> <TaBle border><tr><td> <tr><td>BIT </td><td align="center">7 </td><td align="center">6 </td><td align="center">5 </td><td align="center">4 </td><td align="center">3 </td><td align="center">2 </td><td align="center">1 </td><td align="center">0</td></tr> <tr><td>FIELD </td><td align="center">N/A </td><td align="center">N/A </td><td align="center">N/A </td><td align="center">N/A</td><td align="center">N/A</td><td align="center">FrameError</td><td align="center">Drop</td><td align="center">RxReady(Full)</td></tr> <tr><td>RESET </td><td align="center">0</td><td align="center">0</td><td align="center">0</td><td align="center">0</td><td align="center">0</td><td align="center">0</td><td align="center">0</td><td align="center">0</td></tr> <tr><td>R/W </td><td align="center">RO</td><td align="center">RO</td><td align="center">RO</td><td align="center">RO</td><td align="center">RO</td><td align="center">RO</td><td align="center">WO</td><td align="center">RO</td></tr></TaBle> <br> <p> <TaBle> <tr><td><b>Rx FIFO buffer register: Rx_Buffer</b> </td><td>Offset Address = 0x3</td></tr></TaBle> <br> <p> <TaBle border><tr><td> <tr><td>BIT </td><td align="center">7-0</td></tr> <tr><td>FIELD </td><td align="center">Received Data byte</td></tr> <tr><td>RESET </td><td align="center">0x0</td></tr> <tr><td>R/W </td><td align="center">RO</td></tr></TaBle> <br> <p> <TaBle> <tr><td><b>configuration register: CFG</b> </td><td>Offset Address = 0x4</td></tr></TaBle> <br> <p> <TaBle border><tr><td> <tr><td>BIT </td><td align="center">7-0</td></tr> <tr><td>FIELD </td><td align="center">No. of channels</td></tr> <tr><td>RESET </td><td align="center">0xFF</td></tr> <tr><td>R/W </td><td align="center">RO</td></tr></TaBle> <br> This register defines number of time slots will be sampled and written after the framing pulse.<br> <p> <b>HDLC registers</b> Each HDLC controller its own registers as described in the HDLC controller document but with the offset address as 0xY0 + z where Y represents the HDLC channel number and z the internal HDLC register offset. For example Tx_SC register of the second HDLC controller in the TDM controller will be mapped to 0x20 + 0x0 = 0x20 <p> <H3><A NAME="tth_sEc5.5"> 5.5</A> Diagrams</H3> <p> <p><A NAME="tth_fIg2"> </A> <a href="tdm_core.ps">Figure</a> <center>Figure 2: TDM core</center><A NAME="Core"> </A> <p> <p> <p><A NAME="tth_fIg3"> </A> <a href="tdm_top.ps">Figure</a> <center>Figure 3: TDM controller</center><A NAME="top"> </A> <p> <p> <H2><A NAME="tth_sEc6"> 6</A> Testing and verifications</H2> <p> <TaBle border> <tr><td>Requirement </td><td>Test method </td><td>Validation method </td></tr><tr><td> <tr><td>Interface timing </td><td></td><td></td></tr> <tr><td></td><td></td><td></td></tr><tr><td> <tr><td>Functionality </td><td></td><td></td></tr></TaBle> <H3><A NAME="tth_sEc6.1"> 6.1</A> Simulation and Test benches</H3> <p> <H3><A NAME="tth_sEc6.2"> 6.2</A> Verification techniques and algorithms</H3> <p> <H3><A NAME="tth_sEc6.3"> 6.3</A> Test plans</H3> <p> <H2><A NAME="tth_sEc7"> 7</A> Implementations</H2> <p> <H3><A NAME="tth_sEc7.1"> 7.1</A> Scripts, files and any other information</H3> <p> <H3><A NAME="tth_sEc7.2"> 7.2</A> Design conventions and coding styles</H3> <p> <H2><A NAME="tth_sEc8"> 8</A> Reviews and comments</H2> <p> <H2><A NAME="tth_sEc9"> 9</A> References</H2> <p>