Line 1... |
Line 1... |
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Copyright 2007 Ken Campbell
|
-- Copyright 2007 Ken Campbell
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- $Author: sckoarn $
|
-- $Author: sckoarn $
|
--
|
--
|
-- $Date: 2007-08-21 02:43:14 $
|
-- $Date: 2007-09-02 04:04:04 $
|
--
|
--
|
-- $Name: not supported by cvs2svn $
|
-- $Name: not supported by cvs2svn $
|
--
|
--
|
-- $Id: tb_pkg_header.vhd,v 1.2 2007-08-21 02:43:14 sckoarn Exp $
|
-- $Id: tb_pkg_header.vhd,v 1.3 2007-09-02 04:04:04 sckoarn Exp $
|
--
|
--
|
-- $Source: /home/marcus/revision_ctrl_test/oc_cvs/cvs/vhld_tb/source/tb_pkg_header.vhd,v $
|
-- $Source: /home/marcus/revision_ctrl_test/oc_cvs/cvs/vhld_tb/source/tb_pkg_header.vhd,v $
|
--
|
--
|
-- Description : The the testbench package header file.
|
-- Description : The the testbench package header file.
|
-- Initial GNU release.
|
-- Initial GNU release.
|
Line 20... |
Line 20... |
-- The VHDL Test Bench is free software; you can redistribute it and/or modify
|
-- The VHDL Test Bench is free software; you can redistribute it and/or modify
|
-- it under the terms of the GNU General Public License as published by
|
-- it under the terms of the GNU General Public License as published by
|
-- the Free Software Foundation; either version 2 of the License, or
|
-- the Free Software Foundation; either version 2 of the License, or
|
-- (at your option) any later version.
|
-- (at your option) any later version.
|
--
|
--
|
-- Foobar is distributed in the hope that it will be useful,
|
-- The VHDL Test Bench is distributed in the hope that it will be useful,
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
-- GNU General Public License for more details.
|
-- GNU General Public License for more details.
|
--
|
--
|
-- You should have received a copy of the GNU General Public License
|
-- You should have received a copy of the GNU General Public License
|
-- 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.2 2007/08/21 02:43:14 sckoarn
|
|
-- Fix package definition to match with body
|
|
--
|
-- Revision 1.1.1.1 2007/04/06 04:06:48 sckoarn
|
-- Revision 1.1.1.1 2007/04/06 04:06:48 sckoarn
|
-- Import of the vhld_tb
|
-- Import of the vhld_tb
|
--
|
--
|
--
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
Line 49... |
Line 52... |
package tb_pkg is
|
package tb_pkg is
|
|
|
-- Constants
|
-- Constants
|
constant max_str_len : integer := 256;
|
constant max_str_len : integer := 256;
|
constant max_field_len : integer := 48;
|
constant max_field_len : integer := 48;
|
constant c_stm_text_len : integer := 128;
|
constant c_stm_text_len : integer := 200;
|
-- file handles
|
-- file handles
|
file stimulus : text; -- file main file
|
file stimulus : text; -- file main file
|
file include_file : text; -- file declaration for includes
|
file include_file : text; -- file declaration for includes
|
|
|
-- Type Def's
|
-- Type Def's
|
Line 80... |
Line 83... |
inst_field_6: text_field;
|
inst_field_6: text_field;
|
txt: stm_text_ptr;
|
txt: stm_text_ptr;
|
line_number: integer; -- sequence line
|
line_number: integer; -- sequence line
|
num_of_lines: integer; -- total number of lines
|
num_of_lines: integer; -- total number of lines
|
file_line: integer; -- file line number
|
file_line: integer; -- file line number
|
file_name: text_line;
|
file_idx: integer;
|
next_rec: stim_line_ptr;
|
next_rec: stim_line_ptr;
|
end record;
|
end record;
|
-- define the variables field and pointer
|
-- define the variables field and pointer
|
type var_field;
|
type var_field;
|
type var_field_ptr is access var_field; -- pointer to var_field
|
type var_field_ptr is access var_field; -- pointer to var_field
|
Line 101... |
Line 104... |
instruction: text_field;
|
instruction: text_field;
|
instruction_l: integer;
|
instruction_l: integer;
|
params: integer;
|
params: integer;
|
next_rec: inst_def_ptr;
|
next_rec: inst_def_ptr;
|
end record;
|
end record;
|
|
-- define the file handle record
|
|
type file_def;
|
|
type file_def_ptr is access file_def;
|
|
type file_def is record
|
|
rec_idx: integer;
|
|
file_name: text_line;
|
|
next_rec: file_def_ptr;
|
|
end record;
|
|
|
---*****************************************************************************
|
---*****************************************************************************
|
-- Function Declaration
|
-- Function Declaration
|
-- function str_len(variable line: text_line) return text_field;
|
-- function str_len(variable line: text_line) return text_field;
|
-- function fld_len(s : in text_field) integer;
|
-- function fld_len(s : in text_field) integer;
|
function ew_to_slv(value : in integer;
|
|
length : in integer) return std_logic_vector;
|
|
|
|
function c2std_vec(c: in character) return std_logic_vector;
|
function c2std_vec(c: in character) return std_logic_vector;
|
|
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
-- Procedure declarations
|
-- Procedure declarations
|
Line 156... |
Line 165... |
-- parsesed into the inst_sequ list. Instructions are validated against the
|
-- parsesed into the inst_sequ list. Instructions are validated against the
|
-- inst_set which must have been set up prior to loading the instruction file.
|
-- inst_set which must have been set up prior to loading the instruction file.
|
procedure read_instruction_file(constant file_name: string;
|
procedure read_instruction_file(constant file_name: string;
|
variable inst_set: inout inst_def_ptr;
|
variable inst_set: inout inst_def_ptr;
|
variable var_list: inout var_field_ptr;
|
variable var_list: inout var_field_ptr;
|
variable inst_sequ: inout stim_line_ptr);
|
variable inst_sequ: inout stim_line_ptr;
|
|
variable file_list: inout file_def_ptr);
|
|
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
-- access_inst_sequ
|
-- access_inst_sequ
|
-- This procedure retreeves an instruction from the sequence of instructions.
|
-- This procedure retreeves an instruction from the sequence of instructions.
|
-- Based on the line number you pass to it, it returns the instruction with
|
-- Based on the line number you pass to it, it returns the instruction with
|
-- any variables substituted as integers.
|
-- any variables substituted as integers.
|
procedure access_inst_sequ(variable inst_sequ : in stim_line_ptr;
|
procedure access_inst_sequ(variable inst_sequ : in stim_line_ptr;
|
variable var_list : in var_field_ptr;
|
variable var_list : in var_field_ptr;
|
|
variable file_list : in file_def_ptr;
|
variable sequ_num : in integer;
|
variable sequ_num : in integer;
|
variable inst : out text_field;
|
variable inst : out text_field;
|
variable p1 : out integer;
|
variable p1 : out integer;
|
variable p2 : out integer;
|
variable p2 : out integer;
|
variable p3 : out integer;
|
variable p3 : out integer;
|
Line 215... |
Line 226... |
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
-- dump inst_sequ
|
-- dump inst_sequ
|
-- This procedure dumps to the simulation window the current instruction
|
-- This procedure dumps to the simulation window the current instruction
|
-- sequence. The whole thing will be dumped, which could be big.
|
-- sequence. The whole thing will be dumped, which could be big.
|
-- ** intended for testbench development debug**
|
-- ** intended for testbench development debug**
|
procedure dump_inst_sequ(variable inst_sequ : in stim_line_ptr);
|
-- procedure dump_inst_sequ(variable inst_sequ : in stim_line_ptr);
|
|
|
end tb_pkg;
|
end tb_pkg;
|
|
|
No newline at end of file
|
No newline at end of file
|