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

#hashObject (readonly)

Returns the value of attribute hash.



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

def hash
  @hash
end

#name1Object (readonly)

Returns the value of attribute name1.



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

def name1
  @name1
end

#name2Object (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

#classesObject



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

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

#directoriesObject



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

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

#gatesObject



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

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

#headersObject



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

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

#listObject



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

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

#rtlObject



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

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

#stimulusObject



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

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

#systemcObject



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

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

#tclObject



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

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

#testbenchObject



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

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

#textObject



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

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

#to_aObject Also known as: files



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

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

#to_sObject



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

def to_s ; @to_s ||= list                     ; end

#verilogObject



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

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

#vhdlObject



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

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