Skip to content

Commit

Permalink
IOB now loads timing data from JSON correctly. gp4tchar now operates …
Browse files Browse the repository at this point in the history
…in "append" mode, adding timing data to existing file if present
azonenberg committed Jun 4, 2017
1 parent 9c33a81 commit c014b81
Showing 2 changed files with 41 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/gp4tchar/main.cpp
Original file line number Diff line number Diff line change
@@ -137,10 +137,10 @@ int main(int argc, char* argv[])
// return 1;

//Save to disk
/*

LogNotice("Saving timing data to file %s\n", tfname.c_str());
g_calDevice.SaveTimingData(tfname.c_str());
*/

//Print output
LogNotice("Dumping timing data...\n");
{
60 changes: 39 additions & 21 deletions src/greenpak4/Greenpak4IOB.cpp
Original file line number Diff line number Diff line change
@@ -399,24 +399,7 @@ void Greenpak4IOB::SaveTimingData(FILE* fp, PTVCorner corner)

bool Greenpak4IOB::LoadExtraTimingData(PTVCorner corner, string delaytype, json_object* object)
{
/*
//Pull out all of the json stuff
json_object* from;
if(!json_object_object_get_ex(object, "from", &from))
{
LogError("No source for this delay\n");
return false;
}
string sfrom = json_object_get_string(from);
json_object* to;
if(!json_object_object_get_ex(object, "to", &to))
{
LogError("No dest for this delay\n");
return false;
}
string sto = json_object_get_string(to);
//always need rising/falling data no matter what it is
json_object* rising;
if(!json_object_object_get_ex(object, "rising", &rising))
{
@@ -432,11 +415,46 @@ bool Greenpak4IOB::LoadExtraTimingData(PTVCorner corner, string delaytype, json_
return false;
}
float nfalling = json_object_get_double(falling);
auto delay = CombinatorialDelay(nrising, nfalling);

//Schmitt trigger has no further parameters
if(delaytype == "schmitt")
m_schmittTriggerDelays[corner] = delay;

//Finally, we can actually save the delay!
m_pinToPinDelays[corner][PinPair(sfrom, sto)] = CombinatorialDelay(nrising, nfalling);
*/
//Output buffers need drive strength
else if(delaytype == "obuf")
{
json_object* drive;
if(!json_object_object_get_ex(object, "drive", &drive))
{
LogError("No drive info for this corner\n");
return false;
}
int ndrive = json_object_get_int(drive);

DriveStrength st;
switch(ndrive)
{
case 4:
st = DRIVE_4X;
break;

case 2:
st = DRIVE_2X;
break;

case 1:
default:
st = DRIVE_1X;
break;
}

m_outputDelays[DriveCondition(st, corner)] = delay;
}

//Call base class and make it warn if we don't know what the signal does
else
return Greenpak4IOB::LoadExtraTimingData(corner, delaytype, object);
//no need to call base class, it's an empty stub
return true;
}

0 comments on commit c014b81

Please sign in to comment.