Commit eed88aeb authored by Johann Faerber's avatar Johann Faerber Committed by Manuel Mikschl
Browse files

add4: replaced structure model by rtl model

parent 8da7bc57
......@@ -11,9 +11,8 @@
## ----------------------------------------------------------------------------
SYN_SOURCE_FILES = \
../../src/add1_truthtable.vhd \
../../src/e_add4.vhd \
../../src/a_add4_structure.vhd \
../../src/a_add4_rtl.vhd \
# do not delete this line
# -----------------------------------------------------------------------------
......@@ -39,13 +39,11 @@ ARCHITECTURE tbench OF t_add4 IS
SIGNAL ci_i : std_ulogic;
SIGNAL sum_o : std_ulogic_vector(3 DOWNTO 0);
SIGNAL co_o : std_ulogic;
SIGNAL sum_ref : std_ulogic_vector(3 DOWNTO 0);
SIGNAL co_ref : std_ulogic;
BEGIN -- tbench
-- component instantiation
MUV : ENTITY work.add4(structure)
MUV : ENTITY work.add4(rtl)
PORT MAP (
a_i => a_i,
b_i => b_i,
......@@ -53,29 +51,8 @@ BEGIN -- tbench
sum_o => sum_o,
co_o => co_o);
REF : ENTITY work.add4(rtl)
PORT MAP (
a_i => a_i,
b_i => b_i,
ci_i => ci_i,
sum_o => sum_ref,
co_o => co_ref);
stimuli_p : PROCESS
-- purpose: apply stimuli to input signals of module under test
PROCEDURE apply_stimuli (
CONSTANT ci_stim : IN std_ulogic;
CONSTANT b_stim, a_stim : IN std_ulogic_vector) IS
BEGIN -- apply_stimuli
a_i <= a_stim;
b_i <= b_stim;
ci_i <= ci_stim;
WAIT FOR period;
ASSERT sum_o = sum_ref REPORT "Error: sum is not correct !" SEVERITY failure;
ASSERT co_o = co_ref REPORT "Error: co is not correct !" SEVERITY failure;
END PROCEDURE apply_stimuli;
BEGIN
a_i <= X"0"; -- set a value to input a_i as hexadecimal value
b_i <= B"0000"; -- set a value to input b_i as binary vector value
......@@ -109,13 +86,6 @@ BEGIN -- tbench
ASSERT co_o = '0' REPORT "Error: co is not correct !" SEVERITY failure;
-- alternatively, a local procedure can be used to assign input values:
-----------------------------------------------------------------------
-- the following test cases are the same as above, hence commented here
-- ci_i, b_i, a_i
-- apply_stimuli('0', B"0000", X"0");
-- apply_stimuli('0', B"1111", X"0");
-- apply_stimuli('0', X"F", B"0101");
-- add your stimuli here ...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment