建议采用异步复位,同步释放。代码如下:
process(clkin,async_rst)
begin
if async_rst='0' then
Sync_rst1 <= '0';
elsif clkin'event and clkin='1' then
Sync_rst1 <= '1';
end if;
end process;
process(clkin,async_rst)
begin
if async_rst='0' then
Sync_rst2 <= '0';
elsif clkin'event and clkin='1' then
Sync_rst2 <= Sync_rst1;
end if;
end process;
sync_rst <= Sync_rst2;