Class: VhdlDoctest::TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/vhdl_doctest/test_case.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mapping) ⇒ TestCase

Returns a new instance of TestCase.



4
5
6
7
8
9
10
# File 'lib/vhdl_doctest/test_case.rb', line 4

def initialize(mapping)
  @in_mapping, @out_mapping = mapping.partition{ |port, _| port.in? }
  if @in_mapping.find { |_, v| v == :dont_care }
    raise NotImplementedError.new("Don't care for input value is not supported")
  end
  @out_mapping.select!{ |k, v| v != :dont_care }
end

Instance Attribute Details

#in_mappingObject (readonly)

Returns the value of attribute in_mapping.



3
4
5
# File 'lib/vhdl_doctest/test_case.rb', line 3

def in_mapping
  @in_mapping
end

#out_mappingObject (readonly)

Returns the value of attribute out_mapping.



3
4
5
# File 'lib/vhdl_doctest/test_case.rb', line 3

def out_mapping
  @out_mapping
end

Instance Method Details

#to_vhdlObject



12
13
14
# File 'lib/vhdl_doctest/test_case.rb', line 12

def to_vhdl
  stimuli.join("\n") + "wait for 10 ns;\n" + assertion
end