Skip to content

Commit 7e7af60

Browse files
Now with the source changed!
1 parent 31c29fa commit 7e7af60

6 files changed

Lines changed: 110 additions & 110 deletions

readme.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ error-free, or that defects in it can be corrected.*__
1111

1212
## Description
1313

14-
TimeDelta measures the time from active edges on a reference input to active
15-
edges on a target input. It is useful for tasks such as monitoring the
14+
TimeDelta measures the time from active edges on a start input to active
15+
edges on a stop input. It is useful for tasks such as monitoring the
1616
performance of a digital PLL or the response time of a system to an input event.
1717

18-
Active edges may be set independently for the reference and the target inputs to
19-
be active rising or falling .
18+
Active edges may be set independently for the start and the stop inputs to be
19+
active rising or falling .
2020

2121
![Sample usage image](./docs/edges.png)
2222

23-
Reference edges are marked with a green circle. Target edges are marked with a
23+
Start edges are marked with a green circle. Stop edges are marked with a
2424
red square. The time between the two edges is shown in a text bubble above the
25-
reference trace between the reference and target edges.
25+
start trace between the start and stop edges.
2626

27-
TimeDelta looks for the most recent reference edge before a target edge. Only
28-
adjacent reference and target edges are paired up. Extra edges in either input
27+
TimeDelta looks for the most recent start edge before a stop edge. Only
28+
adjacent start and stop edges are paired up. Extra edges in either input
2929
are skipped.
3030

3131
__Note that TimeDelta does not create sample data at present.__
@@ -45,7 +45,7 @@ specific issues may be raised using GitHub's normal Issues management facility.
4545

4646
The fastest way to use this analyzer is to download a release from github at
4747
https://github.com/GrandFatherADI/TimeDelta/actions. Click on the commit title
48-
for the most recent release version (__V1.0.1__ for example), then at the bottom
48+
for the most recent release version (__V1.0.3__ for example), then at the bottom
4949
of the "runs" page click on the Artifacts entry for your platform. This will
5050
download a .zip file containing the extension file. Unzip this to a suitable
5151
place on your system. Use the "Load Existing Extension..." dialog to point

src/TimeDeltaAnalyzer.cpp

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,79 +20,79 @@ void TimeDeltaAnalyzer::SetupResults()
2020
{
2121
mResults.reset(new TimeDeltaAnalyzerResults(this, mSettings.get()));
2222
SetAnalyzerResults(mResults.get());
23-
mResults->AddChannelBubblesWillAppearOn(mSettings->mRefChannel);
23+
mResults->AddChannelBubblesWillAppearOn(mSettings->mStartChannel);
2424
}
2525

2626
void TimeDeltaAnalyzer::WorkerThread()
2727
{
28-
AnalyzerChannelData *refData = GetAnalyzerChannelData(mSettings->mRefChannel);
29-
AnalyzerChannelData *tagData = GetAnalyzerChannelData(mSettings->mTagChannel);
28+
AnalyzerChannelData *startData = GetAnalyzerChannelData(mSettings->mStartChannel);
29+
AnalyzerChannelData *stopData = GetAnalyzerChannelData(mSettings->mStopChannel);
3030
uint32_t sampleRate = GetSampleRate();
3131

3232
// Start on the first edge
33-
refData->AdvanceToNextEdge();
34-
tagData->AdvanceToNextEdge();
33+
startData->AdvanceToNextEdge();
34+
stopData->AdvanceToNextEdge();
3535

3636
// Move to the next edge if this one is boring
37-
if (bool(refData->GetBitState()) ^ mSettings->mRefEdgeIsPos)
38-
refData->AdvanceToNextEdge();
37+
if (bool(startData->GetBitState()) ^ mSettings->mStartEdgeIsPos)
38+
startData->AdvanceToNextEdge();
3939

40-
if (bool(tagData->GetBitState()) ^ mSettings->mTagEdgeIsPos)
41-
tagData->AdvanceToNextEdge();
40+
if (bool(stopData->GetBitState()) ^ mSettings->mStopEdgeIsPos)
41+
stopData->AdvanceToNextEdge();
4242

4343
while (true)
4444
{
45-
// Both reference and target channels are at interesting edges.
46-
// We are looking for the nearest reference edge before the current
47-
// target edge.
45+
// Both start and stop channels are at interesting edges.
46+
// We are looking for the nearest start edge before the current
47+
// stop edge.
4848

49-
uint64_t refEdge = refData->GetSampleNumber();
50-
uint64_t tagEdge = tagData->GetSampleNumber();
49+
uint64_t startEdge = startData->GetSampleNumber();
50+
uint64_t stopEdge = stopData->GetSampleNumber();
5151

52-
if (refEdge > tagEdge)
52+
if (startEdge > stopEdge)
5353
{
54-
// Current reference edge is after current target edge so find the
55-
// next interesting target edge
56-
tagData->AdvanceToNextEdge();
57-
tagData->AdvanceToNextEdge();
54+
// Current start edge is after current stop edge so find the
55+
// next interesting stop edge
56+
stopData->AdvanceToNextEdge();
57+
stopData->AdvanceToNextEdge();
5858
continue;
5959
}
6060

61-
uint64_t pendingRefEdge = refEdge;
61+
uint64_t pendingStartEdge = startEdge;
6262

6363
// Force a small read ahead on both channels (we hope)
64-
tagData->WouldAdvancingToAbsPositionCauseTransition(tagEdge + 10);
65-
refData->WouldAdvancingToAbsPositionCauseTransition(tagEdge + 10);
64+
stopData->WouldAdvancingToAbsPositionCauseTransition(stopEdge + 10);
65+
startData->WouldAdvancingToAbsPositionCauseTransition(stopEdge + 10);
6666

67-
while (refEdge < tagEdge)
67+
while (startEdge < stopEdge)
6868
{
69-
pendingRefEdge = refEdge;
69+
pendingStartEdge = startEdge;
7070

71-
if (!refData->WouldAdvancingToAbsPositionCauseTransition(tagEdge + 1))
71+
if (!startData->WouldAdvancingToAbsPositionCauseTransition(stopEdge + 1))
7272
break;
7373

74-
refData->AdvanceToNextEdge();
75-
refData->AdvanceToNextEdge();
76-
refEdge = refData->GetSampleNumber();
74+
startData->AdvanceToNextEdge();
75+
startData->AdvanceToNextEdge();
76+
startEdge = startData->GetSampleNumber();
7777
}
7878

7979
// Pending values are the samples we want for the delta
8080
mResults->AddMarker
81-
(pendingRefEdge, AnalyzerResults::Start, mSettings->mRefChannel);
81+
(pendingStartEdge, AnalyzerResults::Start, mSettings->mStartChannel);
8282
mResults->AddMarker
83-
(tagEdge, AnalyzerResults::Stop, mSettings->mTagChannel);
83+
(stopEdge, AnalyzerResults::Stop, mSettings->mStopChannel);
8484

85-
uint64_t end = tagEdge;
85+
uint64_t end = stopEdge;
8686

87-
if (pendingRefEdge == end)
87+
if (pendingStartEdge == end)
8888
++end;
8989

9090
//we have a delta to save
9191
Frame frame;
92-
frame.mData1 = tagEdge - pendingRefEdge;
92+
frame.mData1 = stopEdge - pendingStartEdge;
9393
frame.mData2 = sampleRate;
9494
frame.mFlags = 0;
95-
frame.mStartingSampleInclusive = pendingRefEdge;
95+
frame.mStartingSampleInclusive = pendingStartEdge;
9696
frame.mEndingSampleInclusive = end;
9797

9898
mResults->AddFrame(frame);
@@ -109,16 +109,16 @@ void TimeDeltaAnalyzer::WorkerThread()
109109
mResults->CommitResults();
110110
ReportProgress(frame.mEndingSampleInclusive);
111111

112-
tagData->AdvanceToNextEdge();
113-
tagData->AdvanceToNextEdge();
112+
stopData->AdvanceToNextEdge();
113+
stopData->AdvanceToNextEdge();
114114

115-
if (pendingRefEdge == refEdge)
115+
if (pendingStartEdge == startEdge)
116116
{
117-
refData->AdvanceToNextEdge();
118-
refData->AdvanceToNextEdge();
117+
startData->AdvanceToNextEdge();
118+
startData->AdvanceToNextEdge();
119119
}
120120

121-
pendingRefEdge = 0;
121+
pendingStartEdge = 0;
122122
}
123123
}
124124

src/TimeDeltaAnalyzerSettings.cpp

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,39 @@ constexpr int kSettingsVer = 1;
1010
*/
1111

1212
TimeDeltaAnalyzerSettings::TimeDeltaAnalyzerSettings():
13-
mRefChannel(UNDEFINED_CHANNEL),
14-
mRefEdgeIsPos(true),
15-
mTagChannel(UNDEFINED_CHANNEL),
16-
mTagEdgeIsPos(true)
13+
mStartChannel(UNDEFINED_CHANNEL),
14+
mStartEdgeIsPos(true),
15+
mStopChannel(UNDEFINED_CHANNEL),
16+
mStopEdgeIsPos(true)
1717
{
18-
mRefChannelInterface.reset(new AnalyzerSettingInterfaceChannel());
19-
mRefChannelInterface->SetTitleAndTooltip
20-
("Reference", "Measure time delta from this channel to target channel");
21-
mRefEdgeInterface.reset(new AnalyzerSettingInterfaceBool());
22-
mRefEdgeInterface->SetTitleAndTooltip
23-
("Pos Edge", "Reference rising edge is active");
24-
mTagChannelInterface.reset(new AnalyzerSettingInterfaceChannel());
25-
mTagChannelInterface->SetTitleAndTooltip
26-
("Target", "Measure time delta from this channel to target channel");
27-
mTagEdgeInterface.reset(new AnalyzerSettingInterfaceBool());
28-
mTagEdgeInterface->SetTitleAndTooltip
29-
("Pos Edge", "Target rising edge is active");
30-
31-
mRefChannelInterface->SetChannel(mRefChannel);
32-
mTagChannelInterface->SetChannel(mTagChannel);
33-
34-
AddInterface(mRefChannelInterface.get());
35-
AddInterface(mRefEdgeInterface.get());
36-
AddInterface(mTagChannelInterface.get());
37-
AddInterface(mTagEdgeInterface.get());
18+
mStartChannelInterface.reset(new AnalyzerSettingInterfaceChannel());
19+
mStartChannelInterface->SetTitleAndTooltip
20+
("Start", "Measure time delta from this channel to stop channel");
21+
mStartEdgeInterface.reset(new AnalyzerSettingInterfaceBool());
22+
mStartEdgeInterface->SetTitleAndTooltip
23+
("Pos Edge", "Start rising edge is active");
24+
mStopChannelInterface.reset(new AnalyzerSettingInterfaceChannel());
25+
mStopChannelInterface->SetTitleAndTooltip
26+
("Stop", "Measure time delta from start channel to this channel");
27+
mStopEdgeInterface.reset(new AnalyzerSettingInterfaceBool());
28+
mStopEdgeInterface->SetTitleAndTooltip
29+
("Pos Edge", "Stop rising edge is active");
30+
31+
mStartChannelInterface->SetChannel(mStartChannel);
32+
mStopChannelInterface->SetChannel(mStopChannel);
33+
34+
AddInterface(mStartChannelInterface.get());
35+
AddInterface(mStartEdgeInterface.get());
36+
AddInterface(mStopChannelInterface.get());
37+
AddInterface(mStopEdgeInterface.get());
3838

3939
AddExportOption(0, "Export as text/csv file");
4040
AddExportExtension(0, "text", "txt");
4141
AddExportExtension(0, "csv", "csv");
4242

4343
ClearChannels();
44-
AddChannel(mRefChannel, "Ref", false);
45-
AddChannel(mTagChannel, "Tag", false);
44+
AddChannel(mStartChannel, "Start", false);
45+
AddChannel(mStopChannel, "Stop", false);
4646
}
4747

4848
TimeDeltaAnalyzerSettings::~TimeDeltaAnalyzerSettings()
@@ -51,23 +51,23 @@ TimeDeltaAnalyzerSettings::~TimeDeltaAnalyzerSettings()
5151

5252
bool TimeDeltaAnalyzerSettings::SetSettingsFromInterfaces()
5353
{
54-
mRefChannel = mRefChannelInterface->GetChannel();
55-
mRefEdgeIsPos = mRefEdgeInterface->GetValue();
56-
mTagChannel = mTagChannelInterface->GetChannel();
57-
mTagEdgeIsPos = mTagEdgeInterface->GetValue();
54+
mStartChannel = mStartChannelInterface->GetChannel();
55+
mStartEdgeIsPos = mStartEdgeInterface->GetValue();
56+
mStopChannel = mStopChannelInterface->GetChannel();
57+
mStopEdgeIsPos = mStopEdgeInterface->GetValue();
5858

5959
ClearChannels();
60-
AddChannel(mRefChannel, "Time Delta", true);
60+
AddChannel(mStartChannel, "Time Delta", true);
6161

6262
return true;
6363
}
6464

6565
void TimeDeltaAnalyzerSettings::UpdateInterfacesFromSettings()
6666
{
67-
mRefChannelInterface->SetChannel(mRefChannel);
68-
mRefEdgeInterface->SetValue(mRefEdgeIsPos);
69-
mTagChannelInterface->SetChannel(mTagChannel);
70-
mTagEdgeInterface->SetValue(mTagEdgeIsPos);
67+
mStartChannelInterface->SetChannel(mStartChannel);
68+
mStartEdgeInterface->SetValue(mStartEdgeIsPos);
69+
mStopChannelInterface->SetChannel(mStopChannel);
70+
mStopEdgeInterface->SetValue(mStopEdgeIsPos);
7171
}
7272

7373
void TimeDeltaAnalyzerSettings::LoadSettings(const char* settings)
@@ -77,14 +77,14 @@ void TimeDeltaAnalyzerSettings::LoadSettings(const char* settings)
7777
text_archive.SetString(settings);
7878

7979
text_archive >> settingsVer;
80-
text_archive >> mRefChannel;
81-
text_archive >> mRefEdgeIsPos;
82-
text_archive >> mTagChannel;
83-
text_archive >> mTagEdgeIsPos;
80+
text_archive >> mStartChannel;
81+
text_archive >> mStartEdgeIsPos;
82+
text_archive >> mStopChannel;
83+
text_archive >> mStopEdgeIsPos;
8484

8585
ClearChannels();
86-
AddChannel(mRefChannel, "Time Delta", true);
87-
AddChannel(mTagChannel, "Time Delta", true);
86+
AddChannel(mStartChannel, "Time Delta", true);
87+
AddChannel(mStopChannel, "Time Delta", true);
8888

8989
UpdateInterfacesFromSettings();
9090
}
@@ -94,10 +94,10 @@ const char* TimeDeltaAnalyzerSettings::SaveSettings()
9494
SimpleArchive text_archive;
9595

9696
text_archive << kSettingsVer;
97-
text_archive << mRefChannel;
98-
text_archive << mRefEdgeIsPos;
99-
text_archive << mTagChannel;
100-
text_archive << mTagEdgeIsPos;
97+
text_archive << mStartChannel;
98+
text_archive << mStartEdgeIsPos;
99+
text_archive << mStopChannel;
100+
text_archive << mStopEdgeIsPos;
101101

102102
return SetReturnString(text_archive.GetString());
103103
}

src/TimeDeltaAnalyzerSettings.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ class TimeDeltaAnalyzerSettings : public AnalyzerSettings
1515
virtual void LoadSettings(const char* settings);
1616
virtual const char* SaveSettings();
1717

18-
Channel mRefChannel;
19-
bool mRefEdgeIsPos;
20-
Channel mTagChannel;
21-
bool mTagEdgeIsPos;
18+
Channel mStartChannel;
19+
bool mStartEdgeIsPos;
20+
Channel mStopChannel;
21+
bool mStopEdgeIsPos;
2222

2323
protected:
2424

25-
std::auto_ptr<AnalyzerSettingInterfaceChannel> mRefChannelInterface;
26-
std::auto_ptr<AnalyzerSettingInterfaceBool> mRefEdgeInterface;
27-
std::auto_ptr<AnalyzerSettingInterfaceChannel> mTagChannelInterface;
28-
std::auto_ptr<AnalyzerSettingInterfaceBool> mTagEdgeInterface;
25+
std::auto_ptr<AnalyzerSettingInterfaceChannel> mStartChannelInterface;
26+
std::auto_ptr<AnalyzerSettingInterfaceBool> mStartEdgeInterface;
27+
std::auto_ptr<AnalyzerSettingInterfaceChannel> mStopChannelInterface;
28+
std::auto_ptr<AnalyzerSettingInterfaceBool> mStopEdgeInterface;
2929
};

src/TimeDeltaSimulationDataGenerator.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ void TimeDeltaSimulationDataGenerator::Initialize
1717
mSimulationSampleRateHz = simulation_sample_rate;
1818
mSettings = settings;
1919

20-
mRefData = mChannels.Add(settings->mRefChannel, simulation_sample_rate, BIT_LOW);
21-
mTagData = mChannels.Add(settings->mTagChannel, simulation_sample_rate, BIT_LOW);
20+
mStartData = mChannels.Add(settings->mStartChannel, simulation_sample_rate, BIT_LOW);
21+
mStopData = mChannels.Add(settings->mStopChannel, simulation_sample_rate, BIT_LOW);
2222
}
2323

2424
U32 TimeDeltaSimulationDataGenerator::GenerateSimulationData
@@ -32,11 +32,11 @@ U32 TimeDeltaSimulationDataGenerator::GenerateSimulationData
3232
AnalyzerHelpers::AdjustSimulationTargetSample
3333
(largest_sample_requested, sample_rate, mSimulationSampleRateHz);
3434

35-
while (mRefData->GetCurrentSampleNumber() < largestSample)
36-
CreateDeltaPair(*mRefData);
35+
while (mStartData->GetCurrentSampleNumber() < largestSample)
36+
CreateDeltaPair(*mStartData);
3737

38-
while (mTagData->GetCurrentSampleNumber() < largestSample)
39-
CreateDeltaPair(*mTagData);
38+
while (mStopData->GetCurrentSampleNumber() < largestSample)
39+
CreateDeltaPair(*mStopData);
4040

4141
*simulation_channel = mChannels.GetArray();
4242
return mChannels.GetCount();

src/TimeDeltaSimulationDataGenerator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ class TimeDeltaSimulationDataGenerator
2727
void CreateDeltaPair(SimulationChannelDescriptor &scd);
2828

2929
SimulationChannelDescriptorGroup mChannels;
30-
SimulationChannelDescriptor *mRefData;
31-
SimulationChannelDescriptor *mTagData;
30+
SimulationChannelDescriptor *mStartData;
31+
SimulationChannelDescriptor *mStopData;
3232
};

0 commit comments

Comments
 (0)