ngscopeclient v0.2.2
Loading...
Searching...
No Matches
Ethernet100BaseTXDecoder.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopeprotocols *
4* *
5* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
35#ifndef Ethernet100BaseTXDecoder_h
36#define Ethernet100BaseTXDecoder_h
37
39{
40public:
41 uint32_t len;
42 uint32_t samplesPerThread;
43 uint32_t startOffset;
44};
45
47{
48public:
49 uint32_t len;
50 uint32_t startOffset;
51};
52
54{
55public:
56 Ethernet100BaseTXDecoder(const std::string& color);
57
58 virtual void Refresh(vk::raii::CommandBuffer& cmdBuf, std::shared_ptr<QueueHandle> queue) override;
59 static std::string GetProtocolName();
60
61 PROTOCOL_DECODER_INITPROC(Ethernet100BaseTXDecoder)
62
63protected:
64 int GetState(float voltage)
65 {
66 if(voltage > 0.5)
67 return 1;
68 else if(voltage < -0.5)
69 return -1;
70 else
71 return 0;
72 }
73
74 void DecodeStates(
75 vk::raii::CommandBuffer& cmdBuf,
76 std::shared_ptr<QueueHandle> queue,
77 SparseAnalogWaveform* samples);
78
79 bool TrySync(size_t idle_offset);
80
81 void Descramble(vk::raii::CommandBuffer& cmdBuf, size_t idle_offset);
82
85
88
91
94
97
99 std::shared_ptr<ComputePipeline> m_mlt3DecodeComputePipeline;
100
102 std::shared_ptr<ComputePipeline> m_trySyncComputePipeline;
103
105 std::shared_ptr<ComputePipeline> m_descrambleComputePipeline;
106
108 std::shared_ptr<ComputePipeline> m_findSSDComputePipeline;
109
111 std::shared_ptr<ComputePipeline> m_4b5bDecodeComputePipeline;
112
115
118
120 std::unique_ptr<vk::raii::CommandPool> m_cmdPool;
121
123 std::unique_ptr<vk::raii::CommandBuffer> m_transferCmdBuf;
124
125 //@brief Queue for transfers
126 std::shared_ptr<QueueHandle> m_transferQueue;
127};
128
129#endif
Definition AcceleratorBuffer.h:204
Definition Ethernet100BaseTXDecoder.h:47
Definition Ethernet100BaseTXDecoder.h:54
std::shared_ptr< ComputePipeline > m_findSSDComputePipeline
Compute pipeline for finding start-of-stream descriptor.
Definition Ethernet100BaseTXDecoder.h:108
AcceleratorBuffer< uint8_t > m_descrambledBits
Descrambled serial bit stream after LFSR.
Definition Ethernet100BaseTXDecoder.h:87
bool TrySync(size_t idle_offset)
Try descrambling the first 64 bits at the requested offset and see if it makes sene.
Definition Ethernet100BaseTXDecoder.cpp:638
void Descramble(vk::raii::CommandBuffer &cmdBuf, size_t idle_offset)
Actually run the descrambler.
Definition Ethernet100BaseTXDecoder.cpp:680
AcceleratorBuffer< uint32_t > m_lfsrTable
LFSR lookahead table.
Definition Ethernet100BaseTXDecoder.h:96
AcceleratorBuffer< uint8_t > m_trySyncOutput
Results from TrySync.
Definition Ethernet100BaseTXDecoder.h:90
std::shared_ptr< ComputePipeline > m_descrambleComputePipeline
Compute pipeline for descrambling.
Definition Ethernet100BaseTXDecoder.h:105
AcceleratorBuffer< uint8_t > m_phyBits
Raw scrambled serial bit stream after MLT-3 decoding.
Definition Ethernet100BaseTXDecoder.h:84
AcceleratorBuffer< uint32_t > m_findSSDOutput
Results from FindSSD.
Definition Ethernet100BaseTXDecoder.h:93
std::shared_ptr< ComputePipeline > m_mlt3DecodeComputePipeline
Compute pipeline for MLT-3 decoding.
Definition Ethernet100BaseTXDecoder.h:99
std::unique_ptr< vk::raii::CommandBuffer > m_transferCmdBuf
Command buffer for transfers.
Definition Ethernet100BaseTXDecoder.h:123
std::shared_ptr< ComputePipeline > m_4b5bDecodeComputePipeline
Compute pipeline for 4b5b decoding.
Definition Ethernet100BaseTXDecoder.h:111
AcceleratorBuffer< uint64_t > m_4b5bTimestamps
4b5b decoder output timestamps
Definition Ethernet100BaseTXDecoder.h:117
AcceleratorBuffer< uint8_t > m_4b5bSamples
4b5b decoder output
Definition Ethernet100BaseTXDecoder.h:114
std::shared_ptr< ComputePipeline > m_trySyncComputePipeline
Compute pipeline for TrySync.
Definition Ethernet100BaseTXDecoder.h:102
std::unique_ptr< vk::raii::CommandPool > m_cmdPool
Pool of command buffers.
Definition Ethernet100BaseTXDecoder.h:120
Definition Ethernet100BaseTXDecoder.h:39
Definition EthernetProtocolDecoder.h:94
A waveform sampled at irregular intervals.
Definition Waveform.h:514