PlTbUtils  1.3
PlTbUtils is a collection of functions, procedures and components for easily creating stimuli and checking response in automatic self-checking testbenches.
tb_example2.vhd
Go to the documentation of this file.
1 
36 
37 library ieee;
38 use ieee.std_logic_1164.all;
39 use work.pltbutils_func_pkg.all;
40 use work.pltbutils_comp_pkg.all;
41 
42 entity tb_example2 is
43  generic (
44  G_WIDTH : integer := 8;
45  G_CLK_PERIOD : time := 10 ns;
46  G_DISABLE_BUGS : integer range 0 to 1 := 0
47  );
48 end entity tb_example2;
49 
50 architecture bhv of tb_example2 is
51 
52  -- Simulation status- and control signals
53  -- for accessing .stop_sim and for viewing in waveform window
54  signal pltbs : pltbs_t := C_PLTBS_INIT;
55 
56  -- DUT stimuli and response signals
57  signal clk : std_logic;
58  signal rst : std_logic;
59  signal carry_in : std_logic;
60  signal x : std_logic_vector(G_WIDTH-1 downto 0);
61  signal y : std_logic_vector(G_WIDTH-1 downto 0);
62  signal sum : std_logic_vector(G_WIDTH-1 downto 0);
63  signal carry_out : std_logic;
64 
65 begin
66 
67  dut0 : entity work.dut_example
68  generic map (
69  G_WIDTH => G_WIDTH,
71  )
72  port map (
73  clk_i => clk,
74  rst_i => rst,
75  carry_i => carry_in,
76  x_i => x,
77  y_i => y,
78  sum_o => sum,
80  );
81 
83  generic map(
85  )
86  port map(
87  clk_o => clk,
88  stop_sim_i => pltbs.stop_sim
89  );
90 
91  tc0 : entity work.tc_example2
92  generic map (
93  G_WIDTH => G_WIDTH,
95  )
96  port map(
97  pltbs => pltbs,
98  clk => clk,
99  rst => rst,
100  carry_in => carry_in,
101  x => x,
102  y => y,
103  sum => sum,
105  );
106 
107 end architecture bhv;
in y_i std_logic_vector( G_WIDTH- 1 downto 0)
Definition: dut_example.vhd:53
G_WIDTH integer := 8
Definition: dut_example.vhd:45
G_DISABLE_BUGS integer range 0 to 1:= 1
Definition: dut_example.vhd:47
out carry_o std_logic
Definition: dut_example.vhd:56
in carry_i std_logic
Definition: dut_example.vhd:51
in x_i std_logic_vector( G_WIDTH- 1 downto 0)
Definition: dut_example.vhd:52
in rst_i std_logic
Definition: dut_example.vhd:50
out sum_o std_logic_vector( G_WIDTH- 1 downto 0)
Definition: dut_example.vhd:54
in clk_i std_logic
Definition: dut_example.vhd:49
Creates a clock for use in a testbench.
out clk_o std_logic
Clock output.
in stop_sim_i std_logic
Stops the clock when '1'.
G_PERIOD time := 10 ns
Clock period.
See pltbutils_comp.vhd for a description of the components.
This package defines fuctions and procedures for controlling stimuli to a DUT and checking response.
std_logic clk
Definition: tb_example2.vhd:57
pltbutils_clkgen clkgen0clkgen0
Definition: tb_example2.vhd:89
std_logic_vector( G_WIDTH- 1 downto 0) sum
Definition: tb_example2.vhd:62
std_logic carry_out
Definition: tb_example2.vhd:63
std_logic_vector( G_WIDTH- 1 downto 0) y
Definition: tb_example2.vhd:61
std_logic carry_in
Definition: tb_example2.vhd:59
pltbs_t := C_PLTBS_INIT pltbs
Definition: tb_example2.vhd:54
std_logic rst
Definition: tb_example2.vhd:58
std_logic_vector( G_WIDTH- 1 downto 0) x
Definition: tb_example2.vhd:60
G_WIDTH integer := 8
Definition: tb_example2.vhd:44
G_CLK_PERIOD time := 10 ns
Definition: tb_example2.vhd:45
G_DISABLE_BUGS integer range 0 to 1:= 0
Definition: tb_example2.vhd:47
out rst std_logic
Definition: tc_example2.vhd:49
out carry_in std_logic
Definition: tc_example2.vhd:50
G_WIDTH integer := 8
Definition: tc_example2.vhd:43
in carry_out std_logic
Definition: tc_example2.vhd:55
in clk std_logic
Definition: tc_example2.vhd:48
out pltbs pltbs_t
Definition: tc_example2.vhd:47
in sum std_logic_vector( G_WIDTH- 1 downto 0)
Definition: tc_example2.vhd:53
out y std_logic_vector( G_WIDTH- 1 downto 0)
Definition: tc_example2.vhd:52
G_DISABLE_BUGS integer range 0 to 1:= 0
Definition: tc_example2.vhd:45
out x std_logic_vector( G_WIDTH- 1 downto 0)
Definition: tc_example2.vhd:51