Subsections


Shifter

Name

Shift - Easy way to instantiate a shifter

Synopsys

netOut <= netCmd.Shift ( netIn, direction, type )

Description

This method is a method of net. The net which this method is applied to is the command of the shifter, it's the one which defines the number of bits to shift. The net given as parameter is the input net. The other arguments set the different patameters. The method returns a net : the output net.
Note that it is possible to change the generator instanciated with the SetShift method.

Parameters

Example

class essai ( Model ) :

  def Interface ( self ) :
    self.A = SignalIn ( "a", 4 )
    
    self.Cmd = SignalIn ( "cmd", 2 )
    
    self.S1 = SignalOut ( "s1", 4 )
    self.S2 = SignalOut ( "s2", 4 )
    self.S3 = SignalOut ( "s3", 4 )

    self.Vdd = VddIn  ( "vdd" )
    self.Vss = VssIn  ( "vss" )
	
  def Netlist ( self ) :

    self.S1 <= self.Cmd.Shift ( self.A, "right", "logical" ) 
    self.S2 <= self.Cmd.Shift ( self.A, "right", "arith"   ) 
    
    self.S3 <= self.Cmd.Shift ( self.A, "left", "circular" )
If the value of "a" is "0b1001" and the value of "cmd" is "0b10", we will have :

Errors

Some errors may occur :

See Also

Introduction Netlist Instanciation of a multiplexor Instanciation of a register Instanciation of constants Boolean operations Arithmetical operations Comparison operations

Sophie BELLOEIL
20051116.1