Implemented SP, $nnnn and XOR A instructions

This commit is contained in:
2021-02-16 23:05:46 +00:00
parent aa92344d10
commit 237a5f1489
6 changed files with 205 additions and 20 deletions

View File

@@ -1,13 +1,49 @@
package cpu_pkg;
//
// 4 | ST0_ADDR -> ST1_DEC -> ST2_EXEC -> ST3_NOP
// 12 | '-> ST2_DEC -> ST3_DEC -> ST4_EXEC -> .... -> ST11_NOP
//
typedef enum {
ST0_ADDR,
ST1_DEC,
ST2_EXEC,
ST2_DEC,
ST3_INC_ADDR,
ST3_DEC,
ST4_EXEC
} state_t;
typedef enum logic [2:0] {
REG8_B = 3'h00,
REG8_C = 3'h01,
REG8_D = 3'h02,
REG8_E = 3'h03,
REG8_H = 3'h04,
REG8_L = 3'h05
} reg8_t;
typedef enum logic [2:0] {
ALU_OP_ADD = 3'h00,
ALU_OP_ADC = 3'h01,
ALU_OP_SUB = 3'h02,
ALU_OP_SBC = 3'h03,
ALU_OP_AND = 3'h04,
ALU_OP_XOR = 3'h05,
ALU_OP_OR = 3'h06,
ALU_OP_CP = 3'h07
} alu_op_t;
typedef enum {
OP_SRC_A,
OP_SRC_REG8
} op_src_t;
typedef enum {
OP_DEST_A
} op_dest_t;
typedef enum {
SP_SRC_OPERAND16
} sp_src_t;
endpackage