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_template2.vhd
Go to the documentation of this file.
1 
15 
16 library ieee;
17 use ieee.std_logic_1164.all;
18 use std.textio.all;
19 use work.txt_util.all;
20 use work.pltbutils_func_pkg.all;
21 use work.pltbutils_comp_pkg.all;
22 -- < Template info: add more libraries here, if needed >
23 
24 entity tb_template2 is
25  generic (
26  G_CLK_PERIOD : time := 10 ns; -- < Template info: change value if needed >
27  G_SKIPTESTS : std_logic_vector := (
28  '0', -- Dummy
29  '0', -- Test 1
30  '0' -- Test 2
31  -- ... etc
32  )
33  -- < Template info: add more generics here if needed >
34  );
35 end entity tb_template2;
36 
37 architecture bhv of tb_template2 is
38 
39  -- Simulation status- and control signals
40  -- for accessing .stop_sim and for viewing in waveform window
41  signal pltbs : pltbs_t := C_PLTBS_INIT;
42 
43  -- DUT stimuli and response signals
44  signal clk : std_logic;
45  signal rst : std_logic;
46  -- < Template info: add more DUT stimuli and response signals here. >
47 
48 begin
49 
50  dut0 : entity work.template
51  -- generic map (
52  -- < Template info: add DUT generics here, if any. >
53  -- )
54  port map (
55  clk_i => clk, -- Template example
56  rst_i => rst -- Template example
57  -- < Template info: add more DUT ports here. >
58  );
59 
60  clkgen0 : pltbutils_clkgen
61  generic map(
62  G_PERIOD => G_CLK_PERIOD
63  )
64  port map(
65  clk_o => clk,
66  stop_sim_i => pltbs.stop_sim
67  );
68 
69  tc0 : entity work.tc_template2
70  generic map (
71  G_SKIPTESTS => G_SKIPTESTS
72  -- < Template info: add more generics for testcase component here, if needed. >
73  )
74  port map(
75  clk => clk, -- Template example
76  rst => rst -- Template example
77  -- < Template info: add more ports for testcase component here. >
78  );
79 
80 end architecture bhv;
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.
pltbutils_clkgen clkgen0clkgen0
tc_template2 tc0tc0
pltbs_t := C_PLTBS_INIT pltbs
G_SKIPTESTS std_logic_vector :=( '0', '0', '0')
G_CLK_PERIOD time := 10 ns
Defines useful functions an procedures for text handling text in VHDL.
Definition: txt_util.vhd:31