HDL Workflow advisor to convert a difference equation into verilog

2 次查看(过去 30 天)
I have a Simulink model of a DC-DC convertor (attached below). The PID block is to control the duty cycle which is modeled using Delays, Gains and Adder. Now i want to model the PID block in verilog. I need help doing it in below two ways.
1. Convert the PID block directly using the HDL Workflow advisor with fixed-point conversion of Gains and other signals 2. convert the PID block into a Matlab function block in simulink. convert the function to verilog using HDL Workflow advisor with fixed point conversion of Gains and other signals

回答(1 个)

Tim McBrayer
Tim McBrayer 2016-10-21
I'm not entirely sure what your question is. Both approaches are perfectly valid as input for HDL Coder and are both very well supported. Both will need conversion to fixed point data. Once you choose the appropriate data types for your arithmetic operators, to balance word size vs. precision, HDL Coder can generate your platform-independent Verilog code.
As a new feature in R2016b, HDL Coder now has Native Floating Point support. This feature generates HDL compliant with the IEEE-754 floating point standard for the single (32-bit) data type. Should you want to explore this route, the only model modification necessary would be to convert your model to use the single datatype instead of double. You will need to understand the effects that this has on your generated code as well.
  1 个评论
Anojh kumaran Rajendra
My problem is Fixed point conversion. in the first approach, when i run the fixed point tool; the tool also alters the data types of the blocks outside PID (ADC, DPWM). i need to fix the ADC output to int8 and DPWM input to int8.

请先登录,再进行评论。

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by