prototype works

This commit is contained in:
Jose
2026-03-02 23:20:54 +01:00
parent 8f2b31259c
commit e7cd451e7e
62 changed files with 8924 additions and 220 deletions

View File

@@ -0,0 +1,42 @@
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: nope
// Engineer: Jose
//
// Create Date: 02/20/2026 09:21:52 AM
// Design Name: EX/ME register
// Module Name: ex_me
// Project Name: riscv-ac
// Target Devices: Artix 7
// Tool Versions: 2025.2
// Description: Register between EX/ME stages
//
// Dependencies:
//
// Revision: 1.0
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module ex_me (
input clk, rst,
input we_reg_in, we_mem_in, mem_to_reg_in,
output reg we_reg_out, we_mem_out, mem_to_reg_out,
input [31:0] alu_in, regB_in, pc4_in,
input [4:0] rd_in,
output reg [31:0] alu_out, regB_out, pc4_out,
output reg [4:0] rd_out
);
always @(posedge clk or posedge rst) begin
if (rst) begin
we_reg_out <= 0; we_mem_out <= 0; mem_to_reg_out <= 0;
alu_out <= 0; regB_out <= 0; pc4_out <= 0; rd_out <= 0;
end else begin
we_reg_out <= we_reg_in; we_mem_out <= we_mem_in; mem_to_reg_out <= mem_to_reg_in;
alu_out <= alu_in; regB_out <= regB_in; pc4_out <= pc4_in; rd_out <= rd_in;
end
end
endmodule