00001
00002 #if !defined(oagFpgaMultiRef_P)
00003 #define oagFpgaMultiRef_P
00004
00005 #include "oaDesignDB.h"
00006 #include "oagFpgaRtlGraph.h"
00007 #include <list>
00008 #include <map>
00009
00010 using namespace std;
00011
00012 namespace oagFpga {
00013
00014
00015
00016
00017
00018 typedef enum {BBREF, NET, NEITHER} MultiRefType;
00019 typedef list<class MultiRef> MultiRefBus;
00020
00021
00022
00026
00032
00033
00034 class MultiRef {
00035
00036 public:
00037
00038 MultiRefType type;
00039
00040 union {
00041 oa::oaModBitNet *net;
00042 BBRef bb;
00043 };
00044
00046 MultiRef() { type = NEITHER; }
00048 MultiRef(oa::oaModBitNet *n) { net = n; type = NET; }
00050 MultiRef(BBRef b) { bb = b; type = BBREF; }
00052 MultiRef(const MultiRef &e) { memcpy(this, &e, sizeof(MultiRef)); }
00053
00054 MultiRef& operator=(const MultiRef &e) { memcpy(this, &e, sizeof(MultiRef)); return *this; }
00055 bool operator==(const MultiRef &e) {
00056 if (type != e.type) return false;
00057 else if (type == NEITHER) return true;
00058 else if (type == NET) return net == e.net;
00059 else return bb == e.bb;
00060 }
00061
00062 };
00063
00064 }
00065
00066 #endif