Line 20... |
Line 20... |
---- Author(s): ----
|
---- Author(s): ----
|
---- - Per Larsson, pela@opencores.org ----
|
---- - Per Larsson, pela@opencores.org ----
|
---- ----
|
---- ----
|
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
---- ----
|
---- ----
|
---- Copyright (C) 2013 Authors and OPENCORES.ORG ----
|
---- Copyright (C) 2013-2014 Authors and OPENCORES.ORG ----
|
---- ----
|
---- ----
|
---- This source file may be used and distributed without ----
|
---- This source file may be used and distributed without ----
|
---- restriction provided that this copyright statement is not ----
|
---- restriction provided that this copyright statement is not ----
|
---- removed from the file and that any derivative work contains ----
|
---- removed from the file and that any derivative work contains ----
|
---- the original copyright notice and the associated disclaimer. ----
|
---- the original copyright notice and the associated disclaimer. ----
|
Line 46... |
Line 46... |
---- from http://www.opencores.org/lgpl.shtml ----
|
---- from http://www.opencores.org/lgpl.shtml ----
|
---- ----
|
---- ----
|
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use std.textio.all;
|
|
use work.txt_util.all;
|
|
use work.pltbutils_func_pkg.all;
|
use work.pltbutils_func_pkg.all;
|
use work.pltbutils_comp_pkg.all;
|
use work.pltbutils_comp_pkg.all;
|
|
|
entity tb_example is
|
entity tb_example is
|
generic (
|
generic (
|
Line 62... |
Line 60... |
end entity tb_example;
|
end entity tb_example;
|
|
|
architecture bhv of tb_example is
|
architecture bhv of tb_example is
|
|
|
-- Simulation status- and control signals
|
-- Simulation status- and control signals
|
signal test_num : integer;
|
-- for accessing .stop_sim and for viewing in waveform window
|
-- VHDL-1993:
|
signal pltbs : pltbs_t := C_PLTBS_INIT;
|
--signal test_name : string(pltbutils_test_name'range);
|
|
--signal info : string(pltbutils_info'range);
|
|
-- VHDL-2002:
|
|
signal test_name : string(pltbutils_sc.test_name'range);
|
|
signal info : string(pltbutils_sc.info'range);
|
|
|
|
signal checks : integer;
|
|
signal errors : integer;
|
|
signal stop_sim : std_logic;
|
|
|
|
-- DUT stimuli and response signals
|
-- DUT stimuli and response signals
|
signal clk : std_logic;
|
signal clk : std_logic;
|
signal rst : std_logic;
|
signal rst : std_logic;
|
signal carry_in : std_logic;
|
signal carry_in : std_logic;
|
Line 85... |
Line 74... |
signal sum : std_logic_vector(G_WIDTH-1 downto 0);
|
signal sum : std_logic_vector(G_WIDTH-1 downto 0);
|
signal carry_out : std_logic;
|
signal carry_out : std_logic;
|
|
|
begin
|
begin
|
|
|
-- Simulation status and control for viewing in waveform window
|
|
-- VHDL-1993:
|
|
--test_num <= pltbutils_test_num;
|
|
--test_name <= pltbutils_test_name;
|
|
--checks <= pltbutils_chk_cnt;
|
|
--errors <= pltbutils_err_cnt;
|
|
-- VHDL-2002:
|
|
test_num <= pltbutils_sc.test_num;
|
|
test_name <= pltbutils_sc.test_name;
|
|
info <= pltbutils_sc.info;
|
|
checks <= pltbutils_sc.chk_cnt;
|
|
errors <= pltbutils_sc.err_cnt;
|
|
stop_sim <= pltbutils_sc.stop_sim;
|
|
|
|
|
|
dut0 : entity work.dut_example
|
dut0 : entity work.dut_example
|
generic map (
|
generic map (
|
G_WIDTH => G_WIDTH,
|
G_WIDTH => G_WIDTH,
|
G_DISABLE_BUGS => G_DISABLE_BUGS
|
G_DISABLE_BUGS => G_DISABLE_BUGS
|
)
|
)
|
Line 121... |
Line 95... |
generic map(
|
generic map(
|
G_PERIOD => G_CLK_PERIOD
|
G_PERIOD => G_CLK_PERIOD
|
)
|
)
|
port map(
|
port map(
|
clk_o => clk,
|
clk_o => clk,
|
stop_sim_i => stop_sim
|
stop_sim_i => pltbs.stop_sim
|
);
|
);
|
|
|
tc0 : entity work.tc_example
|
tc0 : entity work.tc_example
|
generic map (
|
generic map (
|
G_WIDTH => G_WIDTH,
|
G_WIDTH => G_WIDTH,
|
G_DISABLE_BUGS => G_DISABLE_BUGS
|
G_DISABLE_BUGS => G_DISABLE_BUGS
|
)
|
)
|
port map(
|
port map(
|
|
pltbs => pltbs,
|
clk => clk,
|
clk => clk,
|
rst => rst,
|
rst => rst,
|
carry_in => carry_in,
|
carry_in => carry_in,
|
x => x,
|
x => x,
|
y => y,
|
y => y,
|