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

📄 fir_top_config.m

📁 使用MATLAB工具
💻 M
字号:
function fir_top_config(this_block)  % Revision History:  %  %   05-Nov-2005  (11:17 hours):  %     Original code was machine generated by Xilinx's System Generator after parsing  %     E:\Test\AD_DA\fir_top.v  %  %  this_block.setTopLevelLanguage('Verilog');  this_block.setEntityName('fir_top');  % System Generator has to assume that your entity  has a combinational feed through;   %   if it  doesn't, then comment out the following line:  this_block.tagAsCombinational;  this_block.addSimulinkInport('din');  this_block.addSimulinkInport('rstn');  this_block.addSimulinkOutport('dout');  dout_port = this_block.port('dout');  dout_port.setType('UFix_32_0');  % -----------------------------  if (this_block.inputTypesKnown)    % do input type checking, dynamic output type and generic setup in this code block.    if (this_block.port('din').width ~= 12);      this_block.setError('Input data type for port "din" must have width=12.');    end    if (this_block.port('rstn').width ~= 1);      this_block.setError('Input data type for port "rstn" must have width=1.');    end    this_block.port('rstn').useHDLVector(false);  end  % if(inputTypesKnown)  % -----------------------------  % -----------------------------   if (this_block.inputRatesKnown)     setup_as_single_rate(this_block,'clk','ce')   end  % if(inputRatesKnown)  % -----------------------------  % Add addtional source files as needed.  %  |-------------  %  | Add files in the order in which they should be compiled.  %  | If two files "a.vhd" and "b.vhd" contain the entities  %  | entity_a and entity_b, and entity_a contains a  %  | component of type entity_b, the correct sequence of  %  | addFile() calls would be:  %  |    this_block.addFile('b.vhd');  %  |    this_block.addFile('a.vhd');  %  |-------------  %    this_block.addFile('');  %    this_block.addFile('');  this_block.addFile('fir_top.v');  this_block.addFile('fir_160_tap.v');return;% ------------------------------------------------------------function setup_as_single_rate(block,clkname,cename)   inputRates = block.inputRates;   uniqueInputRates = unique(inputRates);   if (length(uniqueInputRates)==1 & uniqueInputRates(1)==Inf)     block.setError('The inputs to this block cannot all be constant.');     return;   end   if (uniqueInputRates(end) == Inf)      hasConstantInput = true;      uniqueInputRates = uniqueInputRates(1:end-1);   end   if (length(uniqueInputRates) ~= 1)     block.setError('The inputs to this block must run at a single rate.');     return;   end   theInputRate = uniqueInputRates(1);   for i = 1:block.numSimulinkOutports      block.outport(i).setRate(theInputRate);   end   block.addClkCEPair(clkname,cename,theInputRate);   return; % ------------------------------------------------------------

⌨️ 快捷键说明

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