static int mytest(int ud, int reason) { PLI_INT32 ht, lt; PLI_BYTE8 *cp; PLI_BYTE8 *inst = tf_getinstance(); PLI_BYTE8 *name = tf_spname(); (void)ud; /* Parameter is not used. */ (void)reason; /* Parameter is not used. */ io_printf("Module %s\n", name); lt = tf_gettime(); io_printf("\ttf_gettime()\t\t\t-> %d\n", (int)lt); cp = tf_strgettime(); io_printf("\ttf_strgettime()\t\t\t-> %s\n", cp); lt = tf_getlongtime(&ht); io_printf("\ttf_getlongtime()\t\t-> %d/%d\n", (int)ht, (int)lt); lt = tf_igetlongtime(&ht, inst); io_printf("\ttf_igetlongtime(inst)\t\t-> %d/%d\n", (int)ht, (int)lt); lt = tf_getlongsimtime(&ht); io_printf("\ttf_getlongsimtime()\t\t-> %d/%d\n", (int)ht, (int)lt); lt = tf_gettimeprecision(); io_printf("\ttf_gettimeprecision()\t\t-> %d\n", (int)lt); lt = tf_igettimeprecision(inst); io_printf("\ttf_igettimeprecision(inst)\t-> %d\n", (int)lt); lt = tf_gettimeunit(); io_printf("\ttf_gettimeunit()\t\t-> %d\n", (int)lt); lt = tf_igettimeunit(inst); io_printf("\ttf_gettimeunit(inst)\t\t-> %d\n", (int)lt); lt = tf_igettimeunit(0); io_printf("\ttf_gettimeunit(0)\t\t-> %d\n", (int)lt); return 0; }
static int calltf(int ud, int reason) { int i; PLI_BYTE8 *inst = tf_getinstance(); (void)ud; /* Parameter is not used. */ (void)reason; /* Parameter is not used. */ for (i = 1; i < 5; i++) { io_printf("tf_getp(%d)\t\t-> %d\n", i, (int)tf_getp(i)); io_printf("tf_igetp(%d,inst)\t-> %d\n", i, (int)tf_igetp(i,inst)); io_printf("tf_getrealp(%d)\t\t-> %f\n", i, tf_getrealp(i)); io_printf("tf_igetrealp(%d,inst)\t-> %f\n", i, tf_igetrealp(i,inst)); } return 0; }
int tf_setdelay(PLI_INT32 delay) { return tf_isetdelay(delay, tf_getinstance()); }
/************************************************* lxt2_recordvars - add objects to be recorded ************************************************/ int lxt2_recordvars( int data, int reason ) { int update = 0; int objects = 0; int i; acc_initialize(); switch( reason ) { case reason_calltf: break; case reason_checktf: goto DONE; case reason_finish: if( lxt.inited ) { lxt2_close(); } goto DONE; case reason_rosynch: update = (lxt.updateList != NULL); while( lxt.updateList ) { info_p info; info = lxt.updateList; lxt2_dump( info, 0 ); lxt.updateList = info->updateNext; info->updateNext = 0; } if( update ) { lxt2_timemarkerp1(); } while( lxt.eventList ) { info_p info; info = lxt.eventList; lxt2_dump( info, 1 ); lxt.eventList = info->updateNext; info->updateNext = 0; } lxt2_nexttimemarker(); goto DONE; default: goto DONE; } ginstance = tf_getinstance(); /* * parse options first */ for( i = 1; i <= tf_nump(); ++i ) { handle object; if( tf_typep(i) == tf_nullparam ) { continue; } if( tf_typep(i) == tf_string ) { char* str = acc_fetch_tfarg_str(i); lxt2_option( str ); continue; } } /* * on first call, initialize structure */ if( !lxt.inited ) { lxt2_init(); } for( i = 1; i <= tf_nump(); ++i ) { handle object; if( tf_typep(i) == tf_nullparam ) { continue; } if( tf_typep(i) == tf_string ) { continue; } object = acc_handle_tfarg(i); if( !object ) { tf_error( "cannot find object" ); tf_dofinish(); goto DONE; } lxt2_add( object, lxt.depth ); objects++; } if( objects == 0 ) { #if DEBUG io_printf( "lxt2_recordvars: defaultpath=%s\n", acc_fetch_fullname(acc_handle_parent(acc_handle_tfinst())), lxt.depth ); #endif lxt2_add( acc_handle_parent(acc_handle_tfinst()), lxt.depth ); } lxt2_dump( lxt.objectList, 1 ); DONE: acc_close(); return 0; }
PLI_INT32 tf_setrealdelay(double dly) { return tf_isetrealdelay(dly, tf_getinstance()); }
PLI_INT32 tf_rosynchronize(void) { return tf_irosynchronize(tf_getinstance()); }