Using Xilinx Libraries Guides

Thread Starter

drkidd22

Joined Apr 6, 2011
2
Hello,

I'm new to the CPLD world and have a few questions regarding Xilinx's Libraries Guide.

I'm using Verilog HDL with ISE v13.1 with the CoolRunner-II Dev Board.
Basically my question is how would I use the flip-flops that are in the library.
They have the FD (Macro: D Flip-Flop) and FD16 (Macro: Multiple D Flip-Flop).

I couldn't find a tutorial that would show me how to use them instead of having to write each module. I couldn't find them in the Language Templates either.

Any help will be greatly appreciated as I'm trying to use a few of the macros in the libraries.
 
Are you looking to draw a schematic? They are in the 'symbol' tab when drawing your schematic.

Flip flop is pretty easy in verilog....

Rich (BB code):
reg q;
wire d;
...
always @ (posedge clk)
    q <= d;
...
 
Otherwise, for using those libraries, you treat them sort of like a function that you're supplied with. Just look in the library guide for the instance name.

The lib.pdf guide provides you with vhdl and verilog example instantiations...
 

rfordh

Joined Oct 26, 2010
6
Yeah, you'll want to look at the examples in the guide. For example, from the Virtex4 guide, this is given for the FDCPE element:

Rich (BB code):
FDCPE #(
 .INIT(1'b0) // Initial value of register (1'b0 or 1'b1)
) FDCPE_inst (
 .Q(Q), // Data output
 .C(C), // Clock input
 .CE(CE), // Clock enable input
 .CLR(CLR), // Asynchronous clear input
 .D(D), // Data input
 .PRE(PRE) // Asynchronous set input
);
You'll want to put this in your code and connect the signals you want to those ports (your signals will be the ones in the parentheses).
 
Top