Simulink block for input: constant block not supported in HDL Coder

2 views (last 30 days)
Hello, I am using Matlab 2012a, I built a simple Simulink model, made of a source block, a tigonometric block(sin) and a sink block:
(_in_)---->|_trigonometric_|--->(_out_)
When i try to generate an HDL code through HDL workflow advisor out of it, I got this error
Abnormal exit:Invalid simulink object name:/constant
But the constant block is supported by hdllib.The source block was taken from --> DSP System Toolbox--> Sinks
Will you please suggest a way to remove this error.
  1 Comment
Ethan
Ethan on 8 Nov 2016
Were you ever able to figure this out? I am in a similar situation right now with Demux1 and Clock. Ironically, it is okay with Demux, but not Demux1, or any other renaming of it.

Sign in to comment.

Answers (2)

Tim McBrayer
Tim McBrayer on 28 Feb 2014
Does your constant block happen to be named "/constant"? From the error message, the leading forward slash seems to be the abnormal portion.
  2 Comments
latha
latha on 1 Mar 2014
Sir, Thanks for replying. I checked the name of the block it is given as Constant1. and the same error persists.I have attached the block diagram drawn in simulink.
latha
latha on 5 Mar 2014
Sir I checked the following but there is no mismatch in the subsystem names. I have checked the naming convention in 'Model Advisor but no error was found.After having run all these checks the same error ie; Abnormal exit:Invalid simulink object name:/constant persists. Kindly suggest a way to rectify the mistake.
>> s1='activation_fn/Constant1'
s1 =
activation_fn/Constant1
>> s2=gcb
s2 =
activation_fn/Constant1
>> strcmp(s1,s2)
ans =
1
>> whos s1 s2 Name Size Bytes Class Attributes
s1 1x23 46 char
s2 1x23 46 char

Sign in to comment.


Paul Rogers
Paul Rogers on 3 May 2017
Hello! I just had this issue in my design as well. It turns out my issue was solved by ensuring all constants were not floating point data types (mine were set to doubles). I changed them to fixed point 16.12 which fixed the issue. I hope this helps you and others!

Products

Community Treasure Hunt

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

Start Hunting!