text: /** \file algo/swstate/auto_generated/access/dnx_algo_field_key_alloc_access.c
   *
   * sw state functions definitions
   *
   * DO NOT EDIT THIS FILE!
   * This file is auto-generated.
   * Edits to this file will be lost when it is regenerated.
   */
  /*
   * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
   * 
   * Copyright 2007-2020 Broadcom Inc. All rights reserved.
   */
  
  #ifdef BSL_LOG_MODULE
  #error "BSL_LOG_MODULE redefined"
  #endif
  #define BSL_LOG_MODULE BSL_LS_SWSTATEDNX_GENERAL
  
  #include <soc/dnxc/swstate/dnxc_sw_state_c_includes.h>
  #include <bcm_int/dnx/algo/swstate/auto_generated/access/dnx_algo_field_key_alloc_access.h>
  #include <bcm_int/dnx/algo/swstate/auto_generated/diagnostic/dnx_algo_field_key_alloc_diagnostic.h>
  /*
   * Global Variables
   */
  
  /* dummy variable for gdb to know this type */
  dnx_field_keys_per_stage_allocation_t* dnx_field_keys_per_stage_allocation_sw_dummy = NULL;
  /*
   * FUNCTIONs
   */
  
  /*
   *
   * is_init function for the variable dnx_field_keys_per_stage_allocation_sw
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_is_init(int unit, uint8 *is_init)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_IS_INIT,
          DNXC_SW_STATE_NO_FLAGS);
  
      *is_init = (NULL != ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]));
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_IS_INIT_LOGGING,
          BSL_LS_SWSTATEDNX_ISINIT,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]),
          "dnx_field_keys_per_stage_allocation_sw[%d]",
          unit);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * init function for the variable dnx_field_keys_per_stage_allocation_sw
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_init(int unit)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_INIT,
          DNXC_SW_STATE_NO_FLAGS);
  
      DNX_SW_STATE_MODULE_INIT(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          DNXC_SW_STATE_IMPLEMENTATION_WB,
          dnx_field_keys_per_stage_allocation_t,
          DNXC_SW_STATE_AUTO_GENERATED_ALLOCATION,
          "dnx_field_keys_per_stage_allocation_sw_init");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_INIT_LOGGING,
          BSL_LS_SWSTATEDNX_INIT,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]),
          "dnx_field_keys_per_stage_allocation_sw[%d]",
          unit);
  
      DNX_SW_STATE_DIAG_INFO_UPDATE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_INFO,
          DNX_SW_STATE_DIAG_ALLOC,
          sizeof(dnx_field_keys_per_stage_allocation_t),
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * alloc function for the variable key_occupation
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_alloc(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 nof_instances_to_alloc_0)
  {
      DNX_SW_STATE_DEFAULT_VALUE_DEFS;
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_ALLOC,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_ALLOC(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          dnx_field_key_alloc_detail_t,
          nof_instances_to_alloc_0,
          DNXC_SW_STATE_AUTO_GENERATED_ALLOCATION,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_alloc");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_ALLOC_LOGGING,
          BSL_LS_SWSTATEDNX_ALLOC,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1,
          nof_instances_to_alloc_0 * sizeof(dnx_field_key_alloc_detail_t) / sizeof(*((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation));
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_INFO,
          DNX_SW_STATE_DIAG_ALLOC,
          NULL);
  
      DNX_SW_STATE_DEFAULT_VALUE_LOOP(def_val_idx[0], nof_instances_to_alloc_0)
  
      DNX_SW_STATE_DEFAULT_VALUE_ASSIGN(
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[def_val_idx[0]].key_occupation_state,
          DNX_FIELD_KEY_OCCUPY_NONE);
  
      DNX_SW_STATE_DEFAULT_VALUE_LOOP(def_val_idx[0], nof_instances_to_alloc_0)
  
      DNX_SW_STATE_DEFAULT_VALUE_ASSIGN(
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[def_val_idx[0]].key_field_group_type,
          DNX_FIELD_GROUP_TYPE_NOF);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable key_occupation_state
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_occupation_state_set(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, dnx_field_key_half_occupation_state_e key_occupation_state)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].key_occupation_state,
          key_occupation_state,
          dnx_field_key_half_occupation_state_e,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_occupation_state_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &key_occupation_state,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].key_occupation_state",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_KEY_OCCUPATION_STATE_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable key_occupation_state
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_occupation_state_get(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, dnx_field_key_half_occupation_state_e *key_occupation_state)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          key_occupation_state);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *key_occupation_state = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].key_occupation_state;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].key_occupation_state,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].key_occupation_state",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_KEY_OCCUPATION_STATE_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable key_field_group_type
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_field_group_type_set(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, dnx_field_group_type_e key_field_group_type)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].key_field_group_type,
          key_field_group_type,
          dnx_field_group_type_e,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_field_group_type_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &key_field_group_type,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].key_field_group_type",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_KEY_FIELD_GROUP_TYPE_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable key_field_group_type
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_field_group_type_get(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, dnx_field_group_type_e *key_field_group_type)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          key_field_group_type);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *key_field_group_type = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].key_field_group_type;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].key_field_group_type,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].key_field_group_type",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_KEY_FIELD_GROUP_TYPE_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable key_allocation_id
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_allocation_id_set(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 key_allocation_id)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].key_allocation_id,
          key_allocation_id,
          uint32,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_allocation_id_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &key_allocation_id,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].key_allocation_id",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_KEY_ALLOCATION_ID_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable key_allocation_id
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_allocation_id_get(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 *key_allocation_id)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          key_allocation_id);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *key_allocation_id = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].key_allocation_id;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].key_allocation_id,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].key_allocation_id",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_KEY_ALLOCATION_ID_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable bit_range_key_occ_bmp
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_set(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 bit_range_key_occ_bmp_idx_0, dnx_algo_res_t bit_range_key_occ_bmp)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp,
          bit_range_key_occ_bmp_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp[bit_range_key_occ_bmp_idx_0],
          bit_range_key_occ_bmp,
          dnx_algo_res_t,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &bit_range_key_occ_bmp,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_key_occ_bmp[%d]",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, bit_range_key_occ_bmp_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_KEY_OCC_BMP_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable bit_range_key_occ_bmp
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_get(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 bit_range_key_occ_bmp_idx_0, dnx_algo_res_t *bit_range_key_occ_bmp)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          bit_range_key_occ_bmp);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp,
          bit_range_key_occ_bmp_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *bit_range_key_occ_bmp = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp[bit_range_key_occ_bmp_idx_0];
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp[bit_range_key_occ_bmp_idx_0],
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_key_occ_bmp[%d]",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, bit_range_key_occ_bmp_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_KEY_OCC_BMP_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * alloc function for the variable bit_range_key_occ_bmp
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_alloc(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 nof_instances_to_alloc_0)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_ALLOC,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_ALLOC(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp,
          dnx_algo_res_t,
          nof_instances_to_alloc_0,
          DNXC_SW_STATE_AUTO_GENERATED_ALLOCATION,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_alloc");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_ALLOC_LOGGING,
          BSL_LS_SWSTATEDNX_ALLOC,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_key_occ_bmp",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0,
          nof_instances_to_alloc_0 * sizeof(dnx_algo_res_t) / sizeof(*((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp));
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_KEY_OCC_BMP_INFO,
          DNX_SW_STATE_DIAG_ALLOC,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * create function for the variable bit_range_key_occ_bmp
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_create(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 bit_range_key_occ_bmp_idx_0, dnx_algo_res_create_data_t * data, void *extra_arguments)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_CREATE,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_ALGO_RES_MNGR_CREATE(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp[bit_range_key_occ_bmp_idx_0],
          data,
          extra_arguments,
          0,
          DNXC_SW_STATE_AUTO_GENERATED_ALLOCATION);
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RES_MNGR_CREATE_LOGGING,
          BSL_LS_SWSTATEDNX_RES_MNGRCREATE,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp[bit_range_key_occ_bmp_idx_0],
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_key_occ_bmp[%d]",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, bit_range_key_occ_bmp_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST_WITH_FLAGS(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_KEY_OCC_BMP_INFO,
          DNX_SW_STATE_DIAG_RES_MNGR,
          NULL,
          DNXC_SW_STATE_AUTO_GENERATED_ALLOCATION);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * allocate_several function for the variable bit_range_key_occ_bmp
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_allocate_several(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 bit_range_key_occ_bmp_idx_0, uint32 flags, uint32 nof_elements, void *extra_arguments, int *element)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_ALLOCATE_SEVERAL,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp,
          bit_range_key_occ_bmp_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_ALGO_RES_MNGR_ALLOCATE_SEVERAL(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp[bit_range_key_occ_bmp_idx_0],
          flags,
          nof_elements,
          extra_arguments,
          element);
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RES_MNGR_ALLOCATE_SEVERAL_LOGGING,
          BSL_LS_SWSTATEDNX_RES_MNGRALLOCATE_SEVERAL,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp[bit_range_key_occ_bmp_idx_0],
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_key_occ_bmp[%d]",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, bit_range_key_occ_bmp_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST_WITH_FLAGS(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_KEY_OCC_BMP_INFO,
          DNX_SW_STATE_DIAG_RES_MNGR,
          NULL,
          DNXC_SW_STATE_NO_FLAGS);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * free_several function for the variable bit_range_key_occ_bmp
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_free_several(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 bit_range_key_occ_bmp_idx_0, uint32 nof_elements, int element)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_FREE_SEVERAL,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp,
          bit_range_key_occ_bmp_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_ALGO_RES_MNGR_FREE_SEVERAL(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp[bit_range_key_occ_bmp_idx_0],
          nof_elements,
          element);
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RES_MNGR_FREE_SEVERAL_LOGGING,
          BSL_LS_SWSTATEDNX_RES_MNGRFREE_SEVERAL,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_key_occ_bmp[bit_range_key_occ_bmp_idx_0],
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_key_occ_bmp[%d]",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, bit_range_key_occ_bmp_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST_WITH_FLAGS(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_KEY_OCC_BMP_INFO,
          DNX_SW_STATE_DIAG_RES_MNGR,
          NULL,
          DNXC_SW_STATE_NO_FLAGS);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable num_bit_ranges
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_num_bit_ranges_set(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint8 num_bit_ranges)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].num_bit_ranges,
          num_bit_ranges,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_num_bit_ranges_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &num_bit_ranges,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].num_bit_ranges",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_NUM_BIT_RANGES_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable num_bit_ranges
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_num_bit_ranges_get(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint8 *num_bit_ranges)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          num_bit_ranges);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *num_bit_ranges = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].num_bit_ranges;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].num_bit_ranges,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].num_bit_ranges",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_NUM_BIT_RANGES_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable is_half_key_range_occupied
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_is_half_key_range_occupied_set(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint8 is_half_key_range_occupied)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].is_half_key_range_occupied,
          is_half_key_range_occupied,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_is_half_key_range_occupied_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &is_half_key_range_occupied,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].is_half_key_range_occupied",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_IS_HALF_KEY_RANGE_OCCUPIED_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable is_half_key_range_occupied
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_is_half_key_range_occupied_get(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint8 *is_half_key_range_occupied)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          is_half_key_range_occupied);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *is_half_key_range_occupied = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].is_half_key_range_occupied;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].is_half_key_range_occupied,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].is_half_key_range_occupied",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_IS_HALF_KEY_RANGE_OCCUPIED_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * range_read function for the variable bit_range_desc
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_range_read(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 nof_elements, dnx_field_key_bit_range_detail_t *dest)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_RANGE_READ,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_RANGE_READ(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dest,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          dnx_field_key_bit_range_detail_t,
          nof_elements,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_range_read");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RANGE_READ_LOGGING,
          BSL_LS_SWSTATEDNX_RANGEREAD,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_desc",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, nof_elements);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_DESC_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * range_write function for the variable bit_range_desc
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_range_write(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 nof_elements, const dnx_field_key_bit_range_detail_t *source)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_RANGE_WRITE,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_RANGE_COPY(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          source,
          dnx_field_key_bit_range_detail_t,
          nof_elements,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_range_write");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RANGE_WRITE_LOGGING,
          BSL_LS_SWSTATEDNX_RANGEWRITE,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_desc",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, nof_elements);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_DESC_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * range_fill function for the variable bit_range_desc
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_range_fill(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 from_idx, uint32 nof_elements, dnx_field_key_bit_range_detail_t value)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_RANGE_FILL,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_RANGE_FILL(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          dnx_field_key_bit_range_detail_t,
          from_idx,
          nof_elements,
          value,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_range_fill");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RANGE_FILL_LOGGING,
          BSL_LS_SWSTATEDNX_RANGEFILL,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_desc",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, nof_elements);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_DESC_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * alloc function for the variable bit_range_desc
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_alloc(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 nof_instances_to_alloc_0)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_ALLOC,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_ALLOC(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          dnx_field_key_bit_range_detail_t,
          nof_instances_to_alloc_0,
          DNXC_SW_STATE_AUTO_GENERATED_ALLOCATION,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_alloc");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_ALLOC_LOGGING,
          BSL_LS_SWSTATEDNX_ALLOC,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_desc",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0,
          nof_instances_to_alloc_0 * sizeof(dnx_field_key_bit_range_detail_t) / sizeof(*((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc));
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_DESC_INFO,
          DNX_SW_STATE_DIAG_ALLOC,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable bit_range_size
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_bit_range_size_set(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 bit_range_desc_idx_0, uint8 bit_range_size)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          bit_range_desc_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc[bit_range_desc_idx_0].bit_range_size,
          bit_range_size,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_bit_range_size_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &bit_range_size,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_desc[%d].bit_range_size",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, bit_range_desc_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_DESC_BIT_RANGE_SIZE_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable bit_range_size
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_bit_range_size_get(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 bit_range_desc_idx_0, uint8 *bit_range_size)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          bit_range_size);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          bit_range_desc_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *bit_range_size = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc[bit_range_desc_idx_0].bit_range_size;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc[bit_range_desc_idx_0].bit_range_size,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_desc[%d].bit_range_size",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, bit_range_desc_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_DESC_BIT_RANGE_SIZE_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable fg_type
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_fg_type_set(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 bit_range_desc_idx_0, uint8 fg_type)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          bit_range_desc_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc[bit_range_desc_idx_0].fg_type,
          fg_type,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_fg_type_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &fg_type,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_desc[%d].fg_type",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, bit_range_desc_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_DESC_FG_TYPE_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable fg_type
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_fg_type_get(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint32 key_occupation_idx_0, uint32 bit_range_desc_idx_0, uint8 *fg_type)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          fg_type);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation,
          key_occupation_idx_0);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation);
  
      DNX_SW_STATE_OOB_DYNAMIC_ARRAY_CHECK(
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc,
          bit_range_desc_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *fg_type = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc[bit_range_desc_idx_0].fg_type;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation[key_occupation_idx_0].bit_range_desc[bit_range_desc_idx_0].fg_type,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation[%d].bit_range_desc[%d].fg_type",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1, key_occupation_idx_0, bit_range_desc_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_BIT_RANGE_DESC_FG_TYPE_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable key_occupation_nof
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_nof_set(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint8 key_occupation_nof)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation_nof,
          key_occupation_nof,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_nof_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &key_occupation_nof,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation_nof",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_NOF_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable key_occupation_nof
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_nof_get(int unit, uint32 key_stage_prog_occupation_idx_0, uint32 key_stage_prog_occupation_idx_1, uint8 *key_occupation_nof)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          key_occupation_nof);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_stage_prog_occupation_idx_1,
          DNX_DATA_MAX_FIELD_COMMON_MAX_VAL_NOF_CONTEXTS);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *key_occupation_nof = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation_nof;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_stage_prog_occupation[key_stage_prog_occupation_idx_0][key_stage_prog_occupation_idx_1].key_occupation_nof,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_stage_prog_occupation[%d][%d].key_occupation_nof",
          unit, key_stage_prog_occupation_idx_0, key_stage_prog_occupation_idx_1);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_STAGE_PROG_OCCUPATION_KEY_OCCUPATION_NOF_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable key_on_stage_supports_bitmap_allocation
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_on_stage_supports_bitmap_allocation_set(int unit, uint32 key_on_stage_supports_bitmap_allocation_idx_0, uint32 key_on_stage_supports_bitmap_allocation_idx_1, uint8 key_on_stage_supports_bitmap_allocation)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_on_stage_supports_bitmap_allocation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_on_stage_supports_bitmap_allocation_idx_1,
          DBAL_NOF_ENUM_FIELD_KEY_VALUES);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_on_stage_supports_bitmap_allocation[key_on_stage_supports_bitmap_allocation_idx_0][key_on_stage_supports_bitmap_allocation_idx_1],
          key_on_stage_supports_bitmap_allocation,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_on_stage_supports_bitmap_allocation_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &key_on_stage_supports_bitmap_allocation,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_on_stage_supports_bitmap_allocation[%d][%d]",
          unit, key_on_stage_supports_bitmap_allocation_idx_0, key_on_stage_supports_bitmap_allocation_idx_1);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_ON_STAGE_SUPPORTS_BITMAP_ALLOCATION_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable key_on_stage_supports_bitmap_allocation
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_on_stage_supports_bitmap_allocation_get(int unit, uint32 key_on_stage_supports_bitmap_allocation_idx_0, uint32 key_on_stage_supports_bitmap_allocation_idx_1, uint8 *key_on_stage_supports_bitmap_allocation)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_on_stage_supports_bitmap_allocation_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          key_on_stage_supports_bitmap_allocation);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          key_on_stage_supports_bitmap_allocation_idx_1,
          DBAL_NOF_ENUM_FIELD_KEY_VALUES);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *key_on_stage_supports_bitmap_allocation = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_on_stage_supports_bitmap_allocation[key_on_stage_supports_bitmap_allocation_idx_0][key_on_stage_supports_bitmap_allocation_idx_1];
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_per_stage.key_on_stage_supports_bitmap_allocation[key_on_stage_supports_bitmap_allocation_idx_0][key_on_stage_supports_bitmap_allocation_idx_1],
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_per_stage.key_on_stage_supports_bitmap_allocation[%d][%d]",
          unit, key_on_stage_supports_bitmap_allocation_idx_0, key_on_stage_supports_bitmap_allocation_idx_1);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_PER_STAGE_KEY_ON_STAGE_SUPPORTS_BITMAP_ALLOCATION_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * range_read function for the variable keys_availability_stage_info
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_range_read(int unit, uint32 nof_elements, dnx_field_key_alloc_group_instruction_t *dest)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_RANGE_READ,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_RANGE_READ(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dest,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info,
          dnx_field_key_alloc_group_instruction_t,
          nof_elements,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_range_read");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RANGE_READ_LOGGING,
          BSL_LS_SWSTATEDNX_RANGEREAD,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info",
          unit, nof_elements);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * range_write function for the variable keys_availability_stage_info
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_range_write(int unit, uint32 nof_elements, const dnx_field_key_alloc_group_instruction_t *source)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_RANGE_WRITE,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_RANGE_COPY(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info,
          source,
          dnx_field_key_alloc_group_instruction_t,
          nof_elements,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_range_write");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RANGE_WRITE_LOGGING,
          BSL_LS_SWSTATEDNX_RANGEWRITE,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info",
          unit, nof_elements);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * range_fill function for the variable keys_availability_stage_info
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_range_fill(int unit, uint32 from_idx, uint32 nof_elements, dnx_field_key_alloc_group_instruction_t value)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_RANGE_FILL,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_RANGE_FILL(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info,
          dnx_field_key_alloc_group_instruction_t,
          from_idx,
          nof_elements,
          value,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_range_fill");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RANGE_FILL_LOGGING,
          BSL_LS_SWSTATEDNX_RANGEFILL,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info",
          unit, nof_elements);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable keys_availability_group_info
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_set(int unit, uint32 keys_availability_stage_info_idx_0, uint32 keys_availability_group_info_idx_0, CONST dnx_field_key_alloc_instruction_t *keys_availability_group_info)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_MEMCPY(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0],
          keys_availability_group_info,
          dnx_field_key_alloc_instruction_t,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          keys_availability_group_info,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info[%d]",
          unit, keys_availability_stage_info_idx_0, keys_availability_group_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable keys_availability_group_info
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_get(int unit, uint32 keys_availability_stage_info_idx_0, uint32 keys_availability_group_info_idx_0, dnx_field_key_alloc_instruction_t *keys_availability_group_info)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          keys_availability_group_info);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_group_info_idx_0,
          DNX_FIELD_GROUP_TYPE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *keys_availability_group_info = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0];
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0],
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info[%d]",
          unit, keys_availability_stage_info_idx_0, keys_availability_group_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * range_read function for the variable keys_availability_group_info
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_range_read(int unit, uint32 keys_availability_stage_info_idx_0, uint32 nof_elements, dnx_field_key_alloc_instruction_t *dest)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_RANGE_READ,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_RANGE_READ(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dest,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info,
          dnx_field_key_alloc_instruction_t,
          nof_elements,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_range_read");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RANGE_READ_LOGGING,
          BSL_LS_SWSTATEDNX_RANGEREAD,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info",
          unit, keys_availability_stage_info_idx_0, nof_elements);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * range_write function for the variable keys_availability_group_info
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_range_write(int unit, uint32 keys_availability_stage_info_idx_0, uint32 nof_elements, const dnx_field_key_alloc_instruction_t *source)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_RANGE_WRITE,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_RANGE_COPY(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info,
          source,
          dnx_field_key_alloc_instruction_t,
          nof_elements,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_range_write");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RANGE_WRITE_LOGGING,
          BSL_LS_SWSTATEDNX_RANGEWRITE,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info",
          unit, keys_availability_stage_info_idx_0, nof_elements);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * range_fill function for the variable keys_availability_group_info
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_range_fill(int unit, uint32 keys_availability_stage_info_idx_0, uint32 from_idx, uint32 nof_elements, dnx_field_key_alloc_instruction_t value)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_RANGE_FILL,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_RANGE_FILL(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info,
          dnx_field_key_alloc_instruction_t,
          from_idx,
          nof_elements,
          value,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_range_fill");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_RANGE_FILL_LOGGING,
          BSL_LS_SWSTATEDNX_RANGEFILL,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info",
          unit, keys_availability_stage_info_idx_0, nof_elements);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable structure_is_valid
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_structure_is_valid_set(int unit, uint32 keys_availability_stage_info_idx_0, uint32 keys_availability_group_info_idx_0, uint8 structure_is_valid)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_group_info_idx_0,
          DNX_FIELD_GROUP_TYPE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].structure_is_valid,
          structure_is_valid,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_structure_is_valid_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &structure_is_valid,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info[%d].structure_is_valid",
          unit, keys_availability_stage_info_idx_0, keys_availability_group_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_STRUCTURE_IS_VALID_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable structure_is_valid
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_structure_is_valid_get(int unit, uint32 keys_availability_stage_info_idx_0, uint32 keys_availability_group_info_idx_0, uint8 *structure_is_valid)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          structure_is_valid);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_group_info_idx_0,
          DNX_FIELD_GROUP_TYPE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *structure_is_valid = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].structure_is_valid;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].structure_is_valid,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info[%d].structure_is_valid",
          unit, keys_availability_stage_info_idx_0, keys_availability_group_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_STRUCTURE_IS_VALID_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable nof_available_keys
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_nof_available_keys_set(int unit, uint32 keys_availability_stage_info_idx_0, uint32 keys_availability_group_info_idx_0, uint8 nof_available_keys)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_group_info_idx_0,
          DNX_FIELD_GROUP_TYPE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].nof_available_keys,
          nof_available_keys,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_nof_available_keys_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &nof_available_keys,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info[%d].nof_available_keys",
          unit, keys_availability_stage_info_idx_0, keys_availability_group_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_NOF_AVAILABLE_KEYS_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable nof_available_keys
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_nof_available_keys_get(int unit, uint32 keys_availability_stage_info_idx_0, uint32 keys_availability_group_info_idx_0, uint8 *nof_available_keys)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          nof_available_keys);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_group_info_idx_0,
          DNX_FIELD_GROUP_TYPE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *nof_available_keys = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].nof_available_keys;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].nof_available_keys,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info[%d].nof_available_keys",
          unit, keys_availability_stage_info_idx_0, keys_availability_group_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_NOF_AVAILABLE_KEYS_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable first_available_key
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_first_available_key_set(int unit, uint32 keys_availability_stage_info_idx_0, uint32 keys_availability_group_info_idx_0, uint8 first_available_key)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_group_info_idx_0,
          DNX_FIELD_GROUP_TYPE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].first_available_key,
          first_available_key,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_first_available_key_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &first_available_key,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info[%d].first_available_key",
          unit, keys_availability_stage_info_idx_0, keys_availability_group_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_FIRST_AVAILABLE_KEY_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable first_available_key
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_first_available_key_get(int unit, uint32 keys_availability_stage_info_idx_0, uint32 keys_availability_group_info_idx_0, uint8 *first_available_key)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          first_available_key);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_group_info_idx_0,
          DNX_FIELD_GROUP_TYPE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *first_available_key = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].first_available_key;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].first_available_key,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info[%d].first_available_key",
          unit, keys_availability_stage_info_idx_0, keys_availability_group_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_FIRST_AVAILABLE_KEY_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable supports_bitmap_allocation
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_supports_bitmap_allocation_set(int unit, uint32 keys_availability_stage_info_idx_0, uint32 keys_availability_group_info_idx_0, uint8 supports_bitmap_allocation)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_group_info_idx_0,
          DNX_FIELD_GROUP_TYPE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].supports_bitmap_allocation,
          supports_bitmap_allocation,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_supports_bitmap_allocation_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &supports_bitmap_allocation,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info[%d].supports_bitmap_allocation",
          unit, keys_availability_stage_info_idx_0, keys_availability_group_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_SUPPORTS_BITMAP_ALLOCATION_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable supports_bitmap_allocation
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_supports_bitmap_allocation_get(int unit, uint32 keys_availability_stage_info_idx_0, uint32 keys_availability_group_info_idx_0, uint8 *supports_bitmap_allocation)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          supports_bitmap_allocation);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_group_info_idx_0,
          DNX_FIELD_GROUP_TYPE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *supports_bitmap_allocation = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].supports_bitmap_allocation;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].keys_availability_group_info[keys_availability_group_info_idx_0].supports_bitmap_allocation,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].keys_availability_group_info[%d].supports_bitmap_allocation",
          unit, keys_availability_stage_info_idx_0, keys_availability_group_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_KEYS_AVAILABILITY_GROUP_INFO_SUPPORTS_BITMAP_ALLOCATION_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable nof_available_keys_on_stage
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_nof_available_keys_on_stage_set(int unit, uint32 keys_availability_stage_info_idx_0, uint8 nof_available_keys_on_stage)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].nof_available_keys_on_stage,
          nof_available_keys_on_stage,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_nof_available_keys_on_stage_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &nof_available_keys_on_stage,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].nof_available_keys_on_stage",
          unit, keys_availability_stage_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_NOF_AVAILABLE_KEYS_ON_STAGE_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable nof_available_keys_on_stage
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_nof_available_keys_on_stage_get(int unit, uint32 keys_availability_stage_info_idx_0, uint8 *nof_available_keys_on_stage)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          nof_available_keys_on_stage);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *nof_available_keys_on_stage = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].nof_available_keys_on_stage;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].nof_available_keys_on_stage,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].nof_available_keys_on_stage",
          unit, keys_availability_stage_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_NOF_AVAILABLE_KEYS_ON_STAGE_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * set function for the variable first_available_key_on_stage
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_first_available_key_on_stage_set(int unit, uint32 keys_availability_stage_info_idx_0, uint8 first_available_key_on_stage)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_SET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      DNX_SW_STATE_SET(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].first_available_key_on_stage,
          first_available_key_on_stage,
          uint8,
          0,
          "dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_first_available_key_on_stage_set");
  
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_SET_LOGGING,
          BSL_LS_SWSTATEDNX_SET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &first_available_key_on_stage,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].first_available_key_on_stage",
          unit, keys_availability_stage_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_FIRST_AVAILABLE_KEY_ON_STAGE_INFO,
          DNX_SW_STATE_DIAG_MODIFY,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get function for the variable first_available_key_on_stage
   * AUTO-GENERATED - DO NOT MODIFY
   */
  int
  dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_first_available_key_on_stage_get(int unit, uint32 keys_availability_stage_info_idx_0, uint8 *first_available_key_on_stage)
  {
      DNXC_SW_STATE_INIT_FUNC_DEFS;
  
      VERIFY_FUNCTION_CALL_ALLOWED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          SW_STATE_FUNC_GET,
          DNXC_SW_STATE_NO_FLAGS);
  
      VERIFY_MODULE_IS_INITIALIZED(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID]);
  
      DNX_SW_STATE_OOB_STATIC_ARRAY_CHECK(
          keys_availability_stage_info_idx_0,
          DNX_FIELD_STAGE_NOF);
  
      DNX_SW_STATE_PTR_NULL_CHECK(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          first_available_key_on_stage);
  
      DNX_SW_STATE_DIAG_INFO_PRE(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID);
  
      *first_available_key_on_stage = ((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].first_available_key_on_stage;
      DNX_SW_STATE_LOG(
          unit,
          DNX_SW_STATE_GET_LOGGING,
          BSL_LS_SWSTATEDNX_GET,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          &((dnx_field_keys_per_stage_allocation_t*)sw_state_roots_array[unit][DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID])->keys_availability.keys_availability_stage_info[keys_availability_stage_info_idx_0].first_available_key_on_stage,
          "dnx_field_keys_per_stage_allocation_sw[%d]->keys_availability.keys_availability_stage_info[%d].first_available_key_on_stage",
          unit, keys_availability_stage_info_idx_0);
  
      DNX_SW_STATE_DIAG_INFO_POST(
          unit,
          DNX_ALGO_FIELD_KEY_ALLOC_MODULE_ID,
          dnx_field_keys_per_stage_allocation_sw_info,
          DNX_FIELD_KEYS_PER_STAGE_ALLOCATION_SW_KEYS_AVAILABILITY_KEYS_AVAILABILITY_STAGE_INFO_FIRST_AVAILABLE_KEY_ON_STAGE_INFO,
          DNX_SW_STATE_DIAG_READ,
          NULL);
  
      DNXC_SW_STATE_FUNC_RETURN;
  }
  
  
  
  /*
   *
   * get_name function for enum type dnx_field_key_half_occupation_state_e
   * AUTO-GENERATED - DO NOT MODIFY
   */
  const char *
  dnx_field_key_half_occupation_state_e_get_name(dnx_field_key_half_occupation_state_e value)
  {
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_INVALID", value, DNX_FIELD_KEY_OCCUPY_INVALID);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_FIRST", value, DNX_FIELD_KEY_OCCUPY_FIRST);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_NONE", value, DNX_FIELD_KEY_OCCUPY_NONE);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_MSB_HALF", value, DNX_FIELD_KEY_OCCUPY_MSB_HALF);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_LSB_HALF", value, DNX_FIELD_KEY_OCCUPY_LSB_HALF);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_SINGLE_MSB", value, DNX_FIELD_KEY_OCCUPY_SINGLE_MSB);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_SINGLE_LSB", value, DNX_FIELD_KEY_OCCUPY_SINGLE_LSB);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_DOUBLE_FIRST_HALF", value, DNX_FIELD_KEY_OCCUPY_DOUBLE_FIRST_HALF);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_DOUBLE_SECOND_HALF", value, DNX_FIELD_KEY_OCCUPY_DOUBLE_SECOND_HALF);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_DOUBLE_THIRD_HALF", value, DNX_FIELD_KEY_OCCUPY_DOUBLE_THIRD_HALF);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_DOUBLE_FOURTH_HALF", value, DNX_FIELD_KEY_OCCUPY_DOUBLE_FOURTH_HALF);
  
      DNX_SW_STATE_ENUM_COMPARE_AND_GET_NAME("DNX_FIELD_KEY_OCCUPY_NOF", value, DNX_FIELD_KEY_OCCUPY_NOF);
  
      return NULL;
  }
  
  
  
  /*
   * Global Variables
   */
  
  dnx_field_keys_per_stage_allocation_sw_cbs dnx_field_keys_per_stage_allocation_sw = 	{
  	
  	dnx_field_keys_per_stage_allocation_sw_is_init,
  	dnx_field_keys_per_stage_allocation_sw_init,
  		{
  		
  			{
  			
  				{
  				
  				dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_alloc,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_occupation_state_set,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_occupation_state_get}
  				,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_field_group_type_set,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_field_group_type_get}
  				,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_allocation_id_set,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_key_allocation_id_get}
  				,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_set,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_get,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_alloc,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_create,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_allocate_several,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_key_occ_bmp_free_several}
  				,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_num_bit_ranges_set,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_num_bit_ranges_get}
  				,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_is_half_key_range_occupied_set,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_is_half_key_range_occupied_get}
  				,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_range_read,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_range_write,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_range_fill,
  					dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_alloc,
  						{
  						
  						dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_bit_range_size_set,
  						dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_bit_range_size_get}
  					,
  						{
  						
  						dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_fg_type_set,
  						dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_bit_range_desc_fg_type_get}
  					}
  				}
  			,
  				{
  				
  				dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_nof_set,
  				dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_stage_prog_occupation_key_occupation_nof_get}
  			}
  		,
  			{
  			
  			dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_on_stage_supports_bitmap_allocation_set,
  			dnx_field_keys_per_stage_allocation_sw_keys_per_stage_key_on_stage_supports_bitmap_allocation_get}
  		}
  	,
  		{
  		
  			{
  			
  			dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_range_read,
  			dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_range_write,
  			dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_range_fill,
  				{
  				
  				dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_set,
  				dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_get,
  				dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_range_read,
  				dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_range_write,
  				dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_range_fill,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_structure_is_valid_set,
  					dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_structure_is_valid_get}
  				,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_nof_available_keys_set,
  					dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_nof_available_keys_get}
  				,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_first_available_key_set,
  					dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_first_available_key_get}
  				,
  					{
  					
  					dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_supports_bitmap_allocation_set,
  					dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_keys_availability_group_info_supports_bitmap_allocation_get}
  				}
  			,
  				{
  				
  				dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_nof_available_keys_on_stage_set,
  				dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_nof_available_keys_on_stage_get}
  			,
  				{
  				
  				dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_first_available_key_on_stage_set,
  				dnx_field_keys_per_stage_allocation_sw_keys_availability_keys_availability_stage_info_first_available_key_on_stage_get}
  			}
  		}
  	}
  ;
  #undef BSL_LOG_MODULE
  