I'm working on a port of our RTOS abstraction layer for DSP/BIOS 5.41.09.34, compiler tools 7.0.4. I am targeting the C6747, and running in the C6747 functional simulator.
One thing I can't check is if the functional simulator has a version, or which version of the tools this is attached to? I am on Win7, running CCS5 to avoid some annoyances with the graphics, but CCS4 gives the same results.
The tconf file is as follows:
utils.loadPlatform("ti.platforms.evm6747");
/* The following DSP/BIOS Features are enabled. */
bios.enableRealTimeAnalysis(prog);
bios.enableRtdx(prog);
bios.enableTskManager(prog);
bios.RTDX.MODE = "Simulator";
bios.MEM.NOMEMORYHEAPS = 0;
bios.MEM.instance("IRAM").createHeap = 1;
bios.MEM.BIOSOBJSEG = prog.get("IRAM");
bios.MEM.MALLOCSEG = prog.get("IRAM");
bios.MEM.instance("IRAM").heapSize = 0x00010000;
// !GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!
prog.gen();
Our self tests have some timer stuff, and it's giving inconsistent results. First of all, some of the queries to the CLK module are suspect:
CLK_countspms(); Yields 300000 (seems okay based on 300MHz core clock)
CLK_getprd(); Yields 300000 (seems okay based on default setup of 1000 microsecond period)
CLK_cpuCyclesPerHtime(); Yields 0 (!?)
CLK_cpuCyclesPerLtime(); Yields 0 (!?)
But what is odd:
uint32_t tickStart = CLK_getltime();
uint32_t clkStart = CLK_gethtime();
TSK_sleep(100);
uint32_t tickDelta = CLK_getltime() - tickStart; // Yields 100 (seems okay)
uint32_t clkDelta = CLK_gethtime() - clkStart; // Yields 14463739 (?!?!?)
This code simplifies our unit test framework, and removes the abstraction layers, but what we are trying to test here is that our clock counting mechanism is consistent with the system tick clock. And this test is obviously failing. We expect there to be roughly 300000 * 100 based on the result of CLK_getprd(). I might even accept a /4 error given the CLK_cpuCyclesPerHtime() is clearly giving a bad result. I would also accept something related to 24MHz based on the default configuration for BIOS, except that CLK_getprd() is not consistent with a 24MHz.
If I change the clock settings to NOT "specify input clock rate" (so that the 24MHz is not used) then I get all of the same results except for the clkDelta.
utils.loadPlatform("ti.platforms.evm6747");
/* The following DSP/BIOS Features are enabled. */
bios.enableRealTimeAnalysis(prog);
bios.enableRtdx(prog);
bios.enableTskManager(prog);
bios.RTDX.MODE = "Simulator";
bios.MEM.NOMEMORYHEAPS = 0;
bios.MEM.instance("IRAM").createHeap = 1;
bios.MEM.BIOSOBJSEG = prog.get("IRAM");
bios.MEM.MALLOCSEG = prog.get("IRAM");
bios.MEM.instance("IRAM").heapSize = 0x00010000;
bios.CLK.SPECIFYRATE = 0;
// !GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!
prog.gen();
/* ... */
uint32_t clkDelta = CLK_gethtime() - clkStart; // Yields 180636804 (?!?!?)
Yet another number I can't correlate with anything.
I have not tried this test on actual hardware...
Any thoughts?
Thanks!
Peter
