未外接复位信号,请问spartan有内部“上电复位”信号吗?
时间:10-02
整理:3721RD
点击:
未外接复位信号,请问spartan有内部“上电复位”信号吗?
可使用计数器产生一个复位信号
spartan是基于外部flash的,即每次上电都需要重配置(你可以把配置文件烧录在prom里避免再次烧录,但是实际上重上电时FPGA是自动从prom里再次自我配置的),所以关于是否上电复位,袁芳你怎么看
“可使用计数器产生一个复位信号”
--问题是计数器初始状态如何决定呢
- localparam POWER_UP_RST_LEN=31;
- reg [7:0] power_up_rst_n_cntr;
- reg power_up_rst_n_init;
- // The FPGA will come out of programming with all flops set to 0.
- initial power_up_rst_n_cntr = 8'h0;
- initial power_up_rst_n_init = 1'h0;
- always @(posedge free_run_clk_pin_gbuffer)
- if (power_up_rst_n_cntr!=POWER_UP_RST_LEN)
- power_up_rst_n_cntr <= power_up_rst_n_cntr + 1;
- always @(posedge free_run_clk_pin_gbuffer)
- power_up_rst_n_init <= (power_up_rst_n_cntr==POWER_UP_RST_LEN);
- // assign power_up_rst_n = power_up_rst_n_init & pwr_rst_n_dbg;
- assign power_up_rst_n = power_up_rst_n_init;
谢谢楼上,
此代码需保证 power_up_rst_n_cntr上电为0才行,但FPGA上电,描述的reg是否肯定是0?
貌似初始上电fpga内部是有自动复位的,缺省值为0,查一查用户手册,上面是有说的!
