HDL Coder - Fixed-Point Conversion

9 views (last 30 days)
Sam
Sam on 17 Dec 2014
Answered: niharika agrawal on 20 Mar 2015
I am new to this HDL coder. I have read numerous doucments and watched videos on how to generate VHDL code using Matlab. For simplistic purpose, I decided to create very simple adder function with correspond test bench (TB). When I get to HDL Code Generation window, I get stuck in Fixed-Point Conversion group. Below I have attached the error message that I received from the Fixed-Point Conversion.
During my research, I found out there were numerous issues with installing the complier. Thanks to those users, I was able to install my complier properly. I installed it by using mex –setup command. I was also able to run buildInstrumentedMex adder -args {1,0} and mex file was create, which was a good indication of the complier.
When I launched the HDL coder from the APP tab and add the function/TB .m file, my working directory will change to the VHDL project directory. I am not sure if this is expected behavior during this process.
I would be greatly appreciated if someone could help out with issue.
Error using Float2FixedConverter.Float2FixedConverter (line 143) Cannot find design 'adder' on the path
Error in C:\Program Files\MATLAB\R2013a\toolbox\coder\coder\+coderprivate\Float2FixedManager.p>Float2FixedManager.buildFloatingPointCode (line 77)
Error in C:\Program Files\MATLAB\R2013a\toolbox\coder\coder\private\fpBuildFloatingPointCode.p>fpBuildFloatingPointCode (line 4)
Error in C:\Program Files\MATLAB\R2013a\toolbox\coder\coder\emlcprivate.p>emlcprivate (line 16)
Cannot find design 'adder' on the path
Error in Float2FixedConverter>Float2FixedConverter at 143
Error in Float2FixedManager>buildFloatingPointCode at 77
Error in fpBuildFloatingPointCode at 4
Error in emlcprivate at 16
  6 Comments
Srinivas
Srinivas on 17 Dec 2014
Hello Sam, I was able to investigate the issue. In MATLAB 2013a for MATLAB HDL Coder(on Windows) we have an issue while adding MATLAB function and MATLAB Test Bench by using the 'Add MATLAB function' and 'Add files' buttons respectively.
As a workaround, you could add the files by dragging and dropping on the project. Create a new project and try adding the MATLAB Function and MATLAB Test Bench by dragging and dropping the files from the MATLAB file viewer('Current Folder' window). This should avoid the error you are encountering and let you proceed forward. Please confirm the same if this workaround works for you.
This issue has been fixed in the future releases.
Thanks, Srinivas.
Sam
Sam on 17 Dec 2014
Hey Srinivas,
You are correct. I followed your instruction and I was able to complete the HDL Code Generation.
Thank you, Sam

Sign in to comment.

Answers (2)

Srinivas
Srinivas on 17 Dec 2014
Hello Sam, Can you confirm that both the files(adder.m, adder_tb.m) are in the same directory as the project file?
Also, if there is a mex file on the path with the same name as your design(adder), then it would shadow the MATLAB file adder.m. If this is the case, then the HDL Coder project might not be able to find the design. You could use the 'which' command to see if 'adder.m' is getting shadowed by other files:
>> which -all adder.m
It would also be helpful if you can mention the version of MATLAB that you are using.
Thanks, Srinivas.
  1 Comment
Sam
Sam on 17 Dec 2014
Hey Srinivas,
Yes both files are in the same directory.
Thanks Sam

Sign in to comment.


niharika agrawal
niharika agrawal on 20 Mar 2015
Hello
I am having the same problem when I am converting AES-128 MATLAB code to VHDL using HDL coder. I have done all the steps mentioned above but still getting these errors.

Products

Community Treasure Hunt

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

Start Hunting!