Combinable task with port select causes ET_ILLEGAL_PC

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
MyKeys
Member++
Posts: 24
Joined: Mon Jul 03, 2017 9:41 am

Combinable task with port select causes ET_ILLEGAL_PC

Postby MyKeys » Fri Jul 06, 2018 5:21 pm

Why does the below code cause an ET_ILLEGAL_PC?

Note switching the tasks around with timer_task first or removing the [combine] stops the exception.
Am I missing something obvious?

Code: Select all


#include <platform.h>

on tile[0] : in port p_enc = XS1_PORT_4C;

[[combinable]]
void timer_task ()
{
    timer tmr_test;
    unsigned testValue;

    tmr_test :> testValue;

    while (1)
    {
        select
        {
            case tmr_test when timerafter (testValue) :> void:
                testValue += 100000000;
                break;
        }
    }
}

[[combinable]]
void port_task ()
{
    unsigned port_state;

    while(1)
    {
        select
        {
        case p_enc when pinsneq(port_state) :> port_state:
            break;
        }
    }
}

int main ( )
{
    par
    {
        on tile[0]:
        {
            [[combine]]
            par
            {
                port_task ();
                timer_task ();
            }
        }
    }

    return 0;
}
jakeh
Posts: 5
Joined: Fri Jul 28, 2017 9:55 am

Postby jakeh » Mon Jul 09, 2018 9:31 am

Hi MyKeys,

I'm not able to reproduce this exception on my machine with the given code.
What version of the tools (xTimeComposer) are you using?

Regards,
Jake
MyKeys
Member++
Posts: 24
Joined: Mon Jul 03, 2017 9:41 am

Postby MyKeys » Mon Jul 09, 2018 10:17 am

Hi Jake,

I was using v14.3.0 tools. Trying v14.3.2 seems to resolve the issue.
I don't see anything in the release notes between these versions that could explain this.

Thanks,
Mike

Who is online

Users browsing this forum: No registered users and 36 guests