Class: RgGen::SystemVerilog::Common::Utility::InterfacePort
- Inherits:
-
Object
- Object
- RgGen::SystemVerilog::Common::Utility::InterfacePort
- Includes:
- Core::Utility::AttributeSetter
- Defined in:
- lib/rggen/systemverilog/common/utility/interface_port.rb
Instance Method Summary collapse
- #declaration ⇒ Object
- #identifier ⇒ Object
-
#initialize(default_attributes = {}) ⇒ InterfacePort
constructor
A new instance of InterfacePort.
- #modport(name_and_ports, ports = nil) ⇒ Object
Constructor Details
#initialize(default_attributes = {}) ⇒ InterfacePort
Returns a new instance of InterfacePort.
10 11 12 13 |
# File 'lib/rggen/systemverilog/common/utility/interface_port.rb', line 10 def initialize(default_attributes = {}) apply_attributes(**default_attributes) block_given? && yield(self) end |
Instance Method Details
#declaration ⇒ Object
29 30 31 |
# File 'lib/rggen/systemverilog/common/utility/interface_port.rb', line 29 def declaration "#{port_type} #{port_identifier}" end |
#identifier ⇒ Object
33 34 35 36 37 38 |
# File 'lib/rggen/systemverilog/common/utility/interface_port.rb', line 33 def identifier Identifier.new(name) do |identifier| identifier.__array_size__(array_size) identifier.__sub_identifiers__(@modport_ports) end end |
#modport(name_and_ports, ports = nil) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/rggen/systemverilog/common/utility/interface_port.rb', line 20 def modport(name_and_ports, ports = nil) @modport_name, @modport_ports = if ports [name_and_ports, ports] else Array(name_and_ports)[0..1] end end |