# DpgenNbuse

- Name : DpgenNbuse - Tristate Macro-Generator
- Synopsys :

      Generate ( 'DpgenNbuse', modelname
               , param = { 'nbit'       : n
                         , 'physical'   : true
                         , 'behavioral' : true
                         }
               )

- Description : Generates a `n` bits tristate with an complemented output named `modelname`.
- Terminal Names :
  - cmd : select ( 1 bit )
  - i0 : input ( `n` bits )
  - nq : output ( `n` bits )
  - vdd : power
  - vss : ground
- Parameters : Parameters are given in the map `param`.
  - nbit (mandatory) : Defines the size of the generator
  - physical (optional, default value : False) : In order to generate a layout
  - behavioral (optional, default value : False) : In order to generate a behavior
- Behavior :

      nts:BLOCK(cmd = '1') BEGIN
          nq <= GUARDED not(i0);
      END

- Example :

      from stratus import *

      class inst_nbuse ( Model ) :

        def Interface ( self ) :
          self.i   = SignalIn  (   "i", 29 )
          self.cmd = SignalIn  ( "cmd", 1  )
          self.o   = SignalOut (   "o", 29 )

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

        def Netlist ( self ) :
          Generate ( 'DpgenNbuse', 'nbuse29'
                   , param = { 'nbit'     : 29
                             , 'physical' : True
                             }
                   )
          self.I = Inst ( 'nbuse29', 'inst'
                        , map = { 'i0'  : self.i
                                , 'cmd' : self.cmd
                                , 'nq'  : self.o
                                , 'vdd' : self.vdd
                                , 'vss' : self.vss
                                }
                        )

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