MATLAB DESIGN HDL CODER RELEASE NOTES User's Guide Page 71

  • Download
  • Add to my manuals
  • Print
  • Page
    / 410
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 70
System Generator for DSP User Guide www.xilinx.com 71
UG640 (v 12.2) July 23, 2010
Compiling MATLAB into an FPGA
Example of disp Function
The following MCode function shows how to use the disp function to print variable
values.
function x = testdisp(a, b)
persistent dly, dly = xl_state(zeros(1, 8), a);
persistent rom, rom = xl_state([3, 2, 1, 0], a);
disp('Hello World!');
disp(['num2str(dly) is ', num2str(dly)]);
disp('disp(dly) is ');
disp(dly);
disp('disp(rom) is ');
disp(rom);
a2 = dly.back;
dly.push_front_pop_back(a);
x = a + b;
disp(['a = ', num2str(a), ', ', ...
'b = ', num2str(b), ', ', ...
'x = ', num2str(x)]);
disp(num2str(true));
disp('disp(10) is');
disp(10);
disp('disp(-10) is');
disp(-10);
disp('disp(a) is ');
disp(a);
disp('disp(a == b)');
disp(a==b);
The Enable print with disp option must be checked.
Page view 70
1 2 ... 66 67 68 69 70 71 72 73 74 75 76 ... 409 410

Comments to this Manuals

No comments