// +FHDR------------------------------------------------------------
//                 Copyright (c) 2022 SmartLogic.
//                       ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename      : main.c
// Author        : xianfeng.du
// Created On    : 2022-06-25
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------

#include "ucp_printf.h"
#include "ecs_rfm_spu0_top.h"
#include "msg_transfer_queue.h"
#include "log_client.h"
#include "ucp_utility.h"
#include "spu_shell.h"
#include "hwque.h"

int32_t main(int32_t argc, char* argv[])
{
    UCP_PRINT_EMPTY("Hello world from ECS RFM SPU0,coreId[0x%x]", get_core_id());
    debug_write(DBG_DDR_COMMON_IDX(get_core_id(), 0), PLATFORM_BUILD_DATA);

    /* hw_debug_init  */
    int32_t core_id = get_core_id();
    int ret = 0;
    ret = smart_hq_debug_init((DBG_DDR_HW_ADDR_BASE+DBG_DDR_HW_LEN*core_id), DBG_DDR_HW_LEN);  // 推荐384，实际512
    if (0 != ret)
    {
        debug_write(DBG_DDR_ERR_IDX(core_id, 46), ret);
    }

    spu_log_client_init();

    ecs_rfm_spu0_drv_init();

    ecs_rfm_spu0_msg_transfer_init();

    spu_shell_init();

    while(1) {
        //
    }

    return 0;
}

