|
μHAL (v2.7.9)
Part of the IPbus software repository
|
Go to the documentation of this file.
45 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
57 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
61 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
64 for ( std::vector<uint32_t>::const_iterator lIt ( aIt ); lIt != aEnd; ++lIt )
70 uint32_t lAddress , lAddend , lAndTerm , lOrTerm ;
71 std::vector<uint32_t>::const_iterator lPayloadBegin, lPayloadEnd;
73 if ( IPbus_major != 1 )
75 mPacketHeader = *aIt++;
76 mPacketCounter = ( mPacketHeader>>8 ) &0xFFFF ;
77 mPacketType = mPacketHeader&0x0F ;
80 switch ( mPacketType )
84 if ( IPbus_major != 1 )
86 if ( !control_packet_header ( ) )
106 if ( IPbus_major != 1 )
108 if ( ! aContinueOnError )
114 log (
Warning() ,
"Attempting to see if it is because the bad header was, in fact, a packet header" );
116 return this->analyze ( aIt , aEnd );
124 if ( ( IPbus_major==1 && mResponseGood != 0 ) || ( IPbus_major==2 && mResponseGood != 0xf ) )
137 ni_read ( lAddress );
145 readConfigurationSpace( lAddress );
150 lPayloadEnd = aIt + mWordCounter;
151 ni_write ( lAddress , lPayloadBegin , lPayloadEnd );
157 lPayloadEnd = aIt + mWordCounter;
158 write ( lAddress , lPayloadBegin , lPayloadEnd );
164 rmw_sum ( lAddress , lAddend );
170 rmw_bits ( lAddress , lAndTerm , lOrTerm );
182 status_packet_header();
186 resend_packet_header();
189 unknown_packet_header( );
197 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
204 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
212 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
220 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
228 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
233 uint32_t lCounter ( 0 );
235 while ( aIt != aEnd )
242 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
247 uint32_t lCounter ( 0 );
249 while ( aIt != aEnd )
256 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
265 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
275 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
282 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
290 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
297 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
304 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
312 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
317 mTransactionId ( 0 ),
320 mPacketCounter ( 0 ),
325 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
329 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
333 std::vector<uint32_t>::const_iterator lPayloadBegin, lPayloadEnd;
335 if ( IPbus_major != 1 )
337 mPacketHeader = *aIt++;
338 mPacketCounter = ( mPacketHeader>>8 ) &0xFFFF ;
339 mPacketType = mPacketHeader&0x0F ;
342 switch ( mPacketType )
346 if ( IPbus_major != 1 )
348 if ( !control_packet_header ( ) )
368 if ( IPbus_major != 1 )
370 if ( ! aContinueOnError )
376 log (
Warning() ,
"Attempting to see if it is because the bad header was, in fact, a packet header" );
378 return this->analyze ( aIt , aEnd );
393 lPayloadEnd = aIt + mWordCounter;
394 ni_read ( lPayloadBegin , lPayloadEnd );
399 lPayloadEnd = aIt + mWordCounter;
400 read ( lPayloadBegin , lPayloadEnd );
411 rmw_sum ( lNewValue );
415 rmw_bits ( lNewValue );
427 status_packet_header( );
430 unknown_packet_header( );
438 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
445 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
449 uint32_t lCounter ( 0 );
451 while ( aIt != aEnd )
458 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
462 uint32_t lCounter ( 0 );
464 while ( aIt != aEnd )
471 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
478 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
485 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
493 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
501 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
508 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
516 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
523 template< u
int8_t IPbus_major , u
int8_t IPbus_minor >
virtual void unknown_type()
Virtual callback function for the case where the header is unknown.
virtual void resend_packet_header()
Virtual callback function called when an IPbus 2.0 resend packet header is observed.
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.
virtual void write()
Virtual callback function called when an incrementing write is observed.
virtual bool control_packet_header()
Virtual callback function called when an IPbus 2.0 control packet header is observed.
HostToTargetInspector()
Default constructor.
virtual void bot()
Virtual callback function called when a Byte-OrderTransaction is observed.
virtual void rmw_sum(const uint32_t &aNewValue)
Virtual callback function called when a read-modify-write sum is observed.
virtual void readConfigurationSpace(const uint32_t &aAddress)
Virtual callback function called when an incrementing "configuration space" read is observed.
A class which provides the version-specific functionality for IPbus.
Empty struct which acts as a dummy variable for passing the formatting information around.
Helper class to decode IPbus packets as passed from the Client to the Target.
virtual void read(const uint32_t &aAddress)
Virtual callback function called when an incrementing read is observed.
virtual void write(const uint32_t &aAddress, std::vector< uint32_t >::const_iterator &aIt, const std::vector< uint32_t >::const_iterator &aEnd)
Virtual callback function called when an incrementing write is observed.
virtual void ni_read(std::vector< uint32_t >::const_iterator &aIt, const std::vector< uint32_t >::const_iterator &aEnd)
Virtual callback function called when a non-incrementing read is observed.
virtual void unknown_packet_header()
Virtual callback function called when an unknown IPbus 2.0 packet header is observed.
virtual void read(std::vector< uint32_t >::const_iterator &aIt, const std::vector< uint32_t >::const_iterator &aEnd)
Virtual callback function called when an incrementing read is observed.
virtual ~TargetToHostInspector()
Destructor.
virtual void rmw_bits(const uint32_t &aNewValue)
Virtual callback function called when a read-modify-write bits is observed.
void log(FatalLevel &aFatal, const T0 &aArg0)
Function to add a log entry at Fatal level.
_Integer< T, IntFmt<> > Integer(const T &aT)
Forward declare a function which creates an instance of the ultra-lightweight wrapper from an integer...
virtual void rmw_sum(const uint32_t &aAddress, const uint32_t &aAddend)
Virtual callback function called when a read-modify-write sum is observed.
Helper class to decode IPbus packets as passed from the Target to the Client.
virtual bool control_packet_header()
Virtual callback function called when an IPbus 2.0 control packet header is observed.
virtual void status_packet_header()
Virtual callback function called when an IPbus 2.0 status packet header is observed.
virtual ~HostToTargetInspector()
Destructor.
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.
virtual void ni_write(const uint32_t &aAddress, std::vector< uint32_t >::const_iterator &aIt, const std::vector< uint32_t >::const_iterator &aEnd)
Virtual callback function called when a non-incrementing write is observed.
virtual void ni_read(const uint32_t &aAddress)
Virtual callback function called when a non-incrementing read is observed.
virtual void status_packet_header()
Virtual callback function called when an IPbus 2.0 status packet header is observed.
virtual void unknown_type()
Virtual callback function for the case where the header is unknown.
virtual void ni_write()
Virtual callback function called when a non-incrementing write is observed.
virtual void rmw_bits(const uint32_t &aAddress, const uint32_t &aAndTerm, const uint32_t &aOrTerm)
Virtual callback function called when a read-modify-write bits is observed.
TargetToHostInspector()
Default constructor.
virtual void unknown_packet_header()
Virtual callback function called when an unknown IPbus 2.0 packet header is observed.
virtual void bot()
Virtual callback function called when a Byte-OrderTransaction is observed.