From cbe4c2d62fbd850dd37c7308c47bf2d8a9fcffff Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 19 Mar 2025 12:03:12 +0100 Subject: [PATCH] adds comment to indicate purpose of arch state members --- gen_input/templates/CORENAME.h.gtl | 10 +++++----- src/iss/arch/tgc5c.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gen_input/templates/CORENAME.h.gtl b/gen_input/templates/CORENAME.h.gtl index 4cd1e49..80404b0 100644 --- a/gen_input/templates/CORENAME.h.gtl +++ b/gen_input/templates/CORENAME.h.gtl @@ -146,11 +146,11 @@ struct ${coreDef.name.toLowerCase()}: public arch_if { uint${byteSize(reg.size)}_t ${reg.name} = 0;<% }}%> uint32_t trap_state = 0, pending_trap = 0; - uint64_t icount = 0; - uint64_t cycle = 0; - uint64_t instret = 0; - uint32_t instruction = 0; - uint32_t last_branch = 0; + uint64_t icount = 0; // counts number of instructions undisturbed + uint64_t cycle = 0; // counts number of cycles, in functional mode equals icount + uint64_t instret = 0; // counts number of instructions, can be reset via CSR write + uint32_t instruction = 0; // holds op code of currently executed instruction + uint32_t last_branch = 0; // indicates if last branch was taken } reg; #pragma pack(pop) std::array addr_mode; diff --git a/src/iss/arch/tgc5c.h b/src/iss/arch/tgc5c.h index bca4293..11864e6 100644 --- a/src/iss/arch/tgc5c.h +++ b/src/iss/arch/tgc5c.h @@ -237,11 +237,11 @@ struct tgc5c: public arch_if { uint8_t PRIV = 0; uint32_t DPC = 0; uint32_t trap_state = 0, pending_trap = 0; - uint64_t icount = 0; - uint64_t cycle = 0; - uint64_t instret = 0; - uint32_t instruction = 0; - uint32_t last_branch = 0; + uint64_t icount = 0; // counts number of instructions undisturbed + uint64_t cycle = 0; // counts number of cycles, in functional mode equals icount + uint64_t instret = 0; // counts number of instructions, can be reset via CSR write + uint32_t instruction = 0; // holds op code of currently executed instruction + uint32_t last_branch = 0; // indicates if last branch was taken } reg; #pragma pack(pop)