Subsections


Multiplexor

Name

Mux - Easy way to instantiate a multiplexor

Synopsys

netOut <= netCmd.Mux ( arg )

Description

This method is a method of net. The net which this method is applied to is the command of the multiplexor. The nets given as parameters are all the input nets. This method returns a net : the output net.
There are two ways to describe the multiplexor : the argument arg can be a list or a dictionnary.
Note that it is possible to change the generator instanciated with the SetMux method.

Parameters

Example

class essai ( Model ) :

  def Interface ( self ) :
    self.A    = SignalIn  (    "a", 4 )
    self.B    = SignalIn  (    "b", 4 )
    self.C    = SignalIn  (    "c", 4 )
    self.D    = SignalIn  (    "d", 4 )
    
    self.Cmd1 = SignalIn  ( "cmd1", 2 )
    self.Cmd2 = SignalIn  ( "cmd2", 4 )
    
    self.S1   = SignalOut (   "s1", 4 )
    self.S2   = SignalOut (   "s2", 4 )

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

    self.S1 <= self.Cmd1.Mux ( [sefl.A, self.B, self.C, self.D] ) 

    self.S2 <= self.Cmd2.Mux ( { "0"       : self.A
                               , "1,5-7"   : self.B
                               , "#1?1?"   : self.C
                               , "default" : self.D
                             } )

Errors

Some errors may occur :

See Also

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

Sophie BELLOEIL
20051116.1