<commit_before>/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.H $   */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2016,2019                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
#ifndef __P9_SCAN_RING_UTIL_H
#define __P9_SCAN_RING_UTIL_H

#include <fapi2.H>
#include "p9_ringId.H"
#include "p9_stop_util.H"
#include <map>

//#define __CRONUS_VER
///
/// @file   p9_scan_ring_util.H
/// @brief  utility classes and functions for scan ring debug.
///
/// *HWP HWP Owner:      <NAME> <<EMAIL>>
/// *HWP FW Owner:       <NAME> <<EMAIL>>
/// *HWP Team:           PM
/// *HWP Level:          2
/// *HWP Consumed by:    Hostboot:Phyp:Cro
//

namespace p9_hcodeImageBuild
{

/**
 * @brief   enumerates all the platforms associated with hcode image build.
 */
enum PlatId
{
    PLAT_SELF   =   0,
    PLAT_SGPE   =   1,
    PLAT_CME    =   2,
    PLAT_PGPE   =   3,
};

/**
 * @brief   constants associated with fake scan rings.
 */
enum FakeScanRing_t
{
    SCAN_RNG_START      =   0x5363616e20526e67,
    SCAN_RNG_END        =   0x52696e6720456e64,
    MAX_SCAN_RING_SIZE  =   120,
    MAX_FAKE_CMN_RING   =   0x14,
    MAX_FAKE_RING       =   0x1E,
};

/**
 * @brief   debug modes supported for scan rings.
 */
enum RingDebugMode_t
{
    SCAN_RING_NO_DEBUG      =   0x00,
    SCAN_RING_TRACE_DEBUG   =   0x01,
};
/**
 * @brief   models a fake ring for debug.
 */
struct FakeRing
{
    uint64_t iv_ringHeader;
    uint64_t iv_ringNumber;
    uint8_t  iv_ringPayload[MAX_SCAN_RING_SIZE];
    uint64_t iv_ringEnd;

#ifdef __CRONUS_VER<commit_msg>PM: Addressed various observations on Hcode Image Build<commit_after>/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.H $   */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2016,2019                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
#ifndef __P9_SCAN_RING_UTIL_H
#define __P9_SCAN_RING_UTIL_H

#include <fapi2.H>
#include "p9_ringId.H"
#include "p9_stop_util.H"
#include <map>

//#define __CRONUS_VER
///
/// @file   p9_scan_ring_util.H
/// @brief  utility classes and functions for scan ring debug.
///
/// *HWP HWP Owner:      <NAME> <<EMAIL>>
/// *HWP FW Owner:       <NAME> <<EMAIL>>
/// *HWP Team:           PM
/// *HWP Level:          2
/// *HWP Consumed by:    Hostboot:Phyp:Cro
//

namespace p9_hcodeImageBuild
{

/**
 * @brief   enumerates all the platforms associated with hcode image build.
 */
enum PlatId
{
    PLAT_SELF   =   0,
    PLAT_SGPE   =   1,
    PLAT_CME    =   2,
    PLAT_PGPE   =   3,
};

/**
 * @brief   constants associated with fake scan rings.
 */
enum FakeScanRing_t
{
    SCAN_RNG_START      =   0x5363616e20526e67,
    SCAN_RNG_END        =   0x52696e6720456e64,
    MAX_SCAN_RING_SIZE  =   120,
    MAX_FAKE_CMN_RING   =   0x14,
    MAX_FAKE_RING       =   0x1E,
};

/**
 * @brief   debug modes supported for scan rings.
 */
enum RingDebugMode_t
{
    SCAN_RING_NO_DEBUG          =   0x00,
    SCAN_RING_TRACE_DEBUG       =   0x01,
    SCAN_RING_TRACE_DEEP_DEBUG  =   0x02,
};
/**
 * @brief   models a fake ring for debug.
 */
struct FakeRing
{
    uint64_t iv_ringHeader;
    uint64_t iv_ringNumber;
    uint8_t  iv_ringPayload[MAX_SCAN_RING_SIZE];
    uint64_t iv_ringEnd;

#ifdef __CRONUS_VER
{'fraction_non_alphanumeric': 0.0891982864137087, 'fraction_numerical': 0.02402080783353733, 'mean_word_length': 1.1265452179570592, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 62, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6269182', 'n_tokens_mistral': 1799, 'n_tokens_neox': 1723, 'n_words': 446}