makehdl error: "There is no block named "

8 views (last 30 days)
Adam
Adam on 7 Dec 2015
When using makehdl() to generate VHDL, I get an error after VHDL is successfully created. This is a problem because I would like to call makehdl() several times for different, independent blocks.
The details of the error message are below, including HTML tags that don't show up in the web version of the report. In the text below, I have changed the name of my model to 'model_name' and the name of the block to 'block_name'. The VHDL file block_name.vhd is successfully created, but Matlab gives the error "There is no block named 'model_name/'."
Similar error messages have been reported when using the add_block() function. I suspect there is a formatting problem with my block or model name. Perhaps the trailing slash is a problem? My model 'model_name.slx' contains some blocks that are not HDL Coder compliant, so I am only generating VHDL for the block 'model_name/block_name'.
The error appears to be related to drawing blocks in the generated model. As a workaround, I would be happy to generate VHDL without creating a generated model. I'm not sure if that is possible.
Thank you for your help, MathWorks community.
### Error using slhdlcoder.SimulinkBackEnd/drawTestBench>addTopLevelAnnotationBlock (line 89)
There is no block named 'model_name/<!DOCTYPE HTML PUBLIC "-////W3C////DTD HTML 4.0////EN" "http:////www.w3.org//TR//REC-html40//strict.dtd">
<html><head><meta name="qrichtext" content="1" //><style type="text//css">
p, li { white-space: pre-wrap; }
<//style><//head><body style=" font-family:'Helvetica'; font-size:14px; font-weight:600; font-style:normal;">
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br //><//p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14px;"> Model Name <//span><//p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br //><//p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14px; font-weight:400;"> This model is used to create VHDL <//span><//p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14px; font-weight:400;">for the main blocks within the <//span><//p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14px; font-weight:400;">Block Name.<//span><//p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:400;"><br //><//p><//body><//html>'
Error in slhdlcoder.SimulinkBackEnd/drawTestBench (line 47)
Error in slhdlcoder.SimulinkBackEnd/generateModel (line 69)
Error in slhdlcoder.HDLCoder/generateModel (line 56)
Error in slhdlcoder.HDLCoder/runModelGeneration>doModelGeneration (line 54)
Error in slhdlcoder.HDLCoder/runModelGeneration (line 24)
Error in slhdlcoder.HDLCoder/makehdl (line 347)
Error in privmakehdl (line 18)
Error in makehdl (line 75)
privmakehdl(varargin{:})
Error in [my_mfilename] (line 316)
makehdl(block_name, 'CheckHDL', 'off');
### Begin VHDL Code Generation for 'model_name'.
### Working on model_name/block_name as hdlsrc\model_name\block_name.vhd
### Generating package file hdlsrc\model_name\block_name_pkg.vhd
### Generating HTML files for code generation report in C:\[path] directory...
### Creating HDL Code Generation Check Report block_name_report.html
### HDL check for 'model_name' complete with 2 errors, 6 warnings, and 0 messages.
Error using slhdlcoder.HDLCoder/reporterrors (line 36)
For the block 'model_name'
There is no block named 'model_name/<!DOCTYPE HTML PUBLIC "-////W3C////DTD HTML 4.0////EN"
"http:////www.w3.org//TR//REC-html40//strict.dtd">

Answers (1)

Bharath Venkataraman
Bharath Venkataraman on 9 Dec 2015
Please try the following command: makehdl([model_name '/' block_name]). It will be best if we can see the model (if you can post it).

Categories

Find more on Code Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!