Friday, January 20, 2012

Connect clock signal to FPGA output pad

So now i know how to connect some internal clock signal to the output pin. Direct connection is impossible because the only dedicated clock signal buses can be connected only to the clock input pins of the internal flip-flops.
The internal clock signal can be connected to the output pin or to non clock signal with the following construct:
Here is the VHDL sample:
oddr2_0 : ODDR2
    port map(
        Q           => Output_clk_o,
        C0          => Output_clk_i,
        C1          => Output_clk_i,
        D0          => '0',
        D1          => '1'
    );

obuf_0 : OBUF
    generic map (
        CAPACITANCE => "NORMAL",
        IOSTANDARD  => "LVCMOS33",
        SLEW        => "FAST"
    )
    port map (
        O => Output_clk,
        I => Output_clk_o
    );
Where
  • Output_clk_i is some internal input clock signal
  • Output_clk_o is intermediate wire between ODDR2 and OBUF
  • Output_clk is output clock signal, which can be connected to the non clock input or to the output pin.
Same can be made for differential output clock:
Here is the VHDL sample:
oddr2_0 : ODDR2
    port map(
        Q           => Output_clk_o,
        C0          => Output_clk_i,
        C1          => Output_clk_i,
        D0          => '0',
        D1          => '1'
    );

obuf_0 : OBUFDS
    generic map (
        CAPACITANCE => "NORMAL",
        IOSTANDARD  => "LVDS_33",
        SLEW        => "FAST"
    )
    port map (
        O => Output_clk,
        OB => Output_clk_n,
        I => Output_clk_o
    );
Where
  • Output_clk_i is some internal input clock signal
  • Output_clk_o is intermediate wire between ODDR2 and OBUF
  • Output_clk is output clock signal, which can be connected to the non clock input or to the output pin.
  • Output_clk_n is negative output clock signal, which can be connected to the non clock input or to the output pin. 
In the VHDL file in entity block you must define this signals as clock for simulation:
attribute SIGIS : string;
attribute SIGIS of Output_clk         : signal is "CLK";
attribute SIGIS of Output_clk_n       : signal is "CLK";
If you use this code for embedded Xilinx MicroBlaze you must define this signal in MPD file as follow:
PORT Output_clk      = "", DIR = O, SIGIS = CLK
PORT Output_clk_n      = "", DIR = O, SIGIS = CLK
This information is get from Spartan-6 FPGA Clocking Resources on page 112.

Sunday, January 15, 2012

Usefull user constraints for axi_ethernet

If you try to get hardware design using axi_ethernet core you may to need this recommended constraints:
AXI_Ethernet v3.00.a - Recommended Constraints for AXI-based Ethernet Systems

The above link doesn't exists any more :( Here is carbon copy of them:

This Answer Record provides links to zip files with the recommended constraints for the AXI_Ethernet v3.00.a core logic. The constraints for the Ethernet pins themselves are not included. These constraints have been tested on specific development boards and some attributes such as IDELAY, IDELAYCTRL, and GTP/GTX locations can change in custom implementations.

Designs with AVB Endpoint Enabled (C_AVB = 1)

Virtex-6 Hard TEMAC Implementations 

Virtex-6 Soft TEMAC Implementations 

Spartan-6 Soft TEMAC Implementations 

Designs without AVB Endpoint Enabled (C_AVB = 0)

Virtex-6 Hard TEMAC Implementations 

Virtex-6 Soft TEMAC Implementations 

Spartan-6 Soft TEMAC Implementations