From f3b18ead59ae02f95dabbf0a1dea40873a816975 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 21 Jan 2024 06:23:46 -0600 Subject: rtl: refactor filenames and directory hierarchy --- rtl/core/core_control_coproc.sv | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 rtl/core/core_control_coproc.sv (limited to 'rtl/core/core_control_coproc.sv') diff --git a/rtl/core/core_control_coproc.sv b/rtl/core/core_control_coproc.sv new file mode 100644 index 0000000..05ac655 --- /dev/null +++ b/rtl/core/core_control_coproc.sv @@ -0,0 +1,32 @@ +`include "core/uarch.sv" + +module core_control_coproc +( + input logic clk, + rst_n, + + input insn_decode dec, + input word coproc_read, + + input ctrl_cycle next_cycle, + input logic issue, + + output logic coproc, + output word coproc_wb, + output coproc_decode coproc_ctrl +); + + always_ff @(posedge clk or negedge rst_n) + if(!rst_n) begin + coproc <= 0; + coproc_wb <= 0; + coproc_ctrl <= {$bits(coproc_ctrl){1'b0}}; + end else if(next_cycle.issue && issue) begin + coproc <= dec.ctrl.coproc; + coproc_ctrl <= dec.coproc; + end else if(next_cycle.coproc) begin + coproc <= 0; + coproc_wb <= coproc_read; + end + +endmodule -- cgit v1.2.3