Class: RTL::Port
- Inherits:
-
Object
- Object
- RTL::Port
- Defined in:
- lib/rtl/circuit.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#circuit ⇒ Object
Returns the value of attribute circuit.
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#fanout ⇒ Object
Returns the value of attribute fanout.
-
#name ⇒ Object
Returns the value of attribute name.
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
- #connect(port) ⇒ Object
-
#initialize(dir, name) ⇒ Port
constructor
A new instance of Port.
- #type ⇒ Object
- #type=(t) ⇒ Object
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
#circuit ⇒ Object
Returns the value of attribute circuit.
94 95 96 |
# File 'lib/rtl/circuit.rb', line 94 def circuit @circuit end |
#dir ⇒ Object
Returns the value of attribute dir.
92 93 94 |
# File 'lib/rtl/circuit.rb', line 92 def dir @dir end |
#fanout ⇒ Object
Returns the value of attribute fanout.
95 96 97 |
# File 'lib/rtl/circuit.rb', line 95 def fanout @fanout end |
#name ⇒ Object
Returns the value of attribute name.
93 94 95 |
# File 'lib/rtl/circuit.rb', line 93 def name @name end |
#properties ⇒ Object
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 |
#type ⇒ Object
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 |