HDL Coder reset control

조회 수: 12 (최근 30일)
Andrew
Andrew 2013년 2월 8일
댓글: luckfy zhang 2018년 4월 21일
Hi, Simulink HDL Coder: is it possible to control the generation of the vhdl reset clause on a block by block basis?
In general, most flops in a datapath design dont require reset. we just reset the input of datapath, and wait long enough for the known input to propagate through the datapath and put the design in a well defined state. Anything with feedback requires a reset. By using reset only when required like this, we save fpga routing resource, and produce more efficient, higher performance designs.
However,HDL coder produces vhdl with a reset on every flop. (we use sychronous reset). Is there a way for us to prevent hdl coder adding resets on all flops? can we control it?
cheers andrew

채택된 답변

Tim McBrayer
Tim McBrayer 2013년 2월 11일
편집: Tim McBrayer 2017년 2월 28일
Andrew,
There is a block-level parameter that allows the reset to be disabled on a block by block basis. You can access this parameter by right-clicking on a Delay block and choosing HDL Code -> HDL Block Properties. On this dialog, change ResetType from 'default' to 'none'. This sets the register generated from that Delay block to be generated with no reset.
The ResetType block parameter chooses whether a block will generate a reset or not. 'None' will not generate a reset; 'default' will generate whatever sort of reset is configured for HDL Coder in its Global Settings Configuration Parameters pane.
Since you have stated that you want the default to be no reset, the GUI-based interactive approach will be tedious. To script this, you can use the hdlset_param command, which has the syntax:
hdlset_param(block, parameter, value)
You can combine this with find_system to set all the Delay blocks in your model to have no reset:
hdlset_param(find_system('modelname', 'BlockType', 'Delay'), 'ResetType', 'none')
This will change the value of the HDL block parameter on all Delay blocks in your model to 'none'. Block parameters are persistent and are saved in the model, so this should be a one-time configuration. You can then go back and re-add a reset to those Delay blocks that require it.
  댓글 수: 3
Tim McBrayer
Tim McBrayer 2017년 2월 28일
Good catch; I fixed my statement to match yours.
luckfy zhang
luckfy zhang 2018년 4월 21일
Hello, you answer seems do not applicable for me since there are only asynchronous and synchronous choice for ResetType. And I cannot set this parameter to none. My Matlab version is R2015b. Could you provide me for some help?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by