diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-10-15 23:33:34 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-10-15 23:33:34 -0600 |
| commit | d7747d9e030f965bd358bca5badb849f656147a8 (patch) | |
| tree | fa1ae553ea9d6b7f073d4386136ab676edcf50c5 /rtl/core/decode | |
| parent | 5b0872c995ddd7f581730ff9c7e145b5228e211d (diff) | |
Fix flags and writeback hazards
Diffstat (limited to 'rtl/core/decode')
| -rw-r--r-- | rtl/core/decode/conds.sv | 10 | ||||
| -rw-r--r-- | rtl/core/decode/decode.sv | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/rtl/core/decode/conds.sv b/rtl/core/decode/conds.sv index 652760d..564ed27 100644 --- a/rtl/core/decode/conds.sv +++ b/rtl/core/decode/conds.sv @@ -5,12 +5,15 @@ module core_decode_conds ( input logic[3:0] cond, input psr_flags flags, + output logic execute, + conditional, undefined ); always_comb begin undefined = 0; + conditional = 1; unique case(cond) `COND_EQ: execute = flags.z; @@ -27,10 +30,15 @@ module core_decode_conds `COND_LT: execute = flags.n ^ flags.v; `COND_GT: execute = ~flags.z & (flags.n ~^ flags.v); `COND_LE: execute = flags.z | (flags.n ^ flags.v); - `COND_AL: execute = 1; + + `COND_AL: begin + execute = 1; + conditional = 0; + end `COND_UD: begin execute = 1'bx; + conditional = 1'bx; undefined = 1; end endcase diff --git a/rtl/core/decode/decode.sv b/rtl/core/decode/decode.sv index 16b53d4..73d3b59 100644 --- a/rtl/core/decode/decode.sv +++ b/rtl/core/decode/decode.sv @@ -7,6 +7,7 @@ module core_decode input psr_flags flags, output logic execute, + conditional, undefined, writeback, update_flags, |
