필터 지우기
필터 지우기

HDL Coder Example - Problem

조회 수: 1 (최근 30일)
Ali Alsaqqa
Ali Alsaqqa 2013년 6월 21일
Hi,
I am trying to follow the example below:
But it is not clear for me where should I write this script? I mean, the first two lines:
design_name = 'mlhdlc_sfir.m';
testbench_name = 'mlhdlc_sfir_tb.m';
I understood that I should create two new files with the above mentioned names. OK. What about this?
type(design_name);
Where should this be written? I did it in the command window (main window).
Now there is the code itself, which begins after:
$#codegen
I wrote this in a new m file.
But I get the following error:
??? Input argument "h_in1" is undefined.
Error in ==> test_hdl_coder at 16
m1 = h_in1 * a1; m2 = h_in2 * a2;
Any ideas?

답변 (2개)

Tim McBrayer
Tim McBrayer 2013년 6월 21일
These scripts are part of the published examples that are shipped with HDL Coder. The demo is set up to have you copy the prewritten example files and run the example using them. The "type" command simply prints the file contents to the MATLAB console, so that you can examine the example code in the HTML example you linked to.
To start interactively executing the example, the best place to start is after the testbench file has been displayed; at this anchor link: http://www.mathworks.com/products/hdl-coder/examples.html?file=/products/demos/shipping/hdlcoder/mlhdlc_tutorial_sfir.html#5 This portion creates and copies the prewritten examples files to a temporary directory and then walks you through creating a MATLAB HDL Coder project.
  댓글 수: 1
Ali Alsaqqa
Ali Alsaqqa 2013년 6월 21일
OK, I created two files, one for the design, other for the TestBench, executed the script, but it gives me the following error:
??? Error using ==> copyfile
No matching files were found

댓글을 달려면 로그인하십시오.


Kiran Kintali
Kiran Kintali 2013년 8월 29일
The demo is trying to show that if you execute the following sequence of commands you will have a working directory with write permissions with an example copied there to begin exploring MATLAB to HDL workflow. Hope this is helpful.
design_name = 'mlhdlc_sfir.m';
testbench_name = 'mlhdlc_sfir_tb.m';mlhdlc_demo_dir = fullfile(matlabroot, 'toolbox', 'hdlcoder', 'hdlcoderdemos', 'matlabhdlcoderdemos');
mlhdlc_temp_dir = [tempdir 'mlhdlc_sfir'];
cd(tempdir);
[~, ~, ~] = rmdir(mlhdlc_temp_dir, 's');
mkdir(mlhdlc_temp_dir);
cd(mlhdlc_temp_dir);
copyfile(fullfile(mlhdlc_demo_dir, design_name), mlhdlc_temp_dir);
copyfile(fullfile(mlhdlc_demo_dir, testbench_name), mlhdlc_temp_dir);

카테고리

Help CenterFile Exchange에서 HDL Coder에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by