source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Parameters_msg_error.cpp @ 75

Last change on this file since 75 was 75, checked in by rosiere, 16 years ago

Update all component (except front_end) to :

  • new statistics model
  • no namespace std
File size: 2.2 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Parameters.h"
9#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h"
10#include <sstream>
11
12namespace morpheo {
13namespace behavioural {
14namespace generic {
15namespace victim {
16namespace victim_pseudo_lru {
17
18  std::string Parameters::msg_error(void)
19  {
20    std::string msg = "";
21
22    if (_nb_entity < 2)
23      {
24        msg += "  - nb_entity must be >= 2\n";
25        msg += "    * nb_entity                       : " + toString(_nb_entity) + "\n";
26      }
27
28    if (is_positive(log2(_nb_entity)) == false)
29      {
30        msg += "  - nb_entity is not a power of 2\n";
31        msg += "    * nb_entity                       : " + toString(_nb_entity) + "\n";
32      }
33
34    if (_nb_access <  1)
35      {
36        msg += "  - nb_access must be >= 1\n";
37        msg += "    * nb_access                       : " + toString(_nb_access) + "\n";
38      }
39
40    if (_size_table < 1)
41      {
42        msg += "  - size_table must be >= 1\n";
43        msg += "    * size_table                      : " + toString(_size_table) + "\n";
44      }
45
46    if (is_between_inclusive (static_cast<uint32_t>(log2(_nb_entity)),0 ,(8*sizeof(Tentity_t))) == false)
47      {
48        msg += "  - type \"Tentity_t\" is too little to the size defined by nb_entity\n";
49        msg += "    * nb_entity                       : " + toString(_nb_entity) + "\n";
50        msg += "    * Tentity_t                (bits) : " + toString(8*(sizeof(Tentity_t))) + "\n";
51      }
52
53    if (is_between_inclusive (static_cast<uint32_t>(log2(_size_table)),0 ,(8*sizeof(Taddress_t))) == false)
54      {
55        msg += "  - type \"Taddress_t\" is too little to the size defined by size_table\n";
56        msg += "    * size_table                      : " + toString(_size_table)    + "\n";
57        msg += "      > size                   (bits) : " + toString(log2(_size_table)) + "\n";
58        msg += "    * Taddress_t               (bits) : " + toString(8*(sizeof(Taddress_t))) + "\n";
59      }
60
61
62
63    return msg;
64  };
65
66}; // end namespace victim_pseudo_lru
67}; // end namespace victim
68}; // end namespace generic
69
70}; // end namespace behavioural
71}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.