Complex to Magnitude-Angle HDL Optimized does not get converted to clock-rate
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
The "Complex to Magnitude-Angle HDL Optimized"-Block I use in order to calculate the atan2 of my alpha and beta components that come from my clarke-transfrom stays at the data-rate. All the other blocks get converted to the clock-rate in the generated-model as intendet by using the option "clock-rate pipelining".
I tried the oversampling factor and defining the sample-rate and data-rate through rate-transitions, either way the result stays identical.
Is there something I'm missing or do I have to force the block to its final sample-time?
댓글 수: 1
can you share a sample model with your clock rate pipelining requirements for additional guidance? Thanks
채택된 답변
Kiran Kintali
2020년 7월 24일
편집: Kiran Kintali
2020년 7월 24일
The "Complex to Magnitude-Angle HDL Optimized" simulates latency in the original model and does not participate in clock rate pipelining where the latency is modeled at the data rate in the original model and hence currently does not participate in clock rate pipelining.
Please consider using CORDIC atan2 block in the Math library in the interim. We will be expanding on the capabilities of CMA block in the near future to support additional features.

댓글 수: 10
Thanks for your quick answer.
This behavior is especially annoying because other blocks that implement there function using the CORDIC-algorithm (like sin, cos) have no latency and only show their real behavior in the generated model. The same applies for the "HDL Reciprocal"-Block, which uses the Newton-Raphson approximation.
Sadly the CORDIC atan2 block in the Math library does not support HDL code generation yet.
My solution now uses the genrated model with some modificatians (removed all the z^-1 blocks and used the "OutputPipeline" option instead).
I'm looking forward to future updates on these topics.
May I know what release you are currently using?
I checked R2020b Pre-release; the following functions are indeed supported for HDL code generation.
Trigonometric Function block that has Function set to sin, cos, sincos, cos+jsin, or atan2 and Approximation method as CORDIC.
R2019a, but I will migrate to R2020b next week and test this.
This would be great!
Kiran Kintali
2020년 7월 24일
편집: Kiran Kintali
2020년 7월 25일
Thanks for pointing this out; atan2 CORDIC block is supported since 19b release. I have reported the discrepancy to the documentation team.
I'm now using the latest Simulink R2020a (Version 10.1).
Sadly using the Trigonometric Function Block set to atan2 and CORDIC does throw errors when running the Workflow Advisor. The Error: "Error Delay balancing unsuccessful because Delay introduced in feedback loop cannot be path balanced. Offending Block:controllerTB/control_system_mitreset/PLL/FlattenHierarchyon/Vektordreher-3/Trigonometric Function." is coming from an unrelated part of the system which will compile perfectly fine with the other solution ("Complex to Magnitude-Angle HDL Optimized").
The atan2-Block is not inside a feedback-loop, nethertheless I tried the tips mentioned in the documentation Trigonometric Function (Extended Capabilities - Restrictions), but this changed nothing.
When I open the generted model, the atan2-block did not get converted to the faster clock-rate and stayed at the original slower data-rate. But now it doesn't show the whole CORDIC-Algorithm anymore and just adds the delays like the sin/cos-blocks do.
I will try this with a minimalistic example again, but I don't think this will work.
Is there a working example anywhere?
Best Regards
Manuel
Also I can't seem to find a reference to this topic in the release notes from R2019x to R2020x.

Attached is a basic CORDIC atan2 block in a feedback loop and with a specified oversampling factor that was able to generate code.
>> makehdl(gcb, 'OverSampling', 200)
### Generating HDL for 'cmagang_atan2_os_floop/cmag_atan2'.
### Using the config set for model cmagang_atan2_os_floop for HDL code generation parameters.
### Running HDL checks on the model 'cmagang_atan2_os_floop'.
### Begin compilation of the model 'cmagang_atan2_os_floop'...
### Applying HDL optimizations on the model 'cmagang_atan2_os_floop'...
### The code generation and optimization options you have chosen have introduced additional pipeline delays.
### The delay balancing feature has automatically inserted matching delays for compensation.
### The DUT requires an initial pipeline setup latency. Each output port experiences these additional delays.
### Output port 0: 1 cycles.
### Begin model generation.
### Model generation complete.
### Begin VHDL Code Generation for 'cmagang_atan2_os_floop'.
### MESSAGE: The design requires 200 times faster clock with respect to the base rate = 1.
### Working on Trigonometric Function as hdl_prj\hdlsrc\cmagang_atan2_os_floop\Trigonometric_Function.vhd.
### Working on cmag_atan2_tc as hdl_prj\hdlsrc\cmagang_atan2_os_floop\cmag_atan2_tc.vhd.
### Working on cmagang_atan2_os_floop/cmag_atan2 as hdl_prj\hdlsrc\cmagang_atan2_os_floop\cmag_atan2.vhd.
### Code Generation for 'cmagang_atan2_os_floop' completed.
### Creating HDL Code Generation Check Report cmag_atan2_report.html
### HDL check for 'cmagang_atan2_os_floop' complete with 0 errors, 0 warnings, and 1 messages.
### HDL code generation complete.
>>
Thanks for the example, but I'm unable to open it since I have only R2020a installed. Apart from this, my scenario has no oversampling factor defined (1) because it is a multi-rate system whith parts already assigned to the clock-rate.
I managed to get my system working now.
The problem was that on of my custom library blocks was set to "atomic subsystem" and gets used multiple times inside my model and even once inside a feedback-loop. When I use the "Trigonometric Function"-block for the atan2-calculation instead of the "Complex to Magnitude-Angle HDL Optimized"-block, I had to disable the "Treat as atomic unit"-option for this block inside the feedback-loop.
The validation model and generated model work as intended now.
Finally I will test the generated code on my hardware
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Speed Optimization에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)

