Last change
on this file since 91 was
88,
checked in by rosiere, 16 years ago
|
Almost complete design
with Test and test platform
|
-
Property svn:keywords set to
Id
|
File size:
839 bytes
|
Line | |
---|
1 | #ifndef Morpheo_Behavioural_Operation_h |
---|
2 | #define Morpheo_Behavioural_Operation_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Operation.h 88 2008-12-10 18:31:39Z rosiere $ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace 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, res) ((sign(size,op1) == sign(size,op2))?(sign(size,op1) xor sign(size,res)):0) |
---|
19 | #define carry(size,op1, op2, res) (((res)<(op1)) or ((res)<(op2))) |
---|
20 | #define set_flag(data,flag,is_set) (((is_set)==1)?((data)|(flag)):((data)&~(flag))) |
---|
21 | #define get_flag(data,flag) (((data)&(flag))!=0) |
---|
22 | #define concatenation_bool(a,b) (((a)<<1) | (b)) |
---|
23 | |
---|
24 | }; // end namespace behavioural |
---|
25 | }; // end namespace morpheo |
---|
26 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.