#ifndef __COMMON_H__
#define __COMMON_H__

#define DEBUG
//#define DIFF_TEST

#if _SHARE
// do not enable these features while building a reference design
#undef DIFF_TEST
#undef DEBUG
#endif

/* You will define this macro in PA2 */
//#define HAS_IOE

#include <stdint.h>
#include <assert.h>
#include <string.h>
#include <string>

typedef uint32_t rtlreg_t;

typedef uint32_t paddr_t;
typedef uint32_t vaddr_t;

typedef uint16_t ioaddr_t;

#include "debug.h"
#include "macro.h"

#include <iomanip>
#include <sstream>
inline std::string num2hex(uint32_t n) {
    static std::stringstream ss;
    ss.str("");
    ss << "0x" << std::setfill('0') << std::setw(8) << std::hex << n << std::dec;
    return ss.str();
}

#include <rlib/stdio.hpp>

#endif
