Professional Documents
Culture Documents
Step 1:
1 cos
In1
2
In2 Product
cos
2*pi/3
2/3 1
3 Out1
Product1 Gain
In3
cos
4
Product2
In4
sin
Product3
sin
2/3 2
Out2
Product4 Gain1
sin
Product5
1.all the input & out put ports have been defined as:int32
4 In1
theta Out1
2
1 In2 Vd
va
2 In3
vb Out2
1
3 In4 Vq
vc
dqo
This much .vhd files was created.
In clk
Clock Gateway In1
0 ce_out Out
reset
Constant5 Gateway Out
Scope
System 1 In CEProbe
Generator
clk_enable
Constant4 Gateway In ClockEnable Probe
1
In1 Out1 Out
Constant3 Gateway Out1
Scope1
1 In2
Constant
1 In3 Out
Out2
Constant1 Gateway Out2
Scope2
1 In4
Constant2
BlackBox
VHD FILE:
function dqo_config(this_block)
% Revision History:
%
% 06-Feb-2012 (18:04 hours):
% Original code was machine generated by Xilinx's System Generator after
parsing
% C:\Documents and Settings\E567962\My Documents\MATLAB\hdlsrc\dqo.vhd
%
%
this_block.setTopLevelLanguage('VHDL');
this_block.setEntityName('dqo');
% 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('clk');
this_block.addSimulinkInport('reset');
this_block.addSimulinkInport('clk_enable');
this_block.addSimulinkInport('In1');
this_block.addSimulinkInport('In2');
this_block.addSimulinkInport('In3');
this_block.addSimulinkInport('In4');
this_block.addSimulinkOutport('ce_out');
this_block.addSimulinkOutport('Out1');
this_block.addSimulinkOutport('Out2');
ce_out_port = this_block.port('ce_out');
ce_out_port.setType('UFix_1_0');
ce_out_port.useHDLVector(false);
Out1_port = this_block.port('Out1');
Out1_port.setType('UFix_32_0');
Out2_port = this_block.port('Out2');
Out2_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('clk').width ~= 1);
this_block.setError('Input data type for port "clk" must have
width=1.');
end
this_block.port('clk').useHDLVector(false);
if (this_block.port('reset').width ~= 1);
this_block.setError('Input data type for port "reset" must have
width=1.');
end
this_block.port('reset').useHDLVector(false);
if (this_block.port('clk_enable').width ~= 1);
this_block.setError('Input data type for port "clk_enable" must have
width=1.');
end
this_block.port('clk_enable').useHDLVector(false);
if (this_block.port('In1').width ~= 32);
this_block.setError('Input data type for port "In1" must have
width=32.');
end
if (this_block.port('In2').width ~= 32);
this_block.setError('Input data type for port "In2" must have
width=32.');
end
if (this_block.port('In3').width ~= 32);
this_block.setError('Input data type for port "In3" must have
width=32.');
end
if (this_block.port('In4').width ~= 32);
this_block.setError('Input data type for port "In4" must have
width=32.');
end
end % if(inputTypesKnown)
% -----------------------------
% (!) Set the inout port rate to be the same as the first input
% rate. Change the following code if this is untrue.
uniqueInputRates = unique(this_block.getInputRates);
% this_block.addFile('');
% this_block.addFile('');
this_block.addFile('dqo.vhd');
this_block.addFile('Trigonometric_Function1.vhd');
this_block.addFile('Trigonometric_Function2.vhd');
this_block.addFile('Trigonometric_Function3.vhd');
this_block.addFile('Trigonometric_Function4.vhd');
this_block.addFile('Trigonometric_Function6.vhd');
this_block.addFile('Trigonometric_Function7.vhd');
return;
MATLAB ERROR:
HDL simulation model compilation failed.
ERROR:HDLCompiler:104 - "xlisim_dqo.vhd" Line 1861: Cannot find <trigonometric_function6> in library
<work>. Please ensure that the library was compiled, and that a library and a use clause are present in
the VHDL file.
ERROR:HDLCompiler:854 - "xlisim_dqo.vhd" Line 1802: Unit <rtl> ignored due to previous errors.
Reported by:
'abc_to_dqo/Black Box'