r600/sfn: Add print method to AluReadportValidation
authorGert Wollny <gert.wollny@collabora.com>
Tue, 28 Feb 2023 16:52:45 +0000 (17:52 +0100)
committerMarge Bot <emma+marge@anholt.net>
Sun, 5 Mar 2023 09:54:08 +0000 (09:54 +0000)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>

src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.cpp
src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.h

index d79cd7a..b752b9e 100644 (file)
@@ -150,6 +150,20 @@ AluReadportReservation::schedule_trans_instruction(const AluInstr& alu,
    return visitor2.success;
 }
 
+void AluReadportReservation::print(std::ostream& os) const
+{
+   os << "AluReadportReservation\n";
+   for (int i = 0; i < max_chan_channels; ++i) {
+      os << "  chan " << i << ":";
+      for (int j = 0; j < max_gpr_readports; ++j) {
+         os << m_hw_gpr[j][i] << " ";
+      }
+      os << "\n";
+   }
+   os << "\n";
+
+}
+
 AluReadportReservation::AluReadportReservation()
 {
    for (int i = 0; i < max_chan_channels; ++i) {
index ce924aa..96501d0 100644 (file)
@@ -50,6 +50,8 @@ public:
    static int cycle_vec(AluBankSwizzle swz, int src);
    static int cycle_trans(AluBankSwizzle swz, int src);
 
+   void print(std::ostream& os) const;
+
    static const int max_chan_channels = 4;
    static const int max_gpr_readports = 3;
 
@@ -61,6 +63,12 @@ public:
    uint32_t m_nliterals{0};
 };
 
+inline std::ostream&
+operator << (std::ostream& os, const AluReadportReservation& arp) {
+   arp.print(os);
+   return os;
+}
+
 } // namespace r600
 
 #endif // ALUREADPORTVALIDATION_H