origen 0.44.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/config/application.rb +2 -2
  3. data/config/boot.rb +0 -7
  4. data/config/commands.rb +3 -74
  5. data/config/rubocop/easy_disabled.yml +4 -0
  6. data/config/rubocop/easy_enabled.yml +0 -4
  7. data/config/rubocop/strict_disabled.yml +4 -0
  8. data/config/rubocop/strict_enabled.yml +0 -4
  9. data/config/version.rb +1 -2
  10. data/lib/origen/application/deployer.rb +3 -1
  11. data/lib/origen/application/release.rb +2 -2
  12. data/lib/origen/application/runner.rb +9 -2
  13. data/lib/origen/application.rb +91 -2
  14. data/lib/origen/boot/app.rb +0 -4
  15. data/lib/origen/boot.rb +2 -1
  16. data/lib/origen/code_generators/actions.rb +244 -34
  17. data/lib/origen/code_generators/base.rb +9 -2
  18. data/lib/origen/code_generators/block.rb +203 -0
  19. data/lib/origen/code_generators/block_common.rb +100 -0
  20. data/lib/origen/code_generators/dut.rb +62 -0
  21. data/lib/origen/code_generators/feature.rb +50 -0
  22. data/lib/origen/code_generators/klass.rb +41 -0
  23. data/lib/origen/code_generators/model.rb +60 -0
  24. data/lib/origen/code_generators/module.rb +92 -0
  25. data/lib/origen/code_generators.rb +30 -10
  26. data/lib/origen/commands/lint.rb +6 -1
  27. data/lib/origen/commands/new.rb +1 -1
  28. data/lib/origen/commands/new_resource.rb +41 -0
  29. data/lib/origen/commands/web.rb +11 -6
  30. data/lib/origen/commands.rb +18 -0
  31. data/lib/{option_parser → origen/core_ext/option_parser}/optparse.rb +0 -0
  32. data/lib/origen/dependencies.rb +0 -0
  33. data/lib/origen/file_handler.rb +8 -4
  34. data/lib/origen/generator/pattern_finder.rb +3 -3
  35. data/lib/origen/loader.rb +377 -0
  36. data/lib/origen/model.rb +22 -1
  37. data/lib/origen/model_initializer.rb +5 -1
  38. data/lib/origen/parameters/set.rb +2 -1
  39. data/lib/origen/parameters.rb +95 -3
  40. data/lib/origen/sub_blocks.rb +21 -7
  41. data/lib/origen/top_level.rb +11 -0
  42. data/lib/origen.rb +3 -1
  43. data/origen_app_generators/Gemfile +6 -2
  44. data/origen_app_generators/Gemfile.lock +83 -72
  45. data/origen_app_generators/bin/boot.rb +4 -2
  46. data/origen_app_generators/config/commands.rb +3 -3
  47. data/origen_app_generators/config/shared_commands.rb +11 -6
  48. data/origen_app_generators/lbin/bundle +105 -0
  49. data/origen_app_generators/lbin/byebug +29 -0
  50. data/origen_app_generators/lbin/coderay +29 -0
  51. data/origen_app_generators/lbin/htmldiff +29 -0
  52. data/origen_app_generators/lbin/httparty +29 -0
  53. data/origen_app_generators/lbin/httpclient +29 -0
  54. data/origen_app_generators/lbin/kramdown +29 -0
  55. data/origen_app_generators/lbin/ldiff +29 -0
  56. data/origen_app_generators/lbin/nanoc +29 -0
  57. data/origen_app_generators/lbin/nokogiri +29 -0
  58. data/origen_app_generators/lbin/origen +62 -0
  59. data/origen_app_generators/lbin/pry +29 -0
  60. data/origen_app_generators/lbin/rackup +29 -0
  61. data/origen_app_generators/lbin/rake +29 -0
  62. data/origen_app_generators/lbin/rspec +29 -0
  63. data/origen_app_generators/lbin/rubocop +29 -0
  64. data/origen_app_generators/lbin/ruby-parse +29 -0
  65. data/origen_app_generators/lbin/ruby-rewrite +29 -0
  66. data/origen_app_generators/lbin/thor +29 -0
  67. data/origen_app_generators/lbin/tilt +29 -0
  68. data/origen_app_generators/lbin/yard +29 -0
  69. data/origen_app_generators/lbin/yardoc +29 -0
  70. data/origen_app_generators/lbin/yri +29 -0
  71. data/origen_app_generators/lib/origen_app_generators/application.rb +12 -12
  72. data/origen_app_generators/lib/origen_app_generators/base.rb +34 -8
  73. data/origen_app_generators/lib/origen_app_generators/new.rb +17 -9
  74. data/origen_app_generators/lib/{tasks/new_app_tests.rake → origen_app_generators/new_app_tests.rb} +1 -5
  75. data/origen_app_generators/lib/origen_app_generators/origen_infrastructure/app_generator_plugin.rb +6 -8
  76. data/origen_app_generators/lib/origen_app_generators/plugin.rb +4 -7
  77. data/origen_app_generators/lib/origen_app_generators/test_engineering/common.rb +29 -0
  78. data/origen_app_generators/lib/origen_app_generators/test_engineering/stand_alone_application.rb +9 -181
  79. data/origen_app_generators/lib/origen_app_generators/test_engineering/test_block.rb +4 -105
  80. data/origen_app_generators/lib/origen_app_generators.rb +6 -4
  81. data/origen_app_generators/origen_app_generators.gemspec +7 -7
  82. data/origen_app_generators/templates/app_generators/application/Gemfile +14 -3
  83. data/origen_app_generators/templates/app_generators/application/{lib → app/blocks}/top_level.rb +1 -1
  84. data/origen_app_generators/templates/app_generators/application/app/lib/module.rb +6 -0
  85. data/origen_app_generators/templates/app_generators/application/{templates → app/templates}/web/index.md.erb +0 -0
  86. data/origen_app_generators/templates/app_generators/application/{templates → app/templates}/web/layouts/_basic.html.erb +0 -0
  87. data/origen_app_generators/templates/app_generators/application/{templates → app/templates}/web/partials/_navbar.html.erb +0 -0
  88. data/origen_app_generators/templates/app_generators/application/{templates → app/templates}/web/release_notes.md.erb +0 -0
  89. data/origen_app_generators/templates/app_generators/application/config/application.rb +51 -55
  90. data/origen_app_generators/templates/app_generators/application/{spec → test/spec}/spec_helper.rb +0 -0
  91. data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/application.rb +0 -0
  92. data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/base.rb +0 -0
  93. data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/module.rb +0 -0
  94. data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/plugin.rb +0 -0
  95. data/origen_app_generators/templates/app_generators/origen_infrastructure/app_generator_plugin/config/load_generators.rb +1 -1
  96. data/origen_app_generators/templates/app_generators/plugin/Gemfile +5 -2
  97. data/origen_app_generators/templates/app_generators/plugin/{templates → app/templates}/web/index.md.erb +0 -0
  98. data/origen_app_generators/templates/app_generators/plugin/{templates → app/templates}/web/partials/_navbar_external.html.erb +0 -0
  99. data/origen_app_generators/templates/app_generators/plugin/{templates → app/templates}/web/partials/_navbar_internal.html.erb +0 -0
  100. data/origen_app_generators/templates/app_generators/plugin/gemspec.rb +4 -3
  101. data/origen_app_generators/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/j750.rb +0 -0
  102. data/origen_app_generators/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/uflex.rb +0 -0
  103. data/origen_app_generators/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/v93k.rb +0 -0
  104. data/origen_site_config.yml +0 -7
  105. data/templates/code_generators/attributes.rb +20 -0
  106. data/templates/code_generators/class.rb +9 -0
  107. data/templates/code_generators/controller.rb +87 -0
  108. data/templates/code_generators/model.rb +21 -0
  109. data/templates/code_generators/module.rb +4 -0
  110. data/templates/code_generators/parameters.rb +19 -0
  111. data/templates/code_generators/pins.rb +28 -0
  112. data/templates/code_generators/registers.rb +20 -0
  113. data/templates/code_generators/sub_blocks.rb +24 -0
  114. data/templates/code_generators/timesets.rb +24 -0
  115. data/templates/code_generators/version.rb +0 -1
  116. metadata +66 -77
  117. data/lib/c99/ate_interface.rb +0 -77
  118. data/lib/c99/nvm.rb +0 -110
  119. data/lib/c99/target/mock2.rb +0 -1
  120. data/lib/c99/target/subdir/mock3.rb +0 -1
  121. data/lib/origen/code_generators/bundler.rb +0 -17
  122. data/lib/origen/code_generators/gem_setup.rb +0 -49
  123. data/lib/origen/code_generators/rake.rb +0 -13
  124. data/lib/origen/code_generators/rspec.rb +0 -12
  125. data/lib/origen/commands/add.rb +0 -12
  126. data/lib/tasks/private/build.rake +0 -8
  127. data/origen_app_generators/bin/fix_my_workspace +0 -100
  128. data/origen_app_generators/lib/origen_app_generators/sub_block_parser.rb +0 -81
  129. data/origen_app_generators/lib/tasks/app_generators.rake +0 -6
  130. data/origen_app_generators/spec/sub_block_spec.rb +0 -36
  131. data/origen_app_generators/templates/app_generators/application/lib/app.rake +0 -6
  132. data/origen_app_generators/templates/app_generators/application/lib/module.rb +0 -22
  133. data/origen_app_generators/templates/app_generators/plugin/lib/README +0 -4
  134. data/origen_app_generators/templates/app_generators/plugin/lib_dev/README +0 -5
  135. data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/Gemfile +0 -23
  136. data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/environment/jlink.rb +0 -1
  137. data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/ip_block.rb +0 -23
  138. data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/ip_block_controller.rb +0 -5
  139. data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/top_level.rb +0 -33
  140. data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/lib/top_level_controller.rb +0 -21
  141. data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/pattern/example.rb +0 -4
  142. data/origen_app_generators/templates/app_generators/test_engineering/stand_alone_application/target/top_level.rb +0 -4
  143. data/origen_app_generators/templates/app_generators/test_engineering/test_block/environment/j750.rb +0 -2
  144. data/origen_app_generators/templates/app_generators/test_engineering/test_block/environment/ultraflex.rb +0 -2
  145. data/origen_app_generators/templates/app_generators/test_engineering/test_block/environment/v93k.rb +0 -2
  146. data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/controller.rb +0 -12
  147. data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/interface.rb +0 -21
  148. data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib/model.rb +0 -18
  149. data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib_dev/dut.rb +0 -27
  150. data/origen_app_generators/templates/app_generators/test_engineering/test_block/lib_dev/dut_controller.rb +0 -26
  151. data/origen_app_generators/templates/app_generators/test_engineering/test_block/pattern/example.rb +0 -5
  152. data/origen_app_generators/templates/app_generators/test_engineering/test_block/program/prb1.rb +0 -11
  153. data/origen_app_generators/templates/app_generators/test_engineering/test_block/target/default.rb +0 -2
  154. data/templates/code_generators/gemfile_app.rb +0 -4
  155. data/templates/code_generators/gemfile_plugin.rb +0 -6
  156. data/templates/code_generators/gemspec.rb +0 -33
  157. data/templates/code_generators/rakefile.rb +0 -10
  158. data/templates/code_generators/spec_helper.rb +0 -49
@@ -1,100 +0,0 @@
1
- #!/usr/bin/env ruby
2
- $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
-
4
- if $_fix_my_workspace_version_check
5
- $_fix_my_workspace_version = '0.7.0'
6
- else
7
- if File.exist?(File.expand_path('../../lib/origen.rb', __FILE__))
8
- # If this script is being run from within an origen-core workspace, use that Origen-core,
9
- # not the system-installed origen-core version.
10
- $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
11
- require 'origen'
12
- else
13
- # Use system-installed Origen (the gem in system Ruby)
14
- require 'origen'
15
- end
16
-
17
- if !Origen.site_config.gem_manage_bundler
18
- puts 'Sorry but you have opted to manage Bundler yourself via your Origen site config, and this means'
19
- puts 'that I cannot make certain assumptions about how your workspace is configured.'
20
- puts 'You will need to either resolve this problem yourself, or else change the value of'
21
- puts 'gem_mange_bundler to true.'
22
- puts 'See here for more details on how to do that: http://origen-sdk.org/origen/guides/starting/company/'
23
-
24
- else
25
- ENV['BUNDLE_GEMFILE'] = File.join(Origen.root, 'Gemfile')
26
- ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
27
- ENV['BUNDLE_BIN'] = File.join(Origen.root, 'lbin')
28
-
29
- # Force copy system gems to local gems
30
- if Origen.site_config.gem_use_from_system
31
- local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
32
- gem_dir = Pathname.new(Gem.dir)
33
-
34
- Origen.site_config.gem_use_from_system.each do |gem, version|
35
- begin
36
- # This will raise an error if the system doesn't have this gem installed, that
37
- # will be rescued below
38
- spec = Gem::Specification.find_by_name(gem, version)
39
-
40
- local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir))
41
- FileUtils.mkdir_p local_dir
42
- FileUtils.cp_r("#{spec.gem_dir}/.", local_dir)
43
-
44
- local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir)))
45
- FileUtils.mkdir_p local_file.dirname
46
- FileUtils.cp(spec.cache_file, local_file)
47
-
48
- if spec.extension_dir && File.exist?(spec.extension_dir)
49
- local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir))
50
- FileUtils.mkdir_p local_dir
51
- FileUtils.cp_r("#{spec.extension_dir}/.", local_dir)
52
- end
53
-
54
- local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir)))
55
- FileUtils.mkdir_p local_file.dirname
56
- FileUtils.cp(spec.spec_file, local_file)
57
-
58
- rescue Gem::LoadError
59
- # This just means that one of the gems that should be copied from the system
60
- # was not actually installed in the system, so nothing we can do about that here
61
- end
62
- end
63
- end
64
-
65
- # Delete lbin
66
- FileUtils.rm_rf(ENV['BUNDLE_BIN']) if File.exist?(ENV['BUNDLE_BIN'])
67
-
68
- # Run bundler with correct switches
69
- cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
70
- `chmod o-w #{Origen.root}` # Stops some annoying world writable warnings during install
71
- `chmod o-w #{Origen.root}/bin` if File.exist?("#{Origen.root}/bin")
72
- `chmod o-w #{Origen.root}/.bin` if File.exist?("#{Origen.root}/.bin")
73
-
74
- # Try again, this time updating the bundle
75
- if system(cmd)
76
- fixed = true
77
- elsif system 'bundle update'
78
- fixed = true
79
- end
80
-
81
- if File.exist?(ENV['BUNDLE_BIN'])
82
- `chmod o-w #{ENV['BUNDLE_BIN']}`
83
-
84
- # Make .bat versions of all executables, Bundler should really be doing this when running
85
- # on windows
86
- if Origen.os.windows?
87
- Dir.glob("#{ENV['BUNDLE_BIN']}/*").each do |bin|
88
- unless bin =~ /.bat$/
89
- bat = "#{bin}.bat"
90
- unless File.exist?(bat)
91
- File.open(bat, 'w') { |f| f.write('@"ruby.exe" "%~dpn0" %*') }
92
- end
93
- end
94
- end
95
- end
96
- end
97
-
98
- system 'origen -v' if fixed
99
- end
100
- end
@@ -1,81 +0,0 @@
1
- module OrigenAppGenerators
2
- require 'strscan'
3
- # Responsible for parsing something like this:
4
- #
5
- # "ram, osc, pll, atd(2), comms[ram(2), osc](3)"
6
- #
7
- # into this:
8
- #
9
- # {
10
- # "RAM"=>{}, "Osc"=>{}, "PLL"=>{}, "ATD"=> {:instances=>2},
11
- # "Comms"=>{:instances=>3, :children=>{"RAM"=>{:instances=>2}, "Osc"=>{}}}
12
- # }
13
- #
14
- class SubBlockParser
15
- def parse(str)
16
- r = {}
17
- split(str).each do |tag|
18
- tag, i = extract_instances(tag)
19
- name, children = extract_children(tag)
20
- name = camelize(name)
21
- r[name] = {}
22
- r[name][:instances] = i if i
23
- r[name][:children] = children if children
24
- end
25
- r
26
- end
27
-
28
- private
29
-
30
- # Splits the given string by comma, but understands that nested
31
- # commas should not be split on
32
- def split(str)
33
- r = []
34
- str = StringScanner.new(str)
35
- r << next_tag(str) until str.eos?
36
- r
37
- end
38
-
39
- def next_tag(str)
40
- v = str.scan_until(/,|\[|$/)
41
- if v[-1] == ','
42
- v.chop.strip
43
- elsif v[-1] == '['
44
- open = 1
45
- while open > 0
46
- v += str.scan_until(/\[|\]/)
47
- if v[-1] == '['
48
- open += 1
49
- else
50
- open -= 1
51
- end
52
- end
53
- v += next_tag(str)
54
- # End of line
55
- else
56
- v.strip
57
- end
58
- end
59
-
60
- def extract_children(tag)
61
- # http://rubular.com/r/plGILY2e2U
62
- if tag.strip =~ /([^\[]*)\[(.*)\]/
63
- [Regexp.last_match(1), parse(Regexp.last_match(2))]
64
- else
65
- [tag.strip, nil]
66
- end
67
- end
68
-
69
- def extract_instances(tag)
70
- if tag.strip =~ /(.*)\((\d+)\)$/
71
- [Regexp.last_match(1), Regexp.last_match(2).to_i]
72
- else
73
- [tag.strip, nil]
74
- end
75
- end
76
-
77
- def camelize(val)
78
- val.strip.gsub(/\s+/, '_').camelize
79
- end
80
- end
81
- end
@@ -1,6 +0,0 @@
1
- # You can define any Rake tasks to support your application here (or in any file
2
- # ending in .rake in this directory).
3
- #
4
- # Rake (Ruby Make) is very useful for creating build scripts, see this short video
5
- # for a quick introduction:
6
- # http://railscasts.com/episodes/66-custom-rake-tasks
@@ -1,36 +0,0 @@
1
- require "spec_helper"
2
- require 'origen_app_generators/sub_block_parser'
3
-
4
- describe "Sub block parser" do
5
-
6
- before :all do
7
- @parser = OrigenAppGenerators::SubBlockParser.new
8
- end
9
-
10
- it "Can parse basic strings" do
11
- s = "ram, atd"
12
- @parser.parse(s).should == {"RAM" => {}, "ATD" => {}}
13
- end
14
-
15
- it "Can identify multiple instances" do
16
- s = "ram, osc(2), atd(3)"
17
- @parser.parse(s).should == {"RAM" => {}, "Osc" => {instances: 2}, "ATD" => {instances: 3}}
18
- end
19
-
20
- it "Can handle nesting" do
21
- s = "ram, atd, nvm[ram(2), osc]"
22
- @parser.parse(s).should == {"RAM" => {}, "ATD" => {}, "NVM" => {children: {
23
- "RAM" => {instances: 2}, "Osc" => {}
24
- }}}
25
- end
26
-
27
- it "Can handle a top-level namespace" do
28
- s = "Falcon[ram, atd, nvm[ram(2), osc]], Eagle[ram(2), atd]"
29
- @parser.parse(s).should ==
30
- { "Falcon" => { children: {"RAM" => {}, "ATD" => {}, "NVM" => {children: {
31
- "RAM" => {instances: 2}, "Osc" => {}
32
- }}}},
33
- "Eagle" => { children: {"RAM" => {instances: 2}, "ATD" => {}
34
- }}}
35
- end
36
- end
@@ -1,6 +0,0 @@
1
- # You can define any Rake tasks to support your application here (or in any file
2
- # ending in .rake in this directory).
3
- #
4
- # Rake (Ruby Make) is very useful for creating build scripts, see this short video
5
- # for a quick introduction:
6
- # http://railscasts.com/episodes/66-custom-rake-tasks
@@ -1,22 +0,0 @@
1
- require 'origen'
2
- <% if @type == :plugin -%>
3
- require_relative '../config/application.rb'
4
- <% end -%>
5
- module <%= @namespace %>
6
- <% if @type == :plugin -%>
7
- # THIS FILE SHOULD ONLY BE USED TO LOAD RUNTIME DEPENDENCIES
8
- # If this plugin has any development dependencies (e.g. dummy DUT or other models that are only used
9
- # for testing), then these should be loaded from config/boot.rb
10
-
11
- <% end -%>
12
- # Example of how to explicitly require a file
13
- # require "<%= @name %>/my_file"
14
-
15
- # Load all files in the lib/<%= @name %> directory.
16
- # Note that there is no problem from requiring a file twice (Ruby will ignore
17
- # the second require), so if you have a file that must be required first, then
18
- # explicitly require it up above and then let this take care of the rest.
19
- Dir.glob("#{File.dirname(__FILE__)}/<%= @name %>/**/*.rb").sort.each do |file|
20
- require file
21
- end
22
- end
@@ -1,4 +0,0 @@
1
- This directory should include all of the code that will be required by this plugin whenever
2
- it is used within a 3rd party application.
3
-
4
- Any code that is only for testing, should be placed in lib/<%= @name %>_dev instead.
@@ -1,5 +0,0 @@
1
- This directory should include any code related to testing, documentation, etc., but which
2
- will not be required whenever this plugin is actually used within a 3rd party application.
3
-
4
- Any code that will be required when used within a 3rd party application, should be placed
5
- in lib/<%= @name %> instead.
@@ -1,23 +0,0 @@
1
- <% if (@audience != :external) && Origen.site_config.gem_server -%>
2
- <% Array(Origen.site_config.gem_server).each do |server| -%>
3
- source '<%= server %>'
4
- <% end -%>
5
- <% else %>
6
- source 'https://rubygems.org'
7
- <% end -%>
8
-
9
- gem 'origen', '>= <%= @latest_origen_version %>'
10
-
11
- gem 'origen_testers'
12
-
13
- gem 'origen_debuggers'
14
-
15
- gem 'origen_doc_helpers'
16
-
17
- gem 'byebug'
18
-
19
- gem 'origen_updater'
20
-
21
- # Uncomment these if you want to use a visual debugger (e.g. Visual Studio Code) to debug your app
22
- #gem 'ruby-debug-ide'
23
- #gem 'debase'
@@ -1,23 +0,0 @@
1
- module <%= @namespace %>
2
- class <%= @options[:name] %>
3
- include Origen::Model
4
-
5
- def initialize(options = {})
6
- instantiate_registers(options)
7
- instantiate_sub_blocks(options)
8
- end
9
-
10
- def instantiate_registers(options = {})
11
- end
12
-
13
- def instantiate_sub_blocks(options = {})
14
- <% @options[:sub_blocks].each do |name, attrs| -%>
15
- <% if attrs[:instances] -%>
16
- sub_block :<%= name.underscore %>, instances: <%= attrs[:instances] %>, class_name: '<%= name.camelize %>'
17
- <% else -%>
18
- sub_block :<%= name.underscore %>, class_name: '<%= name.camelize %>'
19
- <% end -%>
20
- <% end -%>
21
- end
22
- end
23
- end
@@ -1,5 +0,0 @@
1
- module <%= @namespace %>
2
- class ATDController
3
- include Origen::Controller
4
- end
5
- end
@@ -1,33 +0,0 @@
1
- module <%= @namespace %>
2
- class <%= @options[:name] || 'TopLevel' %>
3
- include Origen::TopLevel
4
-
5
- def initialize(options = {})
6
- instantiate_pins(options)
7
- instantiate_registers(options)
8
- instantiate_sub_blocks(options)
9
- end
10
-
11
- def instantiate_pins(options = {})
12
- add_pin :tclk
13
- add_pin :tdi
14
- add_pin :tdo
15
- add_pin :tms
16
- add_pin :resetb
17
- add_pins :port_a, size: 8
18
- end
19
-
20
- def instantiate_registers(options = {})
21
- end
22
-
23
- def instantiate_sub_blocks(options = {})
24
- <% @options[:sub_blocks].each do |name, attrs| -%>
25
- <% if attrs[:instances] -%>
26
- sub_block :<%= name.underscore %>, instances: <%= attrs[:instances] %>, class_name: '<%= name.camelize %>'
27
- <% else -%>
28
- sub_block :<%= name.underscore %>, class_name: '<%= name.camelize %>'
29
- <% end -%>
30
- <% end -%>
31
- end
32
- end
33
- end
@@ -1,21 +0,0 @@
1
- module <%= @namespace %>
2
- class <%= @options[:name] || 'TopLevel' %>Controller
3
- include Origen::Controller
4
-
5
- def startup(options)
6
- pp 'Enter test mode' do
7
- tester.set_timeset('func_25mhz', 40) # Where 40 is the period in ns
8
- pin(:tclk).drive!(1)
9
- pin(:resetb).drive!(1)
10
- tester.wait time_in_us: 100
11
- end
12
- end
13
-
14
- def shutdown(options)
15
- pp 'Reset the device' do
16
- pin(:resetb).drive!(0)
17
- pin(:tclk).drive!(0)
18
- end
19
- end
20
- end
21
- end
@@ -1,4 +0,0 @@
1
- Pattern.create do
2
- # Call controller methods from here...
3
- # $dut.atd.convert
4
- end
@@ -1,4 +0,0 @@
1
- # The target file is run before *every* Origen operation and is used to instantiate
2
- # the runtime environment - usually this means instantiating a top-level SoC or
3
- # IP model.
4
- <%= @namespace %>::<%= @options[:name] || "TopLevel" %>.new # Instantiate a DUT instance
@@ -1,2 +0,0 @@
1
- # Instantiate a tester driver, this will be globally available as 'tester'
2
- OrigenTesters::J750.new
@@ -1,2 +0,0 @@
1
- # Instantiate a tester driver, this will be globally available as 'tester'
2
- OrigenTesters::UltraFLEX.new
@@ -1,2 +0,0 @@
1
- # Instantiate a tester driver, this will be globally available as 'tester'
2
- OrigenTesters::V93K.new
@@ -1,12 +0,0 @@
1
- module <%= @namespace %>
2
- class <%= @options[:name] %>Controller
3
- include Origen::Controller
4
-
5
- def do_something
6
- # The config register is defined in the corresponding model
7
- config.mode.write!(0x14)
8
- tester.wait(time_in_us: 100)
9
- config.secure.read!(0)
10
- end
11
- end
12
- end
@@ -1,21 +0,0 @@
1
- module <%= @namespace %>
2
- class Interface
3
- include OrigenTesters::ProgramGenerators
4
-
5
- # This will be called at the start of every flow or sub-flow (whenever Flow.create
6
- # is called).
7
- # Any options passed to Flow.create will be passed in here.
8
- # The options will contain top_level: true, whenever this is called at the start of
9
- # a new top-level flow.
10
- def startup(options = {})
11
- end
12
-
13
- # This will be called at the end of every flow or sub-flow (at the end of every
14
- # Flow.create block).
15
- # Any options passed to Flow.create will be passed in here.
16
- # The options will contain top_level: true, whenever this is called at the end of a
17
- # top-level flow file.
18
- def shutdown(options = {})
19
- end
20
- end
21
- end
@@ -1,18 +0,0 @@
1
- module <%= @namespace %>
2
- class <%= @options[:name] %>
3
- include Origen::Model
4
-
5
- def initialize(options = {})
6
- instantiate_registers(options)
7
- end
8
-
9
- def instantiate_registers(options)
10
- # Define your IP's registers here
11
- reg :config, 0x0, size: 32 do |reg|
12
- reg.bits 15..8, :mode
13
- reg.bit 1, :ext_clk, reset: 1
14
- reg.bit 0, :secure, access: :ro
15
- end
16
- end
17
- end
18
- end
@@ -1,27 +0,0 @@
1
- module <%= @namespace %>Dev
2
- # This is a dummy DUT class that should be used to test that your test module can
3
- # integrate into a top-level app
4
- class DUT
5
- include Origen::TopLevel
6
- include OrigenJTAG
7
- include OrigenARMDebug
8
-
9
- def initialize(options = {})
10
- instantiate_pins(options)
11
- instantiate_sub_blocks(options)
12
- end
13
-
14
- def instantiate_pins(options)
15
- add_pin :tclk
16
- add_pin :tdi
17
- add_pin :tdo
18
- add_pin :tms
19
- add_pin :resetb
20
- end
21
-
22
- def instantiate_sub_blocks(options)
23
- sub_block :arm_debug, class_name: 'OrigenARMDebug::DAP', mem_aps: { mem_ap: 0x0, mdmap: 0x0100_0000 }
24
- sub_block :<%= options[:sub_block_name] %>, class_name: '<%= @namespace %>::<%= options[:class_name] %>', base_address: 0x1000_0000
25
- end
26
- end
27
- end
@@ -1,26 +0,0 @@
1
- module <%= @namespace %>Dev
2
- # This is a dummy DUT controller that should be used to test that your test module can
3
- # integrate into a top-level app
4
- class DUTController
5
- def startup(options = {})
6
- tester.set_timeset('func_25', 40)
7
- ss 'Startup the SoC'
8
- pin(:resetb).drive!(0)
9
- 100.cycles
10
- pin(:resetb).dont_care
11
- end
12
-
13
- def shutdown(options = {})
14
- ss 'Shutdown the SoC'
15
- pin(:resetb).drive!(0)
16
- end
17
-
18
- def write_register(reg, options = {})
19
- arm_debug.mem_ap.write_register(reg, options)
20
- end
21
-
22
- def read_register(reg, options = {})
23
- arm_debug.mem_ap.read_register(reg, options)
24
- end
25
- end
26
- end
@@ -1,5 +0,0 @@
1
- Pattern.create do
2
- # Registers should never be written directly from here, always call API methods
3
- # that are defined by your controllers
4
- dut.<%= options[:sub_block_name] %>.do_something
5
- end
@@ -1,11 +0,0 @@
1
- Flow.create interface: '<%= @namespace %>::Interface' do
2
-
3
- if_job :p1 do
4
- test :test1, bin: 10, id: :t1
5
-
6
- test :test2, bin: 15, if_failed: :t1
7
- end
8
-
9
- pass 1, softbin: 55
10
-
11
- end
@@ -1,2 +0,0 @@
1
- # Instantiate a DUT instance, this will be globally available as 'dut'
2
- <%= @namespace %>Dev::DUT.new
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
- source 'http://origen-hub.am.freescale.net:9292'
3
-
4
- gem "origen_core", ">= <%= Origen.version %>"
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
- source 'http://origen-hub.am.freescale.net:9292'
3
-
4
- # Specify your gem's dependencies in <%= Origen.app.name %>.gemspec
5
- gemspec
6
-
@@ -1,33 +0,0 @@
1
- # coding: utf-8
2
- config = File.expand_path('../config', __FILE__)
3
- require "#{config}/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "<%= Origen.app.name %>"
7
- spec.version = <%= Origen.app.namespace %>::VERSION
8
- spec.authors = ["<%= User.current.name %>"]
9
- spec.email = ["<%= User.current.email %>"]
10
- spec.summary = "<%= @summary %>"
11
- <% if Origen.app.config.web_domain -%>
12
- spec.homepage = "<%= Origen.app.config.web_domain %>"
13
- <% end -%>
14
-
15
- spec.required_ruby_version = '>= 1.9.3'
16
- spec.required_rubygems_version = '>= 1.8.11'
17
-
18
- # Only the files that are hit by these wildcards will be included in the
19
- # packaged gem, the default should hit everything in most cases but this will
20
- # need to be added to if you have any custom directories
21
- spec.files = Dir["lib/**/*.rb", "templates/**/*", "config/**/*.rb",
22
- "bin/*", "lib/tasks/**/*.rake", "pattern/**/*.rb",
23
- "program/**/*.rb"
24
- ]
25
- spec.executables = []
26
- spec.require_paths = ["lib"]
27
-
28
- # Add any gems that your plugin needs to run within a host application
29
- spec.add_runtime_dependency "origen_core", ">= <%= Origen.version %>"
30
-
31
- # Add any gems that your plugin needs for its development environment only
32
- #spec.add_development_dependency "doc_helpers", ">= 1.7.0"
33
- end
@@ -1,10 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/app_tasks.rake, and they will automatically be available to Rake.
3
-
4
- # Any task files found in lib/tasks/shared/*.rake will be available to other apps that
5
- # include this app as a plugin
6
-
7
- require "bundler/setup"
8
- require "origen"
9
-
10
- Origen.app.load_tasks
@@ -1,49 +0,0 @@
1
- $VERBOSE=nil # Don't care about world writable dir warnings and the like
2
-
3
- require 'pathname'
4
- if File.exist? File.expand_path("../Gemfile", Pathname.new(__FILE__).realpath)
5
- require 'rubygems'
6
- require 'bundler/setup'
7
- else
8
- # If running on windows, can't use Origen helpers 'till we load it...
9
- if RUBY_PLATFORM == 'i386-mingw32'
10
- `where origen`.split("\n").find do |match|
11
- match =~ /(.*)\\bin\\origen$/
12
- end
13
- origen_top = $1.gsub("\\", "/")
14
- else
15
- origen_top = `which origen`.strip.sub("/bin/origen", "")
16
- end
17
-
18
- $LOAD_PATH.unshift "#{origen_top}/lib"
19
- end
20
-
21
- require "origen"
22
-
23
- require "rspec/legacy_formatters"
24
- require "#{Origen.top}/spec/format/origen_formatter"
25
-
26
- if RUBY_VERSION >= '2.0.0'
27
- require "byebug"
28
- else
29
- require 'debugger'
30
- end
31
- require 'pry'
32
-
33
- def load_target(target="default")
34
- Origen.target.switch_to target
35
- Origen.target.load!
36
- end
37
-
38
- RSpec.configure do |config|
39
- config.formatter = OrigenFormatter
40
- # rspec-expectations config goes here. You can use an alternate
41
- # assertion/expectation library such as wrong or the stdlib/minitest
42
- # assertions if you prefer.
43
- config.expect_with :rspec do |expectations|
44
- # Enable only the newer, non-monkey-patching expect syntax.
45
- # For more details, see:
46
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
47
- expectations.syntax = :should
48
- end
49
- end