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: f0ec07087421
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f3000bf60d31
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on May 11, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    23d2826 View commit details
  2. LeCroyOscilloscope: Added logic to detect SERDES trigger (but can't a…

    …ctually use it yet). Implemented ProLink/ProBus input mux for SDA/DDA/WaveMaster 8Zi series. Fixes #299.
    azonenberg committed May 11, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f3000bf View commit details
Showing with 177 additions and 1 deletion.
  1. +115 −1 scopehal/LeCroyOscilloscope.cpp
  2. +5 −0 scopehal/LeCroyOscilloscope.h
  3. +20 −0 scopehal/Oscilloscope.cpp
  4. +29 −0 scopehal/Oscilloscope.h
  5. +6 −0 scopehal/OscilloscopeChannel.cpp
  6. +2 −0 scopehal/OscilloscopeChannel.h
116 changes: 115 additions & 1 deletion scopehal/LeCroyOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ LeCroyOscilloscope::LeCroyOscilloscope(SCPITransport* transport)
, m_hasI2cTrigger(false)
, m_hasSpiTrigger(false)
, m_hasUartTrigger(false)
, m_hasSerdesTrigger(false)
, m_maxBandwidth(10000)
, m_triggerArmed(false)
, m_triggerOneShot(false)
@@ -380,6 +381,36 @@ void LeCroyOscilloscope::DetectOptions()
action = "Enabled";
}

//Memory capacity options for WaveMaster/SDA/DDA 8Zi/Zi-A/Zi-B family
else if(o == "-S")
{
type = "Hardware";
desc = "Small (32M point) memory";
m_memoryDepthOption = 32;
action = "Enabled";
}
else if(o == "-S")
{
type = "Hardware";
desc = "Medium (64M point) memory";
m_memoryDepthOption = 64;
action = "Enabled";
}
else if(o == "-L")
{
type = "Hardware";
desc = "Large (128M point) memory";
m_memoryDepthOption = 128;
action = "Enabled";
}
else if(o == "-V")
{
type = "Hardware";
desc = "Very large (256M point) memory";
m_memoryDepthOption = 256;
action = "Enabled";
}

//Print out full names for protocol trigger options and enable trigger mode.
//Note that many of these options don't have _TD in the base (non-TDME) option code!
else if(o.find("I2C") == 0)
@@ -472,6 +503,13 @@ void LeCroyOscilloscope::DetectOptions()
desc = "HD analog TV";
}

//High speed serial trigger
else if(o == "SERIALPAT_T")
{
type = "Trigger";
desc = "Serial Pattern (8b10b/64b66b/NRZ)";
}

//Protocol decodes without trigger capability
//Print out name but otherwise ignore
else if(o == "10-100M-ENET-BUS")
@@ -631,7 +669,7 @@ void LeCroyOscilloscope::DetectOptions()
type = "Miscellaneous";
desc = "Power Analysis";
}
else if( (o == "SDA2") || (o == "SDA3") || (o == "SDA3-LINQ") )
else if( (o == "SDA") || (o == "SDA2") || (o == "SDA3") || (o == "SDA3-LINQ") )
{
type = "Signal Integrity";
desc = "Serial Data Analysis";
@@ -1543,6 +1581,82 @@ void LeCroyOscilloscope::AutoZero(size_t i)
m_transport->SendCommand(string("VBS? '") + prefix + "." + mux + "." + name + ".AutoZero'");
}

bool LeCroyOscilloscope::HasInputMux(size_t i)
{
if(i >= m_analogChannelCount)
return false;

switch(m_modelid)
{
//Add other models with muxes here
case MODEL_SDA_8ZI:
case MODEL_SDA_8ZI_A:
case MODEL_SDA_8ZI_B:
case MODEL_WAVEMASTER_8ZI_B:
return true;

default:
return false;
}
}

size_t LeCroyOscilloscope::GetInputMuxSetting(size_t i)
{
//If no mux, always report 0
if(!HasInputMux(i))
return 0;

lock_guard<recursive_mutex> lock(m_mutex);

//Get the active input and probe name
string prefix = string("app.Acquisition.") + m_channels[i]->GetHwname();
m_transport->SendCommand(string("VBS? 'return = ") + prefix + ".ActiveInput'");
string mux = Trim(m_transport->ReadReply());
if(mux == "InputA")
return 0;
else if(mux == "InputB")
return 1;
else
{
LogWarning("Unknown input mux setting %zu\n", i);
return 0;
}
}

vector<string> LeCroyOscilloscope::GetInputMuxNames(size_t i)
{
//All currently supported scopes have this combination
vector<string> ret;
if(HasInputMux(i))
{
ret.push_back("A (ProLink, upper)");
ret.push_back("B (ProBus, lower)");
}
return ret;
}

void LeCroyOscilloscope::SetInputMux(size_t i, size_t select)
{
if(i >= m_analogChannelCount)
return;

if(!HasInputMux(i))
return;

lock_guard<recursive_mutex> lock(m_mutex);

if(select == 0)
{
m_transport->SendCommand(
string("VBS 'app.Acquisition.") + m_channels[i]->GetHwname() + ".ActiveInput = \"InputA\"'");
}
else
{
m_transport->SendCommand(
string("VBS 'app.Acquisition.") + m_channels[i]->GetHwname() + ".ActiveInput = \"InputB\"'");
}
}

void LeCroyOscilloscope::SetChannelDisplayName(size_t i, string name)
{
auto chan = m_channels[i];
5 changes: 5 additions & 0 deletions scopehal/LeCroyOscilloscope.h
Original file line number Diff line number Diff line change
@@ -102,6 +102,10 @@ class LeCroyOscilloscope
virtual bool CanAutoZero(size_t i);
virtual void AutoZero(size_t i);
virtual std::string GetProbeName(size_t i);
virtual bool HasInputMux(size_t i);
virtual size_t GetInputMuxSetting(size_t i);
virtual std::vector<std::string> GetInputMuxNames(size_t i);
virtual void SetInputMux(size_t i, size_t select);

//Triggering
virtual Oscilloscope::TriggerMode PollTrigger();
@@ -291,6 +295,7 @@ class LeCroyOscilloscope
bool m_hasI2cTrigger;
bool m_hasSpiTrigger;
bool m_hasUartTrigger;
bool m_hasSerdesTrigger;

///Maximum bandwidth we support, in MHz
unsigned int m_maxBandwidth;
20 changes: 20 additions & 0 deletions scopehal/Oscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -479,6 +479,26 @@ string Oscilloscope::GetProbeName(size_t /*i*/)
return "";
}

bool Oscilloscope::HasInputMux(size_t /*i*/)
{
return false;
}

size_t Oscilloscope::GetInputMuxSetting(size_t /*i*/)
{
return 0;
}

vector<string> Oscilloscope::GetInputMuxNames(size_t /*i*/)
{
vector<string> ret;
return ret;
}

void Oscilloscope::SetInputMux(size_t /*i*/, size_t /*select*/)
{
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Analog channel configuration

29 changes: 29 additions & 0 deletions scopehal/Oscilloscope.h
Original file line number Diff line number Diff line change
@@ -292,6 +292,35 @@ class Oscilloscope : public virtual Instrument
*/
virtual std::string GetProbeName(size_t i);

/**
@brief Checks if a channel has an input multiplexer
@param i Zero-based index of channel
*/
virtual bool HasInputMux(size_t i);

/**
@brief Gets the setting for a channel's input mux (if it has one)
@param i Zero-based index of channel
*/
virtual size_t GetInputMuxSetting(size_t i);

/**
@brief Gets names for the input mux ports of a channel
@param i Zero-based index of channel
*/
virtual std::vector<std::string> GetInputMuxNames(size_t i);

/**
@brief Sets the input mux for a channel
@param i Zero-based index of channel
@param select Selector for the mux
*/
virtual void SetInputMux(size_t i, size_t select);

/**
@brief Gets the offset, in volts, for a given channel
6 changes: 6 additions & 0 deletions scopehal/OscilloscopeChannel.cpp
Original file line number Diff line number Diff line change
@@ -333,6 +333,12 @@ string OscilloscopeChannel::GetProbeName()
return "";
}

void OscilloscopeChannel::SetInputMux(size_t select)
{
if(m_scope)
m_scope->SetInputMux(m_index, select);
}

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

2 changes: 2 additions & 0 deletions scopehal/OscilloscopeChannel.h
Original file line number Diff line number Diff line change
@@ -202,6 +202,8 @@ class OscilloscopeChannel
virtual void Invert(bool invert);
virtual bool IsInverted();

virtual void SetInputMux(size_t select);

void SetDefaultDisplayName();
protected:
void SharedCtorInit();