| 1 |
2 |
pela |
----------------------------------------------------------------------
|
| 2 |
|
|
---- ----
|
| 3 |
|
|
---- PlTbUtils Component Declarations ----
|
| 4 |
|
|
---- ----
|
| 5 |
|
|
---- This file is part of the PlTbUtils project ----
|
| 6 |
|
|
---- http://opencores.org/project,pltbutils ----
|
| 7 |
|
|
---- ----
|
| 8 |
|
|
---- Description: ----
|
| 9 |
|
|
---- PlTbUtils is a collection of functions, procedures and ----
|
| 10 |
|
|
---- components for easily creating stimuli and checking response ----
|
| 11 |
|
|
---- in automatic self-checking testbenches. ----
|
| 12 |
|
|
---- ----
|
| 13 |
|
|
---- This file declares testbench components, which are defined ----
|
| 14 |
|
|
---- in pltbutils_comp.vhd . ----
|
| 15 |
|
|
---- "use" this file in your testbech, e.g. ----
|
| 16 |
|
|
---- use work.pltbutils_comp_pkg.all; ----
|
| 17 |
|
|
---- ----
|
| 18 |
|
|
---- ----
|
| 19 |
|
|
---- To Do: ----
|
| 20 |
|
|
---- - ----
|
| 21 |
|
|
---- ----
|
| 22 |
|
|
---- Author(s): ----
|
| 23 |
97 |
pela |
---- - Per Larsson, pela.opencores@gmail.com ----
|
| 24 |
2 |
pela |
---- ----
|
| 25 |
|
|
----------------------------------------------------------------------
|
| 26 |
|
|
---- ----
|
| 27 |
107 |
pela |
---- Copyright (C) 2013-2020 Authors and OPENCORES.ORG ----
|
| 28 |
2 |
pela |
---- ----
|
| 29 |
|
|
---- This source file may be used and distributed without ----
|
| 30 |
|
|
---- restriction provided that this copyright statement is not ----
|
| 31 |
|
|
---- removed from the file and that any derivative work contains ----
|
| 32 |
|
|
---- the original copyright notice and the associated disclaimer. ----
|
| 33 |
|
|
---- ----
|
| 34 |
|
|
---- This source file is free software; you can redistribute it ----
|
| 35 |
|
|
---- and/or modify it under the terms of the GNU Lesser General ----
|
| 36 |
|
|
---- Public License as published by the Free Software Foundation; ----
|
| 37 |
|
|
---- either version 2.1 of the License, or (at your option) any ----
|
| 38 |
|
|
---- later version. ----
|
| 39 |
|
|
---- ----
|
| 40 |
|
|
---- This source is distributed in the hope that it will be ----
|
| 41 |
|
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
| 42 |
|
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
| 43 |
|
|
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
| 44 |
|
|
---- details. ----
|
| 45 |
|
|
---- ----
|
| 46 |
|
|
---- You should have received a copy of the GNU Lesser General ----
|
| 47 |
|
|
---- Public License along with this source; if not, download it ----
|
| 48 |
|
|
---- from http://www.opencores.org/lgpl.shtml ----
|
| 49 |
|
|
---- ----
|
| 50 |
|
|
----------------------------------------------------------------------
|
| 51 |
|
|
|
| 52 |
|
|
library ieee;
|
| 53 |
|
|
use ieee.std_logic_1164.all;
|
| 54 |
|
|
|
| 55 |
|
|
package pltbutils_comp_pkg is
|
| 56 |
|
|
|
| 57 |
|
|
-- See pltbutils_comp.vhd for a description of the components.
|
| 58 |
|
|
|
| 59 |
|
|
component pltbutils_clkgen is
|
| 60 |
|
|
generic (
|
| 61 |
8 |
pela |
G_PERIOD : time := 10 ns;
|
| 62 |
|
|
G_INITVALUE : std_logic := '0'
|
| 63 |
2 |
pela |
);
|
| 64 |
|
|
port (
|
| 65 |
|
|
clk_o : out std_logic;
|
| 66 |
8 |
pela |
clk_n_o : out std_logic;
|
| 67 |
2 |
pela |
stop_sim_i : in std_logic
|
| 68 |
|
|
);
|
| 69 |
|
|
end component pltbutils_clkgen;
|
| 70 |
|
|
|
| 71 |
|
|
-- Instansiation template
|
| 72 |
|
|
-- (copy to your own file and remove the comment characters):
|
| 73 |
|
|
--pltbutils_clkgen0 : pltbutils_clkgen
|
| 74 |
|
|
-- generic map (
|
| 75 |
8 |
pela |
-- G_PERIOD => G_PERIOD,
|
| 76 |
|
|
-- G_INITVALUE => '0'
|
| 77 |
2 |
pela |
-- )
|
| 78 |
|
|
-- port map (
|
| 79 |
|
|
-- clk_o => clk,
|
| 80 |
8 |
pela |
-- clk_n_o => clk_n,
|
| 81 |
107 |
pela |
-- stop_sim_i => pltbs.stop_sim
|
| 82 |
2 |
pela |
-- );
|
| 83 |
|
|
|
| 84 |
107 |
pela |
component pltbutils_time_measure is
|
| 85 |
|
|
generic (
|
| 86 |
|
|
G_VERBOSITY : integer := 0;
|
| 87 |
|
|
G_RPT_LABEL : string := "pltbutils_time_measure"
|
| 88 |
|
|
);
|
| 89 |
|
|
port (
|
| 90 |
|
|
t_hi_o : out time; -- High time
|
| 91 |
|
|
t_lo_o : out time; -- Low time
|
| 92 |
|
|
t_per_o : out time; -- Period time
|
| 93 |
|
|
s_i : in std_logic -- Signal to measure
|
| 94 |
|
|
);
|
| 95 |
|
|
end component pltbutils_time_measure;
|
| 96 |
|
|
|
| 97 |
|
|
-- Instansiation template
|
| 98 |
|
|
-- (copy to your own file and remove the comment characters):
|
| 99 |
|
|
--pltbutils_time_measure0 : pltbutils_time_measure
|
| 100 |
|
|
-- generic map (
|
| 101 |
|
|
-- G_VERBOSITY => G_VERBOSITY
|
| 102 |
|
|
-- G_RPT_LABEL => "sig"
|
| 103 |
|
|
-- )
|
| 104 |
|
|
-- port map (
|
| 105 |
|
|
-- t_hi_o => sig_t_hi,
|
| 106 |
|
|
-- t_lo_o => sig_t_lo,
|
| 107 |
|
|
-- t_per_o => sig_t_per,
|
| 108 |
|
|
-- s_i => sig
|
| 109 |
|
|
-- );
|
| 110 |
|
|
|
| 111 |
|
|
component pltbutils_diff_check is
|
| 112 |
|
|
generic (
|
| 113 |
|
|
G_VERBOSITY : integer := 0;
|
| 114 |
|
|
G_RPT_LABEL : string := "pltbutils_diff_check"
|
| 115 |
|
|
);
|
| 116 |
|
|
port (
|
| 117 |
|
|
diff_error_o : out std_logic; -- High when diff error detected
|
| 118 |
|
|
diff_errors_o : out integer; -- Number of diff errors detected
|
| 119 |
|
|
s_i : in std_logic; -- Pos half of diff pair to check
|
| 120 |
|
|
s_n_i : in std_logic := '0'; -- Neg half of diff pair to check
|
| 121 |
|
|
rst_errors_i : in std_logic := '0' -- High resets diff error counter
|
| 122 |
|
|
);
|
| 123 |
|
|
end component pltbutils_diff_check;
|
| 124 |
|
|
|
| 125 |
|
|
-- Instansiation template
|
| 126 |
|
|
-- (copy to your own file and remove the comment characters):
|
| 127 |
|
|
--pltbutils_diff_check0 : pltbutils_diff_check
|
| 128 |
|
|
-- generic map (
|
| 129 |
|
|
-- G_VERBOSITY => G_VERBOSITY
|
| 130 |
|
|
-- G_RPT_LABEL => "sig"
|
| 131 |
|
|
-- )
|
| 132 |
|
|
-- port map (
|
| 133 |
|
|
-- diff_error => sig_diff_error,
|
| 134 |
|
|
-- diff_errors => sig_diff_errors,
|
| 135 |
|
|
-- s_i => sig,
|
| 136 |
|
|
-- s_n_i => sig_n,
|
| 137 |
|
|
-- rst_errors_i => sig_rst_errors
|
| 138 |
|
|
-- );
|
| 139 |
|
|
|
| 140 |
2 |
pela |
end package pltbutils_comp_pkg;
|
| 141 |
|
|
|
| 142 |
|
|
|