⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manchester_tb.m

📁 Matlab 与 modelsim 协同仿真的例程设置好modelsim运行环境后
💻 M
字号:
hdldaemon('socket',0)
dstat = hdldaemon('status');
portnum = dstat.ipc_id;
global testisdone;

testisdone = 0;
disp('========================================================');
disp('MATLAB testing Manchester Receiver component decoder.vhd...');
disp('Creates two plots of the entity''s transfer function,');
disp('providing a visualization of the decoder behavior.');
projectdir = pwd;
% ModelSim and Tcl use the UNIX file specification format
unixprojectdir = strrep(projectdir,'\','/');
unixsrcfile = strrep(fullfile(matlabroot,'toolbox','modelsim',...
'modelsimdemos','vhdl','manchester','decoder.vhd'),'\','/');
tclcmd = { ['cd ' unixprojectdir ],...
           'catch {wm geometry . 500x200+0+0}',...
           'vlib work',...
           ['vcom -performdefaultbinding ' unixsrcfile],...
           'vsimmatlab work.decoder',...
           ['matlabtb decoder -mfunc Manchester_decoder -socket ', num2str(portnum)],...
           'run 3000',...
           'quit -f'};
vsim('startupfile','decoder.do', 'tclstart',tclcmd);
disp('Waiting for testing of ''decoder.vhd'' to complete...');
disp('Flag from manchester_decoder.m indicates completion...');
while testisdone == 0,
  pause(0.001);
end
pause(1);
disp('MATLAB test of decoder.vhd is complete. Check the');
disp('generated plot for results.');
disp('Press any key to continue to the next test.');
pause;


testisdone = 0;
disp('====================================================');
disp('MATLAB testing Manchester Receiver component iqconv.vhd...');
disp('Checks isum and qsum output for a randomly generated');
disp('stream of data samples.');
projectdir = pwd;
% ModelSim and Tcl use the UNIX file specification format
unixprojectdir = strrep(projectdir,'\','/');
unixsrcfile = strrep(fullfile(matlabroot,'toolbox','modelsim',...
'modelsimdemos','vhdl','manchester','iqconv.vhd'),'\','/');
tclcmd = { ['cd ' unixprojectdir ],...
           'catch {wm geometry . 500x200+0+0}',...
           'vlib work',...
           ['vcom -performdefaultbinding ' unixsrcfile],...
           'vsimmatlab work.iqconv',...
           'force /iqconv/clk 1 0, 0 5 ns -repeat 10 ns ',...
           'force /iqconv/enable 1',...
           'force /iqconv/reset 1',...
           'run 100',...
           ['matlabtb iqconv -rising /iqconv/clk -mfunc Manchester_iqconv -socket ', num2str(portnum)],...
           'run 1000',...
           'quit -f'};
vsim ('startupfile','iqconv.do', 'tclstart',tclcmd);
while testisdone == 0,
  pause(0.001);
end
pause(1);
disp('MATLAB test of iqconv.vhd is complete.');
disp('If the test fails, an error message is displayed.');
disp('Press any key to continue to the next test.');
pause;


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -