HDL Coder reset control

10 次查看(过去 30 天)
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?

请先登录,再进行评论。

更多回答(1 个)

xiaodong yu
xiaodong yu 2024-6-20
Hi Androw
I want to find out all the delay module with "default reset". I use following command, but it is failed. do you have any suggestions?
find_system('modelname', 'BlockType', 'Delay','ResetType','default')
Apreciate your help.
Regards
XD

Community Treasure Hunt

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

Start Hunting!

Translated by