source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_val_tree.cpp @ 81

Last change on this file since 81 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:executable set to *
  • Property svn:keywords set to Id
File size: 643 bytes
Line 
1#ifdef STATISTICS
2#include "Behavioural/include/Stat_binary_tree.h"
3
4namespace morpheo {
5namespace behavioural { 
6  counter_t Stat_binary_tree::val_tree    (void)
7  {
8    switch (_data.op)
9      {
10      case add : return _left->eval() + _right->eval();
11      case sub : return _left->eval() - _right->eval();
12      case mul : return _left->eval() * _right->eval();
13      case div : return _left->eval() / _right->eval();
14      case inc : return _left->eval() + 1;
15      case dec : return _left->eval() - 1;
16      default : throw(ERRORMORPHEO("Stat_binary_tree::val_tree",_("Unknow operator.")));
17      }
18   
19    return 0;
20  }
21}; 
22};
23#endif
Note: See TracBrowser for help on using the repository browser.