Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bc4294bc5c5f
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f93596c012c3
Choose a head ref
  • 2 commits
  • 20 files changed
  • 1 contributor

Commits on May 10, 2020

  1. Copy the full SHA
    71970d1 View commit details
  2. Copy the full SHA
    f93596c View commit details
5 changes: 0 additions & 5 deletions scopemeasurements/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -2,16 +2,11 @@ include_directories(${GTKMM_INCLUDE_DIRS} ${SIGCXX_INCLUDE_DIRS})
link_directories(${GTKMM_LIBRARY_DIRS} ${SIGCXX_LIBRARY_DIRS})

set(SCOPEMEASUREMENTS_SOURCES
DramRefreshActivateLatencyMeasurement.cpp
DramRowColumnLatencyMeasurement.cpp
EyeBitRateMeasurement.cpp
EyeHeightMeasurement.cpp
EyeJitterMeasurement.cpp
EyePeriodMeasurement.cpp
EyeWidthMeasurement.cpp
Fall1090Measurement.cpp
Fall2080Measurement.cpp
FrequencyMeasurement.cpp
OvershootMeasurement.cpp
PkPkVoltageMeasurement.cpp
UndershootMeasurement.cpp
90 changes: 0 additions & 90 deletions scopemeasurements/FrequencyMeasurement.cpp

This file was deleted.

56 changes: 0 additions & 56 deletions scopemeasurements/FrequencyMeasurement.h

This file was deleted.

5 changes: 0 additions & 5 deletions scopemeasurements/scopemeasurements.cpp
Original file line number Diff line number Diff line change
@@ -42,16 +42,11 @@
*/
void ScopeMeasurementStaticInit()
{
AddMeasurementClass(DramRefreshActivateLatencyMeasurement);
AddMeasurementClass(DramRowColumnLatencyMeasurement);
AddMeasurementClass(EyeBitRateMeasurement);
AddMeasurementClass(EyeHeightMeasurement);
AddMeasurementClass(EyeJitterMeasurement);
AddMeasurementClass(EyePeriodMeasurement);
AddMeasurementClass(EyeWidthMeasurement);
AddMeasurementClass(Fall1090Measurement);
AddMeasurementClass(Fall2080Measurement);
AddMeasurementClass(FrequencyMeasurement);
AddMeasurementClass(OvershootMeasurement);
AddMeasurementClass(PkPkVoltageMeasurement);
AddMeasurementClass(UndershootMeasurement);
5 changes: 0 additions & 5 deletions scopemeasurements/scopemeasurements.h
Original file line number Diff line number Diff line change
@@ -39,16 +39,11 @@
#include "../scopehal/scopehal.h"
#include "../scopehal/Measurement.h"

#include "DramRefreshActivateLatencyMeasurement.h"
#include "DramRowColumnLatencyMeasurement.h"
#include "EyeBitRateMeasurement.h"
#include "EyeHeightMeasurement.h"
#include "EyeJitterMeasurement.h"
#include "EyePeriodMeasurement.h"
#include "EyeWidthMeasurement.h"
#include "Fall1090Measurement.h"
#include "Fall2080Measurement.h"
#include "FrequencyMeasurement.h"
#include "OvershootMeasurement.h"
#include "PkPkVoltageMeasurement.h"
#include "UndershootMeasurement.h"
4 changes: 4 additions & 0 deletions scopeprotocols/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -11,14 +11,18 @@ set(SCOPEPROTOCOLS_SOURCES
DCOffsetDecoder.cpp
DDR3Decoder.cpp
DifferenceDecoder.cpp
DramRefreshActivateMeasurementDecoder.cpp
DramRowColumnLatencyMeasurementDecoder.cpp
DVIDecoder.cpp
Ethernet10BaseTDecoder.cpp
Ethernet100BaseTDecoder.cpp
EthernetAutonegotiationDecoder.cpp
EthernetGMIIDecoder.cpp
EthernetProtocolDecoder.cpp
EyeDecoder2.cpp
FallMeasurementDecoder.cpp
FFTDecoder.cpp
FrequencyMeasurementDecoder.cpp
I2CDecoder.cpp
IBM8b10bDecoder.cpp
JtagDecoder.cpp
Original file line number Diff line number Diff line change
@@ -27,77 +27,106 @@
* *
***********************************************************************************************************************/

/**
@file
@author Andrew D. Zonenberg
@brief Declaration of DramRefreshActivateLatencyMeasurement
*/

#include "scopemeasurements.h"
#include "DramRefreshActivateLatencyMeasurement.h"
#include "../scopeprotocols/DDR3Decoder.h"
#include "scopeprotocols.h"
#include "DramRefreshActivateMeasurementDecoder.h"

using namespace std;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Construction/destruction
// Construction / destruction

DramRefreshActivateLatencyMeasurement::DramRefreshActivateLatencyMeasurement()
: FloatMeasurement(TYPE_TIME)
DramRefreshActivateMeasurementDecoder::DramRefreshActivateMeasurementDecoder(string color)
: ProtocolDecoder(OscilloscopeChannel::CHANNEL_TYPE_ANALOG, color, CAT_MEASUREMENT)
{
//Configure for a single input
m_signalNames.push_back("RAM");
//Set up channels
m_signalNames.push_back("din");
m_channels.push_back(NULL);

m_yAxisUnit = Unit(Unit::UNIT_PS);

m_midpoint = 0;
m_range = 1;
}

DramRefreshActivateLatencyMeasurement::~DramRefreshActivateLatencyMeasurement()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory methods

bool DramRefreshActivateMeasurementDecoder::ValidateChannel(size_t i, OscilloscopeChannel* channel)
{
if( (i == 0) && (dynamic_cast<DDR3Decoder*>(channel) != NULL) )
return true;
return false;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Accessors

Measurement::MeasurementType DramRefreshActivateLatencyMeasurement::GetMeasurementType()
void DramRefreshActivateMeasurementDecoder::SetDefaultName()
{
return Measurement::MEAS_PROTO;
char hwname[256];
snprintf(hwname, sizeof(hwname), "Trfc(%s)", m_channels[0]->m_displayname.c_str());
m_hwname = hwname;
m_displayname = m_hwname;
}

string DramRefreshActivateLatencyMeasurement::GetMeasurementName()
string DramRefreshActivateMeasurementDecoder::GetProtocolName()
{
return "DRAM Trfc";
}

bool DramRefreshActivateLatencyMeasurement::ValidateChannel(size_t i, OscilloscopeChannel* channel)
bool DramRefreshActivateMeasurementDecoder::IsOverlay()
{
if( (i == 0) && (dynamic_cast<DDR3Decoder*>(channel) != NULL) )
return true;
//we create a new analog channel
return false;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Measurement processing
bool DramRefreshActivateMeasurementDecoder::NeedsConfig()
{
return false;
}

double DramRefreshActivateMeasurementDecoder::GetVoltageRange()
{
return m_range;
}

bool DramRefreshActivateLatencyMeasurement::Refresh()
double DramRefreshActivateMeasurementDecoder::GetOffset()
{
m_value = INT_MAX;
return -m_midpoint;
}

//TODO: for now, only report the minimum latency
//We really should also report average/max.
//This is where unification of measurements and decodes will be really helpful.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Actual decoder logic

void DramRefreshActivateMeasurementDecoder::Refresh()
{
//Get the input data
if(m_channels[0] == NULL)
return false;
{
SetData(NULL);
return;
}
DDR3Capture* din = dynamic_cast<DDR3Capture*>(m_channels[0]->GetData());
if(din == NULL || (din->GetDepth() == 0))
return false;
{
SetData(NULL);
return;
}

//Create the output
AnalogCapture* cap = new AnalogCapture;

//Measure delay from refreshing a bank until an activation to the same bank
int64_t lastRef[8] = {0, 0, 0, 0, 0, 0, 0, 0};

float fmax = -1e20;
float fmin = 1e20;

int64_t tlast = 0;
for(size_t i=0; i<din->GetDepth(); i++)
{
auto sample = din->m_samples[i];
int64_t tnow = sample.m_offset * din->m_timescale;

//Discard invalid bank IDs
if( (sample.m_sample.m_bank < 0) || (sample.m_sample.m_bank > 8) )
@@ -119,13 +148,35 @@ bool DramRefreshActivateLatencyMeasurement::Refresh()

//Valid access, measure the latency
int64_t latency = tact - tref;
if(latency < m_value)
m_value = latency;
if(fmin > latency)
fmin = latency;
if(fmax < latency)
fmax = latency;

cap->m_samples.push_back(AnalogSample(tlast, tnow-tlast, latency));
tlast = tnow;

//Purge the last-refresh timestamp so we don't report false times for the next activate
lastRef[sample.m_sample.m_bank] = 0;
}
}

//convert ps to sec
m_value *= 1e-12f;
if(cap->m_samples.empty())
{
delete cap;
SetData(NULL);
return;
}

m_range = fmax - fmin + 5000;
if(m_range < 5)
m_range = 5;
m_midpoint = (fmax + fmin) / 2;

SetData(cap);

return true;
//Copy start time etc from the input. Timestamps are in picoseconds.
cap->m_timescale = 1;
cap->m_startTimestamp = din->m_startTimestamp;
cap->m_startPicoseconds = din->m_startPicoseconds;
}
Loading