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: d64ceefbc329
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3e227da4ea85
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 21, 2020

  1. IBM8b10bDecoder: synchronize only to K28.5, not any other commas. Thi…

    …s works fine for most standard protocols, and prevents aligning to false comma sequences.
    azonenberg committed Nov 21, 2020
    Copy the full SHA
    3e227da View commit details
Showing with 34 additions and 2 deletions.
  1. +34 −2 scopeprotocols/IBM8b10bDecoder.cpp
36 changes: 34 additions & 2 deletions scopeprotocols/IBM8b10bDecoder.cpp
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ void IBM8b10bDecoder::Refresh()
//TODO: allow single rate clocks too?
DigitalWaveform data;
SampleOnAnyEdges(din, clkin, data);

q
//Look for commas in the data stream
//TODO: make this more efficient?
size_t max_commas = 0;
@@ -132,6 +132,7 @@ void IBM8b10bDecoder::Refresh()
size_t dlen = data.m_samples.size() - 20;
for(size_t i=0; i<dlen; i += 10)
{
/*
//Check if we have a comma (five identical bits) anywhere in the data stream
//Commas are always at positions 2...6 within the symbol (left-right bit ordering)
bool comma = true;
@@ -143,6 +144,37 @@ void IBM8b10bDecoder::Refresh()
break;
}
}
*/

//Look for K28.5 symbols only.
bool comma = false;
if( !data.m_samples[i+offset+0] &&
!data.m_samples[i+offset+1] &&
data.m_samples[i+offset+2] &&
data.m_samples[i+offset+3] &&
data.m_samples[i+offset+4] &&
data.m_samples[i+offset+5] &&
data.m_samples[i+offset+6] &&
!data.m_samples[i+offset+7] &&
data.m_samples[i+offset+8] &&
!data.m_samples[i+offset+9])
{
comma = true;
}
if( data.m_samples[i+offset+0] &&
data.m_samples[i+offset+1] &&
!data.m_samples[i+offset+2] &&
!data.m_samples[i+offset+3] &&
!data.m_samples[i+offset+4] &&
!data.m_samples[i+offset+5] &&
!data.m_samples[i+offset+6] &&
data.m_samples[i+offset+7] &&
!data.m_samples[i+offset+8] &&
data.m_samples[i+offset+9])
{
comma = true;
}

if(comma)
num_commas ++;
}
@@ -151,7 +183,7 @@ void IBM8b10bDecoder::Refresh()
max_commas = num_commas;
max_offset = offset;
}
//LogDebug("Found %zu commas at offset %zu\n", num_commas, offset);
//LogTrace("Found %zu commas at offset %zu\n", num_commas, offset);
}

//Decode the actual data