mirror of
https://github.com/openhwgroup/cva6.git
synced 2025-04-24 14:17:16 -04:00
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.
51 lines
No EOL
1.3 KiB
Systemverilog
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 |