Class: Output

Inherits:
OnePort show all
Defined in:
lib/Output.rb

Overview

This class defines the Output port instance.

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) ⇒ Output

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 output pins, then calling its superclass, OnePort, to complete other tasks.



5
6
7
8
# File 'lib/Output.rb', line 5

def initialize(name)
  super(name,[0],[])
  self.outputs = "#{self.name}p0\tpin;\n"
end

Instance Method Details

#abeloutObject

This method defines the connections held by the ports of this object and returns the specific ABEL code to be output for this object based on the connections on its input port.



12
13
14
15
16
# File 'lib/Output.rb', line 12

def abelout
  # make this a class variable just for consistency's sake
  @p0 = self.get_port("p0").connections.collect{|p| p.name}.to_s
  "#{self.name}p0 = #{@p0};\n"
end