Version 1.4.1 and 1.4.2 of the V6M6 host software and FPGA configurations include some significant changes:
IM2E1 and IM2T1 Enhancements in Version 1.4.1
The new FPGA configuration (imtelco13.mcs) has added logic to avoid the problem. If the module is generating TDM clock from an RCLK and is told to derive T1 transmit clock from TDM clock, it will automatically revert to using the RCLK selected as the source of TDM clock as the source for the T1 transmit clock.
First, the new FPGA configuration for the IM2E1 and IM2T1 includes logic to compare the receive clocks (RCLK) extracted from the incoming lines to detect which is the faster of the two. The library functions, im2e1_rcvclk and im2t1_rcvclk, now accept a value of 3 for their select argument. When select is 3 the module will choose the faster of the two RCLKs to derive the TDM clock. This ensures that any frame slips are due to elastic store underflows and data will be repeated rather than lost.
Second, logic in the new FPGA along with a hardware modification (Revision 2 of the IM2E1 and IM2T1 module) allows the module to flag data from a repeated frame as invalid on the TDM Subsystem. When used in conjunction with conditional TDM destinations for MIPS modules, the MIPS processor receiving E1 or T1 data via TDM will not receive data from repeated frames.
Functions were added to the host library to enable or disable the slipped frame invalidation mode:
int
im2e1_slipinval (pci, select)
int
im2t1_slipinval (pci, select)
PCI_MOD *pci - pointer to an open IM2E1 or IM2T1.
int select - controls slip frame invalidation
mode for lines 0 and 1.
Bit 0 of select controls slip frame invalidation mode for
line 0: a 1 in this bit enables and a 0 disables.
Bit 1 enables or disables this mode for line 1.
Note 1: Using this mode requires that the Framer chips be configured to generate an interrupt. For both the IM2E1 and IM2T1, this means turning on bit 4 of Interrupt Mask Register 1 in their respective framer chips. For the im2e1_outreg function, the register address is IM2E1REG_MASK1. For the im2t1_outreg function, the register address is IM2T1REG_MASK1.
Note 2: The interrupt must be serviced by the host system or a processor on the V6M6 in time for the next frame slip to be recognized. The time between slips will, of course, depend on the frequency offset between the two incoming RCLKs. For example, with a frequency offset of 0.01%, a slip can be expected every 1.25 seconds.
Bit 8 - RCLK faster than TDMCLK interrupts to PCI INT A
Bit 9 - RCLK faster than TDMCLK interrupts to PCI INT B
The status of this detection is available using the im2e1_intstat
or im2t1_intstat functions. The value returned by these functions
now includes:
Bit 4 - RCLK detected faster than TDMCLK
When this interrupt is serviced, the application running on the host or a
MIPS processor may decide to switch which IM2E1 or IM2T1 module is
sourcing the TDM clock.
Note that the interrupt condition is latched and will remain active
until clear by calling a new function:
int
im2e1_clrfastclk (pci)
int
im2t1_clrfastclk (pci)
PCI_MOD *pci - pointer to an open IM2E1 or IM2T1.
DM4C51 Support in Version 1.4.1
Accessing a C51 Processor unit for control and data transfer operations requires accessing the Unix device and initializing a PCI_MOD structure. This is handled by the dm4c51_open function.
PCI_MOD *
dm4c51_open(devname)
char *devname - name of PCI device and C51 DSP
The devname argument specifies the name of the V6M6 board,
the module location and the C51 DSP on the module.
The format of the name is pciNMD.
The PCI_MOD pointer returned by dm4c51_open is used to pass information about the module and DSP to other library functions.
The dm4c51_init function is used to initialize the C51 DSP referenced by the pci pointer. Note that because a given DM4C51 module is accessed through a single Unix device, the four C51 DSP cannot be accessed by different host programs.
int
dm4c51_init(pci)
PCI_MOD *pci - pointer to an open DM4C51
Most data transfers are handled using the general purpose V6M6 data transfer functions:
pci_dl_i8b pci_up_i8b pci_dl_a8b pci_up_a8b
pci_dl_i16b pci_up_i16b pci_dl_a16b pci_up_a16b
Due to the way the compiler for the C51 arranges long integers in memory, the standard transfer functions for 32-bit values and arrays will not work. The library includes the following functions for 32-bit data transfers:
dm4c51_dl_i32b downloads a 32-bit value to memory of the C51 referenced by pci.
int
dm4c51_dl_i32b(pci, pciadr, value)
PCI_MOD *pci - pointer to an open DM4C51
u_long pciadr - PCI memory address on the DM4C51,
must be modulo-2 aligned
u_long value - Data value to be downloaded
dm4c51_up_i32b uploads a 32-bit value from memory of the C51 referenced by pci. The value returned is the data read from the C51's memory.
long
dm4c51_up_i32b(pci, pciadr)
PCI_MOD *pci - pointer to an open DM4C51
u_long pciadr - PCI memory address on the DM4C51,
must be modulo-2 aligned
dm4c51_dl_a32b and dm4c51_up_a32b download and upload arrays of 32-bit values between the host and the C51 DSP referenced by pci.
int
dm4c51_dl_a32b (pci, pciadr, nlwords, buf)
int
dm4c51_up_a32b (pci, pciadr, nlwords, buf)
PCI_MOD *pci - pointer to an open DM4C51
u_long pciadr - DM4C51 PCI memory address,
must be modulo-2 aligned
u_long nlwords - number of 32-bit words to transfer
u_long *buf - pointer to source data
C51 executable code is loaded in C51 memory on a DM4C51 using the pci_load_code function. When pci_load_code returns a 0 value, it indicates an error reading the file or downloading the program data. For example:
char *prog_name = "c51program";
if (!pci_load_code(pci, prog_name, MM_COFF))
{
perror(prog_name);
exit(1);
}
The dm4c51_run and dm4c51_halt functions are used to control execution of programs in a C51 DSP.
int
dm4c51_run(pci)
int
dm4c51_halt(pci)
PCI_MOD *pci - pointer to an open DM4C51
The C51 DSPs communicate with the V6M6 TDM subsystem through an SC4000 SCSA interface. Each C51 DSP is allocated 32 time slots on the DM4C51 side of the SC4000. The 32 time slots may be mapped to any TDM time slot and TDM bus on the TDM subsystem side of the SC4000.
The C51 DSPs read and write TDM data in their local memory using double buffers. Data is transferred between the TDM data memory and the SC4000 by a common DMA controller on the DM4C51 module. The TDM data buffers are fixed at 32 bytes in size and are at fixed locations in the DSP's memory:
DSP mem addr Buffer Use
------------ ----------
0x1ff80 TDM Out Buffer 1 (to TDM)
0x1ffa0 TDM Out Buffer 2 (to TDM)
0x1ffc0 TDM In Buffer 1 (from TDM)
0x1ffe0 TDM In Buffer 2 (from TDM)
A register bit for each C51 DSP indicating which incoming TDM buffer has data available. The same flag indicates which outgoing TDM buffer may be written to by the C51 DSP.
The standard TDM mapping functions, pci_tdm_src_add, pci_tdm_dst_add, etc. are not used for the DM4C51. Instead, use the functions described below to establish TDM connectivity for the DM4C51. Note that these functions assume the TDM subsystem is configured to use 8-bit TDM slots.
The dm4c51_sc4000_init function resets and initializes the SC4000 and disables its DMA controller. The tdmframe argument specifies the number of 8-bit TDM time slots per TDM frame. In cases where the TDM time slots are larger than 8 bits, this value should specify the equivalent number of 8-bit slots.
int
dm4c51_sc4000_init(pci, tdmframe)
PCI_MOD *pci - pointer to an open DM4C51
int tdmframe - slots per TDM frame:
32, 64 or 128
For adding TDM source and destination connections use the dm4c51_tdm_src_add and dm4c51_tdm_dst_add functions. These functions configure the next available SC4000 slot of the SC4000 to source the TDM bus or receive from the TDM bus during the specified TDM time slot. They also enable the TDM data DMA controller and configure the DMA data count.
int
dm4c51_tdm_src_add(pci, TDMslot, TDMbus)
int
dm4c51_tdm_dst_add(pci, TDMslot, TDMbus)
PCI_MOD *pci - pointer to an open DM4C51
u_int TDMbus - TDM bus: TDM_BUSA, TDM_BUSB,
TDM_BUSC or TDM_BUSD
u_int TDMslot - time slot number (1 - 128).
TDM connections are deleted using the dm4c51_tdm_src_del and dm4c51_tdm_dst_del functions. These functions modify the SC4000 configuration to stop driving the TDM bus or stop receiving from the TDM bus during the specified TDM time slot.
int
dm4c51_tdm_src_del(pci, TDMslot, TDMbus)
int
dm4c51_tdm_dst_del(pci, TDMslot, TDMbus)
PCI_MOD *pci - pointer to an open DM4C51
u_int TDMbus - TDM bus: TDM_BUSA, TDM_BUSB,
TDM_BUSC or TDM_BUSD
u_int TDMslot - time slot number (1 - 128).
A mode was added to reverse the 4 bits of 32K ADPCM data. This mode is selected using a new function, img726_adpcm_32k_reverse:
int
img726_adpcm_32k_reverse (pci, reverse)
PCI_MOD *pci - pointer to an open IM2E1 or IM2T1.
int reverse - 1 enables reverse mode
0 disables reverse mode.
Note that the img726_init function will always clear the reverse
mode setting.
Beta Release of TDM Configurator in Version 1.4.1
The process of generating C code to configure the TDM subsystem using the various library functions can be tedious. Although using the library functions to select timing sources, set parameters and build the TDM connection map provides the most flexible approach, the code tends to be hard to read and modify. The TDM Configurator provides a more integrated approach. It may be used to set up a static or initial TDM configuration using a TDM description file for the configuration of each board in the system.
The TDM Configurator is available as both a host library function call, pci_tdmreadcfg, and as a stand-alone program, pcitdmconfig. Both forms use an input source file; a TDM description file. This file, created by the user, contains a description of the TDM components, operational parameters and connection map for a V6M6 board and its modules. It provides the ability to specify and configure the three following aspects of the serial data flow in your system:
The TDM map compiler parses a TDM description file and makes the appropriate function calls to configure the TDM controller, TDM map RAM, SCSA interfaces, T1 and E1 modules, and any other modules involved in generating timing for the TDM subsystem.
A complete manual for the TDM Configurator and the TDM description file is being written. It will be available on our Internet site or by request soon. In the meantime, the initial version of the software is provided in this release to allow customers to use example applications developed at CAC and WMI.