Block to assign initial value for internal signal compatible with HDL coder?

4 views (last 30 days)
Hello,
I,m using HDL coder. In my design there is a subtract block in a loop, which do -1 each clock cycle, but without an initial value(from my testbench, the default is 0x0000 for the generated code) for the input, the output will cause a data fill-out. That is to say the next value is 0xFFFF. I tried to use a IC block to initialize, but I was told that this block is not supported by HDL coder. I want to initialize an internal signal by 1. Do we have a HDL coder supported block to do that? I'm using MATLAB2013b and Xilinx 14.4 ISE design suite. Thanks.

Accepted Answer

Bharath Venkataraman
Bharath Venkataraman on 27 Feb 2014
If you use the Delay block, you can assign an initial value which HDL Coder uses. Your model will look as follows: Delay block output -> subtract by 1 -> Delay block input
  1 Comment
Beciu Andreea
Beciu Andreea on 27 Aug 2019
But is it possible to have a dynamic value on the initial state ?
In my case, I would like to choose between TWO values for the initial state based on some conditions in the model.
This is possible in basic Simulink by setting the Initial Value as an input to the register block.
However, with HDL Coder R2019a, the register blocks, for exemple "Unit Delay Enabled Resttable Synchronous" does not allow for the initial value to be an input..

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!