HDL Coder - Fixed-Point Conversion

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 件のコメント

Kiran Kintali
Kiran Kintali 2014 年 12 月 17 日
Hi Sam,
I do not see any issue with the code generation. What version of MATLAB are you using? I am attaching a screenshot that shows completed fixed-point conversion and HDLcode generation steps in the HDL workflow advisor.
Do you have your design (adder.m) and test bench (adder_tb.m) and the project in the same folder and is it writable?
Thanks
Kiran Kintali
Kiran Kintali 2014 年 12 月 17 日
HDL Workflow Advisor
Sam
Sam 2014 年 12 月 17 日
Hey Kiran,
Thank you for looking into this.
I am using MATLAB 2013a and both adder.m and adder_tb.m are in the same directory.
When I tried to keep my design file in the same folder as the project, I got an error saying "Invalid design location, design should be in the same directory as the project."
Sam
Sam 2014 年 12 月 17 日
What do you mean by "is it writable"?
Srinivas
Srinivas 2014 年 12 月 17 日
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 2014 年 12 月 17 日
Hey Srinivas,
You are correct. I followed your instruction and I was able to complete the HDL Code Generation.
Thank you, Sam

サインインしてコメントする。

回答 (2 件)

Srinivas
Srinivas 2014 年 12 月 17 日

0 投票

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 件のコメント

Sam
Sam 2014 年 12 月 17 日
Hey Srinivas,
Yes both files are in the same directory.
Thanks Sam

サインインしてコメントする。

niharika agrawal
niharika agrawal 2015 年 3 月 20 日

0 投票

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.

製品

質問済み:

Sam
2014 年 12 月 17 日

回答済み:

2015 年 3 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by