How to assign the name of a (multiple) port while using HDL Coder generate RTL from simulink

3 views (last 30 days)
Hi,
I am using HDL coder to generate RTL from simulink.
While in my simulink model, the port is not a single signal but a multiple signal, assume the port name is sig, and it contains 3 signals which shares the same signal path. After RTL generation, HDL coder automatically expand the sig into 3 signals, which are sig_0, sig_1, and sig_2.
My questions is how can I assign the expanded name? I donot like the sig_0, sig_1 and sig_2. In my design, I would like to assign it as sig_x, sig_y, and sig_z.
Thanks a lot!

Answers (4)

Kiran Kintali
Kiran Kintali on 1 Aug 2021
Can you share a sample model?

dayu lai
dayu lai on 5 Aug 2021
See attachment.
demo_param is the parameter used in demo_sig.mdl.
demo_sig is a quite simple demo for describing the question.
demo_sig.zip contians the generated RTL named demo_sig.v(.v file can not be uploaded as attachment, so I zipped it)
As you see, input port of Demo is automatically expanded into in_0, in_1, in_2.
My question is can the input name in RTL changed into in_x, in_y, in_z (by setting somewhere)?
Another question is, how can I share the logic since the 3 path are totally the same? (In reallity, the data path logic could be much more complex than the demo, so logic sharing is quite import)
Thanks a lot!

Kiran Kintali
Kiran Kintali on 5 Aug 2021
Edited: Kiran Kintali on 5 Aug 2021
>>As you see, input port of Demo is automatically expanded into in_0, in_1, in_2. My question is can the input name in RTL changed into in_x, in_y, in_z (by setting somewhere)?
We do not have _x, _y and _z naming scheme currently. Please reach out to MathWorks support for the naming request. Without going into the solution space the specification of the naming convention that you request can be tricky.
>> How can I share the logic since the 3 paths are totally the same? (In reality, the data path logic could be much more complex than the demo, so logic sharing is quite important)
To enable resource sharing of identical channels as shown in your design you need to use the StreamingFactor option on the subsystem. See the attached pdf file on the usage.
  1 Comment
dayu lai
dayu lai on 6 Aug 2021
Thanks a lot!
I am successfully generate shared logic in this demo.
However, when the project comes larger. I tried again in the large project, streaming optimization is not successful:
SubsystemStreamingFactorSharingFactor
Streaming Report
Subsystem: Activity
StreamingFactor: 3
Streaming optimization unsuccessful
No legal streaming factor values available for this subsystem
Sharing Report
No subsystem(s) found with SharingFactor > 0
Do you have any idea about this?
BTW, I notice that there is another option named SharingFactor. What is that? Is there any introduction or application note on streaming factor and sharing factor?
thanks

Sign in to comment.


Kiran Kintali
Kiran Kintali on 6 Aug 2021

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!