如何在时钟信号的上升沿设置位和在下降沿重置该位?我想知道我怎样才能做到这一点。根据我想要在上升沿设置和在下降沿重置的条件。这就像在输出端获得时钟脉冲一样。
我实现了两个不同的时钟脉冲,但我得到了这样的小故障。

我的代码是这样的
process(clk)
begin
if rising_edge(clk) then
d0 <= new_data;
end if;
end process;
process(clk)
begin
if falling_edge(clk) then
d1 <= new_data;
end if;
end process;
out <= d0 when clk = '1' else d1;

发布于 2013-09-07 00:23:00
如果你想要DDR数据,我只能看到你真的想这样做,有很多方法可以对其进行建模。如果需要合成,请实例化相应的供应商原语
但是,对于模型:
process(clk)
begin
-- you could use this
if clock'event = '1' then
bit <= new_data;
end if;
-- or this
if rising_edge(clk) ot falling_edge(clk) then
bit <= new_data;
end if;
end process;您还可以将其建模为两个进程和一个多路复用
process(clk)
begin
if rising_edge(clk) then
d0 <= new_data;
end if;
end process;
process(clk)
begin
if falling_edge(clk) then
d1 <= new_data;
end if;
end process;
out <= d0 when clk = '1' else d1;发布于 2013-09-07 06:40:05
现在已经看到了波形,您可以执行以下操作以获得无毛刺的脉冲序列
process(clk)
begin
if falling_edge(clk) then
if pass_next_clock = '1' then
mask <= '1';
else
mask <= '0';
end if;
end if;
end process;
pulse <= clk and mask;这需要一个名为pass_next_clock的信号,该信号可以与任一时钟沿对齐,以表示您希望输出下一个时钟高电平脉冲。
发布于 2013-09-07 10:36:58
好了,我把它弄好了。我的最终代码如下所示
shared variables d0 ,d1 : std_logic;
process(clk)
begin
if rising_edge(clk) then
d0 := new_data;
end if;
end process;
process(clk)
begin
if falling_edge(clk) then
d1 := new_data;
end if;
end process;
out <= d0 when clk = '1' else d1;

https://stackoverflow.com/questions/18661936
复制相似问题