aboutsummaryrefslogtreecommitdiff
path: root/rtl/src/register_file_reg.v
blob: 7d9cc03df3798b77cf6bcbe567acaa0470b69bf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// register file reg:
// Stores outputs of register file for one more clock cycle.

module register_file_reg (
  input             clk, 
  input             rstn,

  input      [31:0] rd1_in, 
  input      [31:0] rd2_in,
  
  output reg [31:0] rd1_buf,
  output reg [31:0] rd2_buf
);

always @ (posedge clk or negedge rstn) begin
  if (!rstn) begin
    rd1_buf <= 32'b0;
    rd2_buf <= 32'b0;
  end else begin
    rd1_buf <= rd1_in;
    rd2_buf <= rd2_in;
  end
end

endmodule