feat: add on-chip hardware POR and fix xeDebug ICE execution script

This commit is contained in:
xuejin.wang
2026-10-20 19:37:43 +08:00
parent 1cc994fac4
commit f63694785e
2 changed files with 39 additions and 11 deletions
+19 -3
View File
@@ -34,9 +34,25 @@ module z3_demo_ice_top (
wire irq;
wire cmp_hit;
// ------------------------------------------------------------ 硬件上电自动复位 (POR)
// 烧录至机台后自动拉低复位 20 个周期,随后自动释放,无需外部控制台执行容易崩溃的 force
reg [5:0] por_cnt = 6'd0;
reg por_done = 1'b0;
always @(posedge clk_in) begin
if (por_cnt < 6'd25) begin
por_cnt <= por_cnt + 6'd1;
por_done <= 1'b0;
end else begin
por_done <= 1'b1;
end
end
wire effective_rst_n = (rst_n_in === 1'b0) ? 1'b0 : por_done;
z3_demo_top dut (
.clk (clk_in),
.rst_n (rst_n_in),
.rst_n (effective_rst_n),
.paddr (paddr),
.psel (psel),
.penable (penable),
@@ -95,8 +111,8 @@ module z3_demo_ice_top (
endcase
end
always @(posedge clk_in or negedge rst_n_in) begin
if (!rst_n_in) begin
always @(posedge clk_in or negedge effective_rst_n) begin
if (!effective_rst_n) begin
state <= ST_WAIT;
wait_cnt <= 16'd0;
rd_latched <= 32'd0;