ngscopeclient 0.1-dev+51fbda87c
BERTOutputChannel.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2024 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
36#ifndef BERTOutputChannel_h
37#define BERTOutputChannel_h
38
39#include "BERT.h"
40
46{
47public:
48
50 const std::string& hwname,
51 BERT* bert,
52 const std::string& color = "#808080",
53 size_t index = 0);
54
55 virtual ~BERTOutputChannel();
56
57 virtual void Refresh(vk::raii::CommandBuffer& cmdBuf, std::shared_ptr<QueueHandle> queue) override;
58 virtual bool ValidateChannel(size_t i, StreamDescriptor stream) override;
59
61 BERT* GetBERT() const
62 { return dynamic_cast<BERT*>(m_instrument); }
63
70 { GetBERT()->SetTxPattern(GetIndex(), pattern); }
71
74 { return GetBERT()->GetTxPattern(GetIndex()); }
75
77 std::vector<BERT::Pattern> GetAvailablePatterns()
79
81 bool GetInvert()
82 { return GetBERT()->GetTxInvert(GetIndex()); }
83
89 void SetInvert(bool invert)
90 { GetBERT()->SetTxInvert(GetIndex(), invert); }
91
97 std::vector<float> GetAvailableDriveStrengths()
99
106 { return GetBERT()->GetTxDriveStrength(GetIndex()); }
107
113 void SetDriveStrength(float drive)
114 { GetBERT()->SetTxDriveStrength(GetIndex(), drive); }
115
118 { return GetBERT()->GetTxEnable(GetIndex()); }
119
125 void Enable(bool b)
126 { GetBERT()->SetTxEnable(GetIndex(), b); }
127
137 { return GetBERT()->GetTxPreCursor(GetIndex()); }
138
149 void SetPreCursor(float f)
150 { GetBERT()->SetTxPreCursor(GetIndex(), f); }
151
161 { return GetBERT()->GetTxPostCursor(GetIndex()); }
162
173 void SetPostCursor(float f)
174 { GetBERT()->SetTxPostCursor(GetIndex(), f); }
175
179 int64_t GetDataRate()
180 { return GetBERT()->GetDataRate(GetIndex()); }
181
192 void SetDataRate(int64_t rate)
193 { GetBERT()->SetDataRate(GetIndex(), rate); }
194
195 virtual PhysicalConnector GetPhysicalConnector() override;
196};
197
198#endif
Declaration of BERT.
A pattern generator channel of a BERT.
Definition: BERTOutputChannel.h:46
void SetInvert(bool invert)
Set the polarity inversion state of this channel.
Definition: BERTOutputChannel.h:89
void SetPostCursor(float f)
Sets the TX FFE post-cursor coefficient.
Definition: BERTOutputChannel.h:173
void SetDataRate(int64_t rate)
Sets the data rate of this channel, in symbols per second.
Definition: BERTOutputChannel.h:192
void SetPattern(BERT::Pattern pattern)
Set the pattern this channel is generating.
Definition: BERTOutputChannel.h:69
bool GetEnable()
Gets the enable status of this channel.
Definition: BERTOutputChannel.h:117
void Enable(bool b)
Set the enable state of this channel.
Definition: BERTOutputChannel.h:125
float GetPreCursor()
Gets the TX FFE pre-cursor coefficient.
Definition: BERTOutputChannel.h:136
int64_t GetDataRate()
Gets the data rate of this channel, in symbols per second.
Definition: BERTOutputChannel.h:179
BERTOutputChannel(const std::string &hwname, BERT *bert, const std::string &color="#808080", size_t index=0)
Initialize the channel.
Definition: BERTOutputChannel.cpp:52
std::vector< float > GetAvailableDriveStrengths()
Get the set of amplitudes this channel is capable of outputting.
Definition: BERTOutputChannel.h:97
void SetPreCursor(float f)
Sets the TX FFE pre-cursor coefficient.
Definition: BERTOutputChannel.h:149
float GetDriveStrength()
Get the current nominal amplitude of this channel.
Definition: BERTOutputChannel.h:105
BERT * GetBERT() const
Get the BERT this channel is part of.
Definition: BERTOutputChannel.h:61
void SetDriveStrength(float drive)
Set the current nominal amplitude of this channel.
Definition: BERTOutputChannel.h:113
bool GetInvert()
Get the polarity inversion state of this channel.
Definition: BERTOutputChannel.h:81
std::vector< BERT::Pattern > GetAvailablePatterns()
Get the set of patterns this channel is capable of generating.
Definition: BERTOutputChannel.h:77
float GetPostCursor()
Gets the TX FFE post-cursor coefficient.
Definition: BERTOutputChannel.h:160
BERT::Pattern GetPattern()
Get the pattern this channel is currently generating.
Definition: BERTOutputChannel.h:73
Base class for bit error rate tester drivers.
Definition: BERT.h:45
virtual float GetTxPostCursor(size_t i)=0
Get the post-cursor equalizer tap for a channel.
virtual void SetTxInvert(size_t i, bool invert)=0
Sets the transmit invert flag for a channel.
virtual void SetTxPreCursor(size_t i, float precursor)=0
Set the pre-cursor equalizer tap for a channel.
virtual Pattern GetTxPattern(size_t i)=0
Gets the currently selected transmit pattern for a channel.
virtual float GetTxDriveStrength(size_t i)=0
Get the drive strength for a channel.
virtual void SetTxPostCursor(size_t i, float postcursor)=0
Set the post-cursor equalizer tap for a channel.
virtual bool GetTxEnable(size_t i)=0
Gets the transmit enable flag for a channel.
virtual int64_t GetDataRate(size_t i)=0
Gets the currently selected line rate (in symbols/sec)
virtual void SetTxDriveStrength(size_t i, float drive)=0
Set the drive strength for a channel.
virtual void SetTxPattern(size_t i, Pattern pattern)=0
Sets the transmit pattern for the selected channel.
Pattern
Set of patterns we can generate or accept.
Definition: BERT.h:54
virtual bool GetTxInvert(size_t i)=0
Gets the transmit invert flag for a channel.
virtual void SetTxEnable(size_t i, bool enable)=0
Sets the transmit enable flag for a channel.
virtual float GetTxPreCursor(size_t i)=0
Get the pre-cursor equalizer tap for a channel.
virtual std::vector< Pattern > GetAvailableTxPatterns(size_t i)=0
Gets the list of available transmit patterns for a channel.
virtual std::vector< float > GetAvailableTxDriveStrengths(size_t i)=0
Gets the list of available drive strengths (in volts) for a channel.
virtual void SetDataRate(size_t i, int64_t rate)=0
Sets the data rate (in symbols/sec)
virtual void Refresh()
Evaluates a filter graph node.
Definition: FlowGraphNode.cpp:87
A single channel of an instrument.
Definition: InstrumentChannel.h:63
size_t GetIndex()
Gets the (zero based) index of the channel.
Definition: InstrumentChannel.h:94
Instrument * m_instrument
The instrument we're part of (may be null in the case of filters etc)
Definition: InstrumentChannel.h:274
Descriptor for a single stream coming off a channel.
Definition: StreamDescriptor.h:46