Exemple #1
0
bool EnigmaSim::isHighQos(int qos){
    vector<ENIGMA_FLIT_S>::iterator iter = dutActive.begin();
    int count = 0;

    while( iter != dutActive.end()){
        if( (*iter).qos > qos ){
            if(getFirstPtr((*iter).id) == count){
                if( (signal.tick - (*iter).tick) > ENIGMA_SCHE_MAX  ){
                    if( (*iter).id == portC.back().id  && 
                        ((signal.tick - portC.back().tick ) < ENIGMA_SCHE_MAX)
                        ){
                        showOCell("+Warning: FLIT Qos may not the highest when a IDs group jump to high Qos");
                    }else{
                        showOCell("+Warning: FLIT Qos would not be the highest when a IDs group jump to high Qos");
                        return false;
                    }
                }
            }
        }
        count++;
        iter++;
    }

    return true;
}
Exemple #2
0
LinkedList<T>* LinkedList<T>:: getAtPtr(int i)
{
	if(size() < i)
	{
		std::cout<<"!-- ERROR : PANIC in getAtPtr()---nothing to point to--!"<<std::endl;
		return(NULL);
	}

	int counter = 0;
	LinkedList<T>* p = getFirstPtr();
	while(counter < i)
	{
		counter++;
		p=p->m_next;
	}
	return(p);

}
Exemple #3
0
bool EnigmaSim::checkOCell(){
    bool check = true;
    
    if(isIDExist(ocell.id)){
        if(isIDPending(ocell.id)){
            check = false;
            showOCell("+ERROR: the ID is locked when sent out");
        }else{

            if( isHighQos(ocell.qos) ){
                int p = getFirstPtr(ocell.id);
                if( (dutActive.at(p).id != ocell.id) ||
                    (dutActive.at(p).qos != ocell.qos) ||
                    (dutActive.at(p).payload[0] != ocell.payload[0]) ||
                    (dutActive.at(p).payload[1] != ocell.payload[1]) ||
                    (dutActive.at(p).payload[2] != ocell.payload[2]) ||
                    (dutActive.at(p).payload[3] != ocell.payload[3]) 
                    ){
                    check = false;
                }
                if(check == false){
                    if(isIDUnique(ocell.id)){
                        showOCell("+ERROR: FLIT INFO not correct when ID is unique");
                    }else{
                        showOCell("+ERROR: FLIT INFO not correct when ID is not unique");
                    }
                    showFLIT( dutActive.at(p) );
                }
                
            }else{
                showOCell("+ERROR: FLIT is not high Qos when invoke");
                check = false;
            }
        }
    }else{
        showOCell("+ERROR: the FLIT is not exist");
        check = false;
    }

    return check;
}