Changes between Version 1 and Version 2 of cores/w3_clock_controller


Ignore:
Timestamp:
Feb 26, 2013, 10:31:43 AM (11 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • cores/w3_clock_controller

    v1 v2  
    1111== Driver ==
    1212
    13 The w3_clock_controller pcore includes a C driver to facilitate control of the AD9512s from user code. Refer to the [//svn/WARP/PlatformSupport/CustomPeripherals/pcores/w3_clock_controller_v3_00_b/doc/html/api/index.html w3_clock_controller driver documentation] for more details.
     13The w3_clock_controller pcore includes a C driver to facilitate control of the AD9512s from user code. Refer to the [//svn/WARP/PlatformSupport/CustomPeripherals/pcores/w3_clock_controller_v3_01_b/doc/html/api/index.html w3_clock_controller driver documentation] for more details.
    1414
    1515All driver functions require the base memory address of the w3_clock_controller pcore. This address is set in your XPS project. The EDK tools copy this address into a macro in the {{{xparameters.h}}} file when you generate a BSP. The auto-generated macro should be named {{{XPAR_W3_CLOCK_CONTROLLER_0_BASEADDR}}} (assuming your pcore instance is named {{{w3_CLOCK_controller_0}}}, as in our reference projects).
     
    2323}}}
    2424
     25== Sampling Clock Source ==
     26
     27Many user designs for WARP v3 use the sampling clock reference as the master clock for FPGA logic. Our [wiki:HardwareUsersGuides/WARPv3/TemplateProjects WARP v3 Template Projects] do this, for example. One implication of this approach is the sampling clock source must be stable before the FPGA logic attempts to use it. When the on-board clock is used, this is straightforward. When an off-board clock source is used (via a Clock Module) the FPGA logic must be held in reset until the sampling clock buffer can switch to the external cock source.
     28
     29The w3_clock_controller contains a small block to handle this "at boot" clock selection. Immediately after the FPGA is configured this block writes a handful of registers in the sampling clock buffer to configure the sampling clock input. The block asserts an "invalid" output to hold the rest of the FPGA design in reset until its register writes are complete. The "at boot" logic uses the 200MHz oscillator on WARP v3, which is always available (even when the rest of the FPGA design uses an off-board clock).
     30
     31The w3_clock_controller at boot logic uses the two switches on the CM-MMCX to select the clock mode. When both switches are down (logic 0) the off-board sampling clock will be selected. All other switch settings will use the on-board sampling clock. User software can interpret the other switch states as desired (i.e. to select on/off board RF reference clock, to en/disable CM-MMCX clock outputs, etc.).
    2532
    2633== Usage ==
    2734
    28 An important factor in configuring the WARP v3 clock buffers is whether the FPGA logic implementing the w3_clock_controller core is itself clocked by the sampling clock. If so, it is critical the properties of the AD9512->FPGA clock are not changed by user code. All other outputs from the AD9512 buffers can be changed as needed by user code.
     35An important factor in configuring the WARP v3 clock buffers is whether the FPGA logic implementing the w3_clock_controller core is itself clocked by the sampling clock. If so, it is critical the properties of the AD9512->FPGA clock are not changed by user code at run-time. All other outputs from the AD9512 buffers can be changed as needed by user code.
    2936
    3037The w3_clock_controller driver provides functions to configure the AD9512 output dividers, thereby configuring the frequency of the clocks feeding the RF interface AD9963 chips (the ADC/DAC chips). It is critical that the AD9512->AD9963 clock frequency be consistent with all other rates in the FPGA->DAC and ADC->FPGA interfaces. The combination of AD9963 clock settings (DLL state, ADC/DAC clock source, etc.), AD9963 filter settings (interpolation/decimation rates), AD9512 dividers and internal FPGA->w3_ad_bridge clock connections must all agree. Refer to the [wiki:HardwareUsersGuides/WARPv3/RF WARP v3 User Guide RF section] for more details and examples of valid AD9512/AD9963/FPGA configurations.
    3138
     39The MHS snippet below shows a typical use of the w3_clock_controller (taken from the OnBoardPeriphs template project).
     40{{{#!sh
     41BEGIN w3_clock_controller
     42 PARAMETER INSTANCE = w3_clock_controller_0
     43 PARAMETER HW_VER = 3.01.b
     44 PARAMETER C_BASEADDR = 0xc0400000
     45 PARAMETER C_HIGHADDR = 0xc040ffff
     46 BUS_INTERFACE SPLB = plb_primary
     47#AD9512 SPI pins
     48 PORT rfref_spi_cs_n = clk_rfref_spi_cs_n
     49 PORT samp_spi_cs_n = clk_samp_spi_cs_n
     50 PORT samp_spi_mosi = clk_samp_spi_mosi
     51 PORT rfref_spi_mosi = clk_rfref_spi_mosi
     52 PORT samp_spi_sclk = clk_samp_spi_sclk
     53 PORT rfref_spi_sclk = clk_rfref_spi_sclk
     54 PORT samp_spi_miso = clk_samp_spi_miso
     55 PORT rfref_spi_miso = clk_rfref_spi_miso
     56#At boot ports
     57 PORT at_boot_clk_in = clk_200MHz #always-running clock
     58 PORT at_boot_clk_in_valid = clk_gen_1_locked #valid indicator for at_boot_clk_in (when sourced from MMCM)
     59 PORT at_boot_config_sw = cm_mmcx_sw #CM-MMCX SIP switches
     60 PORT at_boot_clkbuf_clocks_invalid = mmcm_inputs_invalid #reset output
     61#Software-readable input for user applications
     62 PORT usr_status = net_gnd
     63END
     64}}}
     65
    3266== Source ==
    3367
    34 The full hardware and software source code is available in the repository: [source:/PlatformSupport/CustomPeripherals/pcores/w3_clock_controller_v3_00_b]. The VHDL, Verilog and C source code are made available under the [wiki:/license WARP license].
     68The full hardware and software source code is available in the repository: [source:/PlatformSupport/CustomPeripherals/pcores/w3_clock_controller_v3_01_b]. The VHDL, Verilog and C source code are made available under the [wiki:/license WARP license].