What is the reason for error in HDL Coder and Cadence Stratus HLS tutorial?

Hi all,
I'm trying to complete this tutorial https://se.mathworks.com/help/hdlcoder/ug/get-started-with-matlab-to-hls-workflow-using-hdl-coder-app.html but I get stuck in the Verification step in Workflow Advisor. I get this output in the Workflow Advisor window in Verification step (Verify with HLS Test Bench):
## Begin TestBench generation.
Code generation successful.
### Collecting data...
### Begin HDL test bench file generation with logged samples
### Generating test bench data file: x_in.dat.
### Generating test bench data file: y_out_expected.dat.
### Generating test bench data file: delayed_xout_expected.dat.
### Generating test bench file: mlhdlc_sfir_fixptClass_tb.hpp
### Running Stratus Importer on the generated testbench.
### Working on mlhdlc_sfir_fixpt_bdw_import_log.txt as mlhdlc_sfir_fixpt_bdw_import_log.txt.
Stratus Importer failed. See 'mlhdlc_sfir_fixpt_bdw_import_log.txt' for details.
Error in CadenceStratus>>generateBDWImportScripts at 0
Error in CadenceStratus>>postTBGen at 0
Error in HLSPostCodegenDriver>>postTBGen at 0
Error in Manager>>wfa_runHLSSimulation at 0
And following error message to Matlab Command window:
Error using emlhdlcoder.HLSDriver.Tools.CadenceStratus/generateBDWImportScripts
Stratus Importer failed. See 'mlhdlc_sfir_fixpt_bdw_import_log.txt' for
details.
Error in emlhdlcoder.HLSDriver.Tools.CadenceStratus/postTBGen
Error in emlhdlcoder.HLSDriver.HLSPostCodegenDriver/postTBGen
Error in emlhdlcoder.WorkFlow.Manager/wfa_runHLSSimulation
And here is the content of the 'mlhdlc_sfir_fixpt_bdw_import_log.txt' file is:
INFO: Searching /sw/rhel7/cadence/STRATUS2301 for template
WARNING: BDW_IMPORT_ML_CLOCK_FREQ = 0, using default 5.0.
INFO: Processing template tb.cc
FATAL ERROR: Unable to process template tb.cc
I'm using Matlab version R2024a and Cadence Stratus 23.01, but tested also with 22.01 which gave same error. What are the software versions that this tutorial is verified to work?

Answers (2)

We are not aware of such issues with Stratus integration. The error seems to happen post MATLAB to SystemC translation during Stratus project creation time. Would you be able to share your MATLAB code and the project file or a runme file with the codegen command?
Typically the tool version is managed here... https://www.mathworks.com/help/hdlcoder/gs/language-and-tool-version-support.html. although the Stratus version looks not updated; I will check and get back to you.

1 Comment

Thanks for the answer. I use the example files from the tutorial without any edits, so I don't see reason to post them here. You can get the files by running the tutorial initalization command openExample('hdlcoder/GetStartedWithMATLABToSystemCWorkflowUsingHDLCoderAppExample'). I just copied the mlhdlc_sfir.m and mlhdlc_sfir_tb.m files to new folder and started to follow the instructions. My intent was to complete this example before doing any edits to verify that my environment is working. What I forgot to mention in my previous post is that the environment is running on linux if that have effect on something.
Here is screenshot of the step which fails and is described in original post.
What project file are you talking about? Do you mean the .prj file created by the Workflow Advisor? I'm not using the codegen API to complete this. I'm just using the Workflow Advisor UI so far.

Sign in to comment.

openExample('hdlcoder/GetStartedWithMATLABToSystemCWorkflowUsingHDLCoderAppExample')
Cadence Stratus team has reported a limitation w.r.to spaces in the path. Can you please check MATLAB install path and Stratus path locations if they have any spaces? We are working with the Stratus team to resolve the issue and also emit a better error message in the interim in the MATLAB to SystemC/HLS workflows.
Confirming the following version information of MATLAB and Stratus HLS.
% The generated code will likely also work with later versions
% MATLAB R2024a --> Cadence Stratus 22.1 (Stratus team has tested with 23.1 and later releases).
% MATLAB R2024b pre-release --> Currently being tested with 24.1 (beta).
The R2024a and R2024b pre-release doc will be updated with this information shortly.

9 Comments

There are no spaces on the installation paths of the tools nor the project folder.
Matlab installation: /sw/rhel8/matlab/R2024a/
Stratus HLS: /sw/rhel7/cadence/STRATUS2301
And my tutorial folder path: /homedir01/user/Documents/hls_example, where the user is replaced with my username in the system and it does not contain spaces.
Thank you for the update on confirming the used software versions. Are you able to reproduce this issue in the tutorial? I would gladly provide with more information, but it's hard to get because I cannot debug what is happening with the HDL Coder add-on and with Stratus HLS in the process. Are there any logs that I could check or get more extensive logs with some setting change on the HDL Coder add-on?
Thanks. I will bring this to Cadence team and post additional notes here.
Meanwhile can you create a MathWorks side tech support case with the following info?
INFO: Processing template tb.cc
FATAL ERROR: Unable to process template tb.cc
If you can zip up the folder with source MATLAB files, tutorial.prj and output files folders (which includes the resulting tb.cc file) it might contain some further clues to debug your environment setup.
Based on the information so far, the good news is that your MathWorks installation with HDL Coder is functional and you are getting SystemC files from the MATLAB code. We need to debug your Stratus environment and SystemC to RTL steps with Stratus workflows.
I did the tutorial once more as in the instructions. I let it create the project structure to default directory under /tmp to have less variables in the process. But it stops to same step as previously. What is interesting that tb.cc file does not exist under "codegen" directory structure in any of its folders. Actually, based on the log output I got understanding that it tries to find this template from the Stratus installation directory. But as it should contain testbench for the project it does not make much sense.
Anyway, I will create the tech support case about this and include the zipped project folder.
Can you check the availability of Cadence Stratus HLS license?
stratus_hls -V
What does this command return on your machine?
Thanks
This is the output:
stratus_hls 23.01-s005 (wrapper)
stratus_hls 23.01-s005 (99675.020530)
Copyright (c) 2023 Cadence Design Systems, Inc. All rights reserved worldwide.
02252: Build Sat Dec 2 05:30:27 UTC 2023 for x86-linux.
00048: Stratus_HLS_L 23.01 license available.
00048: Stratus_HLS_XL 23.01 license available.
00048: Stratus_IDE 23.01 license available.
00048: Stratus_FloatingPoint 23.01 license available.
stratus_hls succeeded with 0 errors and 0 warnings.
We will setup a call with Stratus HLS team and post the update here.
Cadence team had a call with Eerik and looked at the setup and identifying the next steps on the Stratus side. The issue is specific to install setup at Eerik's end. Closing the thread from MathWorks support point of view and to be continued with Cadence/Stratus HLS team.
Yes, thank you for organizing the remote session. Even we couldn't get this issue resolved in the meeting it guided further investigation. Like Cadence's representative anticipated based on the error message in the log that it could be file permission issue. I did one more time testing with the environment and I can confirm that it is file permission issue. Once I created the project to location with different file permissions I was able to complete the tutorial. Most significant difference between directories is that ownership in working project directory is by default user:nobody instead of user:users, where user is replaced with my username. Whether different group ownership is the root cause for this or not, I'm not sure but cannot investigate this much more. I don't have elevated access to the system so I cannot alter the file owners and groups to confirm whether I could make tutorial working in directory tree where it was not working before.
>> summary from Eerik : I can now confirm that it is file permission/ownership related issue. I have a directory where we can store our projects and most notable difference is that it uses by default myusername:nobody ownership which made the difference for tutorial working. Directories that I previously used and had this issue used myusername:users kind of ownership.
That's great news. Thanks for the update.

Sign in to comment.

Products

Release

R2024a

Asked:

on 11 Jun 2024

Commented:

on 25 Jun 2024

Community Treasure Hunt

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

Start Hunting!