pipeline rstk_ptr calculations for push

This commit is contained in:
Raphael Jacquot 2019-03-15 11:35:33 +01:00
parent e1aa24d006
commit 12f542441d
2 changed files with 4 additions and 4 deletions

View file

@ -202,7 +202,7 @@ always @(posedge i_clk) begin
end
`ifdef SIM
if (cycle_ctr == 148) begin
if (cycle_ctr == 202) begin
bus_halt <= 1'b1;
$display("BUS %0d: [%d] enough cycles for now", phase, cycle_ctr);
end

View file

@ -219,9 +219,9 @@ always @(posedge i_clk) begin
// o_reload_pc <= 1'b1;
reg_PC <= jump_relative ? jump_next_offset + jump_base : jump_next_offset;
if (i_push_pc) begin
$write(" ( push %5h => RSTK[%0d] )", reg_PC, reg_rstk_ptr + 3'd1);
reg_RSTK[(reg_rstk_ptr + 3'o1)&3'o7] <= reg_PC;
reg_rstk_ptr <= reg_rstk_ptr + 3'd1;
$write(" ( push %5h => RSTK[%0d] )", reg_PC, rstk_ptr_to_push_at);
reg_RSTK[rstk_ptr_to_push_at] <= reg_PC;
reg_rstk_ptr <= rstk_ptr_to_push_at;
end
$write("\n");
end