Class: Buf1

Inherits:
TwoPorts show all
Defined in:
lib/Buf1.rb

Overview

This class defines the Buffer part

Instance Attribute Summary

Attributes inherited from Inst

#inputs, #name, #nodes, #outputs

Instance Method Summary collapse

Methods inherited from Inst

#get_port

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

#abeloutObject

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