Class: Buf1
Overview
This class defines the Buffer part
Instance Attribute Summary
Attributes inherited from Inst
#inputs, #name, #nodes, #outputs
Instance Method Summary collapse
-
#abelout ⇒ Object
This method returns the specific ABEL code to be output for this Inst object based on its connections on its input ports.
-
#initialize(name) ⇒ Buf1
constructor
This method is called when a new object is instantiated, it takes the name of the Inst object (name) as its only argument.
Methods inherited from Inst
Constructor Details
#initialize(name) ⇒ Buf1
This method is called when a new object is instantiated, it takes the name of the Inst object (name) as its only argument. It is responsible for defining applicable nodes, then calling its superclass, TwoPorts, to complete other tasks.
6 7 8 9 10 |
# File 'lib/Buf1.rb', line 6 def initialize(name) super(name) # set ABEL to not reduce redundant logic since this is a buffer nodes << "#{name}p1\tnode;\n#{name}p1a\tnode;\n" end |
Instance Method Details
#abelout ⇒ Object
This method returns the specific ABEL code to be output for this Inst object based on its connections on its input ports. These connections are defined in the abelout method of this object’s superclass, TwoPorts.
14 15 16 17 18 |
# File 'lib/Buf1.rb', line 14 def abelout super s = "#{self.name}p1a = #{@p0};\n" s << "#{self.name}p1 = #{@p0} # #{self.name}p1a;\n" end |