cva6/commit_stage.sv
Florian Zaruba 05f2a69c5f First test with back to back ALU instructions
This commit implements a very basic testbench that which reads from an
instruction file and supplies the instructions upon request to the IF
unit. The IF Unit is primarily the same as in RI5CY but does not
implement control flow changes of any kind at the moment. It is
furthermore more decoupled from the rest of the pipeline as it is done
in all major processors:

The processor requests instruction from the IF stage and acknowledges
them. At the moment the processor only supports 64bit register register
instructions, NOP and load immediate (ADDI). Results are written back by
the simple commit unit.
2017-04-17 17:50:41 +02:00

51 lines
No EOL
1.3 KiB
Systemverilog

/* File: commit_stage.sv
* Author: Florian Zaruba <zarubaf@ethz.ch>
* Date: 15.4.2017
*
* Copyright (C) 2017 ETH Zurich, University of Bologna
* All rights reserved.
*
* Description: Commits the architectural state resulting from the scoreboard.
*/
import ariane_pkg::*;
module commit_stage (
input logic clk_i, // Clock
input logic rst_ni, // Asynchronous reset active low
output priv_lvl_t priv_lvl_o, // privilege level out
output exception exception_o, // take exception to controller and if
// from scoreboard
input scoreboard_entry commit_instr_i,
output logic commit_ack_o,
// to register file
output logic[4:0] waddr_a_o,
output logic[63:0] wdata_a_o,
output logic we_a_o
);
assign waddr_a_o = commit_instr_i.rd;
assign wdata_a_o = commit_instr_i.result;
// commit instruction
always_comb begin : commit
// default assignments
commit_ack_o = 1'b0;
we_a_o = 1'b0;
if (commit_instr_i.valid) begin
we_a_o = 1'b1;
commit_ack_o = 1'b1;
end
end
// write register file
// CSR logic
// privilege check
// exception logic
endmodule