Pumpkin, Inc.

Pumpkin User Forums

Watch out for that external RAM timing!

For issues specific to TI's TMS320C2000 DSPs, including TI's Code Composer Studio.

Watch out for that external RAM timing!

Postby aek » Tue Feb 25, 2003 3:13 am

A user evaluating Salvo Lite was getting benchmark results on real hardware (EVAL board from Spectrum Digital eZdsp) that were hugely different (slower) from what we were getting in cycle counts in the CCS simulator.

For example, using a test program we were measuring 874 cycles (5.8us @ 150MHz) from when a semaphore was signaled to when the task waiting on it became eligible and executed the next instruction after the call to OS_WaitSem(). The user was measuring 120us (20x slower!) on the EVAL kit with a 'scope.

It turns out that the difference was because of his use of the external RAM. On this particular board, there is a considerable speed penalty to be paid when using the external SRAM. Once internal RAM like HOSRAM was used instead of external RAM, the latencies matched.

Here's the code (main.c) that was used:

code:
#include "main.h"
#include "salvo.h"
#include "dsp28_device.h"

//
// Some setup for the TMS
//
#pragma DATA_SECTION(PieCtrlRegs,"PieCtrlRegsFile");
volatile struct PIE_CTRL_REGS PieCtrlRegs;

#pragma DATA_SECTION(GpioDataRegs,"GpioDataRegsFile");
volatile struct GPIO_DATA_REGS GpioDataRegs;

#pragma DATA_SECTION(GpioMuxRegs,"GpioMuxRegsFile");
volatile struct GPIO_MUX_REGS GpioMuxRegs;

#pragma DATA_SECTION(SysCtrlRegs,"SysCtrlRegsFile");
volatile struct SYS_CTRL_REGS SysCtrlRegs;


//
// Here starts the Salvo code
//
#define TASK_WAIT OSTCBP(1) /* task #1 */
#define PRIO_WAIT 10 /* task priorities*/
#define SEM_UPDATE_PORT_P OSECBP(1) /* semaphore #1 */

interrupt void ISR14(void) /* Timer 2 is in INTVECT #14 */
{
OSTimer();
}


_OSLabel(TaskWait1)

void TaskWait( void )
{
for (;;) {
OS_WaitSem(SEM_UPDATE_PORT_P, OSNO_TIMEOUT, TaskWait1);
//
// Clear the Output
//
GpioDataRegs.GPFDAT.bit.GPIOF14 = 0;
}
}

void main( void )
{
//
// Setup the TMS, enable the PIE Vector table
//
EVMAP;
PieCtrlRegs.PIECRTL.bit.ENPIE = 1;

//
// Init GPIO.....
//
InitGpio();

//
// Setup the PLL
//
EALLOW;
// Set the PLL to *10/2 -> 30Mhz * 10 / 2 = 150Mhz
// The 2812 works now with 150Mhz
SysCtrlRegs.PLLCR = 0xA;
// Wait for PLL to lock
DELAY_US(1000); /* 1ms */
EDIS;

OSInit();
OSCreateTask(TaskWait, TASK_WAIT, PRIO_WAIT);
OSCreateSem(SEM_UPDATE_PORT_P, 0);

OSEi();

OSSched();

for (;;) {
OSSignalSem(SEM_UPDATE_PORT_P);
GpioDataRegs.GPFDAT.bit.GPIOF14 = 1;
OSSched();
}
}


The latency was measured between when GPIOF14 went HIGH (1) to when GPIOF14 went LOW (0).

------------------

[This message has been edited by aek (edited February 25, 2003).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Return to TI's TMS320C2000 DSPs

Who is online

Users browsing this forum: No registered users and 1 guest

cron