update halt condition fixed in design onboarding
This commit is contained in:
@@ -58,25 +58,30 @@ module cpu_top (
|
|||||||
assign result = result_src ? dsram_rdata_i : alu_result;
|
assign result = result_src ? dsram_rdata_i : alu_result;
|
||||||
|
|
||||||
logic ebreak_latch;
|
logic ebreak_latch;
|
||||||
|
logic halted_latch;
|
||||||
logic load_stall;
|
logic load_stall;
|
||||||
logic load_stall_cycle;
|
logic load_stall_cycle;
|
||||||
logic load_stall_ff;
|
logic load_stall_ff;
|
||||||
|
|
||||||
assign load_stall_ff = (load_stall & ~load_stall_cycle);
|
assign load_stall_ff = (load_stall & ~load_stall_cycle);
|
||||||
|
|
||||||
assign stall_core = ebreak_latch | halted_o | ~en_i | load_stall_ff;
|
assign stall_core = halted_latch | ebreak_latch | ~en_i | load_stall_ff;
|
||||||
|
|
||||||
always_ff @(posedge clk_i) begin
|
always_ff @(posedge clk_i) begin
|
||||||
if (rst_i) begin
|
if (rst_i) begin
|
||||||
halted_o <= 1'b0;
|
halted_o <= 1'b0;
|
||||||
|
halted_latch <= 1'b0;
|
||||||
load_stall_cycle <= 1'b0;
|
load_stall_cycle <= 1'b0;
|
||||||
end else if (ebreak_latch) halted_o <= 1'b1;
|
end else begin
|
||||||
else if (load_stall & ~load_stall_cycle) begin
|
halted_o <= ebreak_latch & ~halted_latch;
|
||||||
|
if (ebreak_latch) halted_latch <= 1'b1;
|
||||||
|
if (load_stall & ~load_stall_cycle) begin
|
||||||
load_stall_cycle <= 1'b1;
|
load_stall_cycle <= 1'b1;
|
||||||
end else if (load_stall & load_stall_cycle) begin
|
end else if (load_stall & load_stall_cycle) begin
|
||||||
load_stall_cycle <= 1'b0;
|
load_stall_cycle <= 1'b0;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
// === Instruction Fetch === //
|
// === Instruction Fetch === //
|
||||||
// certain ports are tied off bc they depend on modulees you need to implement.
|
// certain ports are tied off bc they depend on modulees you need to implement.
|
||||||
|
|||||||
Reference in New Issue
Block a user