why the error and how to remove it : Could not open file variable. No such file or directory.
Show older comments
I am converting a matlab function to vhdl. During fixed point conversion I get the following error in Build Log.
Error using fileread (line 27) Could not open file variable. No such file or directory.
I have attached the function and testbench. Why it is not able to read the file?
3 Comments
priya agarwal
on 20 Jan 2014
Jyothirmai
on 20 Feb 2014
Edited: Jyothirmai
on 20 Feb 2014
Even i got the same erros: Error in Float2FixedConverter>buildDesign at 1699
Error in Float2FixedManager>buildFloatingPointCode at 102
Error in fpBuildFloatingPointCode at 4
Error in emlcprivate at 16
how to remove them? Its saying Float2FixedConverter.m doesnot exist do you want to create? Can i get it in net?
amrita
on 5 Sep 2014
This happens when compiler is not configured; floating2fixedconverter.m needs the compiler;
in matlab command prompt run >>mex -setup command
Accepted Answer
More Answers (2)
Image Analyst
on 20 Jan 2014
Those files don't mention fileread() and don't even have 27 lines. Please attach the entire error message - ALL THE RED TEXT - don't snip out just a small part of it like you did. Is there any chance in the actual code - the code that you forgot to attach - that you were supposed to use fread() instead of fileread()? What does it say when you do these in the command window:
which fread
which fileread
1 Comment
priya agarwal
on 20 Jan 2014
Edited: priya agarwal
on 20 Jan 2014
amrita
on 5 Sep 2014
0 votes
This happens when compiler is not configured; floating2fixedconverter.m needs the compiler;
in matlab command prompt run >>mex -setup command
8 Comments
LRM
on 6 Dec 2014
What should be done if the error persists even after running the 'mex -setup' command? I got the following errors (pasted below) when I ran my code Gcode.m with testbench Gcode_testbench.m, even after running mex setup.
Error using Float2FixedConverter.Float2FixedConverter (line 143) Cannot find design 'Gcode' 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 'Gcode' 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
-------------------
Tim McBrayer
on 8 Dec 2014
Cannot find design 'Gcode' on the path.
I would investigate this angle. With what has been provided here there is nothing else to go on. You don't even mention what release you are using.
Image Analyst
on 8 Dec 2014
But the paths indicate it's R2013a.
LRM
on 9 Dec 2014
Yes, I am using R2013a. The code runs fine in Matlab. In the HDL Coder Workflow Advisor, the Define Input Types step runs fine, but Fixed-Point Conversion throws this error.
I had successfully run the filter example (mlhdlc_sfir.m) given in the Getting Started Guide, in which I used the Xilinx (14.7) ISIM Simulator.
I am not able to figure out why the error 'Cannot find design 'Gcode' on the path.' is appearing.
LRM
on 9 Dec 2014
The Gcode.m file calls several functions. I have verified that none of the constructs while, break, continue, return or parfor have been used in Gcode or any function called.
Please let me know if any other information is required.
LRM
on 10 Dec 2014
I checked Gcode.m using the Code Generation Readiness Tool ( http://in.mathworks.com/help/fixedpoint/ug/check-code-using-the-code-generation-readiness-tool.html)
The tool singled out the following errors: the use of .mexw32 scripts and some unsupported Matlab function calls (tic,toc,fwrite,impz). I will change the code suitably.
I need your confirmation that this is the right approach. Please correct me if I am using the wrong approach for checking HDL code-generation readiness.
Tim McBrayer
on 10 Dec 2014
Yes, this is the correct approach towards ensuring your code can pass through fixed point conversion. I don't know if it will address your original symptom or not.
LRM
on 11 Dec 2014
Thank you very much for your answer.
About the first error - I had created the project (.prj) file in a separate directory, and this was causing the error 'Cannot find design 'Gcode' on the path.'. Now I have created a new .prj file within the directory containing Gcode.m and the associated functions. The fixed point conversion errors (that the tool had pointed out yesterday) are now directly appearing in the HDL coder screen.
Categories
Find more on Speed and Area Optimization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!