All Packages Class Hierarchy This Package Previous Next Index
Class byucc.jhdl.modgen.Adsu
java.lang.Object
|
+----byucc.jhdl.base.Nameable
|
+----byucc.jhdl.base.Node
|
+----byucc.jhdl.base.Cell
|
+----byucc.jhdl.base.Structural
|
+----byucc.jhdl.Logic.Logic
|
+----byucc.jhdl.modgen.Adsu
- public class Adsu
- extends Logic
General Description
Adsu creates an addsub unit with generic length operands. The addsub unit
can optionally be registered, have carry in, or have carry out.
All of the cells are RLOCd for precise placement. Users can instruct
the module generator to place the cells along even bit boundaries or odd.
Implementation
All Technologies
The inputs a,b and output s must be the same wordsize. Adsu control is
done with the add_sub signal. 1= add, 0 = subtract.
If a carry in signal is supplied, 1 = carry in for add, 0= borrow for
subtract.
Pipelining
Pipelining is enabled by setting the registered parameter true.
The registers in the pipe can be stalled using a clk_en signal.
clk_en can be passed in null for a perpetually enabled design. An
exception will be thrown if clk_en is present when the module is
unregistered.
Xilinx XC4000
Selecting bit alignment
Xilinx 4k parts require a CLB to initialize the carry chain. ODD_ALIGNED
Adsu units perform the calculation of the first bit of the sum in this
initialization CLB (odd numbered bits are calculated in the F-LUTS), while
EVEN_ALIGNED Adsu units only initialize the carry chain in the first CLB.
Calculating module size
To find the CLB count for an Adsu unit, take the wordsize of the
operands and divide by two and add one. If the unit is EVEN_ALIGNED,
also add the remainder
- Author:
- Jeremy Anderson
-
cell_interface
-
-
cellname
-
-
EVEN_ALIGNED
- constants to determine placement information
EVEN_ALIGNED adders begin the carry chain with a FORCE.
-
ODD_ALIGNED
-
-
Adsu(Node, int, boolean, Wire, Wire, Wire, Wire, Wire, Wire, Wire)
- Constructor for Adsu unit
-
cellInterfaceDeterminesUniqueNetlistStructure()
-
-
clock()
-
-
compute(int, int, int, int, int)
- Compute implements the behavior of the Adsu for behavioral modelling
of the circuit
-
defaultSimulationModelIsBehavioral()
- The default simulation model is behavioral
-
getCellName()
-
-
propagate()
-
-
reset()
-
EVEN_ALIGNED
public static final int EVEN_ALIGNED
- constants to determine placement information
EVEN_ALIGNED adders begin the carry chain with a FORCE. Even numbered
bit adds occur on the bottom CLB boundary.
ODD_ALIGNED adders perform the lsb addsub in the bottom CLB. Odd
numbered bit adds occur on the bottom CLB boundary.
ODD_ALIGNED
public static final int ODD_ALIGNED
cell_interface
public static CellInterface cell_interface[]
cellname
public static final String cellname
Adsu
public Adsu(Node parent,
int alignment,
boolean registered,
Wire clk_en,
Wire cin,
Wire a,
Wire b,
Wire add_sub,
Wire cout,
Wire s)
- Constructor for Adsu unit
- Parameters:
- parent - Parent of this circuit
- alignment - EVEN_ALIGNED or ODD_ALIGNED
- registered - True for output registers, false for no registers
- clk_en - Clock enable wire
- cin - Carry in wire. Null for no carry in.
- a - A operand
- b - B operand
- add_sub - Add/subtract control signal 1=a+b, 0=a-b.
- cout - Carry out wire. Null for no carry out.
- s - Result wire.
cellInterfaceDeterminesUniqueNetlistStructure
public boolean cellInterfaceDeterminesUniqueNetlistStructure()
- Overrides:
- cellInterfaceDeterminesUniqueNetlistStructure in class Cell
getCellName
public String getCellName()
- Overrides:
- getCellName in class Cell
defaultSimulationModelIsBehavioral
protected boolean defaultSimulationModelIsBehavioral()
- The default simulation model is behavioral
- Overrides:
- defaultSimulationModelIsBehavioral in class Structural
compute
public static int[] compute(int width,
int cin,
int a,
int b,
int add_sub)
- Compute implements the behavior of the Adsu for behavioral modelling
of the circuit
- Parameters:
- cin - carry in of the Adsu
- width - Wordsize of the Adsu
- a - a input.
- b - b input.
- add_sub - add_sub control signal
- Returns:
- Array of integers containing the sum and carryout of the Adsu
propagate
public void propagate()
- Overrides:
- propagate in class Structural
clock
public void clock()
- Overrides:
- clock in class Structural
reset
public void reset()
- Overrides:
- reset in class Structural
All Packages Class Hierarchy This Package Previous Next Index