Re: [Discuss OpenCPI] Platform Mapping HDL Pins
On Wed, Jan 8, 2020 at 12:34 PM Aaron Olivarez <aaron_at_olivarez.info> wrote:
> You need to add ad9361_spi_ prefix so your HdlPlatform needs to look like
> this:
>
> <device worker="ad9361_spi">
> <signal name="ad9361_spi_SPI_CLK" platform='spi_clk'/>
> <signal name="ad9361_spi_SPI_DO" platform='spi_miso'/>
> <signal name="ad9361_spi_SPI_DI" platform='spi_mosi'/>
> <signal name="ad9361_spi_SPI_ENB" platform='spi_csn'/>
> <signal name="ad9361_spi_RESETB" platform='gpio_resetb'/>
> </device>
>
When I tried, this I received the following error:
For file pluto.xml: Signal "ad9361_spi_SPI_CLK" is not defined for device
type "ad9361_spi"
Which I think makes sense. The signal name is defined as SPI_CLK in the
ad9361_spi.xml file.
Looking through the generated code, I don't think things are still
correct. But maybe I am looking too early in the process?
>
> I'm working on a port for the PLUTO and I used the approach of updating
> the XDC file but yours is valid too. This is what my platform xml looks
> like:
>
> <!-- This file defines the pluto HDL platform -->
> <HdlPlatform Language='VHDL' Spec='platform-spec'>
> <specproperty Name='platform' Value='pluto'/>
> <!-- These next two lines must be present in all platforms -->
> <metadata Master='true'/>
> <timebase Master='true'/>
> <!-- This platform worker provides a control plane -->
> <cpmaster master='true'/>
> <!-- Set your time server frequency -->
> <device Worker='time_server'>
> <Property Name='frequency' Value='100e6'/>
> </device>
>
> <sdp Name='zynq' Master='true' Count='4'/>
> <Property Name='axi_error' Type='bool' Arraylength='4' Volatile='true'/>
> <Property Name='sdpDropCount' type='uchar' volatile='true'/>
>
> <!-- debug properties -->
> <property name='useGP1' type='bool' parameter='1' default='false'/>
> <property name='debug_state' type='Ulonglong' arraylength='4'
> volatile='true' debug='false'/>
> <property name='debug_state1' type='Ulonglong' arraylength='4'
> volatile='true' debug='false'/>
> <property name='debug_state2' type='Ulonglong' arraylength='4'
> volatile='true' debug='false'/>
>
> <!-- Put any additional platform-specific properties here using
> <Property> -->
> <!-- Put any built-in (always present) devices here using <device> -->
> <!-- Put any card slots here using <slot> -->
> <!-- Put ad hoc signals here using <signal> -->
>
>
> <device worker='ad9361_adc'/>
> <device worker='ad9361_adc_sub'>
> <Property name='LVDS_P' value='false'/>
> </device>
>
> <device worker='ad9361_dac'/>
> <device worker='ad9361_dac_sub'>
> <Property name='LVDS_P' value='false'/>
> </device>
>
> <device worker='ad9361_data_sub'>
> <Property name='LVDS_P' value='false'/>
> <Signal name='DATA_CLK_N' platform=''/>
> <Signal name='FB_CLK_N' platform=''/>
> <Signal name='TX_FRAME_N' platform=''/>
> <Signal name='RX_FRAME_N' platform=''/>
> </device>
>
> <device Worker='ad9361_spi'/>
> <device Worker='ad9361_config'/>
>
> </HdlPlatform>
>
Thanks! This is great! Were you planning on open sourcing this, or just
for your own little project?
>
> The only caveat is that those device workers in the platform xml also need
> to be instanced in a platform config file or container. The platform and
> card XML simply dictate what's allowed to be instanced. Every device worker
> needs to be instanced in either a platform or container. Here's an example
> of one my HdlConfig:
>
> <HdlConfig Constraints="pluto_ad9361_txrx_sub_mode_2_cmos">
> <device name="ad9361_spi">
> <property name="CP_CLK_FREQ_HZ_p" value="100e6"/> <!-- we MUST provide
> to this worker the pluto's control plane clock freq value -->
> </device>
> <device name="ad9361_config"/>
> <device name="ad9361_data_sub">
> <property name="lvds_p" value="false"/>
> <property name="half_duplex_p" value="false"/>
> <property name="single_port_p" value="true"/>
> <property name="swap_ports_p" value="true"/>
> </device>
> <device name="ad9361_adc"/>
> <device name="ad9361_adc_sub">
> <property name="lvds_p" value="false"/>
> <property name="half_duplex_p" value="false"/>
> <property name="single_port_p" value="true"/>
> </device>
> <device name="ad9361_dac"/>
> <device name="ad9361_dac_sub">
> <property name="lvds_p" value="false"/>
> <property name="half_duplex_p" value="false"/>
> <property name="single_port_p" value="true"/>
> </device>
> </HdlConfig>
>
This is also very good to know. I only had the ad9361_adc and ad9361_dac
in there before. What is interesting is that when I have the ad9361_adc
before the ad9361_adc_sub in the XML, I get the following error:
For file ../../pluto/pluto_txrx.xml: Platform device 'ad9361_adc_sub' is
already in the platform configuration
Should I be adding a new "assembly" which defines all this stuff as opposed
to a different "configuration"?
Thanks for all the guidance.
Brian
Received on Wed Jan 08 2020 - 18:21:36 CST
This archive was generated by hypermail 2.3.0
: Fri Jun 05 2026 - 08:45:25 CDT