source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Sort/src/Parameters_msg_error.cpp @ 88

Last change on this file since 88 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1/*
2 * $Id: Parameters_msg_error.cpp 81 2008-04-15 18:40:01Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/include/Types.h"
9#include "Behavioural/Generic/Sort/include/Parameters.h"
10#include <sstream>
11
12namespace morpheo                    {
13namespace behavioural {
14namespace generic {
15namespace sort {
16
17
18#undef  FUNCTION
19#define FUNCTION "Sort::msg_error"
20  Parameters_test Parameters::msg_error(void)
21  {
22    log_printf(FUNC,Sort,FUNCTION,"Begin");
23
24    Parameters_test test ("Sort");
25
26    // Test if param : n ==  2^k
27    if (is_positive(log2(_nb_input)) == false)
28      test.error("nb_input is not a power of 2.");
29
30    // Test functionnal
31    if (_nb_input < _nb_output)
32      test.error("nb_input must be higher than nb_output.");
33
34    if (is_between_exclusive (_size_data,0 ,(8*sizeof(Tdata_t))) == false)
35      test.error("type \"Tdata_t\" is too little to the size defined by size_data.");
36
37    if (is_between_exclusive (static_cast<uint32_t>(log2(_nb_input)),0 ,(8*sizeof(Taddress_t))) == false)
38      test.error("type \"Taddress_t\" is too little to the size defined by nb_input.");
39
40    if ((not _have_port_index_out) and (not _have_port_data_out))
41      test.error("Need ouput : index, data (sorted) or both.");
42
43    if (not _ascending)
44      test.error("descending order not supported. (Coming Soon)");
45
46    log_printf(FUNC,Sort,FUNCTION,"End");
47
48    return test;
49  };
50
51}; // end namespace sort
52}; // end namespace generic
53
54}; // end namespace behavioural
55}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.