class Ecic::DesignGenerator
Attributes
design_name[W]
include_types_pkg[W]
library[W]
Public Class Methods
source_root()
click to toggle source
# File lib/ecic/design_generator.rb, line 10 def self.source_root File.dirname(__FILE__) + '/../../templates/project' end
Public Instance Methods
copy_rtl_templates()
click to toggle source
def create_design_directory
empty_directory "src/design/#{@library_name}/#{File.dirname(@design_name)}"
end
# 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()
click to toggle source
# 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