Module: RubyHDL

Defined in:
lib/rubyHDL.rb,
lib/HDLRuby/std/sequencer_sw.rb

Overview

Defined Under Namespace

Modules: High Classes: ArrayWrapper

Class Method Summary collapse

Class Method Details

.arrayport(name, sig) ⇒ Object

Creates a new array port 'name' assigned to signal 'sig'.



28
29
30
31
32
33
# File 'lib/rubyHDL.rb', line 28

def self.arrayport(name,sig)
  # Creating the accessing method.
  define_singleton_method(name.to_sym) do
    ArrayWrapper.new(sig)
  end
end

.inport(name, sig) ⇒ Object

Creates a new port 'name' assigned to signal 'sig' for reading.



36
37
38
39
40
41
42
# File 'lib/rubyHDL.rb', line 36

def self.inport(name,sig)
    # Create the accessing methods.
    # For reading.
    define_singleton_method(name.to_sym) do
        RCSim.rcsim_get_signal_fixnum(sig)
    end
end

.outport(name, sig) ⇒ Object

Creates a new wport 'name' assigned to signal 'sig' for writing.



45
46
47
48
49
50
# File 'lib/rubyHDL.rb', line 45

def self.outport(name,sig)
    # For writing.
    define_singleton_method(:"#{name}=") do |val|
        RCSim.rcsim_transmit_fixnum_to_signal_seq(sig,val)
    end
end

.program(name, code) ⇒ Object

Creates a new program 'name' assign to simulator code 'code'.



53
54
55
56
57
58
# File 'lib/rubyHDL.rb', line 53

def self.program(name,code)
    # Create the accessing method.
    define_singleton_method(name.to_sym) do
        code
    end
end