Sundance SMT6035 User Manual v.2.2

SMT6035
User Manual
Version 2.2
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
1 Revision history
Date Comments Engineer Version
08/05/04 First rev FA 1.0
08/07/04 Minor fixes FA 2.0
26/08/05 Minor fixes FA 2.1
04/01/07 Typos fixed.
Added reference to
README.pdf
instructions file.
GM 2.2
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
2 Table of Contents
1 Revision history .............................................................................................................................. 2
2 Table of Contents ........................................................................................................................... 3
List of abbreviations................................................................................................................................. 6
3 List of figures................................................................................................................................... 6
4 Introduction ..................................................................................................................................... 7
5 Conventions.................................................................................................................................... 8
6 Prerequisites................................................................................................................................... 8
7 Software Installation and Setup...................................................................................................... 9
8 Hardware overview ......................................................................................................................... 9
8.1 Comport.................................................................................................................................. 9
8.2 The CPLD............................................................................................................................. 10
8.3 State of the IIOF lines .......................................................................................................... 10
8.4 The PCI bridge chip .............................................................................................................10
9 Software design ............................................................................................................................ 11
9.1 Interface mechanism............................................................................................................ 11
10 Functions exported by libsmtdrv.so ..............................................................................................11
10.1 SmtOpen .............................................................................................................................. 11
10.2 SmtGetBoardCount.............................................................................................................. 12
10.3 SmtOpenBoard ....................................................................................................................12
10.4 SmtCloseBoard .................................................................................................................... 12
10.5 SmtGetBoardIndex............................................................................................................... 13
10.6 SmtGetBoardInfo .................................................................................................................13
10.7 SmtGetError ......................................................................................................................... 14
10.8 SmtGetDLLVer..................................................................................................................... 14
10.9 SmtGetPluginVersion........................................................................................................... 15
11 Functional description................................................................................................................... 16
12 Host comport................................................................................................................................. 16
12.1 CpRead ................................................................................................................................ 16
12.2 CpWrite ................................................................................................................................ 17
12.3 CpCancel.............................................................................................................................. 17
13 Downloading files.......................................................................................................................... 17
13.1 BinaryLoad ........................................................................................................................... 17
13.2 CoffLoad............................................................................................................................... 18
14 Mailboxes...................................................................................................................................... 18
14.1 MbWrite................................................................................................................................ 19
14.2 MbRead................................................................................................................................ 20
14.3 MbCancel ............................................................................................................................. 20
15 High speed channel ...................................................................................................................... 20
15.1 Data transfer mechanism ..................................................................................................... 20
15.2 Control words ....................................................................................................................... 22
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
15.2.1 Protocol between DSP and host ................................................................................. 23
15.2.2 DSP writing to the host................................................................................................ 23
15.2.3 DSP reading from the host .......................................................................................... 24
15.3 SRAM arguments................................................................................................................. 24
15.4 PCI memory access ............................................................................................................. 24
15.5 Handlers............................................................................................................................... 25
15.5.1 Opening a handler....................................................................................................... 25
15.5.2 Closing a handler......................................................................................................... 25
15.5.3 The default handler...................................................................................................... 26
15.5.4 Custom handlers ......................................................................................................... 26
15.5.5 Development guidelines .............................................................................................. 27
15.6 Function reference ............................................................................................................... 28
15.6.1 HscInterface ................................................................................................................ 28
15.6.2 GetIFHw ...................................................................................................................... 28
15.6.3 GetChannel ................................................................................................................. 28
15.6.4 CtrlGet .........................................................................................................................28
15.6.5 CtrlPut.......................................................................................................................... 29
15.6.6 CtrlCancel.................................................................................................................... 29
15.6.7 ArgsPut........................................................................................................................ 29
15.6.8 ArgsGet ....................................................................................................................... 30
15.6.9 SramWrite.................................................................................................................... 30
15.6.10 SramRead ................................................................................................................... 30
15.6.11 SramCancel................................................................................................................. 30
15.6.12 MemOpen.................................................................................................................... 31
15.6.13 MemClose ................................................................................................................... 31
15.6.14 MemWriteStart............................................................................................................. 31
15.6.15 MemWriteDone............................................................................................................ 32
15.6.16 MemReadStart ............................................................................................................ 32
15.6.17 MemReadDone ........................................................................................................... 32
15.6.18 MemCancel ................................................................................................................. 32
15.6.19 RecallHandlers ............................................................................................................ 33
16 Board state.................................................................................................................................... 33
16.1 ResetTIMs............................................................................................................................ 33
16.2 ResetBoard .......................................................................................................................... 33
17 Read and write carrier board registers ......................................................................................... 33
17.1 Read32................................................................................................................................. 34
17.2 Read16................................................................................................................................. 34
17.3 Read8................................................................................................................................... 34
17.4 Write32................................................................................................................................. 34
17.5 Write16................................................................................................................................. 34
17.6 Write8................................................................................................................................... 34
18 PCI bridge chip register access .................................................................................................... 35
18.1 PciRead32............................................................................................................................ 35
18.2 PciWrite32............................................................................................................................ 35
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
18.3 PciWrite16............................................................................................................................ 35
18.4 PciWrite8.............................................................................................................................. 36
18.5 PciVirtualAddr ...................................................................................................................... 36
19 DSP interrupt ................................................................................................................................ 36
19.1 DspAttatchInt........................................................................................................................ 36
20 Memory allocation......................................................................................................................... 36
20.1 MemLock.............................................................................................................................. 37
20.2 MemUnlock .......................................................................................................................... 37
21 Performance figures ..................................................................................................................... 38
22 Handling errors ............................................................................................................................. 38
22.1 Exported functions ............................................................................................................... 38
22.2 Exception mechanism .......................................................................................................... 38
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
List of abbreviations
BAR Base Address Region
COFF Common Object File Format
CPLD Complex PLDs
DMA Direct Memory Access
DSP Digital Signal Processor
HSC High Speed Channel
JTAG Joint Test Action Group
MDL Memory Descriptor List
PCI Peripheral Component Interconnect
PLD Programmable Logic Device
SMT Sundance Multiprocessor Technology Ltd.
TIM Texas Instruments Module
3 List of figures
Figure 1 - The SMT6035 interfaces to Sundance hardware ....................................... 7
Figure 2 - Overview of the hardware. ......................................................................... 9
Figure 3 - Mailboxes with the SMT6035 ................................................................... 19
Figure 4 - Overview of data transfer mechanism ...................................................... 21
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
4 Introduction
The SMT6035 SDK provides you with an easy and efficient way to access Sundance carrier boards. It allows you to control these boards from the host as well as to exchange data between the carrier board and the host. The SMT6035 is ideal for customers that wish to develop their own code to interface with Sundance hardware.
Figure 1 - The SMT6035 interfaces to Sundance hardware
Figure 1 - shows the SMT6035 as a link between your application and the Sundance carrier boards in your system. Having a standard interface such as the SMT6035 ensures that you need no recompilation and can link your software when the hardware in the system changes. The SMT6035 hides the details of the device driver, allowing you to focus on development.
The SMT6035:
Provides host side support for 3L Diamond board services.
Shorten development time by providing you with a ready-to-use interface to
the hardware.
Transfer data between the carrier board and the host.
Downloads applications to the carrier board.
Obtains information about the carrier board.
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
Controls the state of the carrier board.
Gives you a basic building block for more complex systems.
Provides you with direct access to the hardware registers of the carrier board.
Provides you with a C++ type interface to the carrier board.
The SMT6035 currently supports the following carrier boards.
Carrier board Description Functionality
SMT300 1 TIM site Compact PCI carrier board Full support
SMT300Q 4 TIM site Compact PCI carrier board Full support
SMT310 1 TIM site PCI carrier board Full support
SMT310Q 4 TIM site PCI carrier board Full support
SMT130 PCI-104 TIM Carrier card Full support
SMT320 (Obsolete) 4 TIM site PCI carrier board Partial support
SMT327 (Obsolete) 4 TIM site Compact PCI carrier board Partial support
5 Conventions
UINT A 32 bit unsigned value (unsigned int)
DWORD 32 bit unsigned value (unsigned long)
Root TIM The TIM on site 1 of your carrier board
Root DSP The DSP on TIM site 1
6 Prerequisites
C++ is used for all software interfaces. Even if you are not familiar with C++, you should be able to find your way by referring to the examples. They have been compiled and tested with GCC C++ version 2.96, 3.2 and 4.1.
Debugging can be made through your preferred software (for example, with the standard text-mode GNU GDB tool or with one of its GUI front-ends such as ddd, kdbg or xxgdb).
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
7 Software Installation and Setup
Please refer to the README.pdf file included in the SMT6035 zip archive delivered to you. That document includes full and detailed installation instructions, basic system requirements and a Getting Started section about compiling the example applications.
8 Hardware overview
You need to be aware of the assumptions the SMT6035 makes about hardware resources. This section is a basic overview of the main hardware features supported, and shows how the SMT6035 interacts with them. The carrier board User Manual includes a more detailed description of the hardware.
CPLD (BAR 1)

Comport

IntD
PCI Bridge (BAR 0)
Comport
IntA
PCI
LINT (IIOF2)
Comport
IIOF1
IIOF2
IIOF0
Reset
The Bridge chip forms the link between the host and the DSP. The mailbox registers are contained in the bridge chip.
TIM site 1
(Boot loader
supports
loading binary
files from comport)
TIM site
2
TIM site
3
TIM site
4
Figure 2 - Overview of the hardware.
The figure above illustrates the main hardware concepts of a typical Sundance carrier board.
8.1 Comport
A comport is a generic mechanism for transferring data between the components of your system. Most TIMs have several comports that can be used to connect to each other or to the host. These links are usually made with FMS cables, but some boards have built-in connections that can be controlled by carrier board registers; the User Manual for your board will describe these
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
Version 2.2 Page 10 of 39 SMT6035 User Manual
registers in detail. The standard configuration will connect comport 3 on TIM site 1 to the host.
8.2 The CPLD
The CPLD is used to configure the carrier board. It allows you to select the direction of signals on the carrier board, to select interrupt sources and to set the routing of the IIOF lines. The CPLD registers are mapped onto BAR1 of the PCI bridge chip. The carrier board User Manual includes additional information about the CPLD.
8.3 State of the IIOF lines
The LINT (local interrupt) line on the global bus side of the PCI bridge chip can be switched to any of the IIOF lines that go to the DSP.
The initial configuration of the IIOF lines is as follows:
Line Use or direction
IIOF0 Host to DSP
IIOF1 DSP to Host
IIOF2 Used internally by the SMT6035 to signal mailbox interrupts
to the DSP.
Table 1 - Initial state of the IIOF lines when the SMT6035 starts up.
8.4 The PCI bridge chip
The bridge chip represents the link between the host and the carrier board; it connects the local bus on the carrier board with the PCI bus of the host. Specific openings are provided to act like windows through which the local bus can access data on the PCI bus.
The internal PCI bridge registers are mapped onto BAR0, allowing access by both the local bus (DSP side) and the PCI bus (host side). Contained in the bridge chip are the 16 x 8-bit mailbox registers (Section 14).
The bridge chip provides a local bus interrupt line (LINT) as well as a PCI bus interrupt line (IntA). These interrupt lines allow the host side to interrupt the DSP and vice versa.
More information about the bridge chip can be found at
http://www.quicklogic.com
.
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
Version 2.2 Page 11 of 39 SMT6035 User Manual
9 Software design
9.1 Interface mechanism
The software implementation has a C++ style interface, which provides pointers to the hardware.
libsmtdrv.so exports functions that gather information about the installed boards and provide interface pointers for later use.
To use the SMT6035, you have to:
Obtain an interface pointer to the hardware by calling SmtOpenBoard().
Use the interface pointer to call functions related to the hardware.
Example:
IFHw *pBoard = SmtOpenBoard(0); // open the first board found pBoard->ResetTIMs(); pBoard->BinaryLoad("MyFile.app");
10 Functions exported by libsmtdrv.so
This section describes each of the functions exported by Libsmtdrv.so. These functions are described in the header file SmtDrv.h.
10.1 SmtOpen
Initialize the SMT6035 library. Applications must call this function before using any other features of the library.
Prototype
SMTRet SmtOpen( void );
Return value
The function returns SMT_OK on successful completion; other return values indicate failure. SmtGetError() can be used to translate error values into descriptive strings.
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
Version 2.2 Page 12 of 39 SMT6035 User Manual
10.2 SmtGetBoardCount
Returns the number of Sundance carrier boards found in the system.
Prototype
DWORD SmtGetBoardCount(void);
Return value
The number of Sundance carrier boards found in the system.
10.3 SmtOpenBoard
Obtains an interface to a Sundance carrier board.
Prototype
IFHw * SmtOpenBoard( UINT nIndex );
Parameters
nIndex The zero-based index of the carrier board. nIndex should
be in the range 0 <= nIndex < GetBoardCount().
Return value
The return value is an interface of type IFHw that can be used to access the carrier board. Please refer to section 11 for a description of the functions provided by this interface. NULL (0) is returned on error.
10.4 SmtCloseBoard
Closes an interface to a board. You must not use the interface pointer after calling SmtCloseBoard().
Prototype
void SmtCloseBoard( UINT nBoard );
Parameters
nBoard The index of the board that should be closed. nIndex
should be in the range 0 <= nIndex < GetBoardCount().
User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.
Loading...
+ 27 hidden pages