Class: RTL::Port

Inherits:
Object
  • Object
show all
Defined in:
lib/rtl/circuit.rb

Direct Known Subclasses

Sig

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir, name) ⇒ Port

Returns a new instance of Port.



97
98
99
100
101
102
# File 'lib/rtl/circuit.rb', line 97

def initialize dir,name
  @dir=dir
  @name=name
  @fanout=[]
  @properties={}
end

Instance Attribute Details

#circuitObject

Returns the value of attribute circuit.



94
95
96
# File 'lib/rtl/circuit.rb', line 94

def circuit
  @circuit
end

#dirObject

Returns the value of attribute dir.



92
93
94
# File 'lib/rtl/circuit.rb', line 92

def dir
  @dir
end

#fanoutObject

Returns the value of attribute fanout.



95
96
97
# File 'lib/rtl/circuit.rb', line 95

def fanout
  @fanout
end

#nameObject

Returns the value of attribute name.



93
94
95
# File 'lib/rtl/circuit.rb', line 93

def name
  @name
end

#propertiesObject

Returns the value of attribute properties.



96
97
98
# File 'lib/rtl/circuit.rb', line 96

def properties
  @properties
end

Instance Method Details

#connect(port) ⇒ Object



104
105
106
107
# File 'lib/rtl/circuit.rb', line 104

def connect port
  puts "connecting #{self.name}-> #{port.name}" if $verbose
  @fanout << Wire.new(self,port)
end

#typeObject



113
114
115
# File 'lib/rtl/circuit.rb', line 113

def type
  @properties[:type]
end

#type=(t) ⇒ Object



109
110
111
# File 'lib/rtl/circuit.rb', line 109

def type=(t)
  @properties[:type]=t
end