Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Fix GPR module to stop X propagation in Xilinx sim
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-marshall committed Sep 5, 2019
1 parent 239fdb0 commit 9e68b4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rtl/core/frv_gprs.v
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ reg [31:0] gprs_odd [15:0];
// Used for debugging.
wire [31:0] gprs [31:0];

assign rs1_data = rs1_addr[0] ? gprs_odd[rs1_addr[4:1]] : gprs_even[rs1_addr[4:1]];
assign rs2_data = rs2_addr[0] ? gprs_odd[rs2_addr[4:1]] : gprs_even[rs2_addr[4:1]];
assign rs3_data = rs3_addr[0] ? gprs_odd[rs3_addr[4:1]] : gprs_even[rs3_addr[4:1]];
assign rs1_data = gprs[rs1_addr];
assign rs2_data = gprs[rs2_addr];
assign rs3_data = gprs[rs3_addr];

wire rd_odd = rd_addr[0];
wire rd_even = !rd_addr[0];
Expand All @@ -56,7 +56,7 @@ generate for(i = 0; i < 16; i = i+1) begin

always @(*) gprs_even[i] = 0;

assign gprs[2*i+0] = gprs_even[i];
assign gprs[2*i+0] = 32'b0;
assign gprs[2*i+1] = gprs_odd [i];

always @(posedge g_clk) if(rd_wen_odd && rd_top == i) begin
Expand Down

0 comments on commit 9e68b4d

Please sign in to comment.