AHDL: Parameterized Tri-State Bus (lpm_bustri)
This example implements a tri-state bus. The width of the bus is specified with the
LPM_WIDTH parameter and can be changed for your design.
The dq and data_out pins are fed by tri-state buses.
Because tri-state buses cannot feed internal logic, you should
use the lpm_bustri function only if dq and data_out feed pins.
This example uses an Include Statement (shown in blue text) to import the
contents of the Include File containing the Function Prototype of the lpm_bustri function.
An Instance Declaration implements (shown in red text) an instance of the function.
For more information on using this example in your project, go to:
tribus.tdf
INCLUDE "lpm_bustri";
SUBDESIGN tribus
(
enable_out, enable_in : INPUT;
datain[7..0] : INPUT;
dataout[7..0] : OUTPUT;
dq[7..0] : BIDIR;
)
VARIABLE
u1 : lpm_bustri
WITH (LPM_WIDTH=8);
BEGIN
u1.data[7..0] = datain[7..0];
u1.enabletr = enable_out;
u1.enabledt = enable_in;
dataout[7..0] = u1.result[7..0];
dq[7..0] = u1.tridata[7..0];
END;
Feedback
Did this information help you?
If not, please log onto mySupport to file a technical request or enhancement.
Altera does not warrant that this solution will work for the customer's intended purpose and disclaims all liability for use of or reliance on the solution.
|