This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Random Error 34 in Keil uVision simulator

Hi Everyone,

Many thanks for all the previous answer it helps a lot :)

I am using the Keil uVision 4.00a simulator (so no hardware target link) for a C51 chip.

Our software grew a lot bigger so we now have different libraries each of which have their own emulation benches (*.ini files included in a master *.ini). Every benches apply stimuli check answers perform a certain number of tests on timings etc ...

Everything works fine BUT the whole test bench rarely passes through all different tests. Not because the software under test is failing, but because some emulation functions "become undefined". The functions are running properly for a while but crash somehow (I can see in the logic analyzer that the functions do not generate anymore signals). So I can see the emulation going well for part of the tests and suddenly having one of those messages:
*** error 34: 'MyFunction' undefined.
*** function 'MyFunction', error 10, line 119: Syntax error

The second error usually occurs in a function that perform the interface between a fixed virtual hardware configuration (defined here as PORT_DATA, PIN_SYNC, PIN_TE ) of the simulation bench and the real hardware configuration. Every uS the values defined PORT_DATA, PIN_SYNC, PIN_TE are routed to the corresponding real simulator pins ( PORT1 & PORT3 ). The values PORT_DATA, PIN_SYNC, PIN_TE are set by other SIGNAL function running in parallel:

DEFINE  unsigned char   K_BIT_SYNC;     K_BIT_SYNC = 3;         /* sync ( 2=Px.2 3=Px.3 ) */
DEFINE  unsigned char   K_BIT_TEN;      K_BIT_TEN = 7;          /* test enable ( 7=Py.7 ) */
DEFINE  bit             PIN_TE;         PIN_TE = 0;             /* Virtual test enable pin */
DEFINE  bit             PIN_SYNC;       PIN_SYNC = 0;           /* Virtual sync pin */
DEFINE  unsigned char   PORT_DATA;      PORT_DATA = 0;          /* Virtual RFC port */
DEFINE  unsigned char   PORT3_TMP;      PORT3_TMP = 0;          /* Temp storage to build up the new port value */

SIGNAL void fncUpdateVirtualPort( void ) {
        while( 1 ) {                                            /* This is line 119 */
                PORT1 = (PORT1 & ~(1<<K_BIT_SYNC))+( (char)PIN_SYNC<<K_BIT_SYNC);
                P3 = P3 | ( (char)PIN_TE<<K_BIT_TEN);
                PORT3_TMP = (PORT3 & ~(1<<K_BIT_TEN))+( (char)PIN_TE<<K_BIT_TEN);
                PORT3 = (PORT3_TMP & 0xF0) + PORT_DATA;
                swatch( 0.000001 );
        }
}
fncUpdateVirtualPort();                                         /* Run continuously */

The function works according to the expectations but shows the syntax error after running the simulation for some time (the function has been looping several thousands of times at that point).

If I stop the debug session. and start again, the test bench might pass or display a different error. So far I have been able to narrow down the problem to SIGNAL functions.
Any hints? clue? Is there a limit to the number of signal function / calling tree deepness...? Anything I have to consider when I use several SIGNAL function running simultaneously?