Customize DSPBuilder-generated custom component in Qsys/Platform designer
In my system, I use MATLAB HDL coder to generate an IP core facilitating host to target communication with an AXI bus, and a set of external data signals each mapped to their own distinct individual connection points i.e. "conduits".
I also use DSP Builder to generate an IP core specializing in NCO/Mixer/Filter components, also containing ports for external data signals.
I import both of these IP cores as custom components in an existing Qsys/platform designer project for my board (DE10-Nano). I have been using page 66 of this DSPBA manual as a reference guide for importing DSPBuilder-generated custom components into Qsys/Platform designer.
I intend to connect several data signals between the HDL coder custom component and the DSP Builder custom component in Qsys.
The problem that I have been running into is that the HDL coder and DSP builder-generated custom components seem to follow different conventions for mapping their data signals to connection points in Qsys i.e. "conduits". An example of the Qsys implementation of an HDL coder custom component and a DSP Builder custom component are shown below, from top to bottom.
I would like to customize the DSPBuilder-generated custom component (bottom) to have the same data-signal-to-conduit mapping convention in Qsys as the HDL coder generated custom component in Qsys (top). In other words, I would like each of the data signals on the DSPBuilder-generated custom component (data_In3, data_Out3) each mapped to their own distinct conduits, to facilitate directly connecting them to distinct data signal conduits on the HDL-coder generated custom component (In4, In5, ... Out2, Out3).
An example of this kind of connection between Qsys components shown in the above screenshot would be connecting Out1 on HDLCoder component --> In3 on DSPBuilder component, and connecting Out3 on DSPBuilder component to In5 on HDLCoder component.
Currently, DSP Builder generated custom components have all of their data signals mapped to one single conduit labeled "exp", making it difficult to connect data signals between this DSP Builder generated custom component and an HDL coder generated custom component.
How would I go about editing the DSP Builder generated custom component to ensure that each of its external data signals are mapped to distinct individual conduits in Qsys, instead of being all lumped into a single conduit "exp"? Is there an option to configure this data-singal-to-conduit mapping in the MATLAB Simulink DSPBA Blockset, or would I have to manually edit the generated _hw.tcl file used to import the custom component into Qsys?
Best,
- Gheorghe S
Dear all,
I found a workaround for my problem on my own, thanks to your tips.
The workaround procedure I developed for configuring DSP Builder-generated custom components to ensure their data signal ports are compatible with connecting to data signal ports on HDL Coder-generated custom components in Platform Designer/Qsys is as follows:
1. Generate _hw.tcl representing contents of DSPBuilder IP core using MATLAB play button.
2. Edit _hw.tcl using any text editor, set EDITABLE property to "true" near top of file
3. Import _hw.tcl into Platform Designer by adding folder containing _hw.tcl and .vhd files to IP catalog search path via Platform Designer top toolbar Tools >> Options.
4. Select DSP Builder IP core (aka custom component), select Edit...
5. Go to Signals & Interfaces tab...- Add one new conduit for each data signal.
- Drag one data signal to each conduit.
- Set clocks and resets for each conduit.
- rename each conduit from [conduit_end1, conduit_end2, ...] to [In1, In2, ... Out1, Out2...] (corresponding to data signal name).
- For each signal, recast "signal type" from [data_In1, data_In2...] all to just "pin".
- Delete original "exp" conduit.
6. Finish, save + overwrite edits, now "port edits" appear at the end of _hw.tcl file.
7. Copy "port edits" at end of _hw.tcl file.
8. Regenerate _hw.tcl file for DSPBuilder IP core using MATLAB play button.
9. Edit _hw.tcl using text editor, add "port edits" to end of _hw.tcl file, replacing "exp" conduit interface declaration.
10. Refresh Platform Designer using F5, add IP core to project. Now data signal conduits are properly configured for connecting to data signal conduits on MATLAB HDL Coder generated blocks, shown below.Thank you to @sstrell for pointing out the easy/repeatable/bug-free way to edit conduit/data signal assignments from the Qsys component editor.
I borrowed this method to generate the _hw.tcl code necessary to define my custom port configuration.
Unfortunately in doing so, the rest of the _hw.tcl file was "wiped clean", but it is easy to regenerate in MATLAB.
I took the port configuration code generated from the component editor, and added it to my re-generated _hw.tcl file, and after refreshing Qsys, the ports on my DSPBA custom component are configured correctly.
Although slightly roundabout, this consistent UI-based procedure seems to work every time. Also, the port configuration _hw.tcl code generated from the component editor is re-usable as long as the DSPBA in/out data signals remain unchanged.