Is there a way to specify library use clauses when using MyHDL user-defined code?
Consider the following example, which models a differential buffer that is available in the Xilinx unisim library:
from myhdl import *
def ibufds(I, IB, O):
""" Xilinx Differential Signaling Input Buffer"""
@always_comb
def output():
O.next = I
return instances()
ibufds.vhdl_code = """
IBUFDS_inst : IBUFDS
generic map (
DIFF_TERM => FALSE,
IBUF_LOW_PWR => TRUE,referenced I/O standards
IOSTANDARD => "DEFAULT")
port map (
O => O,
I => I,
IB => IB
);"""
Converting this module to VHDL code works fine, but what is missing is the following use clause in the header of the VHDL file:
library unisim;
use unisim.vcomponents.all;
How can I fix that?