From 785662e48aa1cb91c309dfb9dcbefc3babc71da5 Mon Sep 17 00:00:00 2001 From: Shiraz Anwar Khan Date: Mon, 25 Nov 2024 15:02:32 -0800 Subject: [PATCH 1/9] Applied clang format. --- core/inst_handlers/rv64/a/amoadd_d.cpp | 6 ++-- core/inst_handlers/rv64/a/amoadd_w.cpp | 6 ++-- core/inst_handlers/rv64/a/amoand_d.cpp | 6 ++-- core/inst_handlers/rv64/a/amoand_w.cpp | 6 ++-- core/inst_handlers/rv64/a/amomax_d.cpp | 6 ++-- core/inst_handlers/rv64/a/amomax_w.cpp | 6 ++-- core/inst_handlers/rv64/a/amomaxu_d.cpp | 6 ++-- core/inst_handlers/rv64/a/amomaxu_w.cpp | 6 ++-- core/inst_handlers/rv64/a/amomin_d.cpp | 6 ++-- core/inst_handlers/rv64/a/amomin_w.cpp | 6 ++-- core/inst_handlers/rv64/a/amominu_d.cpp | 6 ++-- core/inst_handlers/rv64/a/amominu_w.cpp | 6 ++-- core/inst_handlers/rv64/a/amoor_d.cpp | 6 ++-- core/inst_handlers/rv64/a/amoor_w.cpp | 6 ++-- core/inst_handlers/rv64/a/amoswap_d.cpp | 6 ++-- core/inst_handlers/rv64/a/amoswap_w.cpp | 6 ++-- core/inst_handlers/rv64/a/amoxor_d.cpp | 6 ++-- core/inst_handlers/rv64/a/amoxor_w.cpp | 6 ++-- core/inst_handlers/rv64/a/lr_d.cpp | 6 ++-- core/inst_handlers/rv64/a/lr_w.cpp | 6 ++-- core/inst_handlers/rv64/a/sc_d.cpp | 6 ++-- core/inst_handlers/rv64/a/sc_w.cpp | 6 ++-- core/inst_handlers/rv64/d/fadd_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fclass_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fcvt_d_l.cpp | 6 ++-- core/inst_handlers/rv64/d/fcvt_d_lu.cpp | 6 ++-- core/inst_handlers/rv64/d/fcvt_d_s.cpp | 6 ++-- core/inst_handlers/rv64/d/fcvt_d_w.cpp | 6 ++-- core/inst_handlers/rv64/d/fcvt_d_wu.cpp | 6 ++-- core/inst_handlers/rv64/d/fcvt_l_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fcvt_lu_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fcvt_s_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fcvt_w_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fcvt_wu_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fdiv_d.cpp | 6 ++-- core/inst_handlers/rv64/d/feq_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fld.cpp | 6 ++-- core/inst_handlers/rv64/d/fle_d.cpp | 6 ++-- core/inst_handlers/rv64/d/flt_d.cpp | 6 ++-- core/inst_handlers/rv64/d/flw.cpp | 6 ++-- core/inst_handlers/rv64/d/fmadd_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fmax_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fmin_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fmsub_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fmul_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fmv_d_x.cpp | 6 ++-- core/inst_handlers/rv64/d/fmv_w_x.cpp | 6 ++-- core/inst_handlers/rv64/d/fmv_x_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fmv_x_w.cpp | 6 ++-- core/inst_handlers/rv64/d/fnmadd_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fnmsub_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fsd.cpp | 6 ++-- core/inst_handlers/rv64/d/fsgnj_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fsgnjn_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fsgnjx_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fsqrt_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fsub_d.cpp | 6 ++-- core/inst_handlers/rv64/d/fsw.cpp | 6 ++-- core/inst_handlers/rv64/f/fadd_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fclass_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fcvt_l_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fcvt_lu_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fcvt_s_l.cpp | 6 ++-- core/inst_handlers/rv64/f/fcvt_s_lu.cpp | 6 ++-- core/inst_handlers/rv64/f/fcvt_s_w.cpp | 6 ++-- core/inst_handlers/rv64/f/fcvt_s_wu.cpp | 6 ++-- core/inst_handlers/rv64/f/fcvt_w_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fcvt_wu_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fdiv_s.cpp | 6 ++-- core/inst_handlers/rv64/f/feq_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fle_s.cpp | 6 ++-- core/inst_handlers/rv64/f/flt_s.cpp | 6 ++-- core/inst_handlers/rv64/f/flw.cpp | 6 ++-- core/inst_handlers/rv64/f/fmadd_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fmax_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fmin_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fmsub_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fmul_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fmv_w_x.cpp | 6 ++-- core/inst_handlers/rv64/f/fmv_x_w.cpp | 6 ++-- core/inst_handlers/rv64/f/fnmadd_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fnmsub_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fsgnj_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fsgnjn_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fsgnjx_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fsqrt_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fsub_s.cpp | 6 ++-- core/inst_handlers/rv64/f/fsw.cpp | 6 ++-- core/inst_handlers/rv64/m/div.cpp | 6 ++-- core/inst_handlers/rv64/m/divu.cpp | 6 ++-- core/inst_handlers/rv64/m/divuw.cpp | 6 ++-- core/inst_handlers/rv64/m/divw.cpp | 6 ++-- core/inst_handlers/rv64/m/mul.cpp | 6 ++-- core/inst_handlers/rv64/m/mulh.cpp | 6 ++-- core/inst_handlers/rv64/m/mulhsu.cpp | 6 ++-- core/inst_handlers/rv64/m/mulhu.cpp | 6 ++-- core/inst_handlers/rv64/m/mulw.cpp | 6 ++-- core/inst_handlers/rv64/m/rem.cpp | 6 ++-- core/inst_handlers/rv64/m/remu.cpp | 6 ++-- core/inst_handlers/rv64/m/remuw.cpp | 6 ++-- core/inst_handlers/rv64/m/remw.cpp | 6 ++-- core/inst_handlers/rv64/zicsr/csrrc.cpp | 6 ++-- core/inst_handlers/rv64/zicsr/csrrci.cpp | 6 ++-- core/inst_handlers/rv64/zicsr/csrrs.cpp | 6 ++-- core/inst_handlers/rv64/zicsr/csrrsi.cpp | 6 ++-- core/inst_handlers/rv64/zicsr/csrrw.cpp | 6 ++-- core/inst_handlers/rv64/zicsr/csrrwi.cpp | 6 ++-- core/inst_handlers/rv64/zifencei/fence_i.cpp | 6 ++-- test/core/translate/Translate_test.cpp | 30 ++++++++++++++++---- 109 files changed, 348 insertions(+), 330 deletions(-) diff --git a/core/inst_handlers/rv64/a/amoadd_d.cpp b/core/inst_handlers/rv64/a/amoadd_d.cpp index 5fd9889..81598ff 100644 --- a/core/inst_handlers/rv64/a/amoadd_d.cpp +++ b/core/inst_handlers/rv64/a/amoadd_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amoadd_w.cpp b/core/inst_handlers/rv64/a/amoadd_w.cpp index c140da4..b40404f 100644 --- a/core/inst_handlers/rv64/a/amoadd_w.cpp +++ b/core/inst_handlers/rv64/a/amoadd_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amoand_d.cpp b/core/inst_handlers/rv64/a/amoand_d.cpp index 37f780d..4746cda 100644 --- a/core/inst_handlers/rv64/a/amoand_d.cpp +++ b/core/inst_handlers/rv64/a/amoand_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amoand_w.cpp b/core/inst_handlers/rv64/a/amoand_w.cpp index 86a9c83..55487ca 100644 --- a/core/inst_handlers/rv64/a/amoand_w.cpp +++ b/core/inst_handlers/rv64/a/amoand_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amomax_d.cpp b/core/inst_handlers/rv64/a/amomax_d.cpp index b435897..cbc12d1 100644 --- a/core/inst_handlers/rv64/a/amomax_d.cpp +++ b/core/inst_handlers/rv64/a/amomax_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amomax_w.cpp b/core/inst_handlers/rv64/a/amomax_w.cpp index bf42a41..73f8e8d 100644 --- a/core/inst_handlers/rv64/a/amomax_w.cpp +++ b/core/inst_handlers/rv64/a/amomax_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amomaxu_d.cpp b/core/inst_handlers/rv64/a/amomaxu_d.cpp index 20b1473..f2523da 100644 --- a/core/inst_handlers/rv64/a/amomaxu_d.cpp +++ b/core/inst_handlers/rv64/a/amomaxu_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amomaxu_w.cpp b/core/inst_handlers/rv64/a/amomaxu_w.cpp index f927c2d..b05823e 100644 --- a/core/inst_handlers/rv64/a/amomaxu_w.cpp +++ b/core/inst_handlers/rv64/a/amomaxu_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amomin_d.cpp b/core/inst_handlers/rv64/a/amomin_d.cpp index 7d1c097..eaab6b3 100644 --- a/core/inst_handlers/rv64/a/amomin_d.cpp +++ b/core/inst_handlers/rv64/a/amomin_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amomin_w.cpp b/core/inst_handlers/rv64/a/amomin_w.cpp index 68266a8..b2e4f5b 100644 --- a/core/inst_handlers/rv64/a/amomin_w.cpp +++ b/core/inst_handlers/rv64/a/amomin_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amominu_d.cpp b/core/inst_handlers/rv64/a/amominu_d.cpp index 9bbb73d..6007557 100644 --- a/core/inst_handlers/rv64/a/amominu_d.cpp +++ b/core/inst_handlers/rv64/a/amominu_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amominu_w.cpp b/core/inst_handlers/rv64/a/amominu_w.cpp index d99300d..4a49a9d 100644 --- a/core/inst_handlers/rv64/a/amominu_w.cpp +++ b/core/inst_handlers/rv64/a/amominu_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amoor_d.cpp b/core/inst_handlers/rv64/a/amoor_d.cpp index 504b508..2644f05 100644 --- a/core/inst_handlers/rv64/a/amoor_d.cpp +++ b/core/inst_handlers/rv64/a/amoor_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amoor_w.cpp b/core/inst_handlers/rv64/a/amoor_w.cpp index b72ce07..6300c18 100644 --- a/core/inst_handlers/rv64/a/amoor_w.cpp +++ b/core/inst_handlers/rv64/a/amoor_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amoswap_d.cpp b/core/inst_handlers/rv64/a/amoswap_d.cpp index 93b20c4..2632acc 100644 --- a/core/inst_handlers/rv64/a/amoswap_d.cpp +++ b/core/inst_handlers/rv64/a/amoswap_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amoswap_w.cpp b/core/inst_handlers/rv64/a/amoswap_w.cpp index 869367e..f6c7432 100644 --- a/core/inst_handlers/rv64/a/amoswap_w.cpp +++ b/core/inst_handlers/rv64/a/amoswap_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amoxor_d.cpp b/core/inst_handlers/rv64/a/amoxor_d.cpp index 3746f00..b29d4d3 100644 --- a/core/inst_handlers/rv64/a/amoxor_d.cpp +++ b/core/inst_handlers/rv64/a/amoxor_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/amoxor_w.cpp b/core/inst_handlers/rv64/a/amoxor_w.cpp index f169486..a60d047 100644 --- a/core/inst_handlers/rv64/a/amoxor_w.cpp +++ b/core/inst_handlers/rv64/a/amoxor_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/lr_d.cpp b/core/inst_handlers/rv64/a/lr_d.cpp index 4ba5a01..d691dc6 100644 --- a/core/inst_handlers/rv64/a/lr_d.cpp +++ b/core/inst_handlers/rv64/a/lr_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/lr_w.cpp b/core/inst_handlers/rv64/a/lr_w.cpp index f8b8ce9..20ea2fd 100644 --- a/core/inst_handlers/rv64/a/lr_w.cpp +++ b/core/inst_handlers/rv64/a/lr_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/sc_d.cpp b/core/inst_handlers/rv64/a/sc_d.cpp index b8e3376..c3a09c2 100644 --- a/core/inst_handlers/rv64/a/sc_d.cpp +++ b/core/inst_handlers/rv64/a/sc_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/a/sc_w.cpp b/core/inst_handlers/rv64/a/sc_w.cpp index 4e4faf9..1c32cb4 100644 --- a/core/inst_handlers/rv64/a/sc_w.cpp +++ b/core/inst_handlers/rv64/a/sc_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/a/RvaInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fadd_d.cpp b/core/inst_handlers/rv64/d/fadd_d.cpp index 60ed866..096e892 100644 --- a/core/inst_handlers/rv64/d/fadd_d.cpp +++ b/core/inst_handlers/rv64/d/fadd_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fclass_d.cpp b/core/inst_handlers/rv64/d/fclass_d.cpp index a076a7d..13683bc 100644 --- a/core/inst_handlers/rv64/d/fclass_d.cpp +++ b/core/inst_handlers/rv64/d/fclass_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fcvt_d_l.cpp b/core/inst_handlers/rv64/d/fcvt_d_l.cpp index babad18..9c77869 100644 --- a/core/inst_handlers/rv64/d/fcvt_d_l.cpp +++ b/core/inst_handlers/rv64/d/fcvt_d_l.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fcvt_d_lu.cpp b/core/inst_handlers/rv64/d/fcvt_d_lu.cpp index 2818695..60a4b34 100644 --- a/core/inst_handlers/rv64/d/fcvt_d_lu.cpp +++ b/core/inst_handlers/rv64/d/fcvt_d_lu.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fcvt_d_s.cpp b/core/inst_handlers/rv64/d/fcvt_d_s.cpp index 312b89a..d8381c2 100644 --- a/core/inst_handlers/rv64/d/fcvt_d_s.cpp +++ b/core/inst_handlers/rv64/d/fcvt_d_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fcvt_d_w.cpp b/core/inst_handlers/rv64/d/fcvt_d_w.cpp index e29ff0d..67237b1 100644 --- a/core/inst_handlers/rv64/d/fcvt_d_w.cpp +++ b/core/inst_handlers/rv64/d/fcvt_d_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fcvt_d_wu.cpp b/core/inst_handlers/rv64/d/fcvt_d_wu.cpp index 8ca4f4a..6a54a36 100644 --- a/core/inst_handlers/rv64/d/fcvt_d_wu.cpp +++ b/core/inst_handlers/rv64/d/fcvt_d_wu.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fcvt_l_d.cpp b/core/inst_handlers/rv64/d/fcvt_l_d.cpp index 91c4f4a..c27c003 100644 --- a/core/inst_handlers/rv64/d/fcvt_l_d.cpp +++ b/core/inst_handlers/rv64/d/fcvt_l_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fcvt_lu_d.cpp b/core/inst_handlers/rv64/d/fcvt_lu_d.cpp index 6a41a00..f5a2902 100644 --- a/core/inst_handlers/rv64/d/fcvt_lu_d.cpp +++ b/core/inst_handlers/rv64/d/fcvt_lu_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fcvt_s_d.cpp b/core/inst_handlers/rv64/d/fcvt_s_d.cpp index 4d570d9..3d540d0 100644 --- a/core/inst_handlers/rv64/d/fcvt_s_d.cpp +++ b/core/inst_handlers/rv64/d/fcvt_s_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fcvt_w_d.cpp b/core/inst_handlers/rv64/d/fcvt_w_d.cpp index cae426f..2d6b396 100644 --- a/core/inst_handlers/rv64/d/fcvt_w_d.cpp +++ b/core/inst_handlers/rv64/d/fcvt_w_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fcvt_wu_d.cpp b/core/inst_handlers/rv64/d/fcvt_wu_d.cpp index d49be65..2d33db5 100644 --- a/core/inst_handlers/rv64/d/fcvt_wu_d.cpp +++ b/core/inst_handlers/rv64/d/fcvt_wu_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fdiv_d.cpp b/core/inst_handlers/rv64/d/fdiv_d.cpp index 692cb33..ce41a9e 100644 --- a/core/inst_handlers/rv64/d/fdiv_d.cpp +++ b/core/inst_handlers/rv64/d/fdiv_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/feq_d.cpp b/core/inst_handlers/rv64/d/feq_d.cpp index 2175b52..bee00bf 100644 --- a/core/inst_handlers/rv64/d/feq_d.cpp +++ b/core/inst_handlers/rv64/d/feq_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fld.cpp b/core/inst_handlers/rv64/d/fld.cpp index 5ada91a..83ce38c 100644 --- a/core/inst_handlers/rv64/d/fld.cpp +++ b/core/inst_handlers/rv64/d/fld.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fle_d.cpp b/core/inst_handlers/rv64/d/fle_d.cpp index 4c84649..0d45397 100644 --- a/core/inst_handlers/rv64/d/fle_d.cpp +++ b/core/inst_handlers/rv64/d/fle_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/flt_d.cpp b/core/inst_handlers/rv64/d/flt_d.cpp index 396cede..bae2dfa 100644 --- a/core/inst_handlers/rv64/d/flt_d.cpp +++ b/core/inst_handlers/rv64/d/flt_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/flw.cpp b/core/inst_handlers/rv64/d/flw.cpp index 0811aa4..fbaa9f7 100644 --- a/core/inst_handlers/rv64/d/flw.cpp +++ b/core/inst_handlers/rv64/d/flw.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fmadd_d.cpp b/core/inst_handlers/rv64/d/fmadd_d.cpp index 9b50b88..e97dea8 100644 --- a/core/inst_handlers/rv64/d/fmadd_d.cpp +++ b/core/inst_handlers/rv64/d/fmadd_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fmax_d.cpp b/core/inst_handlers/rv64/d/fmax_d.cpp index 60d21eb..84a147a 100644 --- a/core/inst_handlers/rv64/d/fmax_d.cpp +++ b/core/inst_handlers/rv64/d/fmax_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fmin_d.cpp b/core/inst_handlers/rv64/d/fmin_d.cpp index 421bacd..0cdacfa 100644 --- a/core/inst_handlers/rv64/d/fmin_d.cpp +++ b/core/inst_handlers/rv64/d/fmin_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fmsub_d.cpp b/core/inst_handlers/rv64/d/fmsub_d.cpp index 3668144..f3c86a5 100644 --- a/core/inst_handlers/rv64/d/fmsub_d.cpp +++ b/core/inst_handlers/rv64/d/fmsub_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fmul_d.cpp b/core/inst_handlers/rv64/d/fmul_d.cpp index 67a2237..8853219 100644 --- a/core/inst_handlers/rv64/d/fmul_d.cpp +++ b/core/inst_handlers/rv64/d/fmul_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fmv_d_x.cpp b/core/inst_handlers/rv64/d/fmv_d_x.cpp index 5ce3eb3..d2547ec 100644 --- a/core/inst_handlers/rv64/d/fmv_d_x.cpp +++ b/core/inst_handlers/rv64/d/fmv_d_x.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fmv_w_x.cpp b/core/inst_handlers/rv64/d/fmv_w_x.cpp index 64868d5..c0fb133 100644 --- a/core/inst_handlers/rv64/d/fmv_w_x.cpp +++ b/core/inst_handlers/rv64/d/fmv_w_x.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fmv_x_d.cpp b/core/inst_handlers/rv64/d/fmv_x_d.cpp index 45f2cfe..ca2a85a 100644 --- a/core/inst_handlers/rv64/d/fmv_x_d.cpp +++ b/core/inst_handlers/rv64/d/fmv_x_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fmv_x_w.cpp b/core/inst_handlers/rv64/d/fmv_x_w.cpp index badcd57..52854f7 100644 --- a/core/inst_handlers/rv64/d/fmv_x_w.cpp +++ b/core/inst_handlers/rv64/d/fmv_x_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fnmadd_d.cpp b/core/inst_handlers/rv64/d/fnmadd_d.cpp index 4dd1cbf..3df279c 100644 --- a/core/inst_handlers/rv64/d/fnmadd_d.cpp +++ b/core/inst_handlers/rv64/d/fnmadd_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fnmsub_d.cpp b/core/inst_handlers/rv64/d/fnmsub_d.cpp index b872678..58d4e13 100644 --- a/core/inst_handlers/rv64/d/fnmsub_d.cpp +++ b/core/inst_handlers/rv64/d/fnmsub_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fsd.cpp b/core/inst_handlers/rv64/d/fsd.cpp index 893e765..df7003e 100644 --- a/core/inst_handlers/rv64/d/fsd.cpp +++ b/core/inst_handlers/rv64/d/fsd.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fsgnj_d.cpp b/core/inst_handlers/rv64/d/fsgnj_d.cpp index 90fa1fa..12790a7 100644 --- a/core/inst_handlers/rv64/d/fsgnj_d.cpp +++ b/core/inst_handlers/rv64/d/fsgnj_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fsgnjn_d.cpp b/core/inst_handlers/rv64/d/fsgnjn_d.cpp index 157adf3..e090b17 100644 --- a/core/inst_handlers/rv64/d/fsgnjn_d.cpp +++ b/core/inst_handlers/rv64/d/fsgnjn_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fsgnjx_d.cpp b/core/inst_handlers/rv64/d/fsgnjx_d.cpp index 3bbf5ad..912c53a 100644 --- a/core/inst_handlers/rv64/d/fsgnjx_d.cpp +++ b/core/inst_handlers/rv64/d/fsgnjx_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fsqrt_d.cpp b/core/inst_handlers/rv64/d/fsqrt_d.cpp index 1b76f56..0a0f153 100644 --- a/core/inst_handlers/rv64/d/fsqrt_d.cpp +++ b/core/inst_handlers/rv64/d/fsqrt_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fsub_d.cpp b/core/inst_handlers/rv64/d/fsub_d.cpp index 2b415db..106ebf8 100644 --- a/core/inst_handlers/rv64/d/fsub_d.cpp +++ b/core/inst_handlers/rv64/d/fsub_d.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/d/fsw.cpp b/core/inst_handlers/rv64/d/fsw.cpp index 7b5a117..502d63e 100644 --- a/core/inst_handlers/rv64/d/fsw.cpp +++ b/core/inst_handlers/rv64/d/fsw.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/d/RvdInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fadd_s.cpp b/core/inst_handlers/rv64/f/fadd_s.cpp index 9730a98..10f6791 100644 --- a/core/inst_handlers/rv64/f/fadd_s.cpp +++ b/core/inst_handlers/rv64/f/fadd_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fclass_s.cpp b/core/inst_handlers/rv64/f/fclass_s.cpp index 8cb3a23..65922df 100644 --- a/core/inst_handlers/rv64/f/fclass_s.cpp +++ b/core/inst_handlers/rv64/f/fclass_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fcvt_l_s.cpp b/core/inst_handlers/rv64/f/fcvt_l_s.cpp index 53454bb..d120cd7 100644 --- a/core/inst_handlers/rv64/f/fcvt_l_s.cpp +++ b/core/inst_handlers/rv64/f/fcvt_l_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fcvt_lu_s.cpp b/core/inst_handlers/rv64/f/fcvt_lu_s.cpp index d67549c..52c6fc3 100644 --- a/core/inst_handlers/rv64/f/fcvt_lu_s.cpp +++ b/core/inst_handlers/rv64/f/fcvt_lu_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fcvt_s_l.cpp b/core/inst_handlers/rv64/f/fcvt_s_l.cpp index f13add3..f40dd18 100644 --- a/core/inst_handlers/rv64/f/fcvt_s_l.cpp +++ b/core/inst_handlers/rv64/f/fcvt_s_l.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fcvt_s_lu.cpp b/core/inst_handlers/rv64/f/fcvt_s_lu.cpp index 898a272..ac9fd1a 100644 --- a/core/inst_handlers/rv64/f/fcvt_s_lu.cpp +++ b/core/inst_handlers/rv64/f/fcvt_s_lu.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fcvt_s_w.cpp b/core/inst_handlers/rv64/f/fcvt_s_w.cpp index ff654ec..940fe37 100644 --- a/core/inst_handlers/rv64/f/fcvt_s_w.cpp +++ b/core/inst_handlers/rv64/f/fcvt_s_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fcvt_s_wu.cpp b/core/inst_handlers/rv64/f/fcvt_s_wu.cpp index 4e5b71f..3f14051 100644 --- a/core/inst_handlers/rv64/f/fcvt_s_wu.cpp +++ b/core/inst_handlers/rv64/f/fcvt_s_wu.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fcvt_w_s.cpp b/core/inst_handlers/rv64/f/fcvt_w_s.cpp index 62e6fa9..5807ff5 100644 --- a/core/inst_handlers/rv64/f/fcvt_w_s.cpp +++ b/core/inst_handlers/rv64/f/fcvt_w_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fcvt_wu_s.cpp b/core/inst_handlers/rv64/f/fcvt_wu_s.cpp index 54d1735..c638a4d 100644 --- a/core/inst_handlers/rv64/f/fcvt_wu_s.cpp +++ b/core/inst_handlers/rv64/f/fcvt_wu_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fdiv_s.cpp b/core/inst_handlers/rv64/f/fdiv_s.cpp index fdc7e3a..3ccfe77 100644 --- a/core/inst_handlers/rv64/f/fdiv_s.cpp +++ b/core/inst_handlers/rv64/f/fdiv_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/feq_s.cpp b/core/inst_handlers/rv64/f/feq_s.cpp index 548d1da..2295bf2 100644 --- a/core/inst_handlers/rv64/f/feq_s.cpp +++ b/core/inst_handlers/rv64/f/feq_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fle_s.cpp b/core/inst_handlers/rv64/f/fle_s.cpp index 6a51edf..d270e6d 100644 --- a/core/inst_handlers/rv64/f/fle_s.cpp +++ b/core/inst_handlers/rv64/f/fle_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/flt_s.cpp b/core/inst_handlers/rv64/f/flt_s.cpp index 3f56c54..32a5c75 100644 --- a/core/inst_handlers/rv64/f/flt_s.cpp +++ b/core/inst_handlers/rv64/f/flt_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/flw.cpp b/core/inst_handlers/rv64/f/flw.cpp index ce3a246..47588b4 100644 --- a/core/inst_handlers/rv64/f/flw.cpp +++ b/core/inst_handlers/rv64/f/flw.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fmadd_s.cpp b/core/inst_handlers/rv64/f/fmadd_s.cpp index 449613b..a39f512 100644 --- a/core/inst_handlers/rv64/f/fmadd_s.cpp +++ b/core/inst_handlers/rv64/f/fmadd_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fmax_s.cpp b/core/inst_handlers/rv64/f/fmax_s.cpp index 26974e0..7a0ce1b 100644 --- a/core/inst_handlers/rv64/f/fmax_s.cpp +++ b/core/inst_handlers/rv64/f/fmax_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fmin_s.cpp b/core/inst_handlers/rv64/f/fmin_s.cpp index b3af6ec..a9b91f7 100644 --- a/core/inst_handlers/rv64/f/fmin_s.cpp +++ b/core/inst_handlers/rv64/f/fmin_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fmsub_s.cpp b/core/inst_handlers/rv64/f/fmsub_s.cpp index d96f455..7c41120 100644 --- a/core/inst_handlers/rv64/f/fmsub_s.cpp +++ b/core/inst_handlers/rv64/f/fmsub_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fmul_s.cpp b/core/inst_handlers/rv64/f/fmul_s.cpp index 8d24d8c..943457e 100644 --- a/core/inst_handlers/rv64/f/fmul_s.cpp +++ b/core/inst_handlers/rv64/f/fmul_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fmv_w_x.cpp b/core/inst_handlers/rv64/f/fmv_w_x.cpp index c8b4c04..830f479 100644 --- a/core/inst_handlers/rv64/f/fmv_w_x.cpp +++ b/core/inst_handlers/rv64/f/fmv_w_x.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fmv_x_w.cpp b/core/inst_handlers/rv64/f/fmv_x_w.cpp index e6cda87..6722924 100644 --- a/core/inst_handlers/rv64/f/fmv_x_w.cpp +++ b/core/inst_handlers/rv64/f/fmv_x_w.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fnmadd_s.cpp b/core/inst_handlers/rv64/f/fnmadd_s.cpp index 57456b5..44d98b3 100644 --- a/core/inst_handlers/rv64/f/fnmadd_s.cpp +++ b/core/inst_handlers/rv64/f/fnmadd_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fnmsub_s.cpp b/core/inst_handlers/rv64/f/fnmsub_s.cpp index b699051..3c9d54b 100644 --- a/core/inst_handlers/rv64/f/fnmsub_s.cpp +++ b/core/inst_handlers/rv64/f/fnmsub_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fsgnj_s.cpp b/core/inst_handlers/rv64/f/fsgnj_s.cpp index 2b63c7b..0160a0e 100644 --- a/core/inst_handlers/rv64/f/fsgnj_s.cpp +++ b/core/inst_handlers/rv64/f/fsgnj_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fsgnjn_s.cpp b/core/inst_handlers/rv64/f/fsgnjn_s.cpp index 62f402e..6788efb 100644 --- a/core/inst_handlers/rv64/f/fsgnjn_s.cpp +++ b/core/inst_handlers/rv64/f/fsgnjn_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fsgnjx_s.cpp b/core/inst_handlers/rv64/f/fsgnjx_s.cpp index 751952e..f441f6d 100644 --- a/core/inst_handlers/rv64/f/fsgnjx_s.cpp +++ b/core/inst_handlers/rv64/f/fsgnjx_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fsqrt_s.cpp b/core/inst_handlers/rv64/f/fsqrt_s.cpp index 5f330ca..c5db4af 100644 --- a/core/inst_handlers/rv64/f/fsqrt_s.cpp +++ b/core/inst_handlers/rv64/f/fsqrt_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fsub_s.cpp b/core/inst_handlers/rv64/f/fsub_s.cpp index da17ac0..b1e0518 100644 --- a/core/inst_handlers/rv64/f/fsub_s.cpp +++ b/core/inst_handlers/rv64/f/fsub_s.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/f/fsw.cpp b/core/inst_handlers/rv64/f/fsw.cpp index d9bb59d..3e800cf 100644 --- a/core/inst_handlers/rv64/f/fsw.cpp +++ b/core/inst_handlers/rv64/f/fsw.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/f/RvfInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/div.cpp b/core/inst_handlers/rv64/m/div.cpp index 421c2c7..8d89056 100644 --- a/core/inst_handlers/rv64/m/div.cpp +++ b/core/inst_handlers/rv64/m/div.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/divu.cpp b/core/inst_handlers/rv64/m/divu.cpp index 3a281bc..aeadede 100644 --- a/core/inst_handlers/rv64/m/divu.cpp +++ b/core/inst_handlers/rv64/m/divu.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/divuw.cpp b/core/inst_handlers/rv64/m/divuw.cpp index 16bf8b7..ac59f0c 100644 --- a/core/inst_handlers/rv64/m/divuw.cpp +++ b/core/inst_handlers/rv64/m/divuw.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/divw.cpp b/core/inst_handlers/rv64/m/divw.cpp index bf10073..12082ce 100644 --- a/core/inst_handlers/rv64/m/divw.cpp +++ b/core/inst_handlers/rv64/m/divw.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/mul.cpp b/core/inst_handlers/rv64/m/mul.cpp index edaa409..fd690ba 100644 --- a/core/inst_handlers/rv64/m/mul.cpp +++ b/core/inst_handlers/rv64/m/mul.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/mulh.cpp b/core/inst_handlers/rv64/m/mulh.cpp index 12c2ec4..d145b7d 100644 --- a/core/inst_handlers/rv64/m/mulh.cpp +++ b/core/inst_handlers/rv64/m/mulh.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/mulhsu.cpp b/core/inst_handlers/rv64/m/mulhsu.cpp index 31c7062..14f6178 100644 --- a/core/inst_handlers/rv64/m/mulhsu.cpp +++ b/core/inst_handlers/rv64/m/mulhsu.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/mulhu.cpp b/core/inst_handlers/rv64/m/mulhu.cpp index c12cd54..fe2088f 100644 --- a/core/inst_handlers/rv64/m/mulhu.cpp +++ b/core/inst_handlers/rv64/m/mulhu.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/mulw.cpp b/core/inst_handlers/rv64/m/mulw.cpp index 789106a..75b3dc6 100644 --- a/core/inst_handlers/rv64/m/mulw.cpp +++ b/core/inst_handlers/rv64/m/mulw.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/rem.cpp b/core/inst_handlers/rv64/m/rem.cpp index c1275cc..55dc415 100644 --- a/core/inst_handlers/rv64/m/rem.cpp +++ b/core/inst_handlers/rv64/m/rem.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/remu.cpp b/core/inst_handlers/rv64/m/remu.cpp index 0e32b1e..2ac8970 100644 --- a/core/inst_handlers/rv64/m/remu.cpp +++ b/core/inst_handlers/rv64/m/remu.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/remuw.cpp b/core/inst_handlers/rv64/m/remuw.cpp index 450ad8a..65be068 100644 --- a/core/inst_handlers/rv64/m/remuw.cpp +++ b/core/inst_handlers/rv64/m/remuw.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/m/remw.cpp b/core/inst_handlers/rv64/m/remw.cpp index 1e7ec63..148ee41 100644 --- a/core/inst_handlers/rv64/m/remw.cpp +++ b/core/inst_handlers/rv64/m/remw.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/m/RvmInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/zicsr/csrrc.cpp b/core/inst_handlers/rv64/zicsr/csrrc.cpp index 83790f6..1a85608 100644 --- a/core/inst_handlers/rv64/zicsr/csrrc.cpp +++ b/core/inst_handlers/rv64/zicsr/csrrc.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/zicsr/RvzicsrInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/zicsr/csrrci.cpp b/core/inst_handlers/rv64/zicsr/csrrci.cpp index 8960160..7b2a8cb 100644 --- a/core/inst_handlers/rv64/zicsr/csrrci.cpp +++ b/core/inst_handlers/rv64/zicsr/csrrci.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/zicsr/RvzicsrInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/zicsr/csrrs.cpp b/core/inst_handlers/rv64/zicsr/csrrs.cpp index f77d701..6d6acf6 100644 --- a/core/inst_handlers/rv64/zicsr/csrrs.cpp +++ b/core/inst_handlers/rv64/zicsr/csrrs.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/zicsr/RvzicsrInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/zicsr/csrrsi.cpp b/core/inst_handlers/rv64/zicsr/csrrsi.cpp index 3e65344..6f701f6 100644 --- a/core/inst_handlers/rv64/zicsr/csrrsi.cpp +++ b/core/inst_handlers/rv64/zicsr/csrrsi.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/zicsr/RvzicsrInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/zicsr/csrrw.cpp b/core/inst_handlers/rv64/zicsr/csrrw.cpp index 821f4a3..5742d98 100644 --- a/core/inst_handlers/rv64/zicsr/csrrw.cpp +++ b/core/inst_handlers/rv64/zicsr/csrrw.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/zicsr/RvzicsrInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/zicsr/csrrwi.cpp b/core/inst_handlers/rv64/zicsr/csrrwi.cpp index d5a4de5..79432ce 100644 --- a/core/inst_handlers/rv64/zicsr/csrrwi.cpp +++ b/core/inst_handlers/rv64/zicsr/csrrwi.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/zicsr/RvzicsrInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/core/inst_handlers/rv64/zifencei/fence_i.cpp b/core/inst_handlers/rv64/zifencei/fence_i.cpp index 387c1fd..1023524 100644 --- a/core/inst_handlers/rv64/zifencei/fence_i.cpp +++ b/core/inst_handlers/rv64/zifencei/fence_i.cpp @@ -1,8 +1,8 @@ #include "core/inst_handlers/rv64/zifencei/RvzifenceiInsts.hpp" -//#include "core/ActionGroup.hpp" -//#include "core/AtlasState.hpp" -//#include "core/AtlasInst.hpp" +// #include "core/ActionGroup.hpp" +// #include "core/AtlasState.hpp" +// #include "core/AtlasInst.hpp" namespace atlas { diff --git a/test/core/translate/Translate_test.cpp b/test/core/translate/Translate_test.cpp index f8e8d38..a42df4d 100644 --- a/test/core/translate/Translate_test.cpp +++ b/test/core/translate/Translate_test.cpp @@ -2,7 +2,8 @@ #include "core/AtlasState.hpp" #include "include/AtlasTypes.hpp" #include "core/PageTableEntry.hpp" -#include "core/PageTable.hpp" +// #include "core/PageTable.hpp" +#include "core/PageTableWalker.hpp" #include #include "sparta/utils/SpartaTester.hpp" @@ -128,8 +129,7 @@ class AtlasTranslateTester // 1111 0000 1111) atlas::PageTableEntry sv32PTE3( 0x7F03D4C3); // Valid, Read-only (0111 1111 0000 0011 1101 0100 1100 0011) - atlas::PageTableEntry sv32PTE4( - 0xABC12FF); // Invalid PTE (0000 0000 0000 0000 0000 0000 0000 0000) + atlas::PageTableEntry sv32PTE4(0xABC12FF); pt.addEntry(baseAddrOfPT + 1, sv32PTE1); pt.addEntry(baseAddrOfPT + 10, sv32PTE2); @@ -177,9 +177,22 @@ class AtlasTranslateTester // state_->writeMemory(pa, value); // presetup fopr the test, install all the addresses in pageTable Setups + // Va32Bits va = {0xABC, 0x1F, 0x3E}; //{offset, vpn[0], vpn[1]} - // uint32_t va = 0xABCD; - // uint64_t satpBaseAddress = 0x0000; + // std::cout << va.offset_ << std::endl; + // uint64_t satpBaseAddress = 0xFFFF0000; //base address of PD + + // atlas::PageTable pageDirectory(satpBaseAddress); + // atlas::PageTableEntry sv32PTE1(0x7B1EEFF); + // pageDirectory.addEntry(satpBaseAddress+80, sv32PTE1); //try for (satpBaseAddress+0x50) + + // atlas::PageTable pageTable(0x1EC7B); + // atlas::PageTableEntry sv32PTE2(); + // pageDirectory.addEntry(satpBaseAddress+31, sv32PTE2); //try for (satpBaseAddress+0x50) + + // write memory at (sv32PTE2 >> 10)[basically MSB 22 bits of it] as that will be Physical + // address pointing to the physical page of memory(Note: ths should be mapped via + // writeMemory); // call ptw with the above fields @@ -189,6 +202,11 @@ class AtlasTranslateTester // further walk } + // const size_t size = sizeof(MemoryType); + // const std::vector buffer = convertToByteVector(value); + // const bool success = memory->tryWrite(paddr, size, buffer.data()); + // sparta_assert(success, "Failed to write to memory at address 0x" << std::hex << vaddr); + private: sparta::Scheduler scheduler_; std::unique_ptr atlas_sim_; @@ -203,7 +221,7 @@ int main(int argc, char** argv) (void)argv; AtlasTranslateTester translate_tester; - translate_tester.testBaremetalTranslation(); + // translate_tester.testBaremetalTranslation(); translate_tester.testPageTableEntryCreation(); translate_tester.testAtlasTranslationState(); translate_tester.testPageTable(); From 2987fd5ee9e4203eb36e130702a22bb3c8f4b4c0 Mon Sep 17 00:00:00 2001 From: Shiraz Anwar Khan Date: Mon, 2 Dec 2024 12:07:15 -0500 Subject: [PATCH 2/9] fixed the compilation issue for missed a file in the last commit. --- test/core/translate/Translate_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/core/translate/Translate_test.cpp b/test/core/translate/Translate_test.cpp index a42df4d..271815b 100644 --- a/test/core/translate/Translate_test.cpp +++ b/test/core/translate/Translate_test.cpp @@ -2,8 +2,8 @@ #include "core/AtlasState.hpp" #include "include/AtlasTypes.hpp" #include "core/PageTableEntry.hpp" -// #include "core/PageTable.hpp" -#include "core/PageTableWalker.hpp" + #include "core/PageTable.hpp" +//#include "core/PageTableWalker.hpp" #include #include "sparta/utils/SpartaTester.hpp" @@ -221,7 +221,7 @@ int main(int argc, char** argv) (void)argv; AtlasTranslateTester translate_tester; - // translate_tester.testBaremetalTranslation(); + translate_tester.testBaremetalTranslation(); translate_tester.testPageTableEntryCreation(); translate_tester.testAtlasTranslationState(); translate_tester.testPageTable(); From 17d63a7ea2f6b8c0b0c0eb773d4d13f10ec76ef6 Mon Sep 17 00:00:00 2001 From: Shiraz Anwar Khan Date: Tue, 3 Dec 2024 13:52:58 -0500 Subject: [PATCH 3/9] fixed the indexing of PageTables to PTE's 32 bit address --- core/PageTable.tpp | 2 +- core/PageTableWalker.cpp | 5 +++ core/PageTableWalker.hpp | 8 ++++ include/AtlasTypes.hpp | 2 + test/core/translate/Translate_test.cpp | 53 ++++++++++++-------------- 5 files changed, 41 insertions(+), 29 deletions(-) create mode 100644 core/PageTableWalker.cpp create mode 100644 core/PageTableWalker.hpp diff --git a/core/PageTable.tpp b/core/PageTable.tpp index 0c93977..7be8955 100644 --- a/core/PageTable.tpp +++ b/core/PageTable.tpp @@ -44,7 +44,7 @@ namespace atlas{ // } template bool PageTable::isValidIndex(uint32_t idx){ - return ((idx > baseAddressOfpageTable) && (idx <= (max_entries + baseAddressOfpageTable))); + return ((idx >= baseAddressOfpageTable) && (idx < ((max_entries * PTE_SIZE) + baseAddressOfpageTable))); } diff --git a/core/PageTableWalker.cpp b/core/PageTableWalker.cpp new file mode 100644 index 0000000..734f6e6 --- /dev/null +++ b/core/PageTableWalker.cpp @@ -0,0 +1,5 @@ +// +// Created by skhan on 12/3/24. +// + +#include "PageTableWalker.h" diff --git a/core/PageTableWalker.hpp b/core/PageTableWalker.hpp new file mode 100644 index 0000000..cbd029e --- /dev/null +++ b/core/PageTableWalker.hpp @@ -0,0 +1,8 @@ +// +// Created by skhan on 12/3/24. +// + +#ifndef PAGETABLEWALKER_H +#define PAGETABLEWALKER_H + +#endif //PAGETABLEWALKER_H diff --git a/include/AtlasTypes.hpp b/include/AtlasTypes.hpp index b88d067..9260a02 100644 --- a/include/AtlasTypes.hpp +++ b/include/AtlasTypes.hpp @@ -20,6 +20,8 @@ #define PT_ENTRIES_SV32 1024 // Sv32 has 1,024 entries in a page table #define PT_ENTRIES_SV39 512 // Sv39 has 512 entries in a page table +#define PTE_SIZE 4 + namespace atlas { using Addr = uint64_t; diff --git a/test/core/translate/Translate_test.cpp b/test/core/translate/Translate_test.cpp index 271815b..ee9a64c 100644 --- a/test/core/translate/Translate_test.cpp +++ b/test/core/translate/Translate_test.cpp @@ -131,43 +131,40 @@ class AtlasTranslateTester 0x7F03D4C3); // Valid, Read-only (0111 1111 0000 0011 1101 0100 1100 0011) atlas::PageTableEntry sv32PTE4(0xABC12FF); - pt.addEntry(baseAddrOfPT + 1, sv32PTE1); - pt.addEntry(baseAddrOfPT + 10, sv32PTE2); - pt.addEntry(baseAddrOfPT + 100, sv32PTE3); - pt.addEntry(baseAddrOfPT + 1024, sv32PTE4); + pt.addEntry(baseAddrOfPT + 1*PTE_SIZE, sv32PTE1); + pt.addEntry(baseAddrOfPT + 10*PTE_SIZE, sv32PTE2); + pt.addEntry(baseAddrOfPT + 100*PTE_SIZE, sv32PTE3); + pt.addEntry(baseAddrOfPT + 1023*PTE_SIZE, sv32PTE4); - EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 1).getPPN(), sv32PTE1.getPPN()); - EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 10).getPPN(), sv32PTE2.getPPN()); - EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 100).getPPN(), sv32PTE3.getPPN()); - EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 1024).getPPN(), sv32PTE4.getPPN()); + EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 1*PTE_SIZE).getPPN(), sv32PTE1.getPPN()); + EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 10*PTE_SIZE).getPPN(), sv32PTE2.getPPN()); + EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 100*PTE_SIZE).getPPN(), sv32PTE3.getPPN()); + EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 1023*PTE_SIZE).getPPN(), sv32PTE4.getPPN()); EXPECT_THROW(pt.addEntry( - baseAddrOfPT + 1025, - sv32PTE4)); // Page table has reached its maximum capacity/PageTable index out of bound! - EXPECT_THROW(pt.addEntry( - baseAddrOfPT, + baseAddrOfPT + 1024*PTE_SIZE, sv32PTE4)); // Page table has reached its maximum capacity/PageTable index out of bound! EXPECT_THROW( - pt.getEntry(baseAddrOfPT + 1023).getPPN()); // entry not present at the provided index + pt.getEntry(baseAddrOfPT + 1022*PTE_SIZE).getPPN()); // entry not present at the provided index - EXPECT_THROW(pt.removeEntry(baseAddrOfPT + 1044)); // Index Invalid + EXPECT_THROW(pt.removeEntry(baseAddrOfPT + 1044*PTE_SIZE)); // Index Invalid - EXPECT_TRUE(pt.contains(baseAddrOfPT + 1024)); - pt.removeEntry(baseAddrOfPT + 1024); - EXPECT_FALSE(pt.contains(baseAddrOfPT + 1024)); + EXPECT_TRUE(pt.contains(baseAddrOfPT + 1023*PTE_SIZE)); + pt.removeEntry(baseAddrOfPT + 1023*PTE_SIZE); + EXPECT_FALSE(pt.contains(baseAddrOfPT + 1023*PTE_SIZE)); - EXPECT_TRUE(pt.contains(baseAddrOfPT + 100)); - pt.removeEntry(baseAddrOfPT + 100); - EXPECT_FALSE(pt.contains(baseAddrOfPT + 100)); + EXPECT_TRUE(pt.contains(baseAddrOfPT + 100*PTE_SIZE)); + pt.removeEntry(baseAddrOfPT + 100*PTE_SIZE); + EXPECT_FALSE(pt.contains(baseAddrOfPT + 100*PTE_SIZE)); - EXPECT_TRUE(pt.contains(baseAddrOfPT + 10)); - pt.removeEntry(baseAddrOfPT + 10); - EXPECT_FALSE(pt.contains(baseAddrOfPT + 10)); + EXPECT_TRUE(pt.contains(baseAddrOfPT + 10*PTE_SIZE)); + pt.removeEntry(baseAddrOfPT + 10*PTE_SIZE); + EXPECT_FALSE(pt.contains(baseAddrOfPT + 10*PTE_SIZE)); - EXPECT_TRUE(pt.contains(baseAddrOfPT + 1)); - pt.removeEntry(baseAddrOfPT + 1); - EXPECT_FALSE(pt.contains(baseAddrOfPT + 1)); + EXPECT_TRUE(pt.contains(baseAddrOfPT + 1*PTE_SIZE)); + pt.removeEntry(baseAddrOfPT + 1*PTE_SIZE); + EXPECT_FALSE(pt.contains(baseAddrOfPT + 1*PTE_SIZE)); } void testSv32Translation() @@ -177,7 +174,7 @@ class AtlasTranslateTester // state_->writeMemory(pa, value); // presetup fopr the test, install all the addresses in pageTable Setups - // Va32Bits va = {0xABC, 0x1F, 0x3E}; //{offset, vpn[0], vpn[1]} +// Va32Bits va = {0xABC, 0xFF, 0x50}; //{offset, vpn[0], vpn[1]} // std::cout << va.offset_ << std::endl; // uint64_t satpBaseAddress = 0xFFFF0000; //base address of PD @@ -221,7 +218,7 @@ int main(int argc, char** argv) (void)argv; AtlasTranslateTester translate_tester; - translate_tester.testBaremetalTranslation(); + translate_tester.testBaremetalTranslation(); translate_tester.testPageTableEntryCreation(); translate_tester.testAtlasTranslationState(); translate_tester.testPageTable(); From 12cc0216947d7f0cdbfbe95011b3bf1f10c16353 Mon Sep 17 00:00:00 2001 From: Shiraz Anwar Khan Date: Sun, 8 Dec 2024 02:51:32 -0500 Subject: [PATCH 4/9] basic PageTableWalk for sv32 transalation with unit test. --- core/PageTableWalker.cpp | 35 ++++++- core/PageTableWalker.hpp | 127 ++++++++++++++++++++++++- core/Translate.cpp | 1 + test/core/translate/Translate_test.cpp | 69 +++++++------- 4 files changed, 192 insertions(+), 40 deletions(-) diff --git a/core/PageTableWalker.cpp b/core/PageTableWalker.cpp index 734f6e6..3623f74 100644 --- a/core/PageTableWalker.cpp +++ b/core/PageTableWalker.cpp @@ -1,5 +1,36 @@ // -// Created by skhan on 12/3/24. +// Created by skhan on 11/20/24. // -#include "PageTableWalker.h" +#include "../include/AtlasTypes.hpp" + +namespace atlas{ + PageTableWalker::PageTableWalker() {} + + uint32_t PageTableWalker::sv32PageTableWalk(uint32_t virtAddr, uint32_t satpRegVal, AtlasState* state) { + Va32 va(virtAddr); + //TODO: getBaseAddrFromSatpReg(); + uint32_t PDEaddresss = satpRegVal + va.vpn1()*PTE_SIZE; + uint32_t ptbaseAddress = getPFN(PDEaddresss, state); + uint32_t pteAddress = ptbaseAddress + va.vpn0()*PTE_SIZE; + uint32_t PhyMembaseAddress = getPFN(pteAddress, state); + uint32_t PhyMemFrameAddress = PhyMembaseAddress + va.offset()*PTE_SIZE; + return PhyMemFrameAddress; + } + + //convert this to template method, make uint32_t as template + uint32_t PageTableWalker::getPFN(uint32_t entryValues, AtlasState* state){ + uint64_t pteValueFromMem = state->readMemory(entryValues); + PageTableEntry entry(pteValueFromMem); + //TODO: + // If accessing pte violates a PMA or PMP check, raise an access-fault exception corresponding to the original access type + if(!entry.isValid() || ((!entry.canRead()) && entry.canWrite())){ + std::cout<< "throwing page-fault exception" << std::endl; + throw std::runtime_error("page-fault exception"); + } + //TODO: maybe this should be in PageTableWalk method itself, as this should be controlling if next level is phyMem or next level of PT + // If ((!(pte.r==1)) || (!(pte.x==1))) + // PTE points to next level pageTable + return (pteValueFromMem >> 10) << 10; + } +} \ No newline at end of file diff --git a/core/PageTableWalker.hpp b/core/PageTableWalker.hpp index cbd029e..ff562bb 100644 --- a/core/PageTableWalker.hpp +++ b/core/PageTableWalker.hpp @@ -1,8 +1,127 @@ // -// Created by skhan on 12/3/24. +// Created by skhan on 11/20/24. // +namespace atlas{ -#ifndef PAGETABLEWALKER_H -#define PAGETABLEWALKER_H + struct Va32Bits + { + unsigned offset_ : 12; + unsigned vpn0_ : 10; + unsigned vpn1_ : 10; + } __attribute__((packed)); -#endif //PAGETABLEWALKER_H + union Va32 + { + Va32Bits bits_; + uint32_t data_ = 0; + + Va32(uint32_t word) : data_(word) {} + + uint32_t offset() const { return bits_.offset_; } + + uint32_t vpn0() const { return bits_.vpn0_; } + + uint32_t vpn1() const { return bits_.vpn1_; } + + uint32_t vpn(int i) const + { + if (i == 0) + return vpn0(); + if (i == 1) + return vpn1(); + // assert(0); + return 0; + } + }; + + struct Va39Bits + { + unsigned offset_ : 12; + unsigned vpn0_ : 9; + unsigned vpn1_ : 9; + unsigned vpn2_ : 9; + } __attribute__((packed)); + + /// 39-bit virtual address. + union Va39 + { + Va39Bits bits_; + uint64_t data_ = 0; + + Va39(uint64_t data) : data_(data) {} + + uint64_t offset() const { return bits_.offset_; } + + uint64_t vpn0() const { return bits_.vpn0_; } + + uint64_t vpn1() const { return bits_.vpn1_; } + + uint64_t vpn2() const { return bits_.vpn2_; } + + uint64_t vpn(int i) const + { + if (i == 0) + return vpn0(); + if (i == 1) + return vpn1(); + if (i == 2) + return vpn2(); + // assert(0); + return 0; + } + }; + + /// Structure to unpack the fields of Sv48 virtual address. + struct Va48Bits + { + unsigned offset_ : 12; + unsigned vpn0_ : 9; + unsigned vpn1_ : 9; + unsigned vpn2_ : 9; + unsigned vpn3_ : 9; + } __attribute__((packed)); + + /// 48-bit virtual address. + union Va48 + { + Va48Bits bits_; + uint64_t data_ = 0; + + Va48(uint64_t data) : data_(data) {} + + uint64_t offset() const { return bits_.offset_; } + + uint64_t vpn0() const { return bits_.vpn0_; } + + uint64_t vpn1() const { return bits_.vpn1_; } + + uint64_t vpn2() const { return bits_.vpn2_; } + + uint64_t vpn3() const { return bits_.vpn2_; } + + uint64_t vpn(int i) const + { + if (i == 0) + return vpn0(); + if (i == 1) + return vpn1(); + if (i == 2) + return vpn2(); + if (i == 3) + return vpn3(); + // assert(0); + return 0; + } + }; + + class PageTableWalker{ + + public: + PageTableWalker(); + uint32_t getPFN(uint32_t, AtlasState*); + uint32_t sv32PageTableWalk(uint32_t, uint32_t, AtlasState*); + }; + +} + +#include "PageTableWalker.cpp" \ No newline at end of file diff --git a/core/Translate.cpp b/core/Translate.cpp index 73e630f..fa42235 100644 --- a/core/Translate.cpp +++ b/core/Translate.cpp @@ -32,6 +32,7 @@ namespace atlas ILOG("Translating 0x" << std::hex << request.virtual_addr); // Translation currently not supported, assume VA = PA + //TODO: PageTableWalker.pageTableWalk(request.virtual_addr, state); translation_state->setTranslationResult(request.virtual_addr, request.size); // Keep going diff --git a/test/core/translate/Translate_test.cpp b/test/core/translate/Translate_test.cpp index ee9a64c..3161104 100644 --- a/test/core/translate/Translate_test.cpp +++ b/test/core/translate/Translate_test.cpp @@ -3,12 +3,18 @@ #include "include/AtlasTypes.hpp" #include "core/PageTableEntry.hpp" #include "core/PageTable.hpp" -//#include "core/PageTableWalker.hpp" +#include "core/PageTableWalker.hpp" #include #include "sparta/utils/SpartaTester.hpp" class AtlasTranslateTester { + bool writeToMemory(uint64_t pa, uint64_t val){ + state_->writeMemory(pa, val); + uint64_t valueFromMem = state_->readMemory(pa); + return (valueFromMem == val); + } + public: AtlasTranslateTester() { @@ -169,41 +175,35 @@ class AtlasTranslateTester void testSv32Translation() { - // const atlas::Addr pa = 0x1000; - // const uint64_t value = 0xdeadbeef; - // state_->writeMemory(pa, value); - - // presetup fopr the test, install all the addresses in pageTable Setups -// Va32Bits va = {0xABC, 0xFF, 0x50}; //{offset, vpn[0], vpn[1]} - - // std::cout << va.offset_ << std::endl; - // uint64_t satpBaseAddress = 0xFFFF0000; //base address of PD - - // atlas::PageTable pageDirectory(satpBaseAddress); - // atlas::PageTableEntry sv32PTE1(0x7B1EEFF); - // pageDirectory.addEntry(satpBaseAddress+80, sv32PTE1); //try for (satpBaseAddress+0x50) - - // atlas::PageTable pageTable(0x1EC7B); - // atlas::PageTableEntry sv32PTE2(); - // pageDirectory.addEntry(satpBaseAddress+31, sv32PTE2); //try for (satpBaseAddress+0x50) - - // write memory at (sv32PTE2 >> 10)[basically MSB 22 bits of it] as that will be Physical - // address pointing to the physical page of memory(Note: ths should be mapped via - // writeMemory); - - // call ptw with the above fields - - // indexFromVa = extract index from VA - // pte = use that index to get PTE from the PageTable Map - // PA = use the pte to get PA from it, pass the PA to next level page for the - // further walk + atlas::PageTableWalker walker; + uint32_t va = 0x143FFABC; //{vpn[1]-->0x50-->d(80) , vpn[1]-->0xFF-->d(1023) , offset-->0xABC-->d(2748)} + uint32_t satpBaseAddress = 0xFFFF0000; //base address of PD + uint32_t pdeAddress = satpBaseAddress + (80 * PTE_SIZE); + uint32_t pdeVal = 0x7B1EEFF; + uint32_t pageTableBaseAddr = (pdeVal >> 10) << 10; //7B1EC00 + uint32_t pteAddress = pageTableBaseAddr + (1023 * PTE_SIZE); + uint32_t pteVal = 0x7F03D4C3; + const atlas::Addr phyMemoryBaseAddr = (pteVal >> 10) << 10; //0x7F03D400 + const atlas::Addr pa = (phyMemoryBaseAddr + (2748 * PTE_SIZE)); + const uint64_t val = 0xABCD1234; + + atlas::PageTable pageDirectory(satpBaseAddress); + atlas::PageTableEntry pageDirectoryEntry(pdeVal); + pageDirectory.addEntry(pdeAddress, pageDirectoryEntry); + atlas::PageTable pageTable(pageTableBaseAddr); + atlas::PageTableEntry PageTableEntry(pteVal); + pageTable.addEntry(pteAddress, PageTableEntry); + + EXPECT_TRUE(writeToMemory(pa, val)); + EXPECT_TRUE(writeToMemory(pdeAddress, pdeVal)); + EXPECT_TRUE(writeToMemory(pteAddress, pteVal)); + + uint32_t transaltedPA = walker.sv32PageTableWalk(va, satpBaseAddress, state_); + + EXPECT_EQUAL(pa, transaltedPA); + EXPECT_EQUAL(val, state_->readMemory(transaltedPA)); } - // const size_t size = sizeof(MemoryType); - // const std::vector buffer = convertToByteVector(value); - // const bool success = memory->tryWrite(paddr, size, buffer.data()); - // sparta_assert(success, "Failed to write to memory at address 0x" << std::hex << vaddr); - private: sparta::Scheduler scheduler_; std::unique_ptr atlas_sim_; @@ -221,6 +221,7 @@ int main(int argc, char** argv) translate_tester.testBaremetalTranslation(); translate_tester.testPageTableEntryCreation(); translate_tester.testAtlasTranslationState(); + translate_tester.testSv32Translation(); translate_tester.testPageTable(); REPORT_ERROR; From 1b78df00e5e1e5927530a50c5c0648238699281f Mon Sep 17 00:00:00 2001 From: Shiraz Anwar Khan Date: Sun, 8 Dec 2024 02:58:08 -0500 Subject: [PATCH 5/9] applied clang formatting. --- core/PageTableWalker.cpp | 39 +++++++++------- core/PageTableWalker.hpp | 10 +++-- core/Translate.cpp | 2 +- cosim/AtlasCoSim.cpp | 3 +- system/AtlasSystem.cpp | 4 +- test/core/translate/Translate_test.cpp | 62 +++++++++++++------------- 6 files changed, 65 insertions(+), 55 deletions(-) diff --git a/core/PageTableWalker.cpp b/core/PageTableWalker.cpp index 3623f74..d2838c4 100644 --- a/core/PageTableWalker.cpp +++ b/core/PageTableWalker.cpp @@ -4,33 +4,40 @@ #include "../include/AtlasTypes.hpp" -namespace atlas{ +namespace atlas +{ PageTableWalker::PageTableWalker() {} - uint32_t PageTableWalker::sv32PageTableWalk(uint32_t virtAddr, uint32_t satpRegVal, AtlasState* state) { + uint32_t PageTableWalker::sv32PageTableWalk(uint32_t virtAddr, uint32_t satpRegVal, + AtlasState* state) + { Va32 va(virtAddr); - //TODO: getBaseAddrFromSatpReg(); - uint32_t PDEaddresss = satpRegVal + va.vpn1()*PTE_SIZE; + // TODO: getBaseAddrFromSatpReg(); + uint32_t PDEaddresss = satpRegVal + va.vpn1() * PTE_SIZE; uint32_t ptbaseAddress = getPFN(PDEaddresss, state); - uint32_t pteAddress = ptbaseAddress + va.vpn0()*PTE_SIZE; + uint32_t pteAddress = ptbaseAddress + va.vpn0() * PTE_SIZE; uint32_t PhyMembaseAddress = getPFN(pteAddress, state); - uint32_t PhyMemFrameAddress = PhyMembaseAddress + va.offset()*PTE_SIZE; + uint32_t PhyMemFrameAddress = PhyMembaseAddress + va.offset() * PTE_SIZE; return PhyMemFrameAddress; } - //convert this to template method, make uint32_t as template - uint32_t PageTableWalker::getPFN(uint32_t entryValues, AtlasState* state){ + // convert this to template method, make uint32_t as template + uint32_t PageTableWalker::getPFN(uint32_t entryValues, AtlasState* state) + { uint64_t pteValueFromMem = state->readMemory(entryValues); PageTableEntry entry(pteValueFromMem); - //TODO: - // If accessing pte violates a PMA or PMP check, raise an access-fault exception corresponding to the original access type - if(!entry.isValid() || ((!entry.canRead()) && entry.canWrite())){ - std::cout<< "throwing page-fault exception" << std::endl; + // TODO: + // If accessing pte violates a PMA or PMP check, raise an access-fault exception + // corresponding to the original access type + if (!entry.isValid() || ((!entry.canRead()) && entry.canWrite())) + { + std::cout << "throwing page-fault exception" << std::endl; throw std::runtime_error("page-fault exception"); } - //TODO: maybe this should be in PageTableWalk method itself, as this should be controlling if next level is phyMem or next level of PT - // If ((!(pte.r==1)) || (!(pte.x==1))) - // PTE points to next level pageTable + // TODO: maybe this should be in PageTableWalk method itself, as this should be controlling + // if next level is phyMem or next level of PT + // If ((!(pte.r==1)) || (!(pte.x==1))) + // PTE points to next level pageTable return (pteValueFromMem >> 10) << 10; } -} \ No newline at end of file +} // namespace atlas \ No newline at end of file diff --git a/core/PageTableWalker.hpp b/core/PageTableWalker.hpp index ff562bb..cbaa8d9 100644 --- a/core/PageTableWalker.hpp +++ b/core/PageTableWalker.hpp @@ -1,7 +1,8 @@ // // Created by skhan on 11/20/24. // -namespace atlas{ +namespace atlas +{ struct Va32Bits { @@ -114,14 +115,15 @@ namespace atlas{ } }; - class PageTableWalker{ + class PageTableWalker + { - public: + public: PageTableWalker(); uint32_t getPFN(uint32_t, AtlasState*); uint32_t sv32PageTableWalk(uint32_t, uint32_t, AtlasState*); }; -} +} // namespace atlas #include "PageTableWalker.cpp" \ No newline at end of file diff --git a/core/Translate.cpp b/core/Translate.cpp index fa42235..8dce9fb 100644 --- a/core/Translate.cpp +++ b/core/Translate.cpp @@ -32,7 +32,7 @@ namespace atlas ILOG("Translating 0x" << std::hex << request.virtual_addr); // Translation currently not supported, assume VA = PA - //TODO: PageTableWalker.pageTableWalk(request.virtual_addr, state); + // TODO: PageTableWalker.pageTableWalk(request.virtual_addr, state); translation_state->setTranslationResult(request.virtual_addr, request.size); // Keep going diff --git a/cosim/AtlasCoSim.cpp b/cosim/AtlasCoSim.cpp index 2180316..231030f 100644 --- a/cosim/AtlasCoSim.cpp +++ b/cosim/AtlasCoSim.cpp @@ -138,8 +138,7 @@ namespace atlas // Find event in the event list const cosim::EventList & event_list = event_list_.at(hart_id); - auto it = std::find_if(event_list.begin(), event_list.end(), - [event](const cosim::Event & e) + auto it = std::find_if(event_list.begin(), event_list.end(), [event](const cosim::Event & e) { return e.getEuid() == event->getEuid(); }); sparta_assert(it != event_list.end(), "Event not found in event list!"); diff --git a/system/AtlasSystem.cpp b/system/AtlasSystem.cpp index 12b2bc2..3ceebcb 100644 --- a/system/AtlasSystem.cpp +++ b/system/AtlasSystem.cpp @@ -27,8 +27,8 @@ namespace atlas if (memory_section.data != nullptr) { std::cout << " -- Loading section " << memory_section.name << " (" << std::dec - << memory_section.file_size << "B) " - << " to 0x" << std::hex << memory_section.start_address << std::endl; + << memory_section.file_size << "B) " << " to 0x" << std::hex + << memory_section.start_address << std::endl; bool success = memory_map_->tryPoke(memory_section.start_address, memory_section.file_size, memory_section.data); if (!success) diff --git a/test/core/translate/Translate_test.cpp b/test/core/translate/Translate_test.cpp index 3161104..2f85642 100644 --- a/test/core/translate/Translate_test.cpp +++ b/test/core/translate/Translate_test.cpp @@ -2,14 +2,15 @@ #include "core/AtlasState.hpp" #include "include/AtlasTypes.hpp" #include "core/PageTableEntry.hpp" - #include "core/PageTable.hpp" +#include "core/PageTable.hpp" #include "core/PageTableWalker.hpp" #include #include "sparta/utils/SpartaTester.hpp" class AtlasTranslateTester { - bool writeToMemory(uint64_t pa, uint64_t val){ + bool writeToMemory(uint64_t pa, uint64_t val) + { state_->writeMemory(pa, val); uint64_t valueFromMem = state_->readMemory(pa); return (valueFromMem == val); @@ -137,53 +138,54 @@ class AtlasTranslateTester 0x7F03D4C3); // Valid, Read-only (0111 1111 0000 0011 1101 0100 1100 0011) atlas::PageTableEntry sv32PTE4(0xABC12FF); - pt.addEntry(baseAddrOfPT + 1*PTE_SIZE, sv32PTE1); - pt.addEntry(baseAddrOfPT + 10*PTE_SIZE, sv32PTE2); - pt.addEntry(baseAddrOfPT + 100*PTE_SIZE, sv32PTE3); - pt.addEntry(baseAddrOfPT + 1023*PTE_SIZE, sv32PTE4); + pt.addEntry(baseAddrOfPT + 1 * PTE_SIZE, sv32PTE1); + pt.addEntry(baseAddrOfPT + 10 * PTE_SIZE, sv32PTE2); + pt.addEntry(baseAddrOfPT + 100 * PTE_SIZE, sv32PTE3); + pt.addEntry(baseAddrOfPT + 1023 * PTE_SIZE, sv32PTE4); - EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 1*PTE_SIZE).getPPN(), sv32PTE1.getPPN()); - EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 10*PTE_SIZE).getPPN(), sv32PTE2.getPPN()); - EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 100*PTE_SIZE).getPPN(), sv32PTE3.getPPN()); - EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 1023*PTE_SIZE).getPPN(), sv32PTE4.getPPN()); + EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 1 * PTE_SIZE).getPPN(), sv32PTE1.getPPN()); + EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 10 * PTE_SIZE).getPPN(), sv32PTE2.getPPN()); + EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 100 * PTE_SIZE).getPPN(), sv32PTE3.getPPN()); + EXPECT_EQUAL(pt.getEntry(baseAddrOfPT + 1023 * PTE_SIZE).getPPN(), sv32PTE4.getPPN()); EXPECT_THROW(pt.addEntry( - baseAddrOfPT + 1024*PTE_SIZE, + baseAddrOfPT + 1024 * PTE_SIZE, sv32PTE4)); // Page table has reached its maximum capacity/PageTable index out of bound! - EXPECT_THROW( - pt.getEntry(baseAddrOfPT + 1022*PTE_SIZE).getPPN()); // entry not present at the provided index + EXPECT_THROW(pt.getEntry(baseAddrOfPT + 1022 * PTE_SIZE) + .getPPN()); // entry not present at the provided index - EXPECT_THROW(pt.removeEntry(baseAddrOfPT + 1044*PTE_SIZE)); // Index Invalid + EXPECT_THROW(pt.removeEntry(baseAddrOfPT + 1044 * PTE_SIZE)); // Index Invalid - EXPECT_TRUE(pt.contains(baseAddrOfPT + 1023*PTE_SIZE)); - pt.removeEntry(baseAddrOfPT + 1023*PTE_SIZE); - EXPECT_FALSE(pt.contains(baseAddrOfPT + 1023*PTE_SIZE)); + EXPECT_TRUE(pt.contains(baseAddrOfPT + 1023 * PTE_SIZE)); + pt.removeEntry(baseAddrOfPT + 1023 * PTE_SIZE); + EXPECT_FALSE(pt.contains(baseAddrOfPT + 1023 * PTE_SIZE)); - EXPECT_TRUE(pt.contains(baseAddrOfPT + 100*PTE_SIZE)); - pt.removeEntry(baseAddrOfPT + 100*PTE_SIZE); - EXPECT_FALSE(pt.contains(baseAddrOfPT + 100*PTE_SIZE)); + EXPECT_TRUE(pt.contains(baseAddrOfPT + 100 * PTE_SIZE)); + pt.removeEntry(baseAddrOfPT + 100 * PTE_SIZE); + EXPECT_FALSE(pt.contains(baseAddrOfPT + 100 * PTE_SIZE)); - EXPECT_TRUE(pt.contains(baseAddrOfPT + 10*PTE_SIZE)); - pt.removeEntry(baseAddrOfPT + 10*PTE_SIZE); - EXPECT_FALSE(pt.contains(baseAddrOfPT + 10*PTE_SIZE)); + EXPECT_TRUE(pt.contains(baseAddrOfPT + 10 * PTE_SIZE)); + pt.removeEntry(baseAddrOfPT + 10 * PTE_SIZE); + EXPECT_FALSE(pt.contains(baseAddrOfPT + 10 * PTE_SIZE)); - EXPECT_TRUE(pt.contains(baseAddrOfPT + 1*PTE_SIZE)); - pt.removeEntry(baseAddrOfPT + 1*PTE_SIZE); - EXPECT_FALSE(pt.contains(baseAddrOfPT + 1*PTE_SIZE)); + EXPECT_TRUE(pt.contains(baseAddrOfPT + 1 * PTE_SIZE)); + pt.removeEntry(baseAddrOfPT + 1 * PTE_SIZE); + EXPECT_FALSE(pt.contains(baseAddrOfPT + 1 * PTE_SIZE)); } void testSv32Translation() { atlas::PageTableWalker walker; - uint32_t va = 0x143FFABC; //{vpn[1]-->0x50-->d(80) , vpn[1]-->0xFF-->d(1023) , offset-->0xABC-->d(2748)} - uint32_t satpBaseAddress = 0xFFFF0000; //base address of PD + uint32_t va = 0x143FFABC; //{vpn[1]-->0x50-->d(80) , vpn[1]-->0xFF-->d(1023) , + //offset-->0xABC-->d(2748)} + uint32_t satpBaseAddress = 0xFFFF0000; // base address of PD uint32_t pdeAddress = satpBaseAddress + (80 * PTE_SIZE); uint32_t pdeVal = 0x7B1EEFF; - uint32_t pageTableBaseAddr = (pdeVal >> 10) << 10; //7B1EC00 + uint32_t pageTableBaseAddr = (pdeVal >> 10) << 10; // 7B1EC00 uint32_t pteAddress = pageTableBaseAddr + (1023 * PTE_SIZE); uint32_t pteVal = 0x7F03D4C3; - const atlas::Addr phyMemoryBaseAddr = (pteVal >> 10) << 10; //0x7F03D400 + const atlas::Addr phyMemoryBaseAddr = (pteVal >> 10) << 10; // 0x7F03D400 const atlas::Addr pa = (phyMemoryBaseAddr + (2748 * PTE_SIZE)); const uint64_t val = 0xABCD1234; From d994a22196d6d29417263cefeadcd1ba0ec6b68b Mon Sep 17 00:00:00 2001 From: Shiraz Anwar Khan Date: Mon, 9 Dec 2024 21:43:53 -0500 Subject: [PATCH 6/9] Fixed Review comments --- core/PageTable.tpp | 7 ++++++- core/PageTableWalker.cpp | 16 ++++++++-------- core/PageTableWalker.hpp | 2 +- include/AtlasTypes.hpp | 2 -- test/core/translate/Translate_test.cpp | 14 +++++--------- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/core/PageTable.tpp b/core/PageTable.tpp index 7be8955..7ea4d80 100644 --- a/core/PageTable.tpp +++ b/core/PageTable.tpp @@ -44,7 +44,12 @@ namespace atlas{ // } template bool PageTable::isValidIndex(uint32_t idx){ - return ((idx >= baseAddressOfpageTable) && (idx < ((max_entries * PTE_SIZE) + baseAddressOfpageTable))); + uint32_t pte_size; + if(Mode == MMUMode::SV32) + pte_size = sizeof(RV32); + else if (Mode == MMUMode::SV39) + pte_size = sizeof(RV64); + return ((idx >= baseAddressOfpageTable) && (idx < ((max_entries * pte_size) + baseAddressOfpageTable))); } diff --git a/core/PageTableWalker.cpp b/core/PageTableWalker.cpp index d2838c4..414d499 100644 --- a/core/PageTableWalker.cpp +++ b/core/PageTableWalker.cpp @@ -6,25 +6,25 @@ namespace atlas { - PageTableWalker::PageTableWalker() {} uint32_t PageTableWalker::sv32PageTableWalk(uint32_t virtAddr, uint32_t satpRegVal, AtlasState* state) { + uint32_t PTE_SIZE = sizeof(RV32); Va32 va(virtAddr); // TODO: getBaseAddrFromSatpReg(); - uint32_t PDEaddresss = satpRegVal + va.vpn1() * PTE_SIZE; - uint32_t ptbaseAddress = getPFN(PDEaddresss, state); - uint32_t pteAddress = ptbaseAddress + va.vpn0() * PTE_SIZE; - uint32_t PhyMembaseAddress = getPFN(pteAddress, state); - uint32_t PhyMemFrameAddress = PhyMembaseAddress + va.offset() * PTE_SIZE; + const uint32_t PDEaddresss = satpRegVal + va.vpn1() * PTE_SIZE; + const uint32_t ptbaseAddress = getPFN(PDEaddresss, state); + const uint32_t pteAddress = ptbaseAddress + va.vpn0() * PTE_SIZE; + const uint32_t PhyMembaseAddress = getPFN(pteAddress, state); + const uint32_t PhyMemFrameAddress = PhyMembaseAddress + va.offset() * PTE_SIZE; return PhyMemFrameAddress; } // convert this to template method, make uint32_t as template - uint32_t PageTableWalker::getPFN(uint32_t entryValues, AtlasState* state) + uint32_t PageTableWalker::getPFN(const uint32_t entryValues, AtlasState* state) { - uint64_t pteValueFromMem = state->readMemory(entryValues); + const uint64_t pteValueFromMem = state->readMemory(entryValues); PageTableEntry entry(pteValueFromMem); // TODO: // If accessing pte violates a PMA or PMP check, raise an access-fault exception diff --git a/core/PageTableWalker.hpp b/core/PageTableWalker.hpp index cbaa8d9..a819a76 100644 --- a/core/PageTableWalker.hpp +++ b/core/PageTableWalker.hpp @@ -119,7 +119,7 @@ namespace atlas { public: - PageTableWalker(); + PageTableWalker() {} uint32_t getPFN(uint32_t, AtlasState*); uint32_t sv32PageTableWalk(uint32_t, uint32_t, AtlasState*); }; diff --git a/include/AtlasTypes.hpp b/include/AtlasTypes.hpp index 9260a02..b88d067 100644 --- a/include/AtlasTypes.hpp +++ b/include/AtlasTypes.hpp @@ -20,8 +20,6 @@ #define PT_ENTRIES_SV32 1024 // Sv32 has 1,024 entries in a page table #define PT_ENTRIES_SV39 512 // Sv39 has 512 entries in a page table -#define PTE_SIZE 4 - namespace atlas { using Addr = uint64_t; diff --git a/test/core/translate/Translate_test.cpp b/test/core/translate/Translate_test.cpp index 2f85642..62f7b5a 100644 --- a/test/core/translate/Translate_test.cpp +++ b/test/core/translate/Translate_test.cpp @@ -9,12 +9,6 @@ class AtlasTranslateTester { - bool writeToMemory(uint64_t pa, uint64_t val) - { - state_->writeMemory(pa, val); - uint64_t valueFromMem = state_->readMemory(pa); - return (valueFromMem == val); - } public: AtlasTranslateTester() @@ -126,6 +120,7 @@ class AtlasTranslateTester void testPageTable() // unit test for PageTable.cpp { uint32_t pa = 0x7B1EEFF; + uint32_t PTE_SIZE = sizeof(atlas::RV32); //since test is for SV32 uint32_t baseAddrOfPT = 0xFFFF0000; atlas::PageTable pt(baseAddrOfPT); atlas::PageTableEntry sv32PTE1( @@ -177,6 +172,7 @@ class AtlasTranslateTester void testSv32Translation() { atlas::PageTableWalker walker; + uint32_t PTE_SIZE = sizeof(atlas::RV32); uint32_t va = 0x143FFABC; //{vpn[1]-->0x50-->d(80) , vpn[1]-->0xFF-->d(1023) , //offset-->0xABC-->d(2748)} uint32_t satpBaseAddress = 0xFFFF0000; // base address of PD @@ -196,9 +192,9 @@ class AtlasTranslateTester atlas::PageTableEntry PageTableEntry(pteVal); pageTable.addEntry(pteAddress, PageTableEntry); - EXPECT_TRUE(writeToMemory(pa, val)); - EXPECT_TRUE(writeToMemory(pdeAddress, pdeVal)); - EXPECT_TRUE(writeToMemory(pteAddress, pteVal)); + state_->writeMemory(pa, val); + state_->writeMemory(pdeAddress, pdeVal); + state_->writeMemory(pteAddress, pteVal); uint32_t transaltedPA = walker.sv32PageTableWalk(va, satpBaseAddress, state_); From 719ba5d78bc02452b58515475232aa884a814b99 Mon Sep 17 00:00:00 2001 From: Shiraz Anwar Khan Date: Thu, 12 Dec 2024 16:32:37 -0500 Subject: [PATCH 7/9] Resolved PR comments-2, Removed linker error for template classes. --- core/CMakeLists.txt | 1 + core/PageTable.hpp | 102 +++++++++++++++++++++----- core/PageTable.tpp | 114 ----------------------------- core/PageTableEntry.hpp | 151 ++++++++++++++++++--------------------- core/PageTableEntry.tpp | 60 ---------------- core/PageTableWalker.cpp | 3 +- core/PageTableWalker.hpp | 8 ++- 7 files changed, 163 insertions(+), 276 deletions(-) delete mode 100644 core/PageTable.tpp delete mode 100644 core/PageTableEntry.tpp diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 86bacf8..79c997c 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -10,6 +10,7 @@ add_library(atlascore Execute.cpp AtlasExtractor.cpp AtlasInst.cpp + PageTableWalker.cpp observers/Observer.cpp observers/CoSimObserver.cpp observers/InstructionLogger.cpp diff --git a/core/PageTable.hpp b/core/PageTable.hpp index c96655d..b84b756 100644 --- a/core/PageTable.hpp +++ b/core/PageTable.hpp @@ -1,3 +1,5 @@ +#pragma once + #include #include #include "../include/AtlasTypes.hpp" @@ -10,25 +12,93 @@ namespace atlas private: const uint16_t max_entries; const uint32_t baseAddressOfpageTable; - bool isValidIndex(uint32_t idx); - size_t size(); - uint16_t getMaxNumEntries(MMUMode mode) const; + + bool isValidIndex(uint32_t idx) + { + uint32_t pte_size = (Mode == MMUMode::SV32) ? sizeof(RV32) : sizeof(RV64); + return ((idx >= baseAddressOfpageTable) && + (idx < ((max_entries * pte_size) + baseAddressOfpageTable))); + } + + size_t size() const + { + return pageTable.size(); + } + + uint16_t getMaxNumEntries() const + { + if (Mode == MMUMode::SV32) + return PT_ENTRIES_SV32; + else if (Mode == MMUMode::SV39) + return PT_ENTRIES_SV39; + return 0; + } public: - std::map> - pageTable; // uint32_t will be able to accomodate all the types of indexes(VPNs) for - // addressing the PTE - - PageTable(uint32_t baseAddr); - void addEntry(uint32_t index, PageTableEntry entry); - PageTableEntry getEntry(uint32_t index); - void removeEntry(uint32_t index); - void print(std::ostream & os); - bool contains(uint32_t index); + std::map> pageTable; // uint32_t accommodates all types of VPNs for addressing the PTE + + PageTable(uint32_t baseAddr) + : max_entries(getMaxNumEntries()), baseAddressOfpageTable(baseAddr) {} + + void addEntry(uint32_t index, PageTableEntry entry) + { + if (size() <= max_entries && isValidIndex(index)) { + auto it = pageTable.find(index); + if (it != pageTable.end()) { + it->second = entry; // Update the existing entry + } else { + pageTable.insert({index, entry}); // Insert the new entry + } + } else { + throw std::runtime_error("Page table has reached its maximum capacity or index is out of bounds!"); + } + } + + PageTableEntry getEntry(uint32_t index) + { + if (isValidIndex(index)) { + auto it = pageTable.find(index); + if (it != pageTable.end()) { + return it->second; + } else { + throw std::out_of_range("Index not found in the page table"); + } + } else { + throw std::out_of_range("Invalid index"); + } + } + + void removeEntry(uint32_t index) + { + if (isValidIndex(index)) { + auto it = pageTable.find(index); + if (it != pageTable.end()) { + pageTable.erase(it); + } else { + throw std::out_of_range("Index not found in the page table"); + } + } else { + throw std::out_of_range("Invalid index"); + } + } + + bool contains(uint32_t index) const + { + return pageTable.find(index) != pageTable.end(); + } + + void print(std::ostream &os) const + { + for (const auto &[index, entry] : pageTable) { + os << "Index: " << index << " | PTE: " << entry.getPTE() << std::endl; + } + } }; template - std::ostream & operator<<(std::ostream & os, const PageTable & pt); + std::ostream &operator<<(std::ostream &os, const PageTable &pt) + { + pt.print(os); + return os; + } } // namespace atlas - -#include "PageTable.tpp" \ No newline at end of file diff --git a/core/PageTable.tpp b/core/PageTable.tpp deleted file mode 100644 index 7ea4d80..0000000 --- a/core/PageTable.tpp +++ /dev/null @@ -1,114 +0,0 @@ -#include -#include - -namespace atlas{ - // constructor that sets the maximum number of entries in the page table - - template - uint16_t PageTable::getMaxNumEntries(MMUMode mode) const - { - if(mode == MMUMode::SV32) - return PT_ENTRIES_SV32; - else if (mode == MMUMode::SV39) - return PT_ENTRIES_SV39; - return 0; - } - - template - PageTable::PageTable(uint32_t baseAddr) : - max_entries(getMaxNumEntries(Mode)) , baseAddressOfpageTable(baseAddr) - {} - - template <> void PageTable::addEntry(uint32_t index, PageTableEntry entry) { - if (size() <= max_entries && isValidIndex(index)) { - auto it = pageTable.find(index); - if (it != pageTable.end()) { - // Update the existing entry - it->second = entry; - } else { - // Insert the new entry - pageTable.insert({index, entry}); - } - } else { - throw std::runtime_error("Page table has reached its maximum capacity/PageTable index out of bound!"); - } - } - - // template <> void PageTable::addEntry(uint32_t index, PageTableEntry entry) { - // if (size() < max_entries && isValidIndex(index)) { - // if(pageTable.contains(index)) - // pageTable[index] = entry; - // } else { - // throw std::runtime_error("Page table has reached its maximum capacity/PageTable index out of bound!"); - // } - // } - - template bool PageTable::isValidIndex(uint32_t idx){ - uint32_t pte_size; - if(Mode == MMUMode::SV32) - pte_size = sizeof(RV32); - else if (Mode == MMUMode::SV39) - pte_size = sizeof(RV64); - return ((idx >= baseAddressOfpageTable) && (idx < ((max_entries * pte_size) + baseAddressOfpageTable))); - } - - - // Method to get an entry from the page table at a given index - template PageTableEntry PageTable::getEntry(uint32_t index) { - if(isValidIndex(index)){ - auto it = pageTable.find(index); - if (it != pageTable.end()) { - return it->second; - } else { - throw std::out_of_range("Index not found in the page table"); - } - } - else - throw std::out_of_range("Index Invalid"); - } - - // Method to remove an entry from the page table at a given index - template void PageTable::removeEntry(uint32_t index) { - if(isValidIndex(index)){ - auto it = pageTable.find(index); - if (it != pageTable.end()) { - pageTable.erase(it); - } else { - throw std::out_of_range("Index not found in the page table"); - } - } else{ - throw std::out_of_range("Index Invalid"); - } - } - - // Method to check if an entry exists at a given index - template bool PageTable::contains(uint32_t index) { - return pageTable.find(index) != pageTable.end(); - } - - // Method to get the current number of entries in the page table - template size_t PageTable::size() { - return pageTable.size(); - } - - // // Method to print all entries in the page table - // template void PageTable::print() { - // for ( auto& [index, entry] : pageTable) { - // std::cout << "Index: " << index << " | PTE: " << entry.getPTE() << std::endl; - // } - // } - - template - void PageTable::print(std::ostream& os) { - for (const auto& [index, entry] : pageTable) { - os << "Index: " << index << " | PTE: " << entry.getPTE() << std::endl; - } - } - - template - std::ostream & operator<<(std::ostream & os, const PageTable& pt) - { - pt.print(os); - return os; - } -} diff --git a/core/PageTableEntry.hpp b/core/PageTableEntry.hpp index aed084c..3ddf14e 100644 --- a/core/PageTableEntry.hpp +++ b/core/PageTableEntry.hpp @@ -1,3 +1,5 @@ +#pragma once + #include #include "../include/AtlasTypes.hpp" @@ -33,92 +35,77 @@ namespace atlas bool V_; // Valid bit public: - PageTableEntry(xLen pte); + PageTableEntry(xLen pte) + { + if constexpr (Mode == MMUMode::SV32) { + pageTableEntryValue_ = pte; + unUsedBits_ = 0; // no such field exist here hence 0 + uint32_t PPN1 = (pte >> 20) & TWELVE_BIT_MASK; // 12 bits + uint32_t PPN0 = (pte >> 10) & TEN_BIT_MASK; // Extract PPN[0] (bits 19-10) // 10 bits + this->PPN_ = (PPN1 << 10) | PPN0; // Combine PPN1 and PPN0 to form the full PPN // 22 bits total + decodePTEFields_(pte); + } + } // Getter methods for each field - xLen getPTE() const; - uint32_t getUnusedBits() const; - uint32_t getPPN() const; - uint32_t getPPN1() const; - uint32_t getPPN0() const; - uint8_t getRSW() const; - bool isDirty() const; - bool isAccessed() const; - bool isGlobal() const; - bool isUserMode() const; - bool canExecute() const; - bool canWrite() const; - bool canRead() const; - bool isValid() const; + xLen getPTE() const { return pageTableEntryValue_; } + uint32_t getUnusedBits() const { return (Mode == MMUMode::SV32) ? 0 : unUsedBits_; } + uint32_t getPPN() const { return PPN_; } + uint32_t getPPN1() const { return (Mode == MMUMode::SV32) ? ((PPN_ >> 10) & 0xFFF) : 0; } // 12 bits for PPN1 + uint32_t getPPN0() const { return (Mode == MMUMode::SV32) ? (PPN_ & 0x3FF) : 0; } // 10 bits for PPN0 + uint8_t getRSW() const { return RSW_; } + bool isDirty() const { return D_; } + bool isAccessed() const { return A_; } + bool isGlobal() const { return G_; } + bool isUserMode() const { return U_; } + bool canExecute() const { return X_; } + bool canWrite() const { return W_; } + bool canRead() const { return R_; } + bool isValid() const { return V_; } private: // Setter methods for each field - void setPTE_(xLen pte); - void setUnusedBits_(uint32_t unusedBits); - void setPPN_(uint32_t ppn); - void setPPN0_(uint32_t ppn0); - void setPPN1_(uint32_t ppn1); - void setRSW_(uint8_t rsw); - void setDirty_(bool d); - void setAccessed_(bool a); - void setGlobal_(bool g); - void setUserMode_(bool u); - void setExecute_(bool x); - void setWrite_(bool w); - void setRead_(bool r); - void setValid_(bool v); - - void decodePTEFields_(xLen pte); + void setPTE_(xLen pte) { pageTableEntryValue_ = pte; } + void setUnusedBits_(uint32_t unusedBits) { + if constexpr (Mode != MMUMode::SV32) { + unUsedBits_ = unusedBits; + } + } + void setPPN_(uint32_t ppn) { PPN_ = ppn; } // Setter for full PPN + void setPPN0_(uint32_t ppn0) { + if constexpr (Mode == MMUMode::SV32) { + PPN_ &= ~0x3FF; // Clear the lower 10 bits (PPN0) + PPN_ |= (ppn0 & 0x3FF); // Set the lower 10 bits (PPN0) + } + } + void setPPN1_(uint32_t ppn1) { + if constexpr (Mode == MMUMode::SV32) { + PPN_ &= ~(0xFFF << 10); // Clear bits 21-10 (PPN1) + PPN_ |= (ppn1 & 0xFFF) << 10; // Set bits 21-10 (PPN1) + } + } + void setRSW_(uint8_t rsw) { RSW_ = rsw & 0x3; } // Mask to ensure it's a 2-bit value + void setDirty_(bool d) { D_ = d; } + void setAccessed_(bool a) { A_ = a; } + void setGlobal_(bool g) { G_ = g; } + void setUserMode_(bool u) { U_ = u; } + void setExecute_(bool x) { X_ = x; } + void setWrite_(bool w) { W_ = w; } + void setRead_(bool r) { R_ = r; } + void setValid_(bool v) { V_ = v; } + + void decodePTEFields_(xLen pte) { + if constexpr (Mode == MMUMode::SV32) { + RSW_ = (pte >> 8) & TWO_BIT_MASK; // Extract RSW_ (bits 9-8) // 2 bits + D_ = pte & PTE_D_MASK; // Extract D_ (Dirty bit, bit 7) // 1 bit + A_ = pte & PTE_A_MASK; // Extract A_ (Accessed bit, bit 6) // 1 bit + G_ = pte & PTE_G_MASK; // Extract G_ (Global bit, bit 5) // 1 bit + U_ = pte & PTE_U_MASK; // Extract U_ (User-mode bit, bit 4) // 1 bit + X_ = pte & PTE_X_MASK; // Extract X_ (Execute bit, bit 3) // 1 bit + W_ = pte & PTE_W_MASK; // Extract W_ (Write bit, bit 2) // 1 bit + R_ = pte & PTE_R_MASK; // Extract R_ (Read bit, bit 1) // 1 bit + V_ = pte & PTE_V_MASK; // Extract V_ (Valid bit, bit 0) // 1 bit + } + } }; - - template void PageTableEntry::setPTE_(xLen pte) - { - pageTableEntryValue_ = pte; - } - - template void PageTableEntry::setRSW_(uint8_t rsw) - { - RSW_ = rsw & 0x3; - } // Mask to ensure it's a 2-bit value - - template void PageTableEntry::setDirty_(bool d) { D_ = d; } - - template void PageTableEntry::setAccessed_(bool a) { A_ = a; } - - template void PageTableEntry::setGlobal_(bool g) { G_ = g; } - - template void PageTableEntry::setUserMode_(bool u) { U_ = u; } - - template void PageTableEntry::setExecute_(bool x) { X_ = x; } - - template void PageTableEntry::setWrite_(bool w) { W_ = w; } - - template void PageTableEntry::setRead_(bool r) { R_ = r; } - - template void PageTableEntry::setValid_(bool v) { V_ = v; } - - template typename PageTableEntry::xLen PageTableEntry::getPTE() const - { - return pageTableEntryValue_; - } - - template uint8_t PageTableEntry::getRSW() const { return RSW_; } - - template bool PageTableEntry::isDirty() const { return D_; } - - template bool PageTableEntry::isAccessed() const { return A_; } - - template bool PageTableEntry::isGlobal() const { return G_; } - - template bool PageTableEntry::isUserMode() const { return U_; } - - template bool PageTableEntry::canExecute() const { return X_; } - - template bool PageTableEntry::canWrite() const { return W_; } - - template bool PageTableEntry::canRead() const { return R_; } - - template bool PageTableEntry::isValid() const { return V_; } } // namespace atlas - -#include "PageTableEntry.tpp" \ No newline at end of file diff --git a/core/PageTableEntry.tpp b/core/PageTableEntry.tpp deleted file mode 100644 index 02f9126..0000000 --- a/core/PageTableEntry.tpp +++ /dev/null @@ -1,60 +0,0 @@ -namespace atlas -{ - // Constructor to initialize from a 32-bit PTE value - template <> - PageTableEntry::PageTableEntry(uint32_t pte){ - // using xlen = RV32; - pageTableEntryValue_ = pte; - unUsedBits_ = 0; //no such field exist here hence 0 - uint32_t PPN1 = (pte >> 20) & TWELVE_BIT_MASK; // 12 bits - uint32_t PPN0 = (pte >> 10) & TEN_BIT_MASK; // Extract PPN[0] (bits 19-10) // 10 bits - this->PPN_ = (PPN1 << 10) | PPN0; // Combine PPN1 and PPN0 to form the full PPN // 22 bits total - decodePTEFields_(pte); - } - - template <> - void PageTableEntry::setUnusedBits_(uint32_t unusedBits){ - (void)unusedBits; - unUsedBits_ = 0; //unUsedBits not present in PTE - } - - template <> - void PageTableEntry::setPPN_(uint32_t ppn) {PPN_ = ppn;} // Setter for full PPN - - template <> // Setter for lower 10 bits (PPN0) - void PageTableEntry::setPPN0_(uint32_t ppn0) { - PPN_ &= ~0x3FF; // Clear the lower 10 bits (PPN0) - PPN_ |= (ppn0 & 0x3FF); // Set the lower 10 bits (PPN0) - } - - template <> // Setter for upper 12 bits (PPN1) - void PageTableEntry::setPPN1_(uint32_t ppn1) { - PPN_ &= ~(0xFFF << 10); // Clear bits 21-10 (PPN1) - PPN_ |= (ppn1 & 0xFFF) << 10; // Set bits 21-10 (PPN1) - } - - template <> - uint32_t PageTableEntry::getPPN() const {return PPN_;} - - template <> - uint32_t PageTableEntry::getPPN1() const {return (PPN_ >> 10) & 0xFFF;} // 12 bits for PPN1 - - template <> - uint32_t PageTableEntry::getPPN0() const {return PPN_ & 0x3FF;} // 10 bits for PPN0 - - template <> - uint32_t PageTableEntry::getUnusedBits() const {return 0;} - - template - void PageTableEntry::decodePTEFields_(xLen pte) { - RSW_ = (pte >> 8) & TWO_BIT_MASK; // Extract RSW_ (bits 9-8) // 2 bits - D_ = pte & PTE_D_MASK; // Extract D_ (Dirty bit, bit 7) // 1 bit - A_ = pte & PTE_A_MASK; // Extract A_ (Accessed bit, bit 6) // 1 bit - G_ = pte & PTE_G_MASK; // Extract G_ (Global bit, bit 5) // 1 bit - U_ = pte & PTE_U_MASK; // Extract U_ (User-mode bit, bit 4) // 1 bit - X_ = pte & PTE_X_MASK; // Extract X_ (Execute bit, bit 3) // 1 bit - W_ = pte & PTE_W_MASK; // Extract W_ (Write bit, bit 2) // 1 bit - R_ = pte & PTE_R_MASK; // Extract R_ (Read bit, bit 1) // 1 bit - V_ = pte & PTE_V_MASK; // Extract V_ (Valid bit, bit 0) // 1 bit - } -} \ No newline at end of file diff --git a/core/PageTableWalker.cpp b/core/PageTableWalker.cpp index 414d499..626ed85 100644 --- a/core/PageTableWalker.cpp +++ b/core/PageTableWalker.cpp @@ -3,6 +3,8 @@ // #include "../include/AtlasTypes.hpp" +#include "PageTableWalker.hpp" +#include "PageTableEntry.hpp" namespace atlas { @@ -31,7 +33,6 @@ namespace atlas // corresponding to the original access type if (!entry.isValid() || ((!entry.canRead()) && entry.canWrite())) { - std::cout << "throwing page-fault exception" << std::endl; throw std::runtime_error("page-fault exception"); } // TODO: maybe this should be in PageTableWalk method itself, as this should be controlling diff --git a/core/PageTableWalker.hpp b/core/PageTableWalker.hpp index a819a76..c1104f7 100644 --- a/core/PageTableWalker.hpp +++ b/core/PageTableWalker.hpp @@ -1,6 +1,10 @@ // // Created by skhan on 11/20/24. // +#pragma once + +#include "AtlasState.hpp" + namespace atlas { @@ -124,6 +128,4 @@ namespace atlas uint32_t sv32PageTableWalk(uint32_t, uint32_t, AtlasState*); }; -} // namespace atlas - -#include "PageTableWalker.cpp" \ No newline at end of file +} // namespace atlas \ No newline at end of file From da3d3c21939452e027de3c0bd479133e86cd3339 Mon Sep 17 00:00:00 2001 From: Shiraz Anwar Khan Date: Thu, 12 Dec 2024 18:53:53 -0500 Subject: [PATCH 8/9] Modified the VA structures to remove code redundancy- Resolved PR comments-3. --- core/PageTable.hpp | 77 ++++++++------ core/PageTableEntry.hpp | 97 ++++++++++++----- core/PageTableWalker.cpp | 22 ++-- core/PageTableWalker.hpp | 140 +++++++------------------ test/core/translate/Translate_test.cpp | 4 +- 5 files changed, 173 insertions(+), 167 deletions(-) diff --git a/core/PageTable.hpp b/core/PageTable.hpp index b84b756..ae68c6f 100644 --- a/core/PageTable.hpp +++ b/core/PageTable.hpp @@ -16,14 +16,11 @@ namespace atlas bool isValidIndex(uint32_t idx) { uint32_t pte_size = (Mode == MMUMode::SV32) ? sizeof(RV32) : sizeof(RV64); - return ((idx >= baseAddressOfpageTable) && - (idx < ((max_entries * pte_size) + baseAddressOfpageTable))); + return ((idx >= baseAddressOfpageTable) + && (idx < ((max_entries * pte_size) + baseAddressOfpageTable))); } - size_t size() const - { - return pageTable.size(); - } + size_t size() const { return pageTable.size(); } uint16_t getMaxNumEntries() const { @@ -35,68 +32,88 @@ namespace atlas } public: - std::map> pageTable; // uint32_t accommodates all types of VPNs for addressing the PTE + std::map> + pageTable; // uint32_t accommodates all types of VPNs for addressing the PTE - PageTable(uint32_t baseAddr) - : max_entries(getMaxNumEntries()), baseAddressOfpageTable(baseAddr) {} + PageTable(uint32_t baseAddr) : + max_entries(getMaxNumEntries()), + baseAddressOfpageTable(baseAddr) + { + } void addEntry(uint32_t index, PageTableEntry entry) { - if (size() <= max_entries && isValidIndex(index)) { + if (size() <= max_entries && isValidIndex(index)) + { auto it = pageTable.find(index); - if (it != pageTable.end()) { + if (it != pageTable.end()) + { it->second = entry; // Update the existing entry - } else { + } + else + { pageTable.insert({index, entry}); // Insert the new entry } - } else { - throw std::runtime_error("Page table has reached its maximum capacity or index is out of bounds!"); + } + else + { + throw std::runtime_error( + "Page table has reached its maximum capacity or index is out of bounds!"); } } PageTableEntry getEntry(uint32_t index) { - if (isValidIndex(index)) { + if (isValidIndex(index)) + { auto it = pageTable.find(index); - if (it != pageTable.end()) { + if (it != pageTable.end()) + { return it->second; - } else { + } + else + { throw std::out_of_range("Index not found in the page table"); } - } else { + } + else + { throw std::out_of_range("Invalid index"); } } void removeEntry(uint32_t index) { - if (isValidIndex(index)) { + if (isValidIndex(index)) + { auto it = pageTable.find(index); - if (it != pageTable.end()) { + if (it != pageTable.end()) + { pageTable.erase(it); - } else { + } + else + { throw std::out_of_range("Index not found in the page table"); } - } else { + } + else + { throw std::out_of_range("Invalid index"); } } - bool contains(uint32_t index) const - { - return pageTable.find(index) != pageTable.end(); - } + bool contains(uint32_t index) const { return pageTable.find(index) != pageTable.end(); } - void print(std::ostream &os) const + void print(std::ostream & os) const { - for (const auto &[index, entry] : pageTable) { + for (const auto & [index, entry] : pageTable) + { os << "Index: " << index << " | PTE: " << entry.getPTE() << std::endl; } } }; - template - std::ostream &operator<<(std::ostream &os, const PageTable &pt) + template std::ostream & operator<<(std::ostream & os, const PageTable & pt) { pt.print(os); return os; diff --git a/core/PageTableEntry.hpp b/core/PageTableEntry.hpp index 3ddf14e..b01ed5c 100644 --- a/core/PageTableEntry.hpp +++ b/core/PageTableEntry.hpp @@ -37,74 +37,117 @@ namespace atlas public: PageTableEntry(xLen pte) { - if constexpr (Mode == MMUMode::SV32) { + if constexpr (Mode == MMUMode::SV32) + { pageTableEntryValue_ = pte; - unUsedBits_ = 0; // no such field exist here hence 0 + unUsedBits_ = 0; // no such field exist here hence 0 uint32_t PPN1 = (pte >> 20) & TWELVE_BIT_MASK; // 12 bits - uint32_t PPN0 = (pte >> 10) & TEN_BIT_MASK; // Extract PPN[0] (bits 19-10) // 10 bits - this->PPN_ = (PPN1 << 10) | PPN0; // Combine PPN1 and PPN0 to form the full PPN // 22 bits total + uint32_t PPN0 = + (pte >> 10) & TEN_BIT_MASK; // Extract PPN[0] (bits 19-10) // 10 bits + this->PPN_ = (PPN1 << 10) + | PPN0; // Combine PPN1 and PPN0 to form the full PPN // 22 bits total decodePTEFields_(pte); } } // Getter methods for each field xLen getPTE() const { return pageTableEntryValue_; } + uint32_t getUnusedBits() const { return (Mode == MMUMode::SV32) ? 0 : unUsedBits_; } + uint32_t getPPN() const { return PPN_; } - uint32_t getPPN1() const { return (Mode == MMUMode::SV32) ? ((PPN_ >> 10) & 0xFFF) : 0; } // 12 bits for PPN1 - uint32_t getPPN0() const { return (Mode == MMUMode::SV32) ? (PPN_ & 0x3FF) : 0; } // 10 bits for PPN0 + + uint32_t getPPN1() const + { + return (Mode == MMUMode::SV32) ? ((PPN_ >> 10) & 0xFFF) : 0; + } // 12 bits for PPN1 + + uint32_t getPPN0() const + { + return (Mode == MMUMode::SV32) ? (PPN_ & 0x3FF) : 0; + } // 10 bits for PPN0 + uint8_t getRSW() const { return RSW_; } + bool isDirty() const { return D_; } + bool isAccessed() const { return A_; } + bool isGlobal() const { return G_; } + bool isUserMode() const { return U_; } + bool canExecute() const { return X_; } + bool canWrite() const { return W_; } + bool canRead() const { return R_; } + bool isValid() const { return V_; } private: // Setter methods for each field void setPTE_(xLen pte) { pageTableEntryValue_ = pte; } - void setUnusedBits_(uint32_t unusedBits) { - if constexpr (Mode != MMUMode::SV32) { + + void setUnusedBits_(uint32_t unusedBits) + { + if constexpr (Mode != MMUMode::SV32) + { unUsedBits_ = unusedBits; } } + void setPPN_(uint32_t ppn) { PPN_ = ppn; } // Setter for full PPN - void setPPN0_(uint32_t ppn0) { - if constexpr (Mode == MMUMode::SV32) { - PPN_ &= ~0x3FF; // Clear the lower 10 bits (PPN0) - PPN_ |= (ppn0 & 0x3FF); // Set the lower 10 bits (PPN0) + + void setPPN0_(uint32_t ppn0) + { + if constexpr (Mode == MMUMode::SV32) + { + PPN_ &= ~0x3FF; // Clear the lower 10 bits (PPN0) + PPN_ |= (ppn0 & 0x3FF); // Set the lower 10 bits (PPN0) } } - void setPPN1_(uint32_t ppn1) { - if constexpr (Mode == MMUMode::SV32) { - PPN_ &= ~(0xFFF << 10); // Clear bits 21-10 (PPN1) - PPN_ |= (ppn1 & 0xFFF) << 10; // Set bits 21-10 (PPN1) + + void setPPN1_(uint32_t ppn1) + { + if constexpr (Mode == MMUMode::SV32) + { + PPN_ &= ~(0xFFF << 10); // Clear bits 21-10 (PPN1) + PPN_ |= (ppn1 & 0xFFF) << 10; // Set bits 21-10 (PPN1) } } + void setRSW_(uint8_t rsw) { RSW_ = rsw & 0x3; } // Mask to ensure it's a 2-bit value + void setDirty_(bool d) { D_ = d; } + void setAccessed_(bool a) { A_ = a; } + void setGlobal_(bool g) { G_ = g; } + void setUserMode_(bool u) { U_ = u; } + void setExecute_(bool x) { X_ = x; } + void setWrite_(bool w) { W_ = w; } + void setRead_(bool r) { R_ = r; } + void setValid_(bool v) { V_ = v; } - void decodePTEFields_(xLen pte) { - if constexpr (Mode == MMUMode::SV32) { - RSW_ = (pte >> 8) & TWO_BIT_MASK; // Extract RSW_ (bits 9-8) // 2 bits - D_ = pte & PTE_D_MASK; // Extract D_ (Dirty bit, bit 7) // 1 bit - A_ = pte & PTE_A_MASK; // Extract A_ (Accessed bit, bit 6) // 1 bit - G_ = pte & PTE_G_MASK; // Extract G_ (Global bit, bit 5) // 1 bit - U_ = pte & PTE_U_MASK; // Extract U_ (User-mode bit, bit 4) // 1 bit - X_ = pte & PTE_X_MASK; // Extract X_ (Execute bit, bit 3) // 1 bit - W_ = pte & PTE_W_MASK; // Extract W_ (Write bit, bit 2) // 1 bit - R_ = pte & PTE_R_MASK; // Extract R_ (Read bit, bit 1) // 1 bit - V_ = pte & PTE_V_MASK; // Extract V_ (Valid bit, bit 0) // 1 bit + void decodePTEFields_(xLen pte) + { + if constexpr (Mode == MMUMode::SV32) + { + RSW_ = (pte >> 8) & TWO_BIT_MASK; // Extract RSW_ (bits 9-8) // 2 bits + D_ = pte & PTE_D_MASK; // Extract D_ (Dirty bit, bit 7) // 1 bit + A_ = pte & PTE_A_MASK; // Extract A_ (Accessed bit, bit 6) // 1 bit + G_ = pte & PTE_G_MASK; // Extract G_ (Global bit, bit 5) // 1 bit + U_ = pte & PTE_U_MASK; // Extract U_ (User-mode bit, bit 4) // 1 bit + X_ = pte & PTE_X_MASK; // Extract X_ (Execute bit, bit 3) // 1 bit + W_ = pte & PTE_W_MASK; // Extract W_ (Write bit, bit 2) // 1 bit + R_ = pte & PTE_R_MASK; // Extract R_ (Read bit, bit 1) // 1 bit + V_ = pte & PTE_V_MASK; // Extract V_ (Valid bit, bit 0) // 1 bit } } }; diff --git a/core/PageTableWalker.cpp b/core/PageTableWalker.cpp index 626ed85..d76c453 100644 --- a/core/PageTableWalker.cpp +++ b/core/PageTableWalker.cpp @@ -12,14 +12,22 @@ namespace atlas uint32_t PageTableWalker::sv32PageTableWalk(uint32_t virtAddr, uint32_t satpRegVal, AtlasState* state) { - uint32_t PTE_SIZE = sizeof(RV32); - Va32 va(virtAddr); + uint32_t PTEaddresss, ptbaseAddress; + const uint32_t PTE_SIZE = sizeof(RV32); + const uint32_t offset = extractOffset(virtAddr, MMUMode::SV32); + const std::vector vpnValues = extractVPN(virtAddr, MMUMode::SV32); // TODO: getBaseAddrFromSatpReg(); - const uint32_t PDEaddresss = satpRegVal + va.vpn1() * PTE_SIZE; - const uint32_t ptbaseAddress = getPFN(PDEaddresss, state); - const uint32_t pteAddress = ptbaseAddress + va.vpn0() * PTE_SIZE; - const uint32_t PhyMembaseAddress = getPFN(pteAddress, state); - const uint32_t PhyMemFrameAddress = PhyMembaseAddress + va.offset() * PTE_SIZE; + int vpnVectorIndex = vpnValues.size() - 1; + ptbaseAddress = satpRegVal; + while (vpnVectorIndex > (-1)) + { + PTEaddresss = ptbaseAddress + vpnValues[vpnVectorIndex] * PTE_SIZE; + ptbaseAddress = getPFN(PTEaddresss, state); + vpnVectorIndex--; + } + const uint32_t PhyMemFrameAddress = + ptbaseAddress + + offset * PTE_SIZE; // ptbaseAddress points to the Physical Memory base Address return PhyMemFrameAddress; } diff --git a/core/PageTableWalker.hpp b/core/PageTableWalker.hpp index c1104f7..a5013d6 100644 --- a/core/PageTableWalker.hpp +++ b/core/PageTableWalker.hpp @@ -7,123 +7,61 @@ namespace atlas { - - struct Va32Bits - { - unsigned offset_ : 12; - unsigned vpn0_ : 10; - unsigned vpn1_ : 10; - } __attribute__((packed)); - - union Va32 + // TODO: A template class based on Mode, all methods will work according to the mode, hence + // methods will also be template + class PageTableWalker { - Va32Bits bits_; - uint32_t data_ = 0; - - Va32(uint32_t word) : data_(word) {} - uint32_t offset() const { return bits_.offset_; } + const std::vector offsets_{12, 12, 12}; + const std::vector> vpn_ = { + {10, 10}, // Sv32 + {9, 9, 9}, // Sv39 + {9, 9, 9, 9} // Sv48 + }; - uint32_t vpn0() const { return bits_.vpn0_; } - - uint32_t vpn1() const { return bits_.vpn1_; } - - uint32_t vpn(int i) const + inline uint32_t getMMUModeOffset(MMUMode mmu_mode) { - if (i == 0) - return vpn0(); - if (i == 1) - return vpn1(); - // assert(0); - return 0; + return offsets_.at(static_cast(mmu_mode)); } - }; - - struct Va39Bits - { - unsigned offset_ : 12; - unsigned vpn0_ : 9; - unsigned vpn1_ : 9; - unsigned vpn2_ : 9; - } __attribute__((packed)); - - /// 39-bit virtual address. - union Va39 - { - Va39Bits bits_; - uint64_t data_ = 0; - - Va39(uint64_t data) : data_(data) {} - - uint64_t offset() const { return bits_.offset_; } - uint64_t vpn0() const { return bits_.vpn0_; } - - uint64_t vpn1() const { return bits_.vpn1_; } - - uint64_t vpn2() const { return bits_.vpn2_; } - - uint64_t vpn(int i) const + inline uint32_t getMMUModeVPNBits(MMUMode mmu_mode, int index) { - if (i == 0) - return vpn0(); - if (i == 1) - return vpn1(); - if (i == 2) - return vpn2(); - // assert(0); - return 0; + const auto & vpn_bits = vpn_.at(static_cast(mmu_mode)); + if (index >= ((int)vpn_bits.size())) + { + throw std::out_of_range("VPN index out of range for MMU mode"); + } + return vpn_bits[index]; } - }; - /// Structure to unpack the fields of Sv48 virtual address. - struct Va48Bits - { - unsigned offset_ : 12; - unsigned vpn0_ : 9; - unsigned vpn1_ : 9; - unsigned vpn2_ : 9; - unsigned vpn3_ : 9; - } __attribute__((packed)); - - /// 48-bit virtual address. - union Va48 - { - Va48Bits bits_; - uint64_t data_ = 0; - - Va48(uint64_t data) : data_(data) {} - - uint64_t offset() const { return bits_.offset_; } - - uint64_t vpn0() const { return bits_.vpn0_; } - - uint64_t vpn1() const { return bits_.vpn1_; } - - uint64_t vpn2() const { return bits_.vpn2_; } - - uint64_t vpn3() const { return bits_.vpn2_; } + std::vector getMMUModeVPNs(MMUMode mmu_mode) + { + return vpn_.at(static_cast(mmu_mode)); + } - uint64_t vpn(int i) const + uint32_t extractOffset(uint32_t virtualAddress, MMUMode mode) { - if (i == 0) - return vpn0(); - if (i == 1) - return vpn1(); - if (i == 2) - return vpn2(); - if (i == 3) - return vpn3(); - // assert(0); - return 0; + uint32_t offsetBitsSize = getMMUModeOffset(mode); + return virtualAddress + & ((1 << offsetBitsSize) - 1); // Mask to extract the lower 'offsetBitsSize' bits } - }; - class PageTableWalker - { + std::vector extractVPN(uint32_t virtualAddress, MMUMode mode) + { + std::vector vpnValues; + std::vector vpn_bits = getMMUModeVPNs(mode); + uint32_t shift = getMMUModeOffset(mode); + for (uint32_t bits : vpn_bits) + { + vpnValues.push_back((virtualAddress >> shift) & ((1 << bits) - 1)); + shift += bits; + } + return vpnValues; + } public: PageTableWalker() {} + uint32_t getPFN(uint32_t, AtlasState*); uint32_t sv32PageTableWalk(uint32_t, uint32_t, AtlasState*); }; diff --git a/test/core/translate/Translate_test.cpp b/test/core/translate/Translate_test.cpp index 62f7b5a..88abfed 100644 --- a/test/core/translate/Translate_test.cpp +++ b/test/core/translate/Translate_test.cpp @@ -120,7 +120,7 @@ class AtlasTranslateTester void testPageTable() // unit test for PageTable.cpp { uint32_t pa = 0x7B1EEFF; - uint32_t PTE_SIZE = sizeof(atlas::RV32); //since test is for SV32 + uint32_t PTE_SIZE = sizeof(atlas::RV32); // since test is for SV32 uint32_t baseAddrOfPT = 0xFFFF0000; atlas::PageTable pt(baseAddrOfPT); atlas::PageTableEntry sv32PTE1( @@ -174,7 +174,7 @@ class AtlasTranslateTester atlas::PageTableWalker walker; uint32_t PTE_SIZE = sizeof(atlas::RV32); uint32_t va = 0x143FFABC; //{vpn[1]-->0x50-->d(80) , vpn[1]-->0xFF-->d(1023) , - //offset-->0xABC-->d(2748)} + // offset-->0xABC-->d(2748)} uint32_t satpBaseAddress = 0xFFFF0000; // base address of PD uint32_t pdeAddress = satpBaseAddress + (80 * PTE_SIZE); uint32_t pdeVal = 0x7B1EEFF; From abe868b88010a6e880e28642e1e2233388b2e13b Mon Sep 17 00:00:00 2001 From: Shiraz Anwar Khan Date: Fri, 13 Dec 2024 13:40:06 -0500 Subject: [PATCH 9/9] Fix to Avoid clangformat error in regression tests --- cosim/AtlasCoSim.cpp | 3 ++- system/AtlasSystem.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cosim/AtlasCoSim.cpp b/cosim/AtlasCoSim.cpp index 231030f..2180316 100644 --- a/cosim/AtlasCoSim.cpp +++ b/cosim/AtlasCoSim.cpp @@ -138,7 +138,8 @@ namespace atlas // Find event in the event list const cosim::EventList & event_list = event_list_.at(hart_id); - auto it = std::find_if(event_list.begin(), event_list.end(), [event](const cosim::Event & e) + auto it = std::find_if(event_list.begin(), event_list.end(), + [event](const cosim::Event & e) { return e.getEuid() == event->getEuid(); }); sparta_assert(it != event_list.end(), "Event not found in event list!"); diff --git a/system/AtlasSystem.cpp b/system/AtlasSystem.cpp index 3ceebcb..12b2bc2 100644 --- a/system/AtlasSystem.cpp +++ b/system/AtlasSystem.cpp @@ -27,8 +27,8 @@ namespace atlas if (memory_section.data != nullptr) { std::cout << " -- Loading section " << memory_section.name << " (" << std::dec - << memory_section.file_size << "B) " << " to 0x" << std::hex - << memory_section.start_address << std::endl; + << memory_section.file_size << "B) " + << " to 0x" << std::hex << memory_section.start_address << std::endl; bool success = memory_map_->tryPoke(memory_section.start_address, memory_section.file_size, memory_section.data); if (!success)