Update TGF naming convention

This commit is contained in:
2020-09-11 10:45:44 +02:00
parent f3d578f050
commit 43488676dd
15 changed files with 102 additions and 102 deletions

View File

@ -31,8 +31,8 @@
*******************************************************************************/
#ifndef _TGF01_H_
#define _TGF01_H_
#ifndef _TGF_B_H_
#define _TGF_B_H_
#include <array>
#include <iss/arch/traits.h>
@ -42,11 +42,11 @@
namespace iss {
namespace arch {
struct tgf01;
struct tgf_b;
template <> struct traits<tgf01> {
template <> struct traits<tgf_b> {
constexpr static char const* const core_type = "TGF01";
constexpr static char const* const core_type = "TGF_B";
static constexpr std::array<const char*, 33> reg_names{
{"x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31", "pc"}};
@ -156,15 +156,15 @@ template <> struct traits<tgf01> {
enum mem_type_e { MEM, CSR, FENCE, RES };
};
struct tgf01: public arch_if {
struct tgf_b: public arch_if {
using virt_addr_t = typename traits<tgf01>::virt_addr_t;
using phys_addr_t = typename traits<tgf01>::phys_addr_t;
using reg_t = typename traits<tgf01>::reg_t;
using addr_t = typename traits<tgf01>::addr_t;
using virt_addr_t = typename traits<tgf_b>::virt_addr_t;
using phys_addr_t = typename traits<tgf_b>::phys_addr_t;
using reg_t = typename traits<tgf_b>::reg_t;
using addr_t = typename traits<tgf_b>::addr_t;
tgf01();
~tgf01();
tgf_b();
~tgf_b();
void reset(uint64_t address=0) override;
@ -185,9 +185,9 @@ struct tgf01: public arch_if {
inline uint64_t stop_code() { return interrupt_sim; }
inline phys_addr_t v2p(const iss::addr_t& addr){
if (addr.space != traits<tgf01>::MEM || addr.type == iss::address_type::PHYSICAL ||
if (addr.space != traits<tgf_b>::MEM || addr.type == iss::address_type::PHYSICAL ||
addr_mode[static_cast<uint16_t>(addr.access)&0x3]==address_type::PHYSICAL) {
return phys_addr_t(addr.access, addr.space, addr.val&traits<tgf01>::addr_mask);
return phys_addr_t(addr.access, addr.space, addr.val&traits<tgf_b>::addr_mask);
} else
return virt2phys(addr);
}
@ -199,7 +199,7 @@ struct tgf01: public arch_if {
inline uint32_t get_last_branch() { return reg.last_branch; }
protected:
struct TGF01_regs {
struct TGF_B_regs {
uint32_t X0 = 0;
uint32_t X1 = 0;
uint32_t X2 = 0;
@ -249,4 +249,4 @@ protected:
}
}
#endif /* _TGF01_H_ */
#endif /* _TGF_B_H_ */

View File

@ -31,8 +31,8 @@
*******************************************************************************/
#ifndef _TGF02_H_
#define _TGF02_H_
#ifndef _TGF_C_H_
#define _TGF_C_H_
#include <array>
#include <iss/arch/traits.h>
@ -42,11 +42,11 @@
namespace iss {
namespace arch {
struct tgf02;
struct tgf_c;
template <> struct traits<tgf02> {
template <> struct traits<tgf_c> {
constexpr static char const* const core_type = "TGF02";
constexpr static char const* const core_type = "TGF_C";
static constexpr std::array<const char*, 33> reg_names{
{"x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31", "pc"}};
@ -156,15 +156,15 @@ template <> struct traits<tgf02> {
enum mem_type_e { MEM, CSR, FENCE, RES };
};
struct tgf02: public arch_if {
struct tgf_c: public arch_if {
using virt_addr_t = typename traits<tgf02>::virt_addr_t;
using phys_addr_t = typename traits<tgf02>::phys_addr_t;
using reg_t = typename traits<tgf02>::reg_t;
using addr_t = typename traits<tgf02>::addr_t;
using virt_addr_t = typename traits<tgf_c>::virt_addr_t;
using phys_addr_t = typename traits<tgf_c>::phys_addr_t;
using reg_t = typename traits<tgf_c>::reg_t;
using addr_t = typename traits<tgf_c>::addr_t;
tgf02();
~tgf02();
tgf_c();
~tgf_c();
void reset(uint64_t address=0) override;
@ -185,9 +185,9 @@ struct tgf02: public arch_if {
inline uint64_t stop_code() { return interrupt_sim; }
inline phys_addr_t v2p(const iss::addr_t& addr){
if (addr.space != traits<tgf02>::MEM || addr.type == iss::address_type::PHYSICAL ||
if (addr.space != traits<tgf_c>::MEM || addr.type == iss::address_type::PHYSICAL ||
addr_mode[static_cast<uint16_t>(addr.access)&0x3]==address_type::PHYSICAL) {
return phys_addr_t(addr.access, addr.space, addr.val&traits<tgf02>::addr_mask);
return phys_addr_t(addr.access, addr.space, addr.val&traits<tgf_c>::addr_mask);
} else
return virt2phys(addr);
}
@ -199,7 +199,7 @@ struct tgf02: public arch_if {
inline uint32_t get_last_branch() { return reg.last_branch; }
protected:
struct TGF02_regs {
struct TGF_C_regs {
uint32_t X0 = 0;
uint32_t X1 = 0;
uint32_t X2 = 0;
@ -249,4 +249,4 @@ protected:
}
}
#endif /* _TGF02_H_ */
#endif /* _TGF_C_H_ */