// Generated by the protocol buffer compiler.  DO NOT EDIT!

#include "nvtypes.h"
#include "prbrt.h"
#include "g_crashcat_pb.h"

// 'Report.RiscvMode' enum descriptor
static const PRB_ENUM_MAPPING prb_enum_mappings_report_riscvmode[] = {
    {
        1,
        PRB_MAYBE_ENUM_NAME("MODE_X")
    },
    {
        2,
        PRB_MAYBE_ENUM_NAME("MODE_M")
    },
    {
        3,
        PRB_MAYBE_ENUM_NAME("MODE_S")
    },
    {
        4,
        PRB_MAYBE_ENUM_NAME("MODE_U")
    },
};

const PRB_ENUM_DESC prb_enums_crashcat_report_riscvmode = {
    prb_enum_mappings_report_riscvmode,
    4,
   PRB_MAYBE_ENUM_NAME("RiscvMode")
};

// 'Report.CauseType' enum descriptor
static const PRB_ENUM_MAPPING prb_enum_mappings_report_causetype[] = {
    {
        1,
        PRB_MAYBE_ENUM_NAME("UNKNOWN")
    },
    {
        2,
        PRB_MAYBE_ENUM_NAME("EXCEPTION")
    },
    {
        3,
        PRB_MAYBE_ENUM_NAME("TIMEOUT")
    },
    {
        4,
        PRB_MAYBE_ENUM_NAME("PANIC")
    },
};

const PRB_ENUM_DESC prb_enums_crashcat_report_causetype = {
    prb_enum_mappings_report_causetype,
    4,
   PRB_MAYBE_ENUM_NAME("CauseType")
};

// 'Report.PanicReasonType' enum descriptor
static const PRB_ENUM_MAPPING prb_enum_mappings_report_panicreasontype[] = {
    {
        1,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonUnspecified")
    },
    {
        2,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonUnhandledState")
    },
    {
        3,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonInvalidConfiguration")
    },
    {
        4,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonFatalHardwareError")
    },
    {
        5,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonInsufficientResources")
    },
    {
        6,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonTimeout")
    },
    {
        7,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonEnvCallFailed")
    },
    {
        8,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonAsanMemoryError")
    },
    {
        9,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonProgrammingError")
    },
    {
        10,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonAssertionFailed")
    },
    {
        11,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonTrapKernelPanic")
    },
    {
        12,
        PRB_MAYBE_ENUM_NAME("LibosPanicReasonTrapInstruction")
    },
};

const PRB_ENUM_DESC prb_enums_crashcat_report_panicreasontype = {
    prb_enum_mappings_report_panicreasontype,
    12,
   PRB_MAYBE_ENUM_NAME("PanicReasonType")
};

// 'Riscv64CsrState' field defaults

// 'Riscv64CsrState' field descriptors
const PRB_FIELD_DESC prb_fields_crashcat_riscv64csrstate[] = {
    {
        1,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("header")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        2,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("xstatus")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        3,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("xie")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        4,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("xip")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        5,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("xepc")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        6,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("xtval")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        7,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("xcause")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        8,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("xscratch")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
};

// 'Riscv64GprState' field defaults

// 'Riscv64GprState' field descriptors
const PRB_FIELD_DESC prb_fields_crashcat_riscv64gprstate[] = {
    {
        1,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("header")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        2,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("ra")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        3,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("sp")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        4,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("gp")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        5,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("tp")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        6,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("t0")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        7,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("t1")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        8,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("t2")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        9,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s0")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        10,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s1")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        11,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("a0")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        12,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("a1")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        13,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("a2")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        14,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("a3")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        15,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("a4")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        16,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("a5")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        17,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("a6")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        18,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("a7")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        19,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s2")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        20,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s3")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        21,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s4")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        22,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s5")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        23,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s6")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        24,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s7")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        25,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s8")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        26,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s9")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        27,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s10")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        28,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("s11")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        29,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("t3")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        30,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("t4")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        31,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("t5")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        32,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("t6")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
};

// 'LocalIORegister' field defaults

// 'LocalIORegister' field descriptors
const PRB_FIELD_DESC prb_fields_crashcat_localioregister[] = {
    {
        1,
        {
            PRB_OPTIONAL,
            PRB_UINT32,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("address")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        2,
        {
            PRB_OPTIONAL,
            PRB_UINT32,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("value")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
};

// 'Report' field defaults

// 'Report' field descriptors
const PRB_FIELD_DESC prb_fields_crashcat_report[] = {
    {
        1,
        {
            PRB_OPTIONAL,
            PRB_ENUM,
            0,
        },
        0,
        &prb_enums_crashcat_report_riscvmode,
        PRB_MAYBE_FIELD_NAME("mode")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        2,
        {
            PRB_OPTIONAL,
            PRB_ENUM,
            0,
        },
        0,
        &prb_enums_crashcat_report_causetype,
        PRB_MAYBE_FIELD_NAME("cause")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        3,
        {
            PRB_OPTIONAL,
            PRB_ENUM,
            0,
        },
        0,
        &prb_enums_crashcat_report_panicreasontype,
        PRB_MAYBE_FIELD_NAME("libosPanicReason")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        4,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("pc")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        5,
        {
            PRB_OPTIONAL,
            PRB_UINT32,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("sourcePartition")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        6,
        {
            PRB_OPTIONAL,
            PRB_UINT32,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("sourceUcodeId")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        7,
        {
            PRB_OPTIONAL,
            PRB_UINT32,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("reporterPartition")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        8,
        {
            PRB_OPTIONAL,
            PRB_UINT32,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("reporterUcodeId")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        9,
        {
            PRB_OPTIONAL,
            PRB_UINT32,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("libosVersionMajor")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        10,
        {
            PRB_OPTIONAL,
            PRB_UINT32,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("libosVersionMinor")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        11,
        {
            PRB_OPTIONAL,
            PRB_UINT32,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("libosVersionCl")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        12,
        {
            PRB_OPTIONAL,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("timestamp")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        13,
        {
            PRB_OPTIONAL,
            PRB_MESSAGE,
            0,
        },
        CRASHCAT_RISCV64CSRSTATE,
        0,
        PRB_MAYBE_FIELD_NAME("csrState")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        14,
        {
            PRB_OPTIONAL,
            PRB_MESSAGE,
            0,
        },
        CRASHCAT_RISCV64GPRSTATE,
        0,
        PRB_MAYBE_FIELD_NAME("gprState")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        15,
        {
            PRB_REPEATED,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("StackTrace")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        16,
        {
            PRB_REPEATED,
            PRB_UINT64,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("PcTrace")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        17,
        {
            PRB_REPEATED,
            PRB_MESSAGE,
            0,
        },
        CRASHCAT_LOCALIOREGISTER,
        0,
        PRB_MAYBE_FIELD_NAME("localIORegister")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
    {
        18,
        {
            PRB_OPTIONAL,
            PRB_STRING,
            0,
        },
        0,
        0,
        PRB_MAYBE_FIELD_NAME("buildId")
        PRB_MAYBE_FIELD_DEFAULT(0)
    },
};

// Message descriptors
const PRB_MSG_DESC prb_messages_crashcat[] = {
    {
        8,
        prb_fields_crashcat_riscv64csrstate,
        PRB_MAYBE_MESSAGE_NAME("Crashcat.Riscv64CsrState")
    },
    {
        32,
        prb_fields_crashcat_riscv64gprstate,
        PRB_MAYBE_MESSAGE_NAME("Crashcat.Riscv64GprState")
    },
    {
        2,
        prb_fields_crashcat_localioregister,
        PRB_MAYBE_MESSAGE_NAME("Crashcat.LocalIORegister")
    },
    {
        18,
        prb_fields_crashcat_report,
        PRB_MAYBE_MESSAGE_NAME("Crashcat.Report")
    },
};

// Service descriptors
const PRB_SERVICE_DESC prb_services_crashcat[] = {
   { 0 }
};

