我有些東西我不明白。我從VHDL開始,我不明白我怎麼能看到我的電路結果。 我試圖使用textio軟件包,並在終端上打印我的位結果,並試圖將此位打印到output_file.txt文件中,但這些暫定文件都沒有工作。用VHDL打印一下(Ubuntu 16.04)
所以我的問題是,我如何打印一個位值?他們說,當我嘗試:
error: port "s" cannot be read
有我的代碼:
Library ieee;
Use ieee.std_logic_1164.all;
Use ieee.numeric_std.all;
use std.textio.all;
entity gate_AND is
port(
x1 : in std_logic :='1';
x2 : in std_logic :='0';
x3 : in std_logic :='0';
s : out std_logic);
end entity;
architecture arc of gate_AND is
begin
s <= x1 and x2 and x3;
process
file OutFile : TEXT open write_mode is "output_file.txt";
variable L : line;
begin
write (L, s);
writeline (OutFile, L);
wait;
end process;
end arc;
我懷疑's'被宣佈爲輸出,你不能把它當作一個輸入,而是讓VHDL專家談... – xhienne
OP的問題將在符合IEEE Std 1076-2008標準的VHDL實現中起作用。請參見6.5.2接口對象聲明,第12段*接口對象具有以下模式之一:... - * *** out *** *允許更新接口對象的值,並且只要它是不是信號參數,請閱讀.... *)。參數是特定於子程序的。對於限制於VHDL標準的以前版本的工具,J.H.的答案是有效的。 – user1155120
您還可以通過仿真波形轉儲文件和波形查看器查看電路的結果。你使用什麼VHDL工具? – user1155120