edu.byu.ece.edif.tools.replicate.wiring
Class ModuloIterationWiringPolicy

java.lang.Object
  extended by edu.byu.ece.edif.tools.replicate.wiring.ModuloIterationWiringPolicy
All Implemented Interfaces:
WiringPolicy

public class ModuloIterationWiringPolicy
extends java.lang.Object
implements WiringPolicy

The modulo-iteration wiring policy wires sinks and sources together by iterating sinks and sources simultaneously but recycling through the sources if there are less sources than sinks.


Field Summary
protected static ModuloIterationWiringPolicy _instance
          Singleton instance of the class
 
Constructor Summary
private ModuloIterationWiringPolicy()
          Ensure that the only way to get an instance of the class is through the static method getInstance().
 
Method Summary
 void connectSourcesToSinks(java.util.List<PortConnection> sources, java.util.List<? extends PortConnection> sinks, NetManager netManager)
          Connect the given sources and sinks with a modulo-iteration wiring policy.
static ModuloIterationWiringPolicy getInstance()
          Get (create if needed) the singleton instance of the ModuloIterationWiringPolicy class.
private  java.lang.Object readResolve()
          This method ensures that during deserialization, the _instance variable will be referred to and possibly modified so that extra instances (more than necessary) don't get created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_instance

protected static ModuloIterationWiringPolicy _instance
Singleton instance of the class

Constructor Detail

ModuloIterationWiringPolicy

private ModuloIterationWiringPolicy()
Ensure that the only way to get an instance of the class is through the static method getInstance().

Method Detail

connectSourcesToSinks

public void connectSourcesToSinks(java.util.List<PortConnection> sources,
                                  java.util.List<? extends PortConnection> sinks,
                                  NetManager netManager)
Connect the given sources and sinks with a modulo-iteration wiring policy. The source and sinks are iterated simultaneously. If the sources run out before the sinks, the iteration of sources cycles back to the beginning of the list.

Specified by:
connectSourcesToSinks in interface WiringPolicy

getInstance

public static ModuloIterationWiringPolicy getInstance()
Get (create if needed) the singleton instance of the ModuloIterationWiringPolicy class.

Returns:

readResolve

private java.lang.Object readResolve()
                              throws java.io.ObjectStreamException
This method ensures that during deserialization, the _instance variable will be referred to and possibly modified so that extra instances (more than necessary) don't get created.

Returns:
Throws:
java.io.ObjectStreamException