| 55 | } |
| 56 | |
| 57 | void |
| 58 | Allocate::initialize( PortInfo * const src, |
| 59 | PortInfo * const dst, |
| 60 | FIFO * const fifo ) |
| 61 | { |
| 62 | assert( fifo != nullptr ); |
| 63 | assert( dst != nullptr ); |
| 64 | assert( src != nullptr ); |
| 65 | if( src->getFIFO() != nullptr ) |
| 66 | { |
| 67 | throw PortDoubleInitializeException( |
| 68 | "Source port \"" + src->my_name + "\" already initialized!" ); |
| 69 | } |
| 70 | if( dst->getFIFO() != nullptr ) |
| 71 | { |
| 72 | throw PortDoubleInitializeException( |
| 73 | "Destination port \"" + dst->my_name + "\" already initialized!" ); |
| 74 | } |
| 75 | src->setFIFO( fifo ); |
| 76 | dst->setFIFO( fifo ); |
| 77 | /** NOTE: this list simply speeds up the monitoring if we want it **/ |
| 78 | allocated_fifo.insert( fifo ); |
| 79 | } |
| 80 | |
| 81 | |
| 82 | void |