OpenCores
URL https://opencores.org/ocsvn/vhld_tb/vhld_tb/trunk

Subversion Repositories vhld_tb

[/] [vhld_tb/] [trunk/] [source/] [template_tb_bhv.vhd] - Blame information for rev 23

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sckoarn
-------------------------------------------------------------------------------
2 23 sckoarn
--             Copyright 2014  Ken Campbell
3
--               All rights reserved.
4 2 sckoarn
-------------------------------------------------------------------------------
5
-- $Author: sckoarn $
6
--
7 19 sckoarn
-- $Date:  $
8 2 sckoarn
--
9 19 sckoarn
-- $Id:  $
10 2 sckoarn
--
11 19 sckoarn
-- $Source:  $
12 2 sckoarn
--
13 23 sckoarn
-- Description :  The the testbench template file.
14 2 sckoarn
--
15
------------------------------------------------------------------------------
16 23 sckoarn
--  This file is a template used to generate test bench _bhv.vhd  file.
17 2 sckoarn
--
18 23 sckoarn
--  Redistribution and use in source and binary forms, with or without
19
--  modification, are permitted provided that the following conditions are met:
20 2 sckoarn
--
21 23 sckoarn
--  1. Redistributions of source code must retain the above copyright notice,
22
--     this list of conditions and the following disclaimer.
23 2 sckoarn
--
24 23 sckoarn
--  2. Redistributions in binary form must reproduce the above copyright notice,
25
--     this list of conditions and the following disclaimer in the documentation
26
--     and/or other materials provided with the distribution.
27
--
28
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
32
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38
-- POSSIBILITY OF SUCH DAMAGE.
39 2 sckoarn
-------------------------------------------------------------------------------
40
 
41
architecture bhv of tb_Top is
42
 
43 23 sckoarn
 
44 2 sckoarn
  signal tb_clk            : std_logic;
45 23 sckoarn
 
46 2 sckoarn
-------------------------------------------------------------------------
47
-- Component defintion
48
 
49
-------------------------------------------------------------------------------
50
-- USER Component instantiations
51
--for all: Arbitor      use entity tb_objects.arbitor(bhv);
52
 
53
 
54
  begin
55
 
56
-------------------------------------------------------------------------------
57
-- clock driver process
58
-- the main clock generator
59
clock_driver:
60
  process
61
  begin
62
    tb_clk <=  '0';
63
    wait for 5 ns;
64
    tb_clk <=  '1';
65
    wait for 5 ns;
66
  end process clock_driver;
67
 
68
  --------------------------------------------------------------------------
69
  -- Read_file Process:
70
  --
71
  -- This process is the main process of the testbench.  This process reads
72
  -- the stumulus file, parses it, creates lists of records, then uses these
73
  -- lists to exicute user instructions.  There are two passes through the
74
  -- script.  Pass one reads in the stimulus text file, checks it, creates
75
  -- lists of valid instructions, valid list of variables and finialy a list
76
  -- of user instructions(the sequence).  The second pass through the file,
77
  -- records are drawn from the user instruction list, variables are converted
78
  -- to integers and put through the elsif structure for exicution.
79
  --------------------------------------------------------------------------
80
  Read_file: process
81
    variable current_line : text_line;  -- The current input line
82
    variable inst_list    : inst_def_ptr;  -- the instruction list
83
    variable defined_vars : var_field_ptr; -- defined variables
84
    variable inst_sequ    : stim_line_ptr; -- the instruction sequence
85 10 sckoarn
    variable file_list    : file_def_ptr;  -- pointer to the list of file names
86 13 sckoarn
    variable last_sequ_num: integer;
87
    variable last_sequ_ptr: stim_line_ptr;
88 2 sckoarn
 
89
    variable instruction  : text_field;   -- instruction field
90
    variable par1         : integer;      -- paramiter 1
91
    variable par2         : integer;      -- paramiter 2
92
    variable par3         : integer;      -- paramiter 3
93
    variable par4         : integer;      -- paramiter 4
94
    variable par5         : integer;      -- paramiter 5
95
    variable par6         : integer;      -- paramiter 6
96
    variable txt          : stm_text_ptr;
97
    variable nbase        : base;         -- the number base to use
98
    variable len          : integer;      -- length of the instruction field
99
    variable file_line    : integer;      -- Line number in the stimulus file
100
    variable file_name    : text_line;    -- the file name the line came from
101
    variable v_line       : integer := 0; -- sequence number
102
    variable stack        : stack_register; -- Call stack
103
    variable stack_ptr    : integer  := 0;  -- call stack pointer
104
    variable wh_stack     : stack_register; -- while stack
105
    variable wh_dpth      : integer := 0;   -- while depth
106
    variable wh_ptr       : integer  := 0;  -- while pointer
107
    variable loop_num         : integer := 0;
108
    variable curr_loop_count  : int_array := (others => 0);
109
    variable term_loop_count  : int_array := (others => 0);
110
    variable loop_line        : int_array := (others => 0);
111
 
112
    variable messages     : boolean  := TRUE;
113
    variable if_state     : boolean  := FALSE;
114
    variable wh_state     : boolean  := FALSE;
115
    variable wh_end       : boolean  := FALSE;
116
    variable rand         : std_logic_vector(31 downto 0);
117
    variable rand_back    : std_logic_vector(31 downto 0);
118 10 sckoarn
    variable valid        : integer;
119 23 sckoarn
 
120 10 sckoarn
    --  scratchpad variables
121 2 sckoarn
    variable temp_int     : integer;
122
    variable temp_index   : integer;
123
    variable temp_str     : text_field;
124
    variable v_temp_vec1  : std_logic_vector(31 downto 0);
125
    variable v_temp_vec2  : std_logic_vector(31 downto 0);
126
 
127
    --------------------------------------------------------------------------
128
    --  Area for Procedures which may be usefull to more than one instruction.
129
    --    By coding here commonly used  code sections ...
130
    --    you know the benifits.
131
    ---------------------------------------------------------------------
132
    -----------------------------------------------------------------
133
    -- This procedure writes to the arbitor model access port
134
--    procedure arb_write(add: in integer; .....
135
--    end arb_write;
136
 
137 23 sckoarn
 
138 2 sckoarn
  begin  -- process Read_file
139
-- parse_tb1 start input initialization
140
    -----------------------------------------------------------------------
141
    --           Stimulus file instruction definition
142
    --  This is where the instructions used in the stimulus file are defined.
143
    --  Syntax is
144
    --     define_instruction(inst_def_ptr, instruction, paramiters)
145
    --           inst_def_ptr: is a record pointer defined in tb_pkg_header
146 19 sckoarn
    --           instruction:  the text instruction name  ie. "ADD_VAR"
147 2 sckoarn
    --           paramiters:   the number of fields or paramiters passed
148
    --
149
    --  Some basic instruction are created here, the user should create new
150
    --  instructions below the standard ones.
151
    ------------------------------------------------------------------------
152
    define_instruction(inst_list, "DEFINE_VAR", 2);  -- Define a Variable
153
    define_instruction(inst_list, "EQU_VAR", 2);
154
    define_instruction(inst_list, "ADD_VAR", 2);
155
    define_instruction(inst_list, "SUB_VAR", 2);
156
    define_instruction(inst_list, "CALL", 1);
157
    define_instruction(inst_list, "RETURN_CALL", 0);
158
    define_instruction(inst_list, "JUMP", 1);
159
    define_instruction(inst_list, "LOOP", 1);
160
    define_instruction(inst_list, "END_LOOP", 0);
161
    define_instruction(inst_list, "IF", 3);
162 10 sckoarn
    define_instruction(inst_list, "ELSEIF", 3);
163 2 sckoarn
    define_instruction(inst_list, "ELSE", 0);
164
    define_instruction(inst_list, "END_IF", 0);
165
    define_instruction(inst_list, "WHILE", 3);
166
    define_instruction(inst_list, "END_WHILE", 0);
167
    define_instruction(inst_list, "MESSAGES_OFF", 0);
168
    define_instruction(inst_list, "MESSAGES_ON", 0);
169
    define_instruction(inst_list, "ABORT", 0);       -- Error exit from sim
170
    define_instruction(inst_list, "FINISH", 0);      -- Normal exit from sim
171 19 sckoarn
    define_instruction(inst_list, "INCLUDE", 1);     -- Include a script file
172
    --  Start User defined instructions
173 2 sckoarn
 
174 19 sckoarn
    --  End User defined instructions
175 2 sckoarn
    ------------------------------------------------------------------------
176
    -- Read, test, and load the stimulus file
177 10 sckoarn
    read_instruction_file(stimulus_file, inst_list, defined_vars, inst_sequ,
178
                          file_list);
179 2 sckoarn
 
180 13 sckoarn
    -- initialize last info
181
    last_sequ_num  := 0;
182
    last_sequ_ptr  := inst_sequ;
183 2 sckoarn
------------------------------------------------------------------------
184
-- Using the Instruction record list, get the instruction and implement
185
-- it as per the statements in the elsif tree.
186
  while(v_line < inst_sequ.num_of_lines) loop
187
    v_line := v_line + 1;
188 10 sckoarn
    access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
189 13 sckoarn
         par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
190
         last_sequ_num, last_sequ_ptr);
191 2 sckoarn
 
192
--------------------------------------------------------------------------
193 10 sckoarn
    --if(instruction(1 to len) = "DEFINE_VAR") then
194
    --  null;  -- This instruction was implemented while reading the file
195 23 sckoarn
 
196 2 sckoarn
--------------------------------------------------------------------------
197 10 sckoarn
    if(instruction(1 to len) = "INCLUDE") then
198 2 sckoarn
      null;  -- This instruction was implemented while reading the file
199 23 sckoarn
 
200 2 sckoarn
--------------------------------------------------------------------------
201
    elsif(instruction(1 to len) = "ABORT") then
202
      assert (false)
203
        report "The test has aborted due to an error!!"
204
      severity failure;
205
 
206
--------------------------------------------------------------------------
207
    elsif(instruction(1 to len) = "FINISH") then
208
      assert (false)
209
        report "Test Finished with NO errors!!"
210
      severity failure;
211
 
212
--------------------------------------------------------------------------
213
    elsif(instruction(1 to len) = "EQU_VAR") then
214
      update_variable(defined_vars, par1, par2, valid);
215 23 sckoarn
 
216 2 sckoarn
--------------------------------------------------------------------------
217
    elsif(instruction(1 to len) = "ADD_VAR") then
218
      index_variable(defined_vars, par1, temp_int, valid);
219
      if(valid /= 0) then
220
        temp_int  :=  temp_int + par2;
221
        update_variable(defined_vars, par1, temp_int, valid);
222
      else
223
        assert (false)
224
          report "ADD_VAR Error: Not a valid Variable??"
225
        severity failure;
226
      end if;
227 23 sckoarn
 
228 2 sckoarn
--------------------------------------------------------------------------
229
    elsif(instruction(1 to len) = "SUB_VAR") then
230
      index_variable(defined_vars, par1, temp_int, valid);
231
      if(valid /= 0) then
232
        temp_int  :=  temp_int - par2;
233
        update_variable(defined_vars, par1, temp_int, valid);
234
      else
235
        assert (false)
236
          report "SUB_VAR Error: Not a valid Variable??"
237
        severity failure;
238
      end if;
239 23 sckoarn
 
240 2 sckoarn
--------------------------------------------------------------------------
241
    elsif(instruction(1 to len) = "CALL") then
242
      if(stack_ptr >= 7) then
243
        assert (false)
244
          report "Call Error: Stack over run, calls to deeply nested!!"
245
        severity failure;
246
      end if;
247
      stack(stack_ptr)  :=  v_line;
248
      stack_ptr  :=  stack_ptr + 1;
249
      v_line       :=  par1 - 1;
250 23 sckoarn
 
251 2 sckoarn
--------------------------------------------------------------------------
252
    elsif(instruction(1 to len) = "RETURN_CALL") then
253
      if(stack_ptr <= 0) then
254
        assert (false)
255
          report "Call Error: Stack under run??"
256
        severity failure;
257
      end if;
258
      stack_ptr  :=  stack_ptr - 1;
259
      v_line  :=  stack(stack_ptr);
260
 
261
--------------------------------------------------------------------------
262
    elsif(instruction(1 to len) = "JUMP") then
263
      v_line    :=  par1 - 1;
264
      wh_state  :=  false;
265
      wh_stack  := (others => 0);
266
      wh_dpth   := 0;
267
      wh_ptr    := 0;
268
      stack     := (others => 0);
269
      stack_ptr := 0;
270
 
271
--------------------------------------------------------------------------------
272
     elsif (instruction(1 to len) = "LOOP") then
273 13 sckoarn
    loop_num := loop_num + 1;
274 2 sckoarn
        loop_line(loop_num) := v_line;
275
        curr_loop_count(loop_num) := 0;
276
        term_loop_count(loop_num) := par1;
277 13 sckoarn
    assert (messages)
278 2 sckoarn
          report LF & "Executing LOOP Command" &
279 23 sckoarn
                 LF & "  Nested Loop:" & HT & integer'image(loop_num) &
280 2 sckoarn
                 LF & "  Loop Length:" & HT & integer'image(par1)
281
          severity note;
282 23 sckoarn
 
283 2 sckoarn
--------------------------------------------------------------------------------
284
     elsif (instruction(1 to len) = "END_LOOP") then
285
        curr_loop_count(loop_num) := curr_loop_count(loop_num) + 1;
286
        if (curr_loop_count(loop_num) = term_loop_count(loop_num)) then
287
          loop_num := loop_num - 1;
288
        else
289
          v_line := loop_line(loop_num);
290
        end if;
291
 
292
--------------------------------------------------------------------------------
293
     elsif (instruction(1 to len) = "IF") then
294
       if_state  :=  false;
295
       case par2 is
296
         when 0 => if(par1 = par3) then if_state  :=  true; end if;
297
         when 1 => if(par1 > par3) then if_state  :=  true; end if;
298
         when 2 => if(par1 < par3) then if_state  :=  true; end if;
299
         when 3 => if(par1 /= par3) then if_state :=  true; end if;
300
         when 4 => if(par1 >= par3) then if_state :=  true; end if;
301
         when 5 => if(par1 <= par3) then if_state :=  true; end if;
302
         when others =>
303
           assert (false)
304
             report LF & "ERROR:  IF instruction got an unexpected value" &
305
                 LF & "  in parameter 2!" & LF &
306
                  "Found on line " & (ew_to_str(file_line,dec)) & " in file " & file_name
307
             severity failure;
308
       end case;
309
 
310
       if(if_state = false) then
311
         v_line := v_line + 1;
312 10 sckoarn
         access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
313 13 sckoarn
            par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
314
            last_sequ_num, last_sequ_ptr);
315 2 sckoarn
         while(instruction(1 to len) /= "ELSE" and
316
               instruction(1 to len) /= "ELSEIF" and
317
               instruction(1 to len) /= "END_IF") loop
318
           if(v_line < inst_sequ.num_of_lines) then
319
             v_line := v_line + 1;
320 10 sckoarn
             access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
321 13 sckoarn
                 par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
322
                 last_sequ_num, last_sequ_ptr);
323 2 sckoarn
           else
324
             assert (false)
325
              report LF & "ERROR:  IF instruction unable to find terminating" &
326
                     LF & "    ELSE, ELSEIF or END_IF statement."
327 23 sckoarn
              severity failure;
328 2 sckoarn
           end if;
329
         end loop;
330
         v_line := v_line - 1;  -- re-align so it will be operated on.
331
       end if;
332 23 sckoarn
 
333 2 sckoarn
--------------------------------------------------------------------------------
334
     elsif (instruction(1 to len) = "ELSEIF") then
335
       if(if_state = true) then  -- if the if_state is true then skip to the end
336
         v_line := v_line + 1;
337 10 sckoarn
         access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
338 13 sckoarn
             par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
339
             last_sequ_num, last_sequ_ptr);
340 2 sckoarn
         while(instruction(1 to len) /= "END_IF") loop
341
           if(v_line < inst_sequ.num_of_lines) then
342
             v_line := v_line + 1;
343 10 sckoarn
             access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
344 13 sckoarn
                 par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
345
                 last_sequ_num, last_sequ_ptr);
346 2 sckoarn
           else
347
             assert (false)
348
              report LF & "ERROR:  IF instruction unable to find terminating" &
349
                     LF & "    ELSE, ELSEIF or END_IF statement."
350 23 sckoarn
              severity failure;
351 2 sckoarn
           end if;
352
         end loop;
353
         v_line := v_line - 1;  -- re-align so it will be operated on.
354 23 sckoarn
 
355 2 sckoarn
       else
356
         case par2 is
357
           when 0 => if(par1 = par3) then if_state  :=  true; end if;
358
           when 1 => if(par1 > par3) then if_state  :=  true; end if;
359
           when 2 => if(par1 < par3) then if_state  :=  true; end if;
360
           when 3 => if(par1 /= par3) then if_state :=  true; end if;
361
           when 4 => if(par1 >= par3) then if_state :=  true; end if;
362
           when 5 => if(par1 <= par3) then if_state :=  true; end if;
363
           when others =>
364
             assert (false)
365
               report LF & "ERROR:  ELSEIF instruction got an unexpected value" &
366
                   LF & "  in parameter 2!" & LF &
367
                    "Found on line " & (ew_to_str(file_line,dec)) & " in file " & file_name
368
               severity failure;
369
         end case;
370 23 sckoarn
 
371 2 sckoarn
         if(if_state = false) then
372
           v_line := v_line + 1;
373 10 sckoarn
           access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
374 13 sckoarn
               par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
375
               last_sequ_num, last_sequ_ptr);
376 2 sckoarn
           while(instruction(1 to len) /= "ELSE" and
377
                 instruction(1 to len) /= "ELSEIF" and
378
                 instruction(1 to len) /= "END_IF") loop
379
             if(v_line < inst_sequ.num_of_lines) then
380
               v_line := v_line + 1;
381 10 sckoarn
               access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
382 13 sckoarn
                   par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
383
                   last_sequ_num, last_sequ_ptr);
384 2 sckoarn
             else
385
               assert (false)
386
                report LF & "ERROR:  ELSEIF instruction unable to find terminating" &
387
                       LF & "    ELSE, ELSEIF or END_IF statement."
388 23 sckoarn
                severity failure;
389 2 sckoarn
             end if;
390
           end loop;
391
           v_line := v_line - 1;  -- re-align so it will be operated on.
392
         end if;
393
       end if;
394 23 sckoarn
 
395 2 sckoarn
--------------------------------------------------------------------------------
396
     elsif (instruction(1 to len) = "ELSE") then
397
       if(if_state = true) then  -- if the if_state is true then skip the else
398
         v_line := v_line + 1;
399 10 sckoarn
         access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
400 13 sckoarn
             par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
401
             last_sequ_num, last_sequ_ptr);
402 2 sckoarn
         while(instruction(1 to len) /= "END_IF") loop
403
           if(v_line < inst_sequ.num_of_lines) then
404
             v_line := v_line + 1;
405 10 sckoarn
             access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
406 13 sckoarn
                 par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
407
                 last_sequ_num, last_sequ_ptr);
408 2 sckoarn
           else
409
             assert (false)
410
              report LF & "ERROR:  IF instruction unable to find terminating" &
411
                     LF & "    ELSE, ELSEIF or END_IF statement."
412 23 sckoarn
              severity failure;
413 2 sckoarn
           end if;
414
         end loop;
415
         v_line := v_line - 1;  -- re-align so it will be operated on.
416
       end if;
417 23 sckoarn
 
418 2 sckoarn
--------------------------------------------------------------------------------
419
     elsif (instruction(1 to len) = "END_IF") then
420
       null;  -- instruction is a place holder for finding the end of IF.
421 23 sckoarn
 
422 2 sckoarn
--------------------------------------------------------------------------------
423
     elsif (instruction(1 to len) = "WHILE") then
424
       wh_state  :=  false;
425
       case par2 is
426 11 sckoarn
         when 0 => if(par1 =  par3) then wh_state :=  true; end if;
427
         when 1 => if(par1 >  par3) then wh_state :=  true; end if;
428
         when 2 => if(par1 <  par3) then wh_state :=  true; end if;
429
         when 3 => if(par1 /= par3) then wh_state :=  true; end if;
430
         when 4 => if(par1 >= par3) then wh_state :=  true; end if;
431
         when 5 => if(par1 <= par3) then wh_state :=  true; end if;
432 2 sckoarn
         when others =>
433
           assert (false)
434
             report LF & "ERROR:  WHILE instruction got an unexpected value" &
435
                 LF & "  in parameter 2!" & LF &
436
                  "Found on line " & (ew_to_str(file_line,dec)) & " in file " & file_name
437
             severity failure;
438
       end case;
439
 
440
       if(wh_state = true) then
441
         wh_stack(wh_ptr) :=  v_line;
442
         wh_ptr  := wh_ptr + 1;
443
       else
444
         wh_end := false;
445
         while(wh_end /= true) loop
446
           if(v_line < inst_sequ.num_of_lines) then
447
             v_line := v_line + 1;
448 10 sckoarn
             access_inst_sequ(inst_sequ, defined_vars, file_list, v_line, instruction,
449 13 sckoarn
                 par1, par2, par3, par4, par5, par6, txt, len, file_name, file_line,
450
                 last_sequ_num, last_sequ_ptr);
451 2 sckoarn
           else
452
             assert (false)
453
               report LF & "ERROR:  WHILE instruction unable to find terminating" &
454
                      LF & "    END_WHILE statement."
455 23 sckoarn
             severity failure;
456 2 sckoarn
           end if;
457 23 sckoarn
 
458 2 sckoarn
           -- if is a while need to escape it
459
           if(instruction(1 to len) = "WHILE") then
460
             wh_dpth := wh_dpth + 1;
461
           -- if is the end_while we are looking for
462
           elsif(instruction(1 to len) = "END_WHILE") then
463
             if(wh_dpth = 0) then
464
               wh_end := true;
465
             else
466
               wh_dpth := wh_dpth - 1;
467
             end if;
468
           end if;
469
         end loop;
470
       end if;
471
 
472
--------------------------------------------------------------------------------
473
     elsif (instruction(1 to len) = "END_WHILE") then
474
       if(wh_ptr > 0) then
475
         v_line  :=  wh_stack(wh_ptr - 1) - 1;
476
         wh_ptr  := wh_ptr - 1;
477
       end if;
478 23 sckoarn
 
479 2 sckoarn
--------------------------------------------------------------------------------
480
     elsif (instruction(1 to len) = "MESSAGES_OFF") then
481
       messages  := TRUE;
482
--------------------------------------------------------------------------------
483
     elsif (instruction(1 to len) = "MESSAGES_ON") then
484
       messages  := FALSE;
485
 
486 23 sckoarn
 
487 2 sckoarn
--------------------------------------------------------------------------------
488
--------------------------------------------------------------------------------
489
--  USER Istruction area.  Add all user instructions below this
490
--------------------------------------------------------------------------------
491
--------------------------------------------------------------------------------
492
--    elsif (instruction(1 to len) = "RESET_SYS") then
493
 
494
 
495
--------------------------------------------------------------------------------
496
--  USER Istruction area.  Add all user instructions above this
497
--------------------------------------------------------------------------------
498
    --------------------------------------------------------------------------
499
    -- catch those little mistakes
500
    else
501 10 sckoarn
      assert (false)
502
        report LF & "ERROR:  Seems the command  " & instruction(1 to len) & " was defined but" & LF &
503
                    "was not found in the elsif chain, please check spelling."
504 2 sckoarn
        severity failure;
505
    end if;  -- else if structure end
506 10 sckoarn
    -- after the instruction is finished print out any txt and sub vars
507
    txt_print_wvar(defined_vars, txt, hex);
508 2 sckoarn
  end loop;  -- Main Loop end
509 23 sckoarn
 
510 2 sckoarn
  assert (false)
511
    report LF & "The end of the simulation! It was not terminated as expected." & LF
512
  severity failure;
513 23 sckoarn
 
514 2 sckoarn
  end process Read_file;
515
 
516
 
517
end bhv;
518 19 sckoarn
-------------------------------------------------------------------------------
519
-- Revision History:
520
--  version 1.4
521
-- $Log: not supported by cvs2svn $
522
-- Revision 1.3  2007/11/14 02:35:56  sckoarn
523
-- Fix to WHILE instruction: Change if_state typo to wh_state
524
--
525
-- Revision 1.2  2007/09/02 04:04:04  sckoarn
526
-- Update of version 1.2 tb_pkg
527
-- See documentation for details
528
--
529
-- Revision 1.1.1.1  2007/04/06 04:06:48  sckoarn
530
-- Import of the vhld_tb
531
--
532
--
533
-------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.