μHAL (v2.7.9)
Part of the IPbus software repository
DummyHardware.cpp
Go to the documentation of this file.
1 /*
2 ---------------------------------------------------------------------------
3 
4  This file is part of uHAL.
5 
6  uHAL is a hardware access library and programming framework
7  originally developed for upgrades of the Level-1 trigger of the CMS
8  experiment at CERN.
9 
10  uHAL is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  uHAL is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with uHAL. If not, see <http://www.gnu.org/licenses/>.
22 
23 
24  Andrew Rose, Imperial College, London
25  email: awr01 <AT> imperial.ac.uk
26 
27  Marc Magrans de Abril, CERN
28  email: marc.magrans.de.abril <AT> cern.ch
29 
30 ---------------------------------------------------------------------------
31 */
32 
34 
35 
36 #include <deque>
37 #include <vector>
38 
39 #include <arpa/inet.h>
40 
41 #include <boost/chrono/chrono_io.hpp>
42 #include <boost/thread/thread.hpp>
43 
44 #include "uhal/log/LogLevels.hpp"
46 #include "uhal/log/log.hpp"
47 #include "uhal/ProtocolIPbus.hpp"
48 
49 
50 namespace uhal
51 {
52  namespace tests
53  {
54 
55  template< uint8_t IPbus_major , uint8_t IPbus_minor >
56  DummyHardware<IPbus_major, IPbus_minor>::DummyHardware ( const uint32_t& aReplyDelay, const bool& aBigEndianHack ) :
57  DummyHardwareInterface( boost::chrono::seconds(aReplyDelay) ),
58  HostToTargetInspector< IPbus_major , IPbus_minor >(),
59  mMemory (),
60  mConfigurationSpace(),
61  mReceive ( BUFFER_SIZE , 0x00000000 ),
62  mReply ( BUFFER_SIZE , 0x00000000 ),
63  mReplyHistory ( REPLY_HISTORY_DEPTH , std::make_pair ( 0 , mReply ) ),
64  mLastPacketHeader ( 0x200000f0 ),
65  mTrafficHistory ( 16, 0x00 ),
66  mReceivedControlPacketHeaderHistory ( 4 , 0x00000000 ),
67  mSentControlPacketHeaderHistory ( 4 , 0x00000000 ),
68  mBigEndianHack ( aBigEndianHack )
69  {
70  for (size_t i = 0; i < 10; i++)
71  mConfigurationSpace.push_back( (uint16_t(getpid()) << 16) | i );
72  }
73 
74  template< uint8_t IPbus_major , uint8_t IPbus_minor >
76  {
77  }
78 
79 
80  template< uint8_t IPbus_major , uint8_t IPbus_minor >
82  {
83  // std::cout << aByteCount << " bytes received" << std::endl;
84  if ( IPbus_major == 2 )
85  {
86  bool is_status_request = ( *mReceive.begin() == 0xF1000020 );
87  bool is_resend_request = ( ( *mReceive.begin() & 0xFF0000FF ) == 0xF2000020 );
88 
89  if ( mBigEndianHack || is_status_request || is_resend_request )
90  {
91  for ( std::vector<uint32_t>::iterator lIt ( mReceive.begin() ) ; lIt != mReceive.begin() + ( aByteCount>>2 ) ; ++lIt )
92  {
93  *lIt = ntohl ( *lIt );
94  }
95  }
96  }
97 
98  std::vector<uint32_t>::const_iterator lBegin, lEnd;
99 
100  //
101  //-----------------------------------------------------------------------------------------------------------------------------------------------------------------
102  if ( LoggingIncludes ( Debug() ) )
103  {
104  log ( Debug() , "\n=============================================== RECEIVED ===============================================" );
106  lBegin = mReceive.begin();
107  lEnd = mReceive.begin() + ( aByteCount>>2 );
108  lHostToTargetDebugger.analyze ( lBegin , lEnd );
109  }
110 
111  //-----------------------------------------------------------------------------------------------------------------------------------------------------------------
112  //
113  lBegin = mReceive.begin();
114  lEnd = mReceive.begin() + ( aByteCount>>2 );
115 
116  if ( ! base_type::analyze ( lBegin , lEnd ) ) // Cope with receiving bad headers
117  {
118  log ( Error() , "Found a bad header" );
119  mReply.push_back ( IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , base_type::mWordCounter , base_type::mTransactionId , ( IPbus_major==1 ? 2 : 1 ) ) );
120  }
121 
122  if ( ( base_type::mPacketType == 0 ) && ( mReply.size() != 0 ) )
123  {
124  mReplyHistory.push_back ( std::make_pair ( base_type::mPacketCounter , mReply ) );
125  mReplyHistory.pop_front();
126  }
127 
128  if ( mReplyDelay > boost::chrono::microseconds(0) )
129  {
130  log ( Info() , "Sleeping for " , mReplyDelay );
131  boost::this_thread::sleep_for( mReplyDelay );
132  mReplyDelay = boost::chrono::microseconds(0);
133  log ( Info() , "Now replying " );
134  }
135 
136  //
137  //-----------------------------------------------------------------------------------------------------------------------------------------------------------------
138  if ( LoggingIncludes ( Debug() ) && ! mReply.empty() )
139  {
140  log ( Debug() , "\n=============================================== SENDING ===============================================" );
142  lBegin = mReply.begin();
143  lEnd = mReply.end();
144  lTargetToHostDebugger.analyze ( lBegin , lEnd );
145  }
146 
147  //-----------------------------------------------------------------------------------------------------------------------------------------------------------------
148  //
149 
150  if ( IPbus_major == 2 )
151  {
152  if ( mBigEndianHack || base_type::mPacketType == 1 )
153  {
154  for ( std::vector<uint32_t>::iterator lIt ( mReply.begin() ) ; lIt != mReply.end() ; ++lIt )
155  {
156  *lIt = htonl ( *lIt );
157  }
158  }
159  }
160  }
161 
162 
163  template< uint8_t IPbus_major , uint8_t IPbus_minor >
164  void DummyHardware<IPbus_major, IPbus_minor>::SetEndpoint( const uint32_t& aAddress , const uint32_t& aValue )
165  {
166  if( ! mMemory.size() )
167  mMemory.resize( ADDRESSMASK + 1 );
168  mMemory.at ( aAddress & ADDRESSMASK ) = aValue;
169  }
170 
171 
172  template< uint8_t IPbus_major , uint8_t IPbus_minor >
173  uint32_t DummyHardware<IPbus_major, IPbus_minor>::GetEndpoint( const uint32_t& aAddress )
174  {
175  if( ! mMemory.size() )
176  mMemory.resize( ADDRESSMASK + 1 );
177  return mMemory.at ( aAddress & ADDRESSMASK );
178  }
179 
180 
181  template< uint8_t IPbus_major , uint8_t IPbus_minor >
183  {
184  mReceivedControlPacketHeaderHistory.push_back ( base_type::mPacketHeader );
185  mReceivedControlPacketHeaderHistory.pop_front();
186  uint32_t lExpected ( IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , 0 , base_type::mTransactionId ) );
187  mReply.push_back ( lExpected );
188  mSentControlPacketHeaderHistory.push_back ( lExpected );
189  mSentControlPacketHeaderHistory.pop_front();
190  }
191 
192 
193  template< uint8_t IPbus_major , uint8_t IPbus_minor >
194  void DummyHardware<IPbus_major, IPbus_minor>::ni_read ( const uint32_t& aAddress )
195  {
196  mReceivedControlPacketHeaderHistory.push_back ( base_type::mPacketHeader );
197  mReceivedControlPacketHeaderHistory.pop_front();
198  uint32_t lAddress ( aAddress );
199  uint32_t lExpected ( IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , base_type::mWordCounter , base_type::mTransactionId ) );
200  mReply.push_back ( lExpected );
201  mSentControlPacketHeaderHistory.push_back ( lExpected );
202  mSentControlPacketHeaderHistory.pop_front();
203 
204  for ( ; base_type::mWordCounter!=0 ; --base_type::mWordCounter )
205  {
206  mReply.push_back ( GetEndpoint( lAddress ) );
207  }
208  }
209 
210 
211  template< uint8_t IPbus_major , uint8_t IPbus_minor >
212  void DummyHardware<IPbus_major, IPbus_minor>::read ( const uint32_t& aAddress )
213  {
214  mReceivedControlPacketHeaderHistory.push_back ( base_type::mPacketHeader );
215  mReceivedControlPacketHeaderHistory.pop_front();
216  uint32_t lAddress ( aAddress );
217  uint32_t lExpected ( IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , base_type::mWordCounter , base_type::mTransactionId ) );
218  mReply.push_back ( lExpected );
219  mSentControlPacketHeaderHistory.push_back ( lExpected );
220  mSentControlPacketHeaderHistory.pop_front();
221 
222  for ( ; base_type::mWordCounter!=0 ; --base_type::mWordCounter )
223  {
224  mReply.push_back ( GetEndpoint( lAddress++ ) );
225  }
226  }
227 
228 
229  template< uint8_t IPbus_major , uint8_t IPbus_minor >
231  {
232  mReceivedControlPacketHeaderHistory.push_back ( base_type::mPacketHeader );
233  mReceivedControlPacketHeaderHistory.pop_front();
234  uint32_t lAddress ( aAddress );
235  uint32_t lExpected ( IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , base_type::mWordCounter , base_type::mTransactionId ) );
236  mReply.push_back ( lExpected );
237  mSentControlPacketHeaderHistory.push_back ( lExpected );
238  mSentControlPacketHeaderHistory.pop_front();
239 
240  for ( ; base_type::mWordCounter!=0 ; --base_type::mWordCounter )
241  {
242  mReply.push_back ( mConfigurationSpace.at( lAddress++ ) );
243  }
244  }
245 
246 
247  template< uint8_t IPbus_major , uint8_t IPbus_minor >
248  void DummyHardware<IPbus_major, IPbus_minor>::ni_write ( const uint32_t& aAddress , std::vector<uint32_t>::const_iterator& aIt , const std::vector<uint32_t>::const_iterator& aEnd )
249  {
250  mReceivedControlPacketHeaderHistory.push_back ( base_type::mPacketHeader );
251  mReceivedControlPacketHeaderHistory.pop_front();
252  uint32_t lAddress ( aAddress );
253 
254  while ( aIt != aEnd )
255  {
256  SetEndpoint ( lAddress , *aIt++ );
257  }
258 
259  uint32_t lExpected;
260 
261  if ( IPbus_major == 1 )
262  {
263  lExpected = IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , 0 , base_type::mTransactionId );
264  }
265  else
266  {
267  lExpected = IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , base_type::mWordCounter , base_type::mTransactionId );
268  }
269 
270  mReply.push_back ( lExpected );
271  mSentControlPacketHeaderHistory.push_back ( lExpected );
272  mSentControlPacketHeaderHistory.pop_front();
273  }
274 
275 
276  template< uint8_t IPbus_major , uint8_t IPbus_minor >
277  void DummyHardware<IPbus_major, IPbus_minor>::write ( const uint32_t& aAddress , std::vector<uint32_t>::const_iterator& aIt , const std::vector<uint32_t>::const_iterator& aEnd )
278  {
279  mReceivedControlPacketHeaderHistory.push_back ( base_type::mPacketHeader );
280  mReceivedControlPacketHeaderHistory.pop_front();
281  uint32_t lAddress ( aAddress );
282 
283  while ( aIt != aEnd )
284  {
285  SetEndpoint ( lAddress++ , *aIt++ );
286  }
287 
288  uint32_t lExpected;
289 
290  if ( IPbus_major == 1 )
291  {
292  lExpected = IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , 0 , base_type::mTransactionId );
293  }
294  else
295  {
296  lExpected = IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , base_type::mWordCounter , base_type::mTransactionId );
297  }
298 
299  mReply.push_back ( lExpected );
300  mSentControlPacketHeaderHistory.push_back ( lExpected );
301  mSentControlPacketHeaderHistory.pop_front();
302  }
303 
304 
305  template< uint8_t IPbus_major , uint8_t IPbus_minor >
306  void DummyHardware<IPbus_major, IPbus_minor>::rmw_sum ( const uint32_t& aAddress , const uint32_t& aAddend )
307  {
308  mReceivedControlPacketHeaderHistory.push_back ( base_type::mPacketHeader );
309  mReceivedControlPacketHeaderHistory.pop_front();
310  uint32_t lAddress ( aAddress );
311  uint32_t lExpected ( IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , 1 , base_type::mTransactionId ) );
312  mReply.push_back ( lExpected );
313  mSentControlPacketHeaderHistory.push_back ( lExpected );
314  mSentControlPacketHeaderHistory.pop_front();
315 
316  if ( IPbus_major == 1 )
317  {
318  //IPbus 1.x returns modified value
319  uint32_t lValue( GetEndpoint( lAddress ) );
320  lValue += aAddend;
321  SetEndpoint( lAddress , lValue );
322  mReply.push_back ( lValue );
323  }
324  else
325  {
326  //IPbus 2.x returns pre-modified value
327  uint32_t lValue( GetEndpoint( lAddress ) );
328  mReply.push_back ( lValue );
329  lValue += aAddend;
330  SetEndpoint( lAddress , lValue );
331  }
332  }
333 
334 
335  template< uint8_t IPbus_major , uint8_t IPbus_minor >
336  void DummyHardware<IPbus_major, IPbus_minor>::rmw_bits ( const uint32_t& aAddress , const uint32_t& aAndTerm , const uint32_t& aOrTerm )
337  {
338  mReceivedControlPacketHeaderHistory.push_back ( base_type::mPacketHeader );
339  mReceivedControlPacketHeaderHistory.pop_front();
340  uint32_t lAddress ( aAddress );
341  uint32_t lExpected ( IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , 1 , base_type::mTransactionId ) );
342  mReply.push_back ( lExpected );
343  mSentControlPacketHeaderHistory.push_back ( lExpected );
344  mSentControlPacketHeaderHistory.pop_front();
345 
346  if ( IPbus_major == 1 )
347  {
348  //IPbus 1.x returns modified value
349  uint32_t lValue( GetEndpoint( lAddress ) );
350  lValue &= aAndTerm;
351  lValue |= aOrTerm;
352  SetEndpoint( lAddress , lValue );
353  mReply.push_back ( lValue );
354  }
355  else
356  {
357  //IPbus 2.x returns pre-modified value
358  uint32_t lValue( GetEndpoint( lAddress ) );
359  mReply.push_back ( lValue );
360  lValue &= aAndTerm;
361  lValue |= aOrTerm;
362  SetEndpoint( lAddress , lValue );
363  }
364  }
365 
366 
367  template< uint8_t IPbus_major , uint8_t IPbus_minor >
369  {
370  log ( Error() , Integer ( base_type::mHeader, IntFmt<hex,fixed>() ) , " is an unknown IPbus transaction header. Returning error code." );
371  mReceivedControlPacketHeaderHistory.push_back ( base_type::mPacketHeader );
372  mReceivedControlPacketHeaderHistory.pop_front();
373  uint32_t lExpected ( IPbus< IPbus_major , IPbus_minor >::ExpectedHeader ( base_type::mType , 0 , base_type::mTransactionId , 1 ) );
374  mReply.push_back ( lExpected );
375  mSentControlPacketHeaderHistory.push_back ( lExpected );
376  mSentControlPacketHeaderHistory.pop_front();
377  }
378 
379 
380  template< uint8_t IPbus_major , uint8_t IPbus_minor >
382  {
383  if ( base_type::mPacketCounter != 0 )
384  {
385  uint16_t lTemp ( ( ( mLastPacketHeader>>8 ) &0x0000FFFF ) + 1 );
386 
387  if ( lTemp == 0 )
388  {
389  lTemp = 1;
390  }
391 
392  if ( base_type::mPacketCounter != lTemp )
393  {
394  mTrafficHistory.push_back ( 5 );
395  mTrafficHistory.pop_front();
396  log(Notice(), "Dummy hardware received control packet with ID ", Integer(base_type::mPacketCounter), ", but expected ID ", Integer(lTemp));
397  return false;
398  }
399 
400  mLastPacketHeader = base_type::mPacketHeader;
401  }
402 
403  mReply.push_back ( base_type::mPacketHeader );
404  mTrafficHistory.push_back ( 2 );
405  mTrafficHistory.pop_front();
406  return true;
407  }
408 
409 
410  template< uint8_t IPbus_major , uint8_t IPbus_minor >
412  {
413  mReply.push_back ( base_type::mPacketHeader );
414  mReply.push_back ( BUFFER_SIZE * sizeof ( uint32_t ) );
415  mReply.push_back ( REPLY_HISTORY_DEPTH );
416  uint16_t lTemp ( ( ( mLastPacketHeader>>8 ) &0x0000FFFF ) + 1 );
417 
418  if ( lTemp == 0 )
419  {
420  lTemp = 1;
421  }
422 
423  mReply.push_back ( ( mLastPacketHeader & 0xFF0000FF ) | ( ( lTemp <<8 ) & 0x00FFFF00 ) );
424  std::deque< uint8_t >::const_iterator lIt ( mTrafficHistory.begin() );
425 
426  for ( uint32_t i = 0; i != 4 ; ++i )
427  {
428  uint32_t lTemp ( 0x00000000 );
429 
430  for ( uint32_t j = 0; j != 4 ; ++j )
431  {
432  lTemp <<= 8;
433  lTemp |= ( uint32_t ) ( *lIt );
434  lIt++;
435  }
436 
437  mReply.push_back ( lTemp );;
438  }
439 
440  for ( std::deque< uint32_t >::const_iterator i = mReceivedControlPacketHeaderHistory.begin(); i != mReceivedControlPacketHeaderHistory.end() ; ++i )
441  {
442  mReply.push_back ( *i );
443  }
444 
445  for ( std::deque< uint32_t >::const_iterator i = mSentControlPacketHeaderHistory.begin(); i != mSentControlPacketHeaderHistory.end() ; ++i )
446  {
447  mReply.push_back ( *i );
448  }
449 
450  mTrafficHistory.push_back ( 3 );
451  mTrafficHistory.pop_front();
452  }
453 
454 
455  template< uint8_t IPbus_major , uint8_t IPbus_minor >
457  {
458  std::deque< std::pair< uint32_t , std::vector< uint32_t > > >::reverse_iterator lIt = mReplyHistory.rbegin();
459 
460  for ( ; lIt!=mReplyHistory.rend() ; ++lIt )
461  {
462  if ( lIt->first == base_type::mPacketCounter )
463  {
464  mReply = lIt->second;
465  break;
466  }
467  }
468 
469  mTrafficHistory.push_back ( 4 );
470  mTrafficHistory.pop_front();
471  }
472 
473 
474  template< uint8_t IPbus_major , uint8_t IPbus_minor >
476  {
477  mTrafficHistory.push_back ( 5 );
478  mTrafficHistory.pop_front();
479  }
480 
481 
482  template class DummyHardware<1, 3>;
483  template class DummyHardware<2, 0>;
484  }
485 }
486 
487 
488 
uhal::tests::DummyHardware::mConfigurationSpace
std::vector< uint32_t > mConfigurationSpace
The configuration space within the virtual hardware.
Definition: DummyHardware.hpp:195
uhal::tests::DummyHardware::unknown_type
void unknown_type()
Analyse request and create reply when the header is unknown.
Definition: DummyHardware.cpp:368
uhal::tests::DummyHardware::status_packet_header
void status_packet_header()
Analyse request and create reply when an IPbus 2.0 status packet header is observed.
Definition: DummyHardware.cpp:411
uhal::tests::ADDRESSMASK
static const uint32_t ADDRESSMASK
The mask for the address space (size of the address space in one larger than this)
Definition: DummyHardware.hpp:58
uhal::TargetToHostInspector::analyze
bool analyze(std::vector< uint32_t >::const_iterator &aIt, const std::vector< uint32_t >::const_iterator &aEnd, const bool &aContinueOnError=true)
Analyse an IPbus packet held as a vector of uint32_t's.
Definition: IPbusInspector.cpp:330
uhal::tests::DummyHardware::readConfigurationSpace
void readConfigurationSpace(const uint32_t &aAddress)
Analyse request and create reply when an incrementing "configuration space" read is observed.
Definition: DummyHardware.cpp:230
uhal::tests::DummyHardware::ni_read
void ni_read(const uint32_t &aAddress)
Analyse request and create reply when a non-incrementing read is observed.
Definition: DummyHardware.cpp:194
uhal::tests::DummyHardware::control_packet_header
bool control_packet_header()
Analyse request and create reply when an IPbus 2.0 control packet header is observed.
Definition: DummyHardware.cpp:381
uhal::tests::j
std::vector< uint32_t >::const_iterator j
Definition: test_rawclient.cpp:113
uhal::tests::BUFFER_SIZE
static const uint32_t BUFFER_SIZE
Size of the receive and reply buffers.
Definition: DummyHardware.hpp:62
uhal::IPbus
A class which provides the version-specific functionality for IPbus.
Definition: ProtocolIPbus.hpp:69
boost
Definition: log.hpp:13
uhal::IntFmt
Empty struct which acts as a dummy variable for passing the formatting information around.
Definition: log_inserters.integer.hpp:68
uhal::HostToTargetInspector
Helper class to decode IPbus packets as passed from the Client to the Target.
Definition: IPbusInspector.hpp:55
uhal::tests::DummyHardware::ni_write
void ni_write(const uint32_t &aAddress, std::vector< uint32_t >::const_iterator &aIt, const std::vector< uint32_t >::const_iterator &aEnd)
Analyse request and create reply when a non-incrementing write is observed.
Definition: DummyHardware.cpp:248
uhal
Definition: HttpResponseGrammar.hpp:49
uhal::tests::DummyHardware::bot
void bot()
Analyse request and create reply when a Byte-OrderTransaction is observed.
Definition: DummyHardware.cpp:182
uhal::tests::DummyHardware::SetEndpoint
void SetEndpoint(const uint32_t &aAddress, const uint32_t &aValue)
Definition: DummyHardware.cpp:164
uhal::Info
InfoLevel Info
Definition: LogLevels.cpp:115
uhal::log
void log(FatalLevel &aFatal, const T0 &aArg0)
Function to add a log entry at Fatal level.
Definition: log.hxx:20
log_inserters.integer.hpp
uhal::tests::DummyHardware::DummyHardware
DummyHardware(const uint32_t &aReplyDelay, const bool &aBigEndianHack)
Constructor.
Definition: DummyHardware.cpp:56
uhal::Integer
_Integer< T, IntFmt<> > Integer(const T &aT)
Forward declare a function which creates an instance of the ultra-lightweight wrapper from an integer...
Definition: log_inserters.integer.hxx:43
uhal::LoggingIncludes
const bool & LoggingIncludes(const FatalLevel &)
Function to check at runtime whether the level Fatal is to be included in the log output.
Definition: log.cpp:100
uhal::tests::DummyHardware::AnalyzeReceivedAndCreateReply
void AnalyzeReceivedAndCreateReply(const uint32_t &aByteCount)
Function which analyses the received IPbus packet and creates the suitable response.
Definition: DummyHardware.cpp:81
DummyHardware.hpp
uhal::tests::DummyHardware
Abstract base class to emulate IPbus hardware.
Definition: DummyHardware.hpp:96
uhal::TargetToHostInspector
Helper class to decode IPbus packets as passed from the Target to the Client.
Definition: IPbusInspector.hpp:166
uhal::tests::DummyHardware::~DummyHardware
virtual ~DummyHardware()
Definition: DummyHardware.cpp:75
ProtocolIPbus.hpp
uhal::Error
ErrorLevel Error
Definition: LogLevels.cpp:61
uhal::tests::DummyHardware::write
void write(const uint32_t &aAddress, std::vector< uint32_t >::const_iterator &aIt, const std::vector< uint32_t >::const_iterator &aEnd)
Analyse request and create reply when an incrementing write is observed.
Definition: DummyHardware.cpp:277
uhal::tests::DummyHardware::GetEndpoint
uint32_t GetEndpoint(const uint32_t &aAddress)
Definition: DummyHardware.cpp:173
uhal::HostToTargetInspector::analyze
bool analyze(std::vector< uint32_t >::const_iterator &aIt, const std::vector< uint32_t >::const_iterator &aEnd, const bool &aContinueOnError=true)
Analyse an IPbus packet held as a vector of uint32_t's.
Definition: IPbusInspector.cpp:62
uhal::tests::DummyHardware::unknown_packet_header
void unknown_packet_header()
Analyse request and create reply when an unknown IPbus 2.0 packet header is observed.
Definition: DummyHardware.cpp:475
uhal::Debug
DebugLevel Debug
Definition: LogLevels.cpp:133
uhal::tests::DummyHardwareInterface
Common abstract base class for IPbus 1.3 and 2.0 dummy hardware.
Definition: DummyHardware.hpp:66
uhal::tests::REPLY_HISTORY_DEPTH
static const uint32_t REPLY_HISTORY_DEPTH
The size of the reply history for IPbus 2.0.
Definition: DummyHardware.hpp:60
uhal::Notice
NoticeLevel Notice
Definition: LogLevels.cpp:97
log.hpp
uhal::tests::DummyHardware::resend_packet_header
void resend_packet_header()
Analyse request and create reply when an IPbus 2.0 resend packet header is observed.
Definition: DummyHardware.cpp:456
uhal::tests::DummyHardware::read
void read(const uint32_t &aAddress)
Analyse request and create reply when an incrementing read is observed.
Definition: DummyHardware.cpp:212
LogLevels.hpp
uhal::tests::DummyHardware::rmw_sum
void rmw_sum(const uint32_t &aAddress, const uint32_t &aAddend)
Analyse request and create reply when a read-modify-write sum is observed.
Definition: DummyHardware.cpp:306
uhal::tests::DummyHardware::rmw_bits
void rmw_bits(const uint32_t &aAddress, const uint32_t &aAndTerm, const uint32_t &aOrTerm)
Analyse request and create reply when a read-modify-write bits is observed.
Definition: DummyHardware.cpp:336