summaryrefslogtreecommitdiff
path: root/rtl/core/psr.sv
diff options
context:
space:
mode:
Diffstat (limited to 'rtl/core/psr.sv')
-rw-r--r--rtl/core/psr.sv12
1 files changed, 11 insertions, 1 deletions
diff --git a/rtl/core/psr.sv b/rtl/core/psr.sv
index 0ade723..2c0d48f 100644
--- a/rtl/core/psr.sv
+++ b/rtl/core/psr.sv
@@ -3,13 +3,23 @@
module core_psr
(
input logic clk,
+ update_flags,
+ alu_v_valid,
input psr_flags alu_flags,
output psr_flags flags,
next_flags
);
- assign next_flags = alu_flags; //TODO
+ always_comb begin
+ next_flags = flags;
+
+ if(update_flags) begin
+ next_flags = alu_flags;
+ if(~alu_v_valid)
+ next_flags.v = flags.v;
+ end
+ end
always_ff @(posedge clk)
flags <= next_flags;