Class: BaseChip::Bom

Inherits:
Object
  • Object
show all
Defined in:
lib/base_chip/bom.rb,
lib/base_chip/bom_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Bom

Returns a new instance of Bom.



36
37
38
39
40
# File 'lib/base_chip/bom.rb', line 36

def initialize(hash)
  @hash  = hash.with_indifferent_access
  @name1 = 'all'
  @name2 = 'all'
end

Instance Attribute Details

#hash ⇒ Object (readonly)

Returns the value of attribute hash.



33
34
35
# File 'lib/base_chip/bom.rb', line 33

def hash
  @hash
end

#name1 ⇒ Object (readonly)

Returns the value of attribute name1.



34
35
36
# File 'lib/base_chip/bom.rb', line 34

def name1
  @name1
end

#name2 ⇒ Object (readonly)

Returns the value of attribute name2.



35
36
37
# File 'lib/base_chip/bom.rb', line 35

def name2
  @name2
end

Instance Method Details

#+(bom) ⇒ Object



61
62
63
# File 'lib/base_chip/bom.rb', line 61

def +(bom)
  Bom.new(@hash.merge bom.hash)
end

#classes ⇒ Object



42
# File 'lib/base_chip/bom.rb', line 42

def classes   ; @classes   ||= trim(2,:classes  ) end

#directories ⇒ Object



57
58
59
# File 'lib/base_chip/bom.rb', line 57

def directories
  @directories ||= files.map{ |f| File.dirname(f) }.uniq
end

#gates ⇒ Object



48
# File 'lib/base_chip/bom.rb', line 48

def gates     ; @gates     ||= trim(1,:gates    ) end

#headers ⇒ Object



45
# File 'lib/base_chip/bom.rb', line 45

def headers   ; @headers   ||= trim(2,:headers  ) end

#list ⇒ Object



53
# File 'lib/base_chip/bom.rb', line 53

def list ; @list ||= to_a.join(' ')           ; end

#rtl ⇒ Object



47
# File 'lib/base_chip/bom.rb', line 47

def rtl       ; @rtl       ||= trim(1,:rtl      ) end

#stimulus ⇒ Object



50
# File 'lib/base_chip/bom.rb', line 50

def stimulus  ; @stimulus  ||= trim(1,:stimulus ) end

#systemc ⇒ Object



44
# File 'lib/base_chip/bom.rb', line 44

def systemc   ; @systemc   ||= trim(2,:systemc  ) end

#tcl ⇒ Object



41
42
43
# File 'lib/base_chip/bom_file.rb', line 41

def tcl
  @tcl  ||= BomType.new(self,:tcl )
end

#testbench ⇒ Object



49
# File 'lib/base_chip/bom.rb', line 49

def testbench ; @testbench ||= trim(1,:testbench) end

#text ⇒ Object



38
39
40
# File 'lib/base_chip/bom_file.rb', line 38

def text
  @text ||= BomType.new(self,:text)
end

#to_a ⇒ Object Also known as: files



52
# File 'lib/base_chip/bom.rb', line 52

def to_a ; @to_a ||= @hash.deep_values.flatten; end

#to_s ⇒ Object



54
# File 'lib/base_chip/bom.rb', line 54

def to_s ; @to_s ||= list                     ; end

#verilog ⇒ Object



41
# File 'lib/base_chip/bom.rb', line 41

def verilog   ; @verilog   ||= trim(2,:verilog  ) end

#vhdl ⇒ Object



43
# File 'lib/base_chip/bom.rb', line 43

def vhdl      ; @vhdl      ||= trim(2,:vhdl     ) end