@@ -764,3 +764,59 @@ bool FpgaIO::WriteFirewirePhy(unsigned char addr, unsigned char data)
764
764
quadlet_t write_data = 0x00001000 | static_cast <quadlet_t >(addr) << 8 | static_cast <quadlet_t >(data);
765
765
return port->WriteQuadlet (BoardId, BoardIO::FW_PHY_REQ, write_data);
766
766
}
767
+
768
+
769
+ void FpgaIO::PrintFirewireDebug (std::ostream &debugStream, const quadlet_t *data)
770
+ {
771
+ // Following structure must match DebugData in Firewire.v
772
+ struct DebugData {
773
+ char header[4 ]; // Quad 0
774
+ uint8_t misc_info; // Quad 1
775
+ uint8_t bus_info;
776
+ uint8_t lreq_info;
777
+ uint8_t state;
778
+ uint8_t numPhyStatus; // Quad 2
779
+ uint8_t numTxGrant;
780
+ uint8_t numRecv;
781
+ uint8_t numHubSendReq;
782
+ uint16_t stcount; // Quad 3
783
+ uint8_t numPktRecv;
784
+ uint8_t numEthSendReq;
785
+ };
786
+ const DebugData *p = reinterpret_cast <const DebugData *>(data);
787
+ if (strncmp (p->header , " DBG" , 3 ) != 0 ) {
788
+ debugStream << " PrintFirewireDebug: Unexpected header string: " << p->header [0 ]
789
+ << p->header [1 ] << p->header [2 ] << " (should be DBG)" << std::endl;
790
+ return ;
791
+ }
792
+ debugStream << " State: " << static_cast <uint16_t >(p->state >> 4 )
793
+ << " , Next: " << static_cast <uint16_t >(p->state & 0xf0 ) << std::endl;
794
+ if (p->lreq_info & 0x80 )
795
+ debugStream << " lreq_type: " << static_cast <uint16_t >((p->lreq_info & 0x70 ) >> 4 ) << std::endl;
796
+ if (p->lreq_info & 0x08 )
797
+ debugStream << " lreq_busy" << std::endl;
798
+ debugStream << " tx_type: " << static_cast <uint16_t >(p->lreq_info & 0x07 ) << std::endl;
799
+ debugStream << " " ;
800
+ if (p->bus_info & 0x80 )
801
+ debugStream << " req_write_bus " ;
802
+ if (p->bus_info & 0x40 )
803
+ debugStream << " grant_write_bus " ;
804
+ debugStream << " node_id: " << static_cast <uint16_t >(p->bus_info & 0x3f ) << std::endl;
805
+ debugStream << " " ;
806
+ if (p->misc_info & 0x80 )
807
+ debugStream << " data_block " ;
808
+ if (p->misc_info & 0x08 )
809
+ debugStream << " recvCtlInvalid " ;
810
+ if (p->misc_info & 0x04 )
811
+ debugStream << " recvPktNull " ;
812
+ if (p->misc_info & 0x02 )
813
+ debugStream << " link_active " ;
814
+ debugStream << " rx_speed: " << static_cast <uint16_t >((p->misc_info & 0x70 )>>4 ) << std::endl;
815
+ debugStream << " numHubSendReq: " << static_cast <uint16_t >(p->numHubSendReq ) << std::endl;
816
+ debugStream << " numRecv: " << static_cast <uint16_t >(p->numRecv ) << std::endl;
817
+ debugStream << " numPktRecv: " << static_cast <uint16_t >(p->numPktRecv ) << std::endl;
818
+ debugStream << " numTxGrant: " << static_cast <uint16_t >(p->numTxGrant ) << std::endl;
819
+ debugStream << " numPhyStatus: " << static_cast <uint16_t >(p->numPhyStatus ) << std::endl;
820
+ debugStream << " numEthSendReq: " << static_cast <uint16_t >(p->numEthSendReq ) << std::endl;
821
+ debugStream << " stcount: " << p->stcount << std::endl;
822
+ }
0 commit comments