byucc.jhdl.synth.operators
Class MuxSynthesizer

java.lang.Object
  extended bybyucc.jhdl.synth.operators.LogicSynthesizer
      extended bybyucc.jhdl.synth.operators.MuxSynthesizer
All Implemented Interfaces:
OperatorSynthesizer

public class MuxSynthesizer
extends LogicSynthesizer

A class responsible for synthesizing mux operators in a DataFlowGraph This class extends LogicSynthesizer and will call LogicSynthesizer.createCell after sorting the inputWires as appropriate so that the mux wires are connected correctly.


Constructor Summary
MuxSynthesizer()
           
 
Method Summary
 Wire createCell(Logic parent, DFVertex operator, Wire[] inputWires)
          Create a cell from the given DFVertex operator.
 void resolveInputWidths(DFVertex operator)
          Determine the widths for one or more inputs to the given operator vertex based on the output width and other inputs with established widths.
 void resolveOutputWidth(DFVertex operator)
          Determine the width for the output of the given operator based on one or more of the inputs with established widths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MuxSynthesizer

public MuxSynthesizer()
Method Detail

createCell

public Wire createCell(Logic parent,
                       DFVertex operator,
                       Wire[] inputWires)
Create a cell from the given DFVertex operator. This method will create the appropriate cell with parent as its parent and input wires from inputWires. It will return a new wire created for the output. The new cell should implement the function defined by operator.getOperation()

Specifically MuxSynthesizer simply finds the input wires by tracing edges back from operator to their tail vertices and calling getAssociatedWire on each of those vertices. After locating all wires, they will be sorted in the appropriate order for the mux, then control will be passed up to super.createCell for the reflection and cell creation.

The approriate order for mux inputs is that all input edges with a non-null weight come before any with null weights. Also, all input edges with non-null weights will be sorted in ascending numerical order.

Specified by:
createCell in interface OperatorSynthesizer
Overrides:
createCell in class LogicSynthesizer
Parameters:
operator - an operator in a DataFlowGraph specifying the operation to be performed by the new cell.
inputWires - ignored
Returns:
the output wire of the newly created cell.

resolveOutputWidth

public void resolveOutputWidth(DFVertex operator)
Determine the width for the output of the given operator based on one or more of the inputs with established widths. TODO: I'd like to achieve better code reuse with LogicSynthesizer.resolveOutputWidth. This method is almost identical to that one. The only difference is that we ignore the "select" input when computing the maximum input width.

Specified by:
resolveOutputWidth in interface OperatorSynthesizer
Overrides:
resolveOutputWidth in class LogicSynthesizer
Parameters:
operator - The operator vertex whose output width is to be resolved.

resolveInputWidths

public void resolveInputWidths(DFVertex operator)
Determine the widths for one or more inputs to the given operator vertex based on the output width and other inputs with established widths. TODO: I'd like to achieve better code reuse with LogicSynthesizer.resolveInputWidths. This method is almost identical to that one. The only difference is that we do not want to change the width of the "select" input edge.

Specified by:
resolveInputWidths in interface OperatorSynthesizer
Overrides:
resolveInputWidths in class LogicSynthesizer
Parameters:
operator - The operator vertex whose input widths are to be resolved.


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.