Class: Ecic::DesignGenerator
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Ecic::DesignGenerator
- Includes:
- SourceListUpdater, Thor::Actions
- Defined in:
- lib/ecic/design_generator.rb
Instance Attribute Summary collapse
-
#design_name ⇒ Object
writeonly
Sets the attribute design_name.
-
#include_types_pkg ⇒ Object
writeonly
Sets the attribute include_types_pkg.
-
#library ⇒ Object
writeonly
Sets the attribute library.
Class Method Summary collapse
Instance Method Summary collapse
-
#copy_rtl_templates ⇒ Object
def create_design_directory empty_directory “src/design/#@library_name/#File.dirname(@design_name)” end.
- #update_src_list ⇒ Object
Methods included from SourceListUpdater
Instance Attribute Details
#design_name=(value) ⇒ Object (writeonly)
Sets the attribute design_name
8 9 10 |
# File 'lib/ecic/design_generator.rb', line 8 def design_name=(value) @design_name = value end |
#include_types_pkg=(value) ⇒ Object (writeonly)
Sets the attribute include_types_pkg
8 9 10 |
# File 'lib/ecic/design_generator.rb', line 8 def include_types_pkg=(value) @include_types_pkg = value end |
#library=(value) ⇒ Object (writeonly)
Sets the attribute library
8 9 10 |
# File 'lib/ecic/design_generator.rb', line 8 def library=(value) @library = value end |
Class Method Details
.source_root ⇒ Object
10 11 12 |
# File 'lib/ecic/design_generator.rb', line 10 def self.source_root File.dirname(__FILE__) + '/../../templates/project' end |
Instance Method Details
#copy_rtl_templates ⇒ Object
def create_design_directory
empty_directory "src/design/#{@library_name}/#{File.dirname(@design_name)}"
end
23 24 25 26 27 28 29 30 31 |
# File 'lib/ecic/design_generator.rb', line 23 def copy_rtl_templates base_name = "#{@library.path}/#{@design_name}" if @include_types_pkg template("src/design/lib/pkg_types.vhd.tt", "#{base_name}-pkg_types.vhd") end template("src/design/lib/pkg_comp.vhd.tt", "#{base_name}-pkg_comp.vhd") template("src/design/lib/ent.vhd.tt", "#{base_name}-ent.vhd") template("src/design/lib/arc_rtl.vhd.tt", "#{base_name}-arc_rtl.vhd") end |
#update_src_list ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/ecic/design_generator.rb', line 33 def update_src_list src_file = File.join(destination_root,"#{@library.path}/sources.rb") create_file src_file unless File.exists?(src_file) if @include_types_pkg append_to_file(src_file, "source_file('#{@design_name}-pkg_types.vhd')\n") end append_to_file(src_file, "source_file('#{@design_name}-pkg_comp.vhd')\n") append_to_file(src_file, "source_file('#{@design_name}-ent.vhd')\n") append_to_file(src_file, "source_file('#{@design_name}-arc_rtl.vhd')\n") end |