[Discuss OpenCPI] Fwd: Multiple AD9361 Devices Cause Multiple Connections Error

From: Davis Hoover <dhoover_at_geontech.com>
Date: Thu, 16 Jan 20 12:07:11 -0500

Hey Brian,

The supports relationship of the existing AD9361 device/subdevice worker
should not need to be modified. There is a good diagram of these
relationships here:
https://github.com/opencpi/training/blob/master/PDFs/presentations/Extra_Device_Support_Development.pdf

The multi-channel instantiation does not suffer from the problem in
question, and is exemplified by both the aforementioned pdf and the
following assembly container:
https://github.com/opencpi/opencpi/blob/release_1.5/projects/assets/hdl/assemblies/empty/cnt_2rx_2tx_bypassasm_fmcomms_2_3_lpc_LVDS_zed.xml

I *think* the problem is: you can have a subdevice worker which supports
multiple instances of a single device worker:
worker=foo.hdl, pfconfig/container instname=foo_0
worker=foo.hdl, pfconfig/container instname=foo_1
worker=foo_sub.hdl(supports foo.hdl), pfconfig/container instname=foo_sub

...but you *cannot* have multiple *subdevice workers*, each of which
support the same device worker
worker=foo.hdl, pfconfig/container instname=foo_0
worker=foo.hdl, pfconfig/container instname=foo_1
worker=foo_sub.hdl(supports foo.hdl), pfconfig/container instname=foo_sub_0
worker=foo.hdl, pfconfig/container instname=foo_2
worker=foo.hdl, pfconfig/container instname=foo_3
worker=foo_sub.hdl(supports foo.hdl), pfconfig/container instname=foo_sub_1
... in this scenario, both foo_sub_0 and foo_sub_1 are trying to make a
connection to foo_0 and foo_1, due to missing functionality in the code
generator, which is what the code generator is complaining about with
"multiple connections not allowed"

Off the top of my head, the two possible workarounds I envision are:
a) copy all device workers with a new name, e.g. ad9361_data_sub_copy.hdl,
with the subdevice connections of the copies being modified to refer to all
_copy versions (yuck...)
b) step through the code generator to find the "Multiple connections not
allowed" gets printed, and look into addition the proper functionality

This is my best guess at the moment...

---------- Forwarded message ---------
From: Brian Padalino <bpadalino_at_gmail.com>
Date: Thu, Jan 16, 2020 at 10:10 AM
Subject: Re: [Discuss OpenCPI] Multiple AD9361 Devices Cause Multiple
Connections Error
To: <discuss_at_lists.opencpi.org>


On Wed, Jan 15, 2020 at 9:26 PM Brian Padalino <bpadalino_at_gmail.com> wrote:

> I am trying to instantiate 2 AD9361 devices on a single platform, always
> connected (no slots), with platform pin renaming.
>
> I defined two different AFE's for the AD9361 devices as such:
>
> <device name="afe0_adc" worker="ad9361_adc"/>
> <device name="afe0_adc_sub" worker="ad9361_adc_sub"/>
> <device name="afe0_dac" worker="ad9361_dac"/>
> <device name="afe0_dac_sub" worker="ad9361_dac_sub"/>
> <device name="afe0_spi" worker="ad9361_spi">
> ...
> <device name="afe1_adc" worker="ad9361_adc"/>
> <device name="afe1_adc_sub" worker="ad9361_adc_sub"/>
> <device name="afe1_dac" worker="ad9361_dac"/>
> <device name="afe1_dac_sub" worker="ad9361_dac_sub"/>
> <device name="afe1_spi" worker="ad9361_spi">
>
> I then created single0 and single1 configurations like this:
>
> <HdlConfig Constraints="newplatform" Language="vhdl">
> <!-- AD9361 AFE #0 -->
> <device name="afe0_spi">
> <property name="CP_CLK_FREQ_HZ_p" value="100e6"/>
> </device>
> <device name="afe0_data_sub">
> <property name="LVDS_p" value="true"/>
> <property name="DATA_CLK_DELAY" value="2"/>
> <property name="TX_DATA_DELAY" value="0"/>
> <property name="FB_CLK_DELAY" value="7"/>
> <property name="TX_DATA_DELAY" value="0"/>
> </device>
> <device name="afe0_adc_sub">
> <property name="LVDS_p" value="true"/>
> </device>
> <device name="afe0_adc"/>
> <device name="afe0_dac_sub">
> <property name="LVDS_p" value="true"/>
> </device>
> <device name="afe0_dac"/>
> </HdlConfig>
>
> When I try to instantiate both, I get this error:
>
> dual.xml: in HdlPlatformAssembly for dual: Multiple connections not
> allowed for port 'dev_adc' on instance 'afe0_adc' of worker 'ad9361_adc'
>
> I see a devsignal defined as dev_adc in the ad9361_adc.xml file, but I
> have no idea why it's trying to get multiple connections.
>

Working through this more, it seems like I need to add a <supports> tag
with the worker, device, and connections. This would associated the
devices in very specific ways instead of generically or in an overloaded
way.

This would also seem to be the case for also enabling dual channel modes
for each of the AD9361 devices by connecting the other channel output to a
second ADC or DAC.

After adding all the <supports> tags, I am still getting a problem with the
ad9361_data_sub worker:

  <supports> element for device "afe0_data_sub" on board "newplatform" does
not match any <supports> element on the "ad9361_data_sub" worker

I've determined it's the ad9361_adc_sub and ad9361_dac_sub tags which are
problematic. Here is the beginning of the definition:

  <device name="afe0_data_sub" worker="ad9361_data_sub">
    <supports worker="ad9361_config" device="afe0_config">
        <connect port="dev_cfg_data_port" to="dev_cfg_data_port"/>
        <connect port="dev_rxen_data_sub" to="dev_rxen_config"/>
        <connect port="dev_txen_data_sub" to="dev_txen_config"/>
        <connect port="dev_data_clk" to="dev_data_clk" index="2"/>
    </supports>
    <supports worker="ad9361_adc_sub" device="afe0_adc_sub">
        <connect port="dev_data_clk" to="dev_data_clk" index="0"/>
        <connect port="dev_data_from_pins" to="dev_data_adc"/>
    </supports>
    <supports worker="ad9361_dac_sub" device="afe0_dac_sub">
        <connect port="dev_data_clk" to="dev_data_dac" index="1"/>
        <connect port="dev_data_to_pins" to="dev_data_dac"/>
        <connect port="dev_txen" to="dev_txen_dac"/>
    </supports>

And the <supports> tags from the ad9361_data_sub.xml in OpenCPI looks like
this:

  <!-- Sub-Device Port Connections (Supports) -->
  <supports worker='ad9361_config'>
    <connect port="dev_cfg_data_port" to="dev_cfg_data_port"/>
    <connect port="dev_rxen_data_sub" to="dev_rxen_config"/>
    <connect port="dev_txen_data_sub" to="dev_txen_config"/>
    <connect port="dev_data_clk" to="dev_data_clk" index='2'/>
  </supports>
  <supports worker='ad9361_adc_sub'>
    <connect port="dev_data_clk" to="dev_data_clk" index='0'/>
    <connect port="dev_data_from_pins" to="dev_data_adc"/>
    <!--connect port="dev_rxen" to="dev_rxen_adc"/--> <!-- TODO / FIXME -
support this -->
  </supports>
  <supports worker='ad9361_dac_sub'>
    <connect port="dev_data_clk" to="dev_data_clk" index='1'/>
    <connect port="dev_data_to_pins" to="dev_data_dac"/>
    <connect port="dev_txen" to="dev_txen_dac"/>
  </supports>

I can't find much information about this stuff, so I'll keep trying, but
someone who might know either how to get more debug out of why the tag
isn't matched would be great.

Again, any insight or help is appreciated.

Thanks,
Brian

>


Received on Thu Jan 16 2020 - 17:07:11 CST

This archive was generated by hypermail 2.3.0 : Fri Jun 05 2026 - 08:45:25 CDT