Example #1
0
void
DYN_PARAM_SWITCH_CLASS::ProcessSwitchString(const char *arg)
{
    char *name = strdup(arg);
    char *eq = index(name, '=');
    if ( ! eq )
    {
        ASIMERROR("Invalid parameter specification in '"
                  << "--param " << name << "'" << endl
                  << "    Correct syntax: -param <name>=<value>" << endl);
    }
    else
    {
        char *value = eq + 1;
        *eq = '\0';
        if ( ! SetParam(name, value))
        {
            *eq = '=';
            ASIMERROR("Don't know about dynamic parameter "
                      << name << endl);
        }
        *eq = '=';
    }
    free(name);
}
bool
ASIM_COMMON_SYSTEM_CLASS::InitModule()
{
    if ( ! ASIM_SYSTEM_CLASS::InitModule()) 
    {
        ASIMERROR("System module did not initialize properly\n");
    }

    if (myChip.InitModule() == false) 
    {
        ASIMERROR("The chip module did not initialize properly\n");
    }

    return true;
}
bool
ASIM_COMMON_SYSTEM_CLASS::InitModule()
{
    
    if (!ASIM_SYSTEM_CLASS::InitModule()) 
    {
        ASIMERROR("System module did not initialize properly\n");
    }

    if (myChip.InitModule() == false) 
    {
        ASIMERROR("The chip module did not initialize properly\n");
    }

    // We initialize the clockserver structures
    // IMPORTANT! It must be done after the modules initialization!
    clock->InitClockServer();

    // Set the reference clock domain (-rd option)
    clock->SetReferenceClockDomain(referenceDomain);    
    
    return true;
}
Example #4
0
// cleanup
void LLPI_CLASS::KillMonitorThread()
{
    if (pthread_self() == monitorThreadID)
    {
        ASIMERROR("llpi: Monitor thread trying to cancel itself!\n");
    }
    else if (monitorAlive)
    {
        usleep(50); // Allow non-thread-safe printouts or calls to older stdlib implementations to finish.
        pthread_cancel(monitorThreadID);
        pthread_join(monitorThreadID, NULL);
        monitorAlive = false;
    }
}