Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Enable" and "Disable" FrameV2 events when enable signal changes state. #5

Merged
merged 3 commits into from
Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/SpiAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ void SpiAnalyzer::AdvanceToActiveEnableEdgeWithCorrectClockPolarity()
for( ;; )
{
if( IsInitialClockPolarityCorrect() == true ) // if false, this function moves to the next active enable edge.
{
if( mEnable )
{
FrameV2 frame_v2_start_of_transaction;
mResults->AddFrameV2( frame_v2_start_of_transaction, "enable", mCurrentSample, mCurrentSample + 1 );
}
break;
}
}
}

Expand Down Expand Up @@ -173,6 +180,13 @@ bool SpiAnalyzer::WouldAdvancingTheClockToggleEnable()
U64 next_edge = mClock->GetSampleOfNextEdge();
bool enable_will_toggle = mEnable->WouldAdvancingToAbsPositionCauseTransition( next_edge );

if( enable_will_toggle )
{
U64 enable_edge = mEnable->GetSampleOfNextEdge();
FrameV2 frame_v2_end_of_transaction;
mResults->AddFrameV2( frame_v2_end_of_transaction, "disable", enable_edge, enable_edge + 1 );
}

if( enable_will_toggle == false )
return false;
else
Expand Down Expand Up @@ -278,7 +292,7 @@ void SpiAnalyzer::GetWord()
}
}

// save the resuls:
// save the results:
U32 count = mArrowLocations.size();
for( U32 i = 0; i < count; i++ )
mResults->AddMarker( mArrowLocations[ i ], mArrowMarker, mSettings->mClockChannel );
Expand Down