问题描述
注意:电路延迟显示为集总分量。
该电路的当前状态/新状态表是:
对于红色的 1
,我可以写出一个简短的最小项方程,我用它来推导出这个电路的特性方程:
现在很明显输入只是一个否定的输出,所以现在我可以在文件 clock_not.vhdl
内的 VHDL 源代码中设计一个组件。我使用数据流风格,对于简单的信号分配,我写了我上面计算的特征方程:
library ieee;
use ieee.std_logic_1164.all;
entity clock_not is
port(
o: inout std_logic -- Input/output (clock output & Feedback)
);
end clock_not;
architecture logic_001 of clock_not is
begin
-- characteristics equation
o <= not o;
end architecture logic_001;
这是我用于仿真的 VHDL 测试平台文件 clock_not_tb.vhdl
:
library ieee;
use ieee.std_logic_1164.all;
entity clock_not_tb is
end clock_not_tb;
architecture test_001 of clock_not_tb is
component clock_not
port(
o: inout std_logic -- Input/output (clock output & Feedback)
);
end component;
signal ox: std_logic; -- Input/output (clock output & Feedback)
begin
c1: clock_not port map (o => ox);
process begin
ox <= '0';
wait for 1000 ns;
assert false report "END OF TEST!";
wait;
end process;
end architecture test_001;
我的 makefile
有一个目标 simulate
,如下所示:
simulate:
ghdl -s clock_not.vhdl
ghdl -s clock_not_tb.vhdl
ghdl -a clock_not.vhdl
ghdl -a clock_not_tb.vhdl
ghdl -r clock_not_tb --vcd=clock_not.vcd
此目标编译模拟并创建 .vcd
文件。编译报告没有错误。当我用 GTKwave 应用程序时钟打开 .vcd
文件时显示为 u
(uninitalised)。
我认为这是因为电路延迟被忽略了...那么我如何启用电路延迟?我怀疑我只需要修复 makefile 并添加 ghdl
参数,但是哪一个?有没有其他方法可以正确模拟这个时钟?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)