Class: Ecic::SvDesignGenerator
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Ecic::SvDesignGenerator
- Includes:
- Thor::Actions
- Defined in:
- lib/ecic/sv_design_generator.rb
Instance Attribute Summary collapse
-
#design_name ⇒ Object
writeonly
Sets the attribute design_name.
-
#library ⇒ Object
writeonly
Sets the attribute library.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#design_name=(value) ⇒ Object (writeonly)
Sets the attribute design_name
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
7 8 9 |
# File 'lib/ecic/sv_design_generator.rb', line 7 def library=(value) @library = value end |
Class Method Details
.source_root ⇒ Object
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_templates ⇒ Object
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_list ⇒ Object
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 |