Class: Ecic::SvDesignGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/ecic/sv_design_generator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#design_name=(value) ⇒ Object (writeonly)

Sets the attribute design_name

Parameters:

  • value

    the value to set the attribute design_name to.



7
8
9
# File 'lib/ecic/sv_design_generator.rb', line 7

def design_name=(value)
  @design_name = value
end

#library=(value) ⇒ Object (writeonly)

Sets the attribute library

Parameters:

  • value

    the value to set the attribute library to.



7
8
9
# File 'lib/ecic/sv_design_generator.rb', line 7

def library=(value)
  @library = value
end

Class Method Details

.source_rootObject



9
10
11
# File 'lib/ecic/sv_design_generator.rb', line 9

def self.source_root
  File.dirname(__FILE__) + '/../../templates/project'
end

Instance Method Details

#copy_rtl_templatesObject



13
14
15
16
# File 'lib/ecic/sv_design_generator.rb', line 13

def copy_rtl_templates
  base_name = "#{@library.path}/#{@design_name}"
  template("src/design/lib/design.sv.tt", "#{base_name}.sv")
end

#update_src_listObject



18
19
20
21
22
# File 'lib/ecic/sv_design_generator.rb', line 18

def update_src_list
  src_file = File.join(destination_root,"#{@library.path}/sources.rb")  
  create_file src_file unless File.exists?(src_file)
  append_to_file src_file, "source_file('#{@design_name}.sv')\n"
end