~ruther/verilog-riscv-semestral-project

ref: 914e69e6c0df1f4e3f33718891c838e42fe535b1 verilog-riscv-semestral-project/src/stages/fetch.sv -rw-r--r-- 379 bytes
914e69e6 — Rutherther refactor: save pc + 4 in stages 1 year, 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import cpu_types::*;

module fetch(
  input        clk,
  input        flush,
  input [31:0] pc,
  input [31:0] mem_instruction,

  output       stage_status_t stage_out
);
  assign stage_out.instruction.instruction = mem_instruction;

  assign stage_out.pc = pc;
  assign stage_out.pc_plus_4 = pc + 4;

  assign stage_out.valid = !flush;
  assign stage_out.ready = 1;
endmodule
Do not follow this link