Sha256: 00be92acec3514a912a613826f728eb293ad7dd5cb567a32f4df1e4c54297645

Contents?: true

Size: 854 Bytes

Versions: 1

Compression:

Stored size: 854 Bytes

Contents

module <%= @namespace %>
  class <%= @options[:name] || "TopLevel" %>
    include Origen::TopLevel

    def initialize(options = {})
      instantiate_pins(options)
      instantiate_registers(options)
      instantiate_sub_blocks(options)
    end

    def instantiate_pins(options = {})
      add_pin :tclk
      add_pin :tdi
      add_pin :tdo
      add_pin :tms
      add_pin :resetb
      add_pins :port_a, size: 8
    end

    def instantiate_registers(options = {})
    end

    def instantiate_sub_blocks(options = {})
<% @options[:sub_blocks].each do |name, attrs| -%>
<%   if attrs[:instances] -%>
      sub_blocks :<%= name.underscore %>, instances: <%= attrs[:instances] %>, class_name: '<%= name.camelize %>'
<%   else -%>
      sub_block  :<%= name.underscore %>, class_name: '<%= name.camelize %>'
<%   end -%>
<% end -%>
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
origen_app_generators-0.1.0 templates/app_generators/test_engineering/stand_alone_application/lib/top_level.rb