source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_assert.cpp @ 94

Last change on this file since 94 was 94, checked in by rosiere, 15 years ago

Update document on Vhdl generation.

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1#ifdef VHDL_TESTBENCH
2#ifdef VHDL_TESTBENCH_ASSERT
3/*
4 * $Id: Interface_fifo_testbench_assert.cpp 94 2008-12-15 11:04:03Z rosiere $
5 *
6 * [ Description ]
7 *
8 */
9
10#include "Behavioural/include/Interface_fifo.h"
11
12namespace morpheo              {
13namespace behavioural          {
14
15#undef  FUNCTION
16#define FUNCTION "Interface_fifo::testbench_assert"
17  void Interface_fifo::testbench_assert (Vhdl * & vhdl,
18                                         std::string counter_name)
19  {
20    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
21   
22    if (not _test_exhaustive)
23      if (_list_cycle->empty()== false)
24        {
25          std::string test_name = Interface::testbench_test_name(vhdl);
26
27          vhdl->set_body("");
28          vhdl->set_body("-- Interface \""+_name+"\"");
29          vhdl->set_body("");
30         
31          uint32_t j = 0;
32          std::list<uint32_t>::iterator i = _list_cycle->begin();
33         
34          while (i != _list_cycle->end())
35            {
36              vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '1')) report \"***** <"+_name+"> Test number "+toString(j)+" is OK     *****\" severity NOTE;");
37              vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '0')) report \"@@@@@ <"+_name+"> Test number "+toString(j)+" is KO !!! @@@@@\" severity NOTE;");
38              j++;
39              ++i;
40            }
41        }
42   
43    log_printf(FUNC,Behavioural,FUNCTION,"End");
44  };
45
46}; // end namespace behavioural         
47}; // end namespace morpheo             
48#endif
49#endif
Note: See TracBrowser for help on using the repository browser.