source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Operation.h @ 141

Last change on this file since 141 was 141, checked in by rosiere, 14 years ago

Add statistics in stage IFETCH, DECODE and COMMIT (insert, retire and commit)

  • Property svn:keywords set to Id
File size: 971 bytes
Line 
1#ifndef Morpheo_Behavioural_Operation_h
2#define Morpheo_Behavioural_Operation_h
3
4/*
5 * $Id: Operation.h 141 2010-08-02 18:56:05Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11namespace morpheo {
12namespace behavioural {
13
14#  define neg(     size,data)           (~(data)+1)
15#  define sign(    size,data)           ((data)>>(size-1))
16#  define unsigned(size,data)           (data)
17#  define signed(  size,data)           ((sign(size,data)==0)?(data):neg(size,data))
18//#define ovf(     size,op1, op2, c_in) ((op2^(op1+op2+c_in))&~(op1^op2))>>(size-1);
19#  define ovf(     size,op1, op2, res)  ((sign(size,op1) == sign(size,op2))?(sign(size,op1) xor sign(size,res)):0)
20#  define carry(   size,op1, op2, res)  (((res)<(op1)) or ((res)<(op2)))
21#  define set_flag(data,flag,is_set)    (((is_set)==1)?((data)|(flag)):((data)&~(flag)))
22#  define get_flag(data,flag)           (((data)&(flag))!=0)
23#  define concatenation_bool(a,b)       (((a)<<1) | (b))
24
25}; // end namespace behavioural
26}; // end namespace morpheo             
27#endif
Note: See TracBrowser for help on using the repository browser.