source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Parameters_msg_error.cpp @ 88

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1/*
2 * $Id: Parameters_msg_error.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/include/Types.h"
9#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/include/Parameters.h"
10#include <sstream>
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace multi_front_end {
16namespace front_end {
17namespace prediction_unit {
18namespace branch_target_buffer {
19namespace branch_target_buffer_register {
20
21
22#undef  FUNCTION
23#define FUNCTION "Branch_Target_Buffer_Register::msg_error"
24  Parameters_test Parameters::msg_error(void)
25  {
26    log_printf(FUNC,Branch_Target_Buffer_Register,FUNCTION,"Begin");
27
28    Parameters_test test ("Branch_Target_Buffer_Register");
29
30    if (_size_counter < 2 )
31      test.error(_("size_counter must be >= 2.\n"));
32
33    if ((_associativity == 0) or
34        (_associativity > _size_buffer))
35      test.error(_("associativity must be > 0 and <= size_buffer.\n"));
36
37    if (_associativity == 1) // special case : full assoc and direct map ... also we print direct map
38      test.information(_("Branch Target Buffer is Direct Map.\n"));
39    else
40      if (_associativity == _size_buffer)
41        test.information(_("Branch Target Buffer is Full associative.\n"));
42      else
43        test.information(_("Branch Target Buffer is Semi associative.\n"));
44
45    for (uint32_t i=0; i<_nb_context; i++)
46      if (_associativity < (_nb_instruction[i]/2))
47        test.error(toString(_("associativity must be >= nb_instruction[%d]/2.\n"),i));
48
49    log_printf(FUNC,Branch_Target_Buffer_Register,FUNCTION,"End");
50
51    return test;
52  };
53
54}; // end namespace branch_target_buffer_register
55}; // end namespace branch_target_buffer
56}; // end namespace prediction_unit
57}; // end namespace front_end
58}; // end namespace multi_front_end
59}; // end namespace core
60
61}; // end namespace behavioural
62}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.