Add files for FIR and IIR filter - not tested
This commit is contained in:
@@ -0,0 +1,231 @@
|
||||
-- -------------------------------------------------------------
|
||||
--
|
||||
-- File Name: C:\Users\Imants\Desktop\sin_gen\iif_hdl\ld3_fixed_point2\IIF.vhd
|
||||
-- Created: 2020-06-09 21:58:09
|
||||
--
|
||||
-- Generated by MATLAB 9.3 and HDL Coder 3.11
|
||||
--
|
||||
--
|
||||
-- -------------------------------------------------------------
|
||||
-- Rate and Clocking Details
|
||||
-- -------------------------------------------------------------
|
||||
-- Model base rate: 4.53515e-05
|
||||
-- Target subsystem base rate: 4.53515e-05
|
||||
--
|
||||
--
|
||||
-- Clock Enable Sample Time
|
||||
-- -------------------------------------------------------------
|
||||
-- ce_out 4.53515e-05
|
||||
-- -------------------------------------------------------------
|
||||
--
|
||||
--
|
||||
-- Output Signal Clock Enable Sample Time
|
||||
-- -------------------------------------------------------------
|
||||
-- Out1 ce_out 4.53515e-05
|
||||
-- -------------------------------------------------------------
|
||||
--
|
||||
-- -------------------------------------------------------------
|
||||
|
||||
|
||||
-- -------------------------------------------------------------
|
||||
--
|
||||
-- Module: IIF
|
||||
-- Source Path: ld3_fixed_point2/IIF
|
||||
-- Hierarchy Level: 0
|
||||
--
|
||||
-- -------------------------------------------------------------
|
||||
LIBRARY IEEE;
|
||||
USE IEEE.std_logic_1164.ALL;
|
||||
USE IEEE.numeric_std.ALL;
|
||||
|
||||
ENTITY IIF IS
|
||||
PORT( clk : IN std_logic;
|
||||
reset : IN std_logic;
|
||||
clk_enable : IN std_logic;
|
||||
In1 : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En14
|
||||
ce_out : OUT std_logic;
|
||||
Out1 : OUT std_logic_vector(15 DOWNTO 0) -- sfix16_En14
|
||||
);
|
||||
END IIF;
|
||||
|
||||
|
||||
ARCHITECTURE rtl OF IIF IS
|
||||
|
||||
-- Signals
|
||||
SIGNAL enb : std_logic;
|
||||
SIGNAL enb_const_rate : std_logic;
|
||||
SIGNAL Constant_out1 : unsigned(15 DOWNTO 0); -- ufix16_En21
|
||||
SIGNAL Constant_out1_1 : unsigned(15 DOWNTO 0); -- ufix16_En21
|
||||
SIGNAL In1_signed : signed(15 DOWNTO 0); -- sfix16_En14
|
||||
SIGNAL Constant3_out1 : signed(15 DOWNTO 0); -- sfix16_En14
|
||||
SIGNAL Constant2_out1 : unsigned(15 DOWNTO 0); -- ufix16_En16
|
||||
SIGNAL Subtract1_out1 : signed(15 DOWNTO 0); -- sfix16_En9
|
||||
SIGNAL Delay1_out1 : signed(15 DOWNTO 0); -- sfix16_En9
|
||||
SIGNAL a_3_cast : signed(16 DOWNTO 0); -- sfix17_En16
|
||||
SIGNAL a_3_mul_temp : signed(32 DOWNTO 0); -- sfix33_En25
|
||||
SIGNAL a_3_cast_1 : signed(31 DOWNTO 0); -- sfix32_En25
|
||||
SIGNAL a_3_out1 : signed(15 DOWNTO 0); -- sfix16_En10
|
||||
SIGNAL a_2_mul_temp : signed(31 DOWNTO 0); -- sfix32_En23
|
||||
SIGNAL a_2_out1 : signed(15 DOWNTO 0); -- sfix16_En9
|
||||
SIGNAL Subtract2_sub_cast : signed(31 DOWNTO 0); -- sfix32_En14
|
||||
SIGNAL Subtract2_sub_cast_1 : signed(31 DOWNTO 0); -- sfix32_En14
|
||||
SIGNAL Subtract2_sub_temp : signed(31 DOWNTO 0); -- sfix32_En14
|
||||
SIGNAL Subtract2_out1 : signed(15 DOWNTO 0); -- sfix16_En9
|
||||
SIGNAL Subtract1_sub_cast : signed(31 DOWNTO 0); -- sfix32_En10
|
||||
SIGNAL Subtract1_sub_cast_1 : signed(31 DOWNTO 0); -- sfix32_En10
|
||||
SIGNAL Subtract1_sub_temp : signed(31 DOWNTO 0); -- sfix32_En10
|
||||
SIGNAL Subtract1_out1_1 : signed(15 DOWNTO 0); -- sfix16_En9
|
||||
SIGNAL b_1_cast : signed(16 DOWNTO 0); -- sfix17_En21
|
||||
SIGNAL b_1_mul_temp : signed(32 DOWNTO 0); -- sfix33_En30
|
||||
SIGNAL b_1_cast_1 : signed(31 DOWNTO 0); -- sfix32_En30
|
||||
SIGNAL b_1_out1 : signed(15 DOWNTO 0); -- sfix16_En15
|
||||
SIGNAL b_1_out1_1 : signed(15 DOWNTO 0); -- sfix16_En15
|
||||
SIGNAL Constant1_out1 : signed(15 DOWNTO 0); -- sfix16_En20
|
||||
SIGNAL Constant1_out1_1 : signed(15 DOWNTO 0); -- sfix16_En20
|
||||
SIGNAL Delay1_out1_1 : signed(15 DOWNTO 0); -- sfix16_En9
|
||||
SIGNAL b_3_mul_temp : signed(31 DOWNTO 0); -- sfix32_En29
|
||||
SIGNAL b_3_out1 : signed(15 DOWNTO 0); -- sfix16_En15
|
||||
SIGNAL b_3_out1_1 : signed(15 DOWNTO 0); -- sfix16_En15
|
||||
SIGNAL Sum1_add_cast : signed(31 DOWNTO 0); -- sfix32_En15
|
||||
SIGNAL Sum1_add_cast_1 : signed(31 DOWNTO 0); -- sfix32_En15
|
||||
SIGNAL Sum1_add_temp : signed(31 DOWNTO 0); -- sfix32_En15
|
||||
SIGNAL Sum1_out1 : signed(15 DOWNTO 0); -- sfix16_En14
|
||||
|
||||
ATTRIBUTE multstyle : string;
|
||||
|
||||
BEGIN
|
||||
Constant_out1 <= to_unsigned(16#D9E8#, 16);
|
||||
|
||||
enb_const_rate <= clk_enable;
|
||||
|
||||
HwModeRegister_process : PROCESS (clk, reset)
|
||||
BEGIN
|
||||
IF reset = '1' THEN
|
||||
Constant_out1_1 <= to_unsigned(16#0000#, 16);
|
||||
ELSIF clk'EVENT AND clk = '1' THEN
|
||||
IF enb_const_rate = '1' THEN
|
||||
Constant_out1_1 <= Constant_out1;
|
||||
END IF;
|
||||
END IF;
|
||||
END PROCESS HwModeRegister_process;
|
||||
|
||||
|
||||
In1_signed <= signed(In1);
|
||||
|
||||
Constant3_out1 <= to_signed(-16#5E65#, 16);
|
||||
|
||||
Constant2_out1 <= to_unsigned(16#F268#, 16);
|
||||
|
||||
enb <= clk_enable;
|
||||
|
||||
Delay1_process : PROCESS (clk, reset)
|
||||
BEGIN
|
||||
IF reset = '1' THEN
|
||||
Delay1_out1 <= to_signed(16#0000#, 16);
|
||||
ELSIF clk'EVENT AND clk = '1' THEN
|
||||
IF enb = '1' THEN
|
||||
Delay1_out1 <= Subtract1_out1;
|
||||
END IF;
|
||||
END IF;
|
||||
END PROCESS Delay1_process;
|
||||
|
||||
|
||||
a_3_cast <= signed(resize(Constant2_out1, 17));
|
||||
a_3_mul_temp <= a_3_cast * Delay1_out1;
|
||||
a_3_cast_1 <= a_3_mul_temp(31 DOWNTO 0);
|
||||
a_3_out1 <= a_3_cast_1(30 DOWNTO 15);
|
||||
|
||||
a_2_mul_temp <= Constant3_out1 * Subtract1_out1;
|
||||
a_2_out1 <= a_2_mul_temp(29 DOWNTO 14);
|
||||
|
||||
Subtract2_sub_cast <= resize(In1_signed, 32);
|
||||
Subtract2_sub_cast_1 <= resize(a_2_out1 & '0' & '0' & '0' & '0' & '0', 32);
|
||||
Subtract2_sub_temp <= Subtract2_sub_cast - Subtract2_sub_cast_1;
|
||||
Subtract2_out1 <= Subtract2_sub_temp(20 DOWNTO 5);
|
||||
|
||||
Subtract1_sub_cast <= resize(Subtract2_out1 & '0', 32);
|
||||
Subtract1_sub_cast_1 <= resize(a_3_out1, 32);
|
||||
Subtract1_sub_temp <= Subtract1_sub_cast - Subtract1_sub_cast_1;
|
||||
Subtract1_out1_1 <= Subtract1_sub_temp(16 DOWNTO 1);
|
||||
|
||||
reduced_process : PROCESS (clk, reset)
|
||||
BEGIN
|
||||
IF reset = '1' THEN
|
||||
Subtract1_out1 <= to_signed(16#0000#, 16);
|
||||
ELSIF clk'EVENT AND clk = '1' THEN
|
||||
IF enb = '1' THEN
|
||||
Subtract1_out1 <= Subtract1_out1_1;
|
||||
END IF;
|
||||
END IF;
|
||||
END PROCESS reduced_process;
|
||||
|
||||
|
||||
b_1_cast <= signed(resize(Constant_out1_1, 17));
|
||||
b_1_mul_temp <= b_1_cast * Subtract1_out1;
|
||||
b_1_cast_1 <= b_1_mul_temp(31 DOWNTO 0);
|
||||
b_1_out1 <= b_1_cast_1(30 DOWNTO 15);
|
||||
|
||||
PipelineRegister_process : PROCESS (clk, reset)
|
||||
BEGIN
|
||||
IF reset = '1' THEN
|
||||
b_1_out1_1 <= to_signed(16#0000#, 16);
|
||||
ELSIF clk'EVENT AND clk = '1' THEN
|
||||
IF enb_const_rate = '1' THEN
|
||||
b_1_out1_1 <= b_1_out1;
|
||||
END IF;
|
||||
END IF;
|
||||
END PROCESS PipelineRegister_process;
|
||||
|
||||
|
||||
Constant1_out1 <= to_signed(-16#6CF4#, 16);
|
||||
|
||||
HwModeRegister2_process : PROCESS (clk, reset)
|
||||
BEGIN
|
||||
IF reset = '1' THEN
|
||||
Constant1_out1_1 <= to_signed(16#0000#, 16);
|
||||
ELSIF clk'EVENT AND clk = '1' THEN
|
||||
IF enb_const_rate = '1' THEN
|
||||
Constant1_out1_1 <= Constant1_out1;
|
||||
END IF;
|
||||
END IF;
|
||||
END PROCESS HwModeRegister2_process;
|
||||
|
||||
|
||||
HwModeRegister3_process : PROCESS (clk, reset)
|
||||
BEGIN
|
||||
IF reset = '1' THEN
|
||||
Delay1_out1_1 <= to_signed(16#0000#, 16);
|
||||
ELSIF clk'EVENT AND clk = '1' THEN
|
||||
IF enb = '1' THEN
|
||||
Delay1_out1_1 <= Delay1_out1;
|
||||
END IF;
|
||||
END IF;
|
||||
END PROCESS HwModeRegister3_process;
|
||||
|
||||
|
||||
b_3_mul_temp <= Constant1_out1_1 * Delay1_out1_1;
|
||||
b_3_out1 <= b_3_mul_temp(29 DOWNTO 14);
|
||||
|
||||
PipelineRegister1_process : PROCESS (clk, reset)
|
||||
BEGIN
|
||||
IF reset = '1' THEN
|
||||
b_3_out1_1 <= to_signed(16#0000#, 16);
|
||||
ELSIF clk'EVENT AND clk = '1' THEN
|
||||
IF enb = '1' THEN
|
||||
b_3_out1_1 <= b_3_out1;
|
||||
END IF;
|
||||
END IF;
|
||||
END PROCESS PipelineRegister1_process;
|
||||
|
||||
|
||||
Sum1_add_cast <= resize(b_1_out1_1, 32);
|
||||
Sum1_add_cast_1 <= resize(b_3_out1_1, 32);
|
||||
Sum1_add_temp <= Sum1_add_cast + Sum1_add_cast_1;
|
||||
Sum1_out1 <= Sum1_add_temp(16 DOWNTO 1);
|
||||
|
||||
Out1 <= std_logic_vector(Sum1_out1);
|
||||
|
||||
ce_out <= clk_enable;
|
||||
|
||||
END rtl;
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
vlib work
|
||||
vcom IIF.vhd
|
||||
@@ -0,0 +1 @@
|
||||
ld3_fixed_point2/IIF --> IIF
|
||||
@@ -0,0 +1,105 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" itemscope itemtype="http://www.mathworks.com/help/schema/MathWorksDocPage">
|
||||
<head>
|
||||
<title>HDL Check Report for 'ld3_fixed_point2/IIF'</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
|
||||
<script type="text/javascript" src="file://C:/Program%20Files/MATLAB/R2017b/toolbox/hdlcoder/hdlcommon/js_css/jquery-1.7.1.js"></script>
|
||||
<script type="text/javascript" src="file://C:/Program%20Files/MATLAB/R2017b/toolbox/hdlcoder/hdlcommon/js_css/docscripts.js"></script>
|
||||
|
||||
<link href="file://C:/Program%20Files/MATLAB/R2017b/toolbox/hdlcoder/hdlcommon/js_css/ice_960.css" rel="stylesheet" type="text/css">
|
||||
<link href="file://C:/Program%20Files/MATLAB/R2017b/toolbox/hdlcoder/hdlcommon/js_css/HDLsite5.css" rel="stylesheet" type="text/css">
|
||||
<link href="file://C:/Program%20Files/MATLAB/R2017b/toolbox/hdlcoder/hdlcommon/js_css/ice_doc_center.css" rel="stylesheet" type="text/css">
|
||||
<link href="file://C:/Program%20Files/MATLAB/R2017b/toolbox/hdlcoder/hdlcommon/js_css/ice_doc_center_installed.css" rel="stylesheet" type="text/css">
|
||||
<link href="file://C:/Program%20Files/MATLAB/R2017b/toolbox/hdlcoder/hdlcommon/js_css/ice_doc_center_print.css" rel="stylesheet" type="text/css" media="print">
|
||||
<script type="text/javascript">
|
||||
if (navigator.appName != "ICEbrowser") {
|
||||
var cssStyleSheets = $("link").filter(function(){
|
||||
var href = $(this).attr('href');
|
||||
return href.indexOf("ice_doc_center_print.css") == -1});
|
||||
var hrefElements = $.map(cssStyleSheets, function(elem) {
|
||||
var href = $(elem).attr('href');
|
||||
var hrefArray = href.split("/");
|
||||
hrefArray[hrefArray.length - 1] = hrefArray[hrefArray.length - 1].replace("ice_", "");
|
||||
return {
|
||||
href: hrefArray.join("/"),
|
||||
media: $(elem).attr('media')
|
||||
};
|
||||
});
|
||||
cssStyleSheets.remove();
|
||||
for (var i = 0; i < hrefElements.length; i++) {
|
||||
if ($.browser.msie && $.browser.version <= 8) {
|
||||
document.createStyleSheet(hrefElements[i].href);
|
||||
} else {
|
||||
var link = $('<link rel="stylesheet" href=' + hrefElements[i].href + ' type="text/css" />');
|
||||
if (hrefElements[i].media) {
|
||||
link.attr('media', hrefElements[i].media);
|
||||
}
|
||||
$('head').append(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container_192">
|
||||
<div class="grid_192">
|
||||
<div class="page_container"><div class="content_frame">
|
||||
<h1>HDL Code Generation Check Report for 'ld3_fixed_point2/IIF'
|
||||
<a href="matlab:open_system('ld3_fixed_point2/IIF');">open model 'ld3_fixed_point2/IIF'</a><BR>
|
||||
Generated on 2020-06-09 21:58:09</h1>
|
||||
<H2>HDL check for 'ld3_fixed_point2' complete with 1 errors, 2 warnings, and 1 messages.</H2><BR>
|
||||
<H3>The following table describes blocks for which errors, warnings or messages were reported.</H3><BR>
|
||||
<TABLE>
|
||||
<TR><TD> <B>Simulink Blocks and resources</B> </TD><TD> <B>Level</B> </TD><TD> <B>Description</B> </TD></TR><TR bgcolor="#F0F0F0"><TD>
|
||||
<a alt="hdlcoder:engine:pathbalancing1" href="matlab:hilite(get_param(char([108 100 51 95 102 105 120 101 100 95 112 111 105 110 116 50]),'object'),'none');open_system(char([108 100 51 95 102 105 120 101 100 95 112 111 105 110 116 50]))">ld3_fixed_point2</a>
|
||||
</TD>
|
||||
<TD>Error</TD>
|
||||
<TD>Delay balancing unsuccessful because Signal rate of value 0 found.
|
||||
Offending Block:ld3_fixed_point2/IIF/.</TD>
|
||||
</TR>
|
||||
<TR bgcolor="#FFFFFF"><TD>
|
||||
<a alt="hdlcoder:optimization:HwModeCantBuyRegisters" href="matlab:hilite(get_param(char([108 100 51 95 102 105 120 101 100 95 112 111 105 110 116 50]),'object'),'none');hilite_system(char([108 100 51 95 102 105 120 101 100 95 112 111 105 110 116 50 47 73 73 70 47 97 40 50 41]))">ld3_fixed_point2/IIF/a(2)</a>
|
||||
</TD>
|
||||
<TD>Warning</TD>
|
||||
<TD>Unable to insert required number of pipeline registers because the block, ld3_fixed_point2/IIF/a(2), is in a feedback path. Number of registers required: 2; number of registers inserted: 0.</TD>
|
||||
</TR>
|
||||
<TR bgcolor="#F0F0F0"><TD>
|
||||
<a alt="hdlcoder:optimization:HwModeCantBuyRegisters" href="matlab:hilite(get_param(char([108 100 51 95 102 105 120 101 100 95 112 111 105 110 116 50]),'object'),'none');hilite_system(char([108 100 51 95 102 105 120 101 100 95 112 111 105 110 116 50 47 73 73 70 47 97 40 51 41]))">ld3_fixed_point2/IIF/a(3)</a>
|
||||
</TD>
|
||||
<TD>Warning</TD>
|
||||
<TD>Unable to insert required number of pipeline registers because the block, ld3_fixed_point2/IIF/a(3), is in a feedback path. Number of registers required: 2; number of registers inserted: 0.</TD>
|
||||
</TR>
|
||||
<TR bgcolor="#FFFFFF"><TD>
|
||||
<a alt="hdlcoder:hdldisp:GeneratingFeedbackHiliteScript" href="matlab:run('C:\Users\Imants\Desktop\sin_gen\iif_hdl\ld3_fixed_point2\highlightFeedbackLoop')">C:\Users\Imants\Desktop\sin_gen\iif_hdl\ld3_fixed_point2\highlightFeedbackLoop.m</a>
|
||||
</TD>
|
||||
<TD>Message</TD>
|
||||
<TD>One or more feedback loops in the model are inhibiting optimizations. To highlight these loops in your model, click the following MATLAB script: <a href="matlab:run('C:\Users\Imants\Desktop\sin_gen\iif_hdl\ld3_fixed_point2\highlightFeedbackLoop')">C:\Users\Imants\Desktop\sin_gen\iif_hdl\ld3_fixed_point2\highlightFeedbackLoop.m</a></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<BR><BR> </div></div></div></div>
|
||||
<div class="grid_192">
|
||||
<div class="footer_container">
|
||||
<div class="footer">
|
||||
<ul class="footernav">
|
||||
<li class="footernav_trademarks"><a href="C:/Program Files/MATLAB/R2017b/help/acknowledgments.html">Acknowledgments</a></li>
|
||||
<li class="footernav_trademarks"><a href="C:/Program%20Files/MATLAB/R2017b/trademarks.txt">Trademarks</a></li>
|
||||
<li class="footernav_patents"><a href="C:/Program%20Files/MATLAB/R2017b/patents.txt">Patents</a></li>
|
||||
<li class="footernav_help"><a href="C:/Program Files/MATLAB/R2017b/license_agreement.txt">Terms of Use</a></li>
|
||||
</ul>
|
||||
<div class="copyright">© 1994-2020 The MathWorks, Inc.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready( setTimeout( function () {
|
||||
$(".expandAllLink").trigger('click');
|
||||
}, 50 ) );
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,2 @@
|
||||
SLStudio.Utils.RemoveHighlighting(get_param('ld3_fixed_point2', 'handle'));
|
||||
SLStudio.Utils.RemoveHighlighting(get_param('gm_ld3_fixed_point2', 'handle'));
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
open_system('ld3_fixed_point2');
|
||||
open_system('gm_ld3_fixed_point2');
|
||||
cs.HiliteType = 'user1';
|
||||
cs.ForegroundColor = 'black';
|
||||
cs.BackgroundColor = 'cyan';
|
||||
set_param(0, 'HiliteAncestorsData', cs);
|
||||
hilite_system('gm_ld3_fixed_point2/IIF/Delay', 'user1');
|
||||
hilite_system('ld3_fixed_point2/IIF/Delay', 'user1');
|
||||
cs.HiliteType = 'user1';
|
||||
cs.ForegroundColor = 'black';
|
||||
cs.BackgroundColor = 'cyan';
|
||||
set_param(0, 'HiliteAncestorsData', cs);
|
||||
hilite_system('gm_ld3_fixed_point2/IIF/Delay1', 'user1');
|
||||
hilite_system('ld3_fixed_point2/IIF/Delay1', 'user1');
|
||||
cs.HiliteType = 'user1';
|
||||
cs.ForegroundColor = 'black';
|
||||
cs.BackgroundColor = 'cyan';
|
||||
set_param(0, 'HiliteAncestorsData', cs);
|
||||
hilite_system('gm_ld3_fixed_point2/IIF/Subtract1', 'user1');
|
||||
hilite_system('ld3_fixed_point2/IIF/Subtract1', 'user1');
|
||||
cs.HiliteType = 'user1';
|
||||
cs.ForegroundColor = 'black';
|
||||
cs.BackgroundColor = 'cyan';
|
||||
set_param(0, 'HiliteAncestorsData', cs);
|
||||
hilite_system('gm_ld3_fixed_point2/IIF/Subtract2', 'user1');
|
||||
hilite_system('ld3_fixed_point2/IIF/Subtract2', 'user1');
|
||||
cs.HiliteType = 'user1';
|
||||
cs.ForegroundColor = 'black';
|
||||
cs.BackgroundColor = 'cyan';
|
||||
set_param(0, 'HiliteAncestorsData', cs);
|
||||
hilite_system('gm_ld3_fixed_point2/IIF/a(2)', 'user1');
|
||||
hilite_system('ld3_fixed_point2/IIF/a(2)', 'user1');
|
||||
cs.HiliteType = 'user1';
|
||||
cs.ForegroundColor = 'black';
|
||||
cs.BackgroundColor = 'cyan';
|
||||
set_param(0, 'HiliteAncestorsData', cs);
|
||||
hilite_system('gm_ld3_fixed_point2/IIF/a(3)', 'user1');
|
||||
hilite_system('ld3_fixed_point2/IIF/a(3)', 'user1');
|
||||
Reference in New Issue
Block a user