vhdl - 触发非常短的脉冲 - VHDL
问题描述
我正在使用 CMOD A7 (Artix 7),我需要触发一个基于大约 10ns 持续时间的脉冲(蓝线)的过程:
通常我会通过让一个进程不断地将输入行的当前值与使用临时寄存器保存最后一个值的最后一个值进行比较来进行这样的触发。然而,我相信这块板上的振荡器有大约 83ns 的周期,这对于这种方法来说太慢了。
如果我使用的是纯数字电子设备,这很容易,将触发器连接到触发器,轮询触发器的输出(它会随着输入而改变并锁存),然后在我阅读并开始操作后将其重置. 所以我想在VHDL中有一种方法可以做到这一点,但我被引导相信if rising_edge()
在非时钟信号上使用是不行的。
我从哪里开始?
解决方案
So the solution here is twofold:
Firstly, I can derive a 100MHz clock using the onboard MCCM and Vivado's ClockWiz
IP.
I can also use the FDCE
component provided by Vivado to utilise one of the onboard flipflops to extend the pulses and reset it after passing it through a few flipflops for synchronisation.
I've not tested this yet but I believe it should work:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
library unisim;
use unisim.vcomponents.all;
entity input_syncroniser is
generic
(
in_pipe_len: in positive := 5
);
port
(
clk : in STD_LOGIC;
rst : in STD_LOGIC;
din : in STD_LOGIC;
dfo : out STD_LOGIC
);
end input_syncroniser;
architecture behavioural of input_syncroniser is
signal delayed_pulse: std_logic := '0';
signal in_pipe: std_logic_vector(in_pipe_len - 1 downto 0) := (others => '0');
signal pipe_head: std_logic := '0';
begin
FDCE_inst : FDCE
generic map
(
INIT => '0'
)
port map
(
Q => delayed_pulse,
C => din,
CE => '1',
CLR => pipe_head,
D => '1'
);
input_synchroniser: process(clk)
begin
if (rising_edge(clk)) then
in_pipe <= in_pipe(in_pipe'high downto in_pipe'low) & delayed_pulse;
end if;
end process;
pipe_head <= in_pipe(in_pipe'high);
dfo <= pipe_head;
end behavioural;
推荐阅读
- c - 尝试编译 C 文件时出错:mkfifo:无法创建 fifo 'stderr':不支持操作
- python - brew 安装最新的 python3 但 python3 没有更新?
- npm - GatsbyJS - 无法解析“babel-runtime/helpers/possibleConstructorReturn”
- python - 如何为 aws lambda 处理函数(Python)编写单元测试
- html - 使图像的底部有点暗
- amazon-web-services - Cloudfront no_Caching 参数
- applescript - 从 AppleScript 应用程序中运行 AppleScript 脚本
- java - 更改日期选择器主题android java
- python - 网页抓取没有“类”或“ID”标识符的特定部分
- reactjs - 材料ui datagrid复选框行选择不起作用