simulink - 在 Simulink/System Generator 中为黑匣子配置时钟信号
问题描述
我使用代码 VHDL 通过 System Generator 的“黑匣子”在 Simulink 中制作一次性计时器。该模块得出的输入是:clk、en、触发器、延迟和输出是:pluse。现在我想使用 System Generator 在 Zynq 7020 上实现并使用时钟频率 = 1.562Mhz。我读了“ug897-vivado-system generator-user”,但我仍然不知道如何配置 clk。
Matlab/Simulink 中的图表
一次性定时器/黑盒的 VHDL 代码
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
library UNISIM;
use UNISIM.VComponents.all;
entity oneshot is
port ( clk : in STD_LOGIC;
ce : in STD_LOGIC;
trigger : in STD_LOGIC:='0';
delay : in STD_LOGIC_VECTOR (7 downto 0);
pulse : out STD_LOGIC :='0');
end oneshot;
architecture Behavioral of oneshot is
signal count: INTEGER range 0 to 255; -- count variable
signal bus_rising_edge : boolean;
signal input_sync : std_logic_vector(0 to 2);
begin
input_syncronizer : process(clk) begin
if rising_edge(clk) then
input_sync <= to_x01(trigger)&input_sync(0 to 1);
end if;
end process ;
bus_rising_edge <= input_sync(0 to 1) = "10";
trigger_process: process (clk)
begin
-- wait for trigger leading edge
if rising_edge(clk) then
if bus_rising_edge then
pulse <= '1';
count <= to_integer(unsigned(delay));
elsif count > 1 then
pulse <= '1';
count <= count - 1;
else
pulse <= '0';
end if;
end if;
end process;
end Behavioral;
Matlab 代码在导入 VHDL 代码时自动创建 https://drive.google.com/open?id=1jfztL-NgftDc7VAgAX4eHfuJF8uOgK3V
(对不起,我无法正确发布我的代码)
解决方案
您可以双击系统生成器标记并选择时钟选项卡并更改时钟周期。该时钟用于模拟。实际上,您的操作时钟是您板上的时钟。
推荐阅读
- react-native - 如何在本机反应中使用状态钩子来动态创建组件
- ios - 没有为给定的视图控制器注册本机启动画面。首先为给定的视图控制器调用“splashscreen.show”
- javascript - 仅使用解析和 Math.random 从 JSON 中获取随机值,没有循环、数组和 Object.keys
- grid - 如何将 QML 中的项目包装和堆叠成行和列
- python - 如何使用opencv获取轮廓作为图像
- python-3.x - 在 python 中导入包时遇到问题
- postgresql - 将记录从一个表插入到另一个表,然后删除插入的记录
- delphi - 如何在不重新安装整个 JVCL 库的情况下修复 JvYearGrid 控件的小错误
- python - 返回 2 个或更多 dfs 的函数 - 如何在 main() 函数中调用它?
- python - 如何使用 Python 操作 CSV 中特定索引中的所有项目?