summaryrefslogtreecommitdiff
path: root/inc/definitions.h
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-29 22:14:42 -0400
committerGitHub <noreply@github.com>2025-03-29 22:14:42 -0400
commitb3566a17da8081147dba3711d415385450ed6019 (patch)
treecf5d6872eec0cf50d1831137a337bbbdfbee0ff1 /inc/definitions.h
parent495a8af3a90257e491c063730bccf86e34e153fa (diff)
parentd8e33f871bfb8dbfbad3fa0d7e1e13af5bcde830 (diff)
Merge pull request #37 from bdunahu/bdunahu
Instr, InstrDTO gets/sets, other structures required for decode -- tests as we move forward -- base classes -- decode stage implemented
Diffstat (limited to 'inc/definitions.h')
-rw-r--r--inc/definitions.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/inc/definitions.h b/inc/definitions.h
index ff2f7c6..3238a8b 100644
--- a/inc/definitions.h
+++ b/inc/definitions.h
@@ -11,6 +11,10 @@
* The total number of words in a line
*/
#define LINE_SIZE static_cast<int>(pow(2, 2))
+/**
+ * Number of bits in a word
+ */
+#define WORD_SPEC 32
/**
* The number of bits to specify a memory word
@@ -28,7 +32,8 @@
* The total number of lines in l1 cache
*/
#define L1_CACHE_WORD_SPEC 7
-#define L1_CACHE_LINE_SPEC static_cast<unsigned int>(L1_CACHE_WORD_SPEC - LINE_SPEC)
+#define L1_CACHE_LINE_SPEC \
+ static_cast<unsigned int>(L1_CACHE_WORD_SPEC - LINE_SPEC)
#define L1_CACHE_LINES static_cast<int>(pow(2, L1_CACHE_LINE_SPEC))
/**
@@ -47,6 +52,31 @@
#define GPR_NUM 16
/**
+ * The number of vector registers
+ */
+#define V_NUM 8
+
+/**
+ * The number of bits to specify an instruction type
+ */
+#define TYPE_SIZE 2
+
+/**
+ * The number of bits to specify a register
+ */
+#define REG_SIZE 5
+
+/**
+ * The number of bits to specify an R-Type opcode.
+ */
+#define R_OPCODE_SIZE 5
+
+/**
+ * The number of bits to specify an opcode.
+ */
+#define OPCODE_SIZE 4
+
+/**
* Return the N least-significant bits from integer K using a bit mask
* @param the integer to be parsed
* @param the number of bits to be parsed