フィルターのクリア

dpigen: support for converting matlab fi data-type to systemverilog bit-vectors instead of shortint/int

2 ビュー (過去 30 日間)
Hi
I have been using the 'dpigen' functionality to generate DPI shared-objects of matlab models which I use in my SystemVerilog/UVM testbench. I use the generated SystemVerilog wrapper module of the matlab function, and I can see that only certain SystemVerilog types are supported for the input/output ports of the wrapper module, according to the page below,
In my case, in the matlab-world an input of type 'fi(0,1,14,0)' (signed 14-bit) is converted into a 'shortint' and an input of type 'fi(0,1,18,17)' (signed 18-bit) is converted into an 'int'. This means an additional step of manual 'type-conversion' has to be done by the user in order to drive the wrapper module for each and every input and output, and this tends to be very error prone, in cases where there are several input/outputs. In an ideal world, I would have expected the types logic [13:0] and logic [17:0] respectively for my example.
My question is, why is dpigen restricted to a limited set of types instead of using bit-vectors in the SystemVerilog world ?
From such a sophisticated code-generation tool, it should be possible for the user to have an automatic seamless interface to the Systemverilog testbench, without intoducing manual steps.
regards

回答 (2 件)

Dave Gutierrez
Dave Gutierrez 2019 年 7 月 9 日
Hi Krishnan,
If you use the flag "-FixedPointDataType BitVector" or "-FixedPointDataType LogicVector" you can get the desired interface in SystemVerilog. This feature is available from R2017b:
For more info you can type >>help dpigen to read more about this flag.
Hope this helps!
David G

Krishnan Gopal
Krishnan Gopal 2019 年 7 月 12 日
Thanks. Somehow, this information was not available in the official/online HTML documentation for dpigen.
I will try this out.
Krishnan

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by