File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ module hwpe_ctrl_regfile_ff #(
4141 output logic [NumWords- 1 : 0 ][DataWidth- 1 : 0 ] MemContent_o
4242);
4343
44+ logic [DataWidth- 1 : 0 ] r_data_d, r_data_q;
4445logic [NumWords- 1 : 0 ][DataWidth- 1 : 0 ] data_d, data_q;
4546
4647logic clk_int;
@@ -50,7 +51,20 @@ assign enable = WriteEnable_i & (WriteAddr_i <= NumWords);
5051
5152assign clkg_en = enable | clear_i;
5253
53- assign ReadData_o = (ReadEnable_i && (ReadAddr_i <= NumWords)) ? data_q[ReadAddr_i] : '0 ;
54+ // Output read with 1 cycle latency
55+ always_ff @ (posedge clk_i, negedge rst_ni) begin
56+ if (~ rst_ni)
57+ r_data_q <= '0 ;
58+ else begin
59+ if (clear_i)
60+ r_data_q <= '0 ;
61+ else
62+ r_data_q <= r_data_d;
63+ end
64+ end
65+
66+ assign r_data_d = (ReadEnable_i && (ReadAddr_i <= NumWords)) ? data_q[ReadAddr_i] : '0 ;
67+ assign ReadData_o = r_data_q;
5468
5569tc_clk_gating i_we_clkg (
5670 .clk_i ( clk_i ),
You can’t perform that action at this time.
0 commit comments