diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-09-25 19:55:29 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-09-25 19:55:29 -0600 |
| commit | fa370016708149976c748c14eadad1f89cf5a8ea (patch) | |
| tree | 785ca92bebaef645e15f26a97d4892ef2ba2dad9 /rtl/core/psr.sv | |
| parent | 3aa075cf009d9aa8c602389853cc3ea78cda8701 (diff) | |
Refactor CPSR and uarch.sv
Diffstat (limited to 'rtl/core/psr.sv')
| -rw-r--r-- | rtl/core/psr.sv | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/rtl/core/psr.sv b/rtl/core/psr.sv index 1450333..0ade723 100644 --- a/rtl/core/psr.sv +++ b/rtl/core/psr.sv @@ -1,19 +1,19 @@ -`ifndef CORE_PSR_SV -`define CORE_PSR_SV +`include "core/uarch.sv" -typedef struct packed -{ - logic n, z, c, v; -} psr_flags; +module core_psr +( + input logic clk, + input psr_flags alu_flags, -typedef logic[4:0] psr_mode; + output psr_flags flags, + next_flags +); -`define MODE_USR 5'b10000 -`define MODE_FIQ 5'b10001 -`define MODE_IRQ 5'b10010 -`define MODE_SVC 5'b10011 -`define MODE_ABT 5'b10111 -`define MODE_UND 5'b11011 -`define MODE_SYS 5'b11111 + assign next_flags = alu_flags; //TODO -`endif + always_ff @(posedge clk) + flags <= next_flags; + + initial flags = 4'b0000; + +endmodule |
