Most common boolean operators can be instantiated without the Inst constructor.
Boolean operators are listed below :
And2 : q <= i0 & i1
Or2 : q <= i0 | i1
Xor2 : q <= i0 ^ i1
Inv : q <= ~i0
One can choose the generator to be used. Some methods are applied to the cell and set the generator used when using &, |, ^ and ~. The generators used by default are the ones from the virtual library.
Methods are :
SetAnd
SetOr
SetXor
SetNot
class essai ( Model ) :
def Interface ( self ) :
self.A = SignalIn ( "a", 4 )
self.B = SignalIn ( "b", 4 )
self.B = SignalIn ( "c", 4 )
self.S = SignalOut ( "s", 4 )
self.vdd = VddIn ( "vdd" )
self.vss = VssIn ( "vss" )
def Netlist ( self ) :
self.S <= ( ~self.A & self.B ) | self.C
Some errors may occur :
[Stratus ERROR] & : the nets must have the same lenght.
[Stratus ERROR] : there is no alim.
Introduction Netlist Instanciation of a multiplexor Instanciation of a shifter Instanciation of a register Instanciation of constants Arithmetical operations Comparison operations
Sophie BELLOEIL