37 use ieee.std_logic_1164.
all;
38 use ieee.numeric_std.
all;
57 signal pltbs : pltbs_t := C_PLTBS_INIT;
60 signal clk : std_logic;
61 signal rst : std_logic;
63 signal x : std_logic_vector(G_WIDTH-1 downto 0);
64 signal y : std_logic_vector(G_WIDTH-1 downto 0);
99 variable pltbv : pltbv_t := C_PLTBV_INIT;
101 startsim("tc1", "", pltbv, pltbs);
104 x <= (others => '0');
105 y <= (others => '0');
107 starttest(1, "Reset test", pltbv, pltbs);
109 check("Sum during reset", sum, 0, pltbv, pltbs);
112 endtest(pltbv, pltbs);
114 starttest(2, "Simple sum test", pltbv, pltbs);
116 x <= std_logic_vector(to_unsigned(1, x'length));
117 y <= std_logic_vector(to_unsigned(2, x'length));
121 endtest(pltbv, pltbs);
123 starttest(3, "Simple carry in test", pltbv, pltbs);
126 x <= std_logic_vector(to_unsigned(1, x'length));
127 y <= std_logic_vector(to_unsigned(2, x'length));
132 endtest(pltbv, pltbs);
134 starttest(4, "Simple carry out test", pltbv, pltbs);
136 x <= std_logic_vector(to_unsigned(2**G_WIDTH-1, x'length));
137 y <= std_logic_vector(to_unsigned(1, x'length));
141 endtest(pltbv, pltbs);
143 endsim(pltbv, pltbs, true);
147 end architecture bhv;
in y_i std_logic_vector( G_WIDTH- 1 downto 0)
G_DISABLE_BUGS integer range 0 to 1:= 1
in x_i std_logic_vector( G_WIDTH- 1 downto 0)
out sum_o std_logic_vector( G_WIDTH- 1 downto 0)
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.
pltbutils_clkgen clkgen0clkgen0
std_logic_vector( G_WIDTH- 1 downto 0) sum
std_logic_vector( G_WIDTH- 1 downto 0) y
pltbs_t := C_PLTBS_INIT pltbs
std_logic_vector( G_WIDTH- 1 downto 0) x
This is an example which demonstrates how PlTbUtils can be used.
G_CLK_PERIOD time := 10 ns
G_DISABLE_BUGS integer range 0 to 1:= 0
Defines useful functions an procedures for text handling text in VHDL.