# DpgenOr3

- Name : DpgenOr3 - Or3 Macro-Generator
- Synopsys :

      Generate ( 'DpgenOr3', modelname
               , param = { 'nbit'       : n
                         , 'drive'      : d
                         , 'physical'   : True
                         , 'behavioral' : True
                         }
               )

- Description : Generates a `n` bits three inputs OR with an output power of `d` named `modelname`.
- Terminal Names :
  - i0 : input (`n` bits)
  - i1 : input (`n` bits)
  - i2 : input (`n` bits)
  - q : output (`n` bits)
  - vdd : power
  - vss : ground
- Parameters : Parameters are given in the map `param`.
  - nbit (mandatory) : Defines the size of the generator
  - drive (optional) : Defines the output power of the gates
    - Valid drive are : 2 or 4
    - If this parameter is not defined, it's value is the smallest one permitted
  - physical (optional, default value : False) : In order to generate a layout
  - behavioral (optional, default value : False) : In order to generate a behavior
- Behavior :

      nq <= i0 or i1 or i2

- Example :

      from stratus import *

      class inst_or3 ( Model ) :

        def Interface ( self ) :
          self.in1 = SignalIn  ( "in1", 5 )
          self.in2 = SignalIn  ( "in2", 5 )
          self.in3 = SignalIn  ( "in3", 5 )
          self.o   = SignalOut (   "o", 5 )

          self.vdd = VddIn ( "vdd" )
          self.vss = VssIn ( "vss" )

        def Netlist ( self ) :
          Generate ( 'DpgenOr3', 'or3_5'
                   , param = { 'nbit'     : 5
                             , 'physical' : True
                             }
                   )
          self.I = Inst ( 'or3_5', 'inst'
                        , map = { 'i0'  : self.in1
                                , 'i1'  : self.in2
                                , 'i2'  : self.in3
                                , 'q'   : self.o
                                , 'vdd' : self.vdd
                                , 'vss' : self.vss
                                }
                        )

        def Layout ( self ) :
          Place ( self.I, NOSYM, Ref(0, 0) )