feat: synthesize hardware free-running clock generator (ixc_uClkGen) for standalone ICE
This commit is contained in:
@@ -34,12 +34,20 @@ module z3_demo_ice_top (
|
|||||||
wire irq;
|
wire irq;
|
||||||
wire cmp_hit;
|
wire cmp_hit;
|
||||||
|
|
||||||
|
// ------------------------------------------------------------ 硬件自激时钟发生器
|
||||||
|
// Palladium 原生支持将此类时钟综合为物理机台内部的硬件自振荡时钟 (ixc_uClkGen)
|
||||||
|
// 无需外接机箱硬件线缆,通电自动全速自振荡
|
||||||
|
reg clk_osc = 1'b0;
|
||||||
|
always #10 clk_osc = ~clk_osc;
|
||||||
|
|
||||||
|
wire clk = clk_osc;
|
||||||
|
|
||||||
// ------------------------------------------------------------ 硬件上电自动复位 (POR)
|
// ------------------------------------------------------------ 硬件上电自动复位 (POR)
|
||||||
// 烧录至机台后自动拉低复位 20 个周期,随后自动释放,无需外部控制台执行容易崩溃的 force
|
// 烧录至机台后自动拉低复位 20 个周期,随后自动释放,无需外部控制台执行容易崩溃的 force
|
||||||
reg [5:0] por_cnt = 6'd0;
|
reg [5:0] por_cnt = 6'd0;
|
||||||
reg por_done = 1'b0;
|
reg por_done = 1'b0;
|
||||||
|
|
||||||
always @(posedge clk_in) begin
|
always @(posedge clk) begin
|
||||||
if (por_cnt < 6'd25) begin
|
if (por_cnt < 6'd25) begin
|
||||||
por_cnt <= por_cnt + 6'd1;
|
por_cnt <= por_cnt + 6'd1;
|
||||||
por_done <= 1'b0;
|
por_done <= 1'b0;
|
||||||
@@ -51,7 +59,7 @@ module z3_demo_ice_top (
|
|||||||
wire effective_rst_n = (rst_n_in === 1'b0) ? 1'b0 : por_done;
|
wire effective_rst_n = (rst_n_in === 1'b0) ? 1'b0 : por_done;
|
||||||
|
|
||||||
z3_demo_top dut (
|
z3_demo_top dut (
|
||||||
.clk (clk_in),
|
.clk (clk),
|
||||||
.rst_n (effective_rst_n),
|
.rst_n (effective_rst_n),
|
||||||
.paddr (paddr),
|
.paddr (paddr),
|
||||||
.psel (psel),
|
.psel (psel),
|
||||||
@@ -111,7 +119,7 @@ module z3_demo_ice_top (
|
|||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
|
|
||||||
always @(posedge clk_in or negedge effective_rst_n) begin
|
always @(posedge clk or negedge effective_rst_n) begin
|
||||||
if (!effective_rst_n) begin
|
if (!effective_rst_n) begin
|
||||||
state <= ST_WAIT;
|
state <= ST_WAIT;
|
||||||
wait_cnt <= 16'd0;
|
wait_cnt <= 16'd0;
|
||||||
|
|||||||
Reference in New Issue
Block a user