![]() |
![]() |
Note: Refer to the LogiBLOX Guide for detailed instructions on using LogiBLOX.
Most synthesis tools can infer arithmetic modules from VHDL or Verilog code for these operators: +, -, <, <=, >, >=, =, +1, -1. These adders, subtracters, comparators, incrementers, and decrementers use FPGA dedicated device resources, such as carry logic, to improve the speed and area of designs. For bus widths greater than four, library modules are generally faster unless multiple instances of the same function are compiled together. For more information on the module libraries, refer to your synthesis tool documentation.
If you want to use a module that is not in the module libraries, you can use LogiBLOX to create components that can be instantiated in your code. This is useful for large memory arrays if your synthesis tool does not infer memory. However, Xilinx recommends properly constraining the synthesis and using the Xilinx-specific module generation capabilities of your tool. A simulation model is also created so that RTL simulation can be performed before your design is compiled.
You can create an instance of an externally defined macro, including a user-defined macro or a Xilinx macro (such as an I/O or flip-flop), by instantiating what some synthesis tool vendors refer to as a black box in your HDL code. These black boxes are Verilog empty module descriptions or VHDL component declarations.
Some synthesis tools allow instantiation of higher order Xilinx macros, such as counters and adders from the Unified library. Other synthesis tools provide Xilinx macro libraries that pre-define the Xilinx macros. Without this expansion, macros are not understood by the implementation tools. However, Xilinx does not recommend using these macros. The preferred method is the synthesis tool module expansion, or if you require more control, you can instantiate a LogiBLOX module. If necessary, use these macro libraries only with older schematic-based designs. However, even in these cases, schematic-based netlists are required to expand the macros, which makes the macro library redundant. LogiBLOX modules should also be unnecessary because the synthesis tool should provide equivalent performance. If you find a design in which this is not true, you can use LogiBLOX modules, and contact Xilinx and your synthesis vendor for a solution.
LogiBLOX is a graphical tool that allows you to select from several arithmetic, logic, I/O, sequential, and data storage modules for inclusion in your HDL design. Use LogiBLOX to instantiate the modules listed in the following table.
Module | Description |
---|---|
Arithmetic | |
Accumulator | Adds data to or subtracts it from the current value stored in the accumulator register |
Adder/Subtracter | Adds or subtracts two data inputs and a carry input |
Comparator | Compares the magnitude or equality of two values |
Counter | Generates a sequence of count values |
Logic | |
Constant | Forces a constant value onto a bus |
Decoder | Routes input data to 1-of-n lines on the output port |
Multiplexer | Type 1, Type 2 - Routes input data on 1-of-n lines to the output port |
Simple Gates | Type 1, Type 2, Type 3 - Implements the AND, INVERT, NAND, NOR, OR, XNOR, and XOR logic functions |
Tristate | Creates a tri-stated internal data bus |
I/O | |
Bi-directional Input/Output | Connects internal and external pin signals |
Pad | Simulates an input/output pad |
Sequential | |
Clock Divider | Generates a period that is a multiple of the clock input period |
Counter | Generates a sequence of count values |
Shift Register | Shifts the input data to the left or right |
Storage | |
Data Register | Captures the input data on active clock transitions |
Memory: ROM, RAM, SYNC_RAM, DP_RAM | Stores information and makes it readable |
Option | Description |
---|---|
Behavioral VHDL netlist | Generates a simulation netlist in behavioral VHDL; output file has a .vhd extension. |
Gate level EDIF netlist | Generates a simulation netlist in EDIF format; output file has an .edn extension. |
Structural Verilog netlist | Generates a simulation netlist in structural Verilog; output file has a .v extension. |
Option | Description |
---|---|
VHDL template | Generates a LogiBLOX VHDL component declaration/instantiation template that is copied into your VHDL design when a LogiBLOX module is instantiated. The output file has a .vhi extension. |
Verilog template | Generates a LogiBLOX Verilog module definition/instantiation template that is copied into your Verilog design when a LogiBLOX module is instantiated. The output file has a .vei extension. |
Note: For more information on simulation, refer to the Simulating Your Design chapter.
Note: If you do not use a remove design type of command, the netlist file may be empty. If this occurs, the Xilinx software will trim this module/component and all connected logic. Refer to your synthesis tool documentation for the correct command and syntax.
Note: For more information on simulation, refer to the Simulating Your Design chapter.
The VHDL example in this section shows how to instantiate a LogiBLOX black box component.
VHDL Exampleentity top is
port (clk, rst, en, data: in bit; q: out bit);
end top;
architecture structural of top is
-- Declare the black_box as a boolean attribute
attribute black_box: boolean;
-- Declare the black_box_pad_pin as a string attribute
attribute black_box_pad_pin: string;
-- In this example, GIZMO is a user macro that I created
-- in a schematic editor, and
-- that I want to directly instantiate in my VHDL design
-- as a black box. Create a component declaration.
component GIZMO
port(Q: out bit; D, C, CLR: in bit);
end component;
-- Set the black_box attribute on GIZMO to be "true".
attribute black_box of GIZMO: component is true;
-- In this example, MYBUF is a user I/O macro that I created
-- in a schematic editor, and
-- that I want to directly instantiate in my VHDL design
-- as a black box. Create a component declaration.
component MYBUF
port(O: out bit; I: in bit);
end component;
-- Set the black_box_pad_pin attribute on MYBUF to
-- the pin that interfaces with the external world, "I".
attribute black_box_pad_pin of MYBUF: component is "I";
signal data_core: bit;
begin
-- Instantiate an MYBUF. Here we connect
-- data to I and data_core to O.
data_pad: MYBUF port map (O => data_core, I => data);
-- Instantiate a GIZMO. Here we connect q to Q,
-- data_core to D, clk to C, and rst to CLR.
my_gizmo: GIZMO port map (Q => q, D => data_core,
C => clk, CLR => rst);
end structural;