This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Task Sleep and timer not working in C64+ megamodule cycle accurate simulator

Other Parts Discussed in Thread: SYSBIOS

 

Hi I have an issue The task sleep and timer interrupt is not working with the simulator setup. I have gone through the following link and tired the changes mentioned in this but still I was not sucessfull. the Swi post is working but task sleep and timer is not working.

http://processors.wiki.ti.com/index.php/C64x%2B_CPU_Cycle_Accurate_Simulator

Following version I use:

BIOS version:6.34.4.22

XDC version  :3.24.5.48

compiler:Tiv.7.4.4

ti.platforms.sim64Pxx 

ti.targets.C64P

Code Composer Studio Version: 5.5.0.00077

 

  • 4111.app.cfg

     

    Attached app.cfg which i was used and changed tisim_c64plus.cfg like below

     MODULE TIMER_CONNECTION;
      SUB_MODULES DM64xx, TCI64xx;
      
      MODULE DM64xx;
       CONDITION1   AND, DM64xx;
       
       //**************************//
       //! CPU Memory Map Setting !//
       //**************************//     
       CONNECT1  System.VBUSM_TO_MIF0_mem_map, System.MIF_TO_FLATMEM_mif, 0x0, 0xffffffff, 0;
       CONNECT2  System.C64xplus.MM.EMCCtrlecfg_mem_map, System.MIF_TO_FLATMEM_mif, 0x0, 0xffffffff, 0;
       CONNECT3  System.C64xplus.MM.EMCCtrlecfg_mem_map, System.TIMER64_0_mif, 0x02940000, 0x0294003F, -0x02940000;
       CONNECT4  System.C64xplus.MM.EMCCtrlecfg_mem_map, System.TIMER64_1_mif, 0x02980000, 0x0298003F, -0x02980000;

  • Hi,
    Could you please share your project code.
  • /*
    * ======== main.c ========
    */

    #include <xdc/std.h>

    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/System.h>

    #include <ti/sysbios/BIOS.h>

    #include <ti/sysbios/knl/Task.h>
    #include<ti/sysbios/knl/Swi.h>
    #include <ti/sysbios/hal/Timer.h>

    #define CM_FCLKEN_PER *(int *)0x48005000
    #define CM_ICLKEN_PER *(int *)0x48005010

    Task_Handle task;
    Swi_Handle swi1;
    Timer_Handle timer0;
    Swi_Params params;
    Timer_Params paramstimer;
    Error_Block eb;

    /*
    * ======== taskFxn ========
    */
    Void swifxn(UArg a0, UArg a1)
    {
    System_printf("inside SWI interrupt call()\n");
    }

    Void timerfxn(UArg a0)
    {
    static int i;
    System_printf("inside Timer() %d \n",i++);
    }



    Void task_Sim(UArg a0, UArg a1)
    {
    System_printf("enter taskFxn()\n");

    Task_sleep(1);

    Swi_post(swi1);
    System_printf("exit taskFxn()\n");

    System_flush(); /* force SysMin output to console */
    }

    /*
    * ======== main ========
    */
    Int main()
    {

    System_printf("enter main()\n");

    Error_init(&eb);
    task = Task_create(task_Sim, NULL, &eb);
    if (task == NULL) {
    System_printf("Task_create() failed!\n");
    BIOS_exit(0);
    }

    Swi_Params_init( &params );
    Timer_Params_init(&paramstimer);
    paramstimer.period=100000;
    // paramstimer.periodType=PeriodType_MICROSECS;

    //CM_FCLKEN_PER = CM_FCLKEN_PER|0x000107C0; // 9,8,7 enabled
    //CM_ICLKEN_PER = CM_ICLKEN_PER|0x000107C0;



    swi1= Swi_create( swifxn, &params, &eb );

    // Allocate and initialize a new instance object and return its handle

    timer0= Timer_create(1, timerfxn, &paramstimer, &eb);

    BIOS_start(); /* does not return */
    return(0);
    }
  • Hi, Titus

    I have pasted the code. please let me know your thought.

    regards
    John
  • One more doubt,
    How does the clock module works in c64+ simulator ?? . in target we configure with a GP timer.
  • John,

    Since your questions are more related to the simulator and its configuration, rather than the hardware timer's register settings, this seems more appropriate to be addressed in the Code Composer Forum where there will be more help available for the simulator. I have asked a Moderator to move this thread there, from the C6000 Single Core DSP Forum.

    Regards,
    RandyP
  • I found the issue. the issue was in the target configuration file , for TMS320C64x+ Cycle Accurate Simulator I need to choose this device --> C6455 earlier i was using incorrect device. found it from spru600i document.
  • Thank you for your help Randy How do i mark this thread as closed.
  • John,

    Thank you for replying back with your solution. It will help many people who have a similar problem, do an E2E search and find your thread with the Verified Answer.

    You post above is marked with the green box meaning Verify Answer, and that takes care of closing it. When it is marked as Answered, we know we do not need to keep pushing for an answer and readers can quickly find the most important post in the thread.

    Regards,
    RandyP