Class: RubyHDL::ArrayWrapper
- Inherits:
-
Object
- Object
- RubyHDL::ArrayWrapper
- Defined in:
- lib/rubyHDL.rb
Overview
Wrapper for array signal accesses.
Instance Method Summary collapse
-
#[](idx) ⇒ Object
Read the array.
-
#[]=(idx, val) ⇒ Object
Write to the array.
-
#initialize(sig) ⇒ ArrayWrapper
constructor
Create a new memory wrapper for signal +sig+.
Constructor Details
#initialize(sig) ⇒ ArrayWrapper
Create a new memory wrapper for signal +sig+
12 13 14 |
# File 'lib/rubyHDL.rb', line 12 def initialize(sig) @signal = sig end |
Instance Method Details
#[](idx) ⇒ Object
Read the array.
17 18 19 |
# File 'lib/rubyHDL.rb', line 17 def [](idx) return RCSim.rcsim_read_index_fixnum(@signal,idx) end |
#[]=(idx, val) ⇒ Object
Write to the array.
22 23 24 |
# File 'lib/rubyHDL.rb', line 22 def []=(idx,val) return RCSim.rcsim_write_index_fixnum_seq(@signal,idx,val) end |