Line 1... |
Line 1... |
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Copyright 2007 Ken Campbell
|
-- Copyright 2007 Ken Campbell
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- $Author: sckoarn $
|
-- $Author: sckoarn $
|
--
|
--
|
-- $Date: 2007-11-14 02:35:56 $
|
-- $Date: 2008-02-24 01:34:11 $
|
--
|
--
|
-- $Name: not supported by cvs2svn $
|
-- $Name: not supported by cvs2svn $
|
--
|
--
|
-- $Id: template_tb_bhv.vhd,v 1.3 2007-11-14 02:35:56 sckoarn Exp $
|
-- $Id: template_tb_bhv.vhd,v 1.4 2008-02-24 01:34:11 sckoarn Exp $
|
--
|
--
|
-- $Source: /home/marcus/revision_ctrl_test/oc_cvs/cvs/vhld_tb/source/template_tb_bhv.vhd,v $
|
-- $Source: /home/marcus/revision_ctrl_test/oc_cvs/cvs/vhld_tb/source/template_tb_bhv.vhd,v $
|
--
|
--
|
-- Description : The the testbench package template behave file.
|
-- Description : The the testbench package template behave file.
|
-- Initial GNU release.
|
-- Initial GNU release.
|
Line 31... |
Line 31... |
-- along with The VHDL Test Bench; if not, write to the Free Software
|
-- along with The VHDL Test Bench; if not, write to the Free Software
|
-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Revision History:
|
-- Revision History:
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
-- Revision 1.3 2007/11/14 02:35:56 sckoarn
|
|
-- Fix to WHILE instruction: Change if_state typo to wh_state
|
|
--
|
-- Revision 1.2 2007/09/02 04:04:04 sckoarn
|
-- Revision 1.2 2007/09/02 04:04:04 sckoarn
|
-- Update of version 1.2 tb_pkg
|
-- Update of version 1.2 tb_pkg
|
-- See documentation for details
|
-- See documentation for details
|
--
|
--
|
-- Revision 1.1.1.1 2007/04/06 04:06:48 sckoarn
|
-- Revision 1.1.1.1 2007/04/06 04:06:48 sckoarn
|
Line 86... |
Line 89... |
variable current_line : text_line; -- The current input line
|
variable current_line : text_line; -- The current input line
|
variable inst_list : inst_def_ptr; -- the instruction list
|
variable inst_list : inst_def_ptr; -- the instruction list
|
variable defined_vars : var_field_ptr; -- defined variables
|
variable defined_vars : var_field_ptr; -- defined variables
|
variable inst_sequ : stim_line_ptr; -- the instruction sequence
|
variable inst_sequ : stim_line_ptr; -- the instruction sequence
|
variable file_list : file_def_ptr; -- pointer to the list of file names
|
variable file_list : file_def_ptr; -- pointer to the list of file names
|
|
variable last_sequ_num: integer;
|
|
variable last_sequ_ptr: stim_line_ptr;
|
|
|
variable instruction : text_field; -- instruction field
|
variable instruction : text_field; -- instruction field
|
variable par1 : integer; -- paramiter 1
|
variable par1 : integer; -- paramiter 1
|
variable par2 : integer; -- paramiter 2
|
variable par2 : integer; -- paramiter 2
|
variable par3 : integer; -- paramiter 3
|
variable par3 : integer; -- paramiter 3
|
Line 178... |
Line 183... |
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
-- Read, test, and load the stimulus file
|
-- Read, test, and load the stimulus file
|
read_instruction_file(stimulus_file, inst_list, defined_vars, inst_sequ,
|
read_instruction_file(stimulus_file, inst_list, defined_vars, inst_sequ,
|
file_list);
|
file_list);
|
|
|
|
-- initialize last info
|
|
last_sequ_num := 0;
|
|
last_sequ_ptr := inst_sequ;
|
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
-- Using the Instruction record list, get the instruction and implement
|
-- Using the Instruction record list, get the instruction and implement
|
-- it as per the statements in the elsif tree.
|
-- it as per the statements in the elsif tree.
|
while(v_line < inst_sequ.num_of_lines) loop
|
while(v_line < inst_sequ.num_of_lines) loop
|
v_line := v_line + 1;
|
v_line := v_line + 1;
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line);
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
|
|
last_sequ_num, last_sequ_ptr);
|
|
|
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
--if(instruction(1 to len) = "DEFINE_VAR") then
|
--if(instruction(1 to len) = "DEFINE_VAR") then
|
-- null; -- This instruction was implemented while reading the file
|
-- null; -- This instruction was implemented while reading the file
|
|
|
Line 307... |
Line 316... |
end case;
|
end case;
|
|
|
if(if_state = false) then
|
if(if_state = false) then
|
v_line := v_line + 1;
|
v_line := v_line + 1;
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line);
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
|
|
last_sequ_num, last_sequ_ptr);
|
while(instruction(1 to len) /= "ELSE" and
|
while(instruction(1 to len) /= "ELSE" and
|
instruction(1 to len) /= "ELSEIF" and
|
instruction(1 to len) /= "ELSEIF" and
|
instruction(1 to len) /= "END_IF") loop
|
instruction(1 to len) /= "END_IF") loop
|
if(v_line < inst_sequ.num_of_lines) then
|
if(v_line < inst_sequ.num_of_lines) then
|
v_line := v_line + 1;
|
v_line := v_line + 1;
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line);
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
|
|
last_sequ_num, last_sequ_ptr);
|
else
|
else
|
assert (false)
|
assert (false)
|
report LF & "ERROR: IF instruction unable to find terminating" &
|
report LF & "ERROR: IF instruction unable to find terminating" &
|
LF & " ELSE, ELSEIF or END_IF statement."
|
LF & " ELSE, ELSEIF or END_IF statement."
|
severity failure;
|
severity failure;
|
Line 330... |
Line 341... |
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
elsif (instruction(1 to len) = "ELSEIF") then
|
elsif (instruction(1 to len) = "ELSEIF") then
|
if(if_state = true) then -- if the if_state is true then skip to the end
|
if(if_state = true) then -- if the if_state is true then skip to the end
|
v_line := v_line + 1;
|
v_line := v_line + 1;
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line);
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
|
|
last_sequ_num, last_sequ_ptr);
|
while(instruction(1 to len) /= "END_IF") loop
|
while(instruction(1 to len) /= "END_IF") loop
|
if(v_line < inst_sequ.num_of_lines) then
|
if(v_line < inst_sequ.num_of_lines) then
|
v_line := v_line + 1;
|
v_line := v_line + 1;
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line);
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
|
|
last_sequ_num, last_sequ_ptr);
|
else
|
else
|
assert (false)
|
assert (false)
|
report LF & "ERROR: IF instruction unable to find terminating" &
|
report LF & "ERROR: IF instruction unable to find terminating" &
|
LF & " ELSE, ELSEIF or END_IF statement."
|
LF & " ELSE, ELSEIF or END_IF statement."
|
severity failure;
|
severity failure;
|
Line 364... |
Line 377... |
end case;
|
end case;
|
|
|
if(if_state = false) then
|
if(if_state = false) then
|
v_line := v_line + 1;
|
v_line := v_line + 1;
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line);
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
|
|
last_sequ_num, last_sequ_ptr);
|
while(instruction(1 to len) /= "ELSE" and
|
while(instruction(1 to len) /= "ELSE" and
|
instruction(1 to len) /= "ELSEIF" and
|
instruction(1 to len) /= "ELSEIF" and
|
instruction(1 to len) /= "END_IF") loop
|
instruction(1 to len) /= "END_IF") loop
|
if(v_line < inst_sequ.num_of_lines) then
|
if(v_line < inst_sequ.num_of_lines) then
|
v_line := v_line + 1;
|
v_line := v_line + 1;
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line);
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
|
|
last_sequ_num, last_sequ_ptr);
|
else
|
else
|
assert (false)
|
assert (false)
|
report LF & "ERROR: ELSEIF instruction unable to find terminating" &
|
report LF & "ERROR: ELSEIF instruction unable to find terminating" &
|
LF & " ELSE, ELSEIF or END_IF statement."
|
LF & " ELSE, ELSEIF or END_IF statement."
|
severity failure;
|
severity failure;
|
Line 388... |
Line 403... |
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
elsif (instruction(1 to len) = "ELSE") then
|
elsif (instruction(1 to len) = "ELSE") then
|
if(if_state = true) then -- if the if_state is true then skip the else
|
if(if_state = true) then -- if the if_state is true then skip the else
|
v_line := v_line + 1;
|
v_line := v_line + 1;
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line);
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
|
|
last_sequ_num, last_sequ_ptr);
|
while(instruction(1 to len) /= "END_IF") loop
|
while(instruction(1 to len) /= "END_IF") loop
|
if(v_line < inst_sequ.num_of_lines) then
|
if(v_line < inst_sequ.num_of_lines) then
|
v_line := v_line + 1;
|
v_line := v_line + 1;
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line);
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
|
|
last_sequ_num, last_sequ_ptr);
|
else
|
else
|
assert (false)
|
assert (false)
|
report LF & "ERROR: IF instruction unable to find terminating" &
|
report LF & "ERROR: IF instruction unable to find terminating" &
|
LF & " ELSE, ELSEIF or END_IF statement."
|
LF & " ELSE, ELSEIF or END_IF statement."
|
severity failure;
|
severity failure;
|
Line 435... |
Line 452... |
wh_end := false;
|
wh_end := false;
|
while(wh_end /= true) loop
|
while(wh_end /= true) loop
|
if(v_line < inst_sequ.num_of_lines) then
|
if(v_line < inst_sequ.num_of_lines) then
|
v_line := v_line + 1;
|
v_line := v_line + 1;
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line);
|
par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
|
|
last_sequ_num, last_sequ_ptr);
|
else
|
else
|
assert (false)
|
assert (false)
|
report LF & "ERROR: WHILE instruction unable to find terminating" &
|
report LF & "ERROR: WHILE instruction unable to find terminating" &
|
LF & " END_WHILE statement."
|
LF & " END_WHILE statement."
|
severity failure;
|
severity failure;
|