summaryrefslogtreecommitdiff
path: root/rtl/core/porch
diff options
context:
space:
mode:
Diffstat (limited to 'rtl/core/porch')
-rw-r--r--rtl/core/porch/conds.sv47
-rw-r--r--rtl/core/porch/porch.sv57
2 files changed, 0 insertions, 104 deletions
diff --git a/rtl/core/porch/conds.sv b/rtl/core/porch/conds.sv
deleted file mode 100644
index b8db1e7..0000000
--- a/rtl/core/porch/conds.sv
+++ /dev/null
@@ -1,47 +0,0 @@
-`include "core/decode/isa.sv"
-`include "core/uarch.sv"
-
-module core_porch_conds
-(
- input word insn,
- input psr_flags flags,
-
- output logic execute,
- conditional,
- undefined
-);
-
- always_comb begin
- undefined = 0;
- conditional = 1;
-
- unique case(insn `FIELD_COND)
- `COND_EQ: execute = flags.z;
- `COND_NE: execute = ~flags.z;
- `COND_HS: execute = flags.c;
- `COND_LO: execute = ~flags.c;
- `COND_MI: execute = flags.n;
- `COND_PL: execute = ~flags.n;
- `COND_VS: execute = flags.v;
- `COND_VC: execute = ~flags.v;
- `COND_HI: execute = flags.c & ~flags.z;
- `COND_LS: execute = ~flags.c | flags.z;
- `COND_GE: execute = flags.n ~^ flags.v;
- `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: begin
- execute = 1;
- conditional = 0;
- end
-
- `COND_UD: begin
- execute = 1'bx;
- conditional = 1'bx;
- undefined = 1;
- end
- endcase
- end
-
-endmodule
diff --git a/rtl/core/porch/porch.sv b/rtl/core/porch/porch.sv
deleted file mode 100644
index 060ab91..0000000
--- a/rtl/core/porch/porch.sv
+++ /dev/null
@@ -1,57 +0,0 @@
-`include "core/uarch.sv"
-
-module core_porch
-(
- input logic clk,
- rst_n,
- flush,
- stall,
- input psr_flags flags,
-
- input word fetch_insn,
- input logic fetch_nop,
- fetch_abort,
- input ptr fetch_insn_pc,
- fetch_head,
- input insn_decode fetch_dec,
-
- output word insn,
- output ptr insn_pc,
- output insn_decode dec,
- output logic abort
-);
-
- logic execute, conditional, undefined, nop;
- insn_decode hold_dec;
-
- //FIXME: User mode puede hacer msr o mcr y saltare cualquier lĂ­mite de seguridad
-
- always_comb begin
- dec = hold_dec;
- dec.ctrl.nop = nop;
- dec.ctrl.execute = !flush && dec.ctrl.execute && execute && !nop && !abort;
- dec.ctrl.undefined = !flush && (dec.ctrl.undefined || undefined);
- dec.ctrl.conditional = !flush && (dec.ctrl.conditional || conditional);
- end
-
- core_porch_conds conds
- (
- .*
- );
-
- always_ff @(posedge clk or negedge rst_n)
- if(!rst_n) begin
- nop <= 0; // Even though it is a NOP
- insn <= `NOP;
- abort <= 0;
- insn_pc <= 0;
- hold_dec <= {$bits(hold_dec){1'b0}};
- end else if(flush || !stall) begin
- nop <= flush ? 1 : fetch_nop;
- insn <= flush ? `NOP : fetch_insn;
- abort <= flush ? 0 : fetch_abort;
- insn_pc <= flush ? fetch_head : fetch_insn_pc;
- hold_dec <= fetch_dec;
- end
-
-endmodule