Example :
from stratus import *
class inst_shrot ( Model ) :
def Interface ( self ) :
self.rotop = SignalIn ( "rotop", 3 )
self.instshamt = SignalIn ( "instshamt", 2 )
self.insti = SignalIn ( "insti", 4 )
self.insto = SignalOut ( "insto", 4 )
self.vdd = VddIn ( "vdd" )
self.vss = VssIn ( "vss" )
def Netlist ( self ) :
Generate ( 'DpgenShrot', 'shrot_4'
, param = { 'nbit' : 4
, 'physical' : True
}
)
self.I = Inst ( 'shrot_4', 'inst'
, map = { 'op' : self.rotop
, 'shamt' : self.instshamt
, 'i' : self.insti
, 'o' : self.insto
, 'vdd' : self.vdd
, 'vss' : self.vss
}
)
def Layout ( self ) :
Place ( self.I, NOSYM, Ref(0, 0) )