例如,假定有一个DLL文件名为sim.dll,对应的初始化函数为sim_init,有输入信号in1,in2,输出信号 out1,out2,可以这样编写对应的 VHDL 文件 (sim.vhd):
library ieee;
use ieee.std_logic_1164.all;
entity sim is
port(
in1: in std_logic;
in2: in std_logic;
out1: out std_logic;
out2: out std_logic;
);
end entity sim;
architecture dll of sim is
attribute foreign : string;
attribute foreign of dll : architecture is "sim_init sim.dll”
begin
end;