Example #1
0
void EvcdReader::signalChanges(void)
{
    vector< pair< string, State > > states;
    vector< pair< string, string > > regStates;

    for (unsigned int i=0; i < currStates.size(); i++)
    {
        string alias = currStates[i].first;
        string name  = signalMap[alias].name;
		string type  = signalMap[alias].type;
        string value = currStates[i].second;

		if(type == "reg") {
			regStates.push_back(make_pair( name, value));
		}
		if(type == "inout" || type == "output" || type == "input" || type == "port") {
			const char ch = toupper(value[0]);

            State state = charToState(ch);

			states.push_back( make_pair( name, state));
		}
    }

//    if (states.size() > 0)
        evDataRef.data[currTime] = states;
//    if (regStates.size() > 0)
        evDataRef.setRegData( regStates, currTime);
}
Example #2
0
	//were basically reading from /proc/[pid]/stat
	void Process::readData()
	{
		std::getline(mReader,mData);

		char pName[512];
		char state;
		//std::sscanf from the c library comes handy here, because we dont have to deal with file parsing
		std::sscanf(mData.c_str(), "%d %s %c", &mPid, pName, &state);

		mProcessName = pName;
		mExecutionPath = getExPath();
		mState = charToState(state);
	}