origen 0.41.2 → 0.42.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/version.rb +2 -2
- data/lib/origen/generator/pattern.rb +1 -1
- data/lib/origen/model/exporter.rb +18 -2
- data/lib/origen/revision_control/git.rb +2 -1
- data/lib/origen/sub_blocks.rb +75 -22
- data/origen_app_generators/origen_app_generators.gemspec +3 -3
- data/vendor/lib/models/origen/export1.rb +1 -1
- data/vendor/lib/models/origen/export1/block1.rb +1 -1
- data/vendor/lib/models/origen/non_origen_meta_data.md +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b916938b9392e5b4be6121f06ee887c292813306e90a6d9418ecc48f3133bb4d
|
4
|
+
data.tar.gz: 706c9e176befbd2eca212cc6f95a55f3e0dfc61d7fa844007a5a507019b256a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7395218ebd774335a39540fe27d19710269b94f2fb2d2d6746638f148d32e255f16d43d17ea72e533f988fd35e109a888ac519107386dadd93c950370e0c3153
|
7
|
+
data.tar.gz: 4fee8e8fc1083e90165283cb6e08cb8bafab60a41b2e202bf32d1a5712a39ec3ccf83fe0cba7540076832176586817dc9c42bb83d626a7c79ada5a4043155517
|
data/config/version.rb
CHANGED
@@ -65,7 +65,7 @@ module Origen
|
|
65
65
|
puts 'The current target has not instantiated a tester and pattern generation cannot run.'
|
66
66
|
puts 'Add something like this to your target file:'
|
67
67
|
puts ''
|
68
|
-
puts ' $tester =
|
68
|
+
puts ' $tester = OrigenTesters::J750.new'
|
69
69
|
puts ''
|
70
70
|
exit 1
|
71
71
|
end
|
@@ -1,6 +1,16 @@
|
|
1
1
|
module Origen
|
2
2
|
module Model
|
3
3
|
module Exporter
|
4
|
+
# Export the model
|
5
|
+
#
|
6
|
+
# Options defaults:
|
7
|
+
# include_pins: true
|
8
|
+
# include_registers: true
|
9
|
+
# include_sub_blocks: true
|
10
|
+
# include_timestamp: true
|
11
|
+
# rm_rb_only: nil # delete only .rb files, default is rm -rf * Origen.root/vendor/lib/models/name
|
12
|
+
#
|
13
|
+
# Use the rm_rb_only option if the export dir is under revision control and the dir contains revision control metadata
|
4
14
|
def export(name, options = {})
|
5
15
|
options = {
|
6
16
|
include_pins: true,
|
@@ -14,7 +24,13 @@ module Origen
|
|
14
24
|
file = options[:file_path] || export_path(name, options)
|
15
25
|
dir = options[:dir_path] || export_dir(options)
|
16
26
|
path_to_file = Pathname.new(File.join(dir, file))
|
17
|
-
|
27
|
+
if File.exist?(path_to_file.sub_ext('').to_s)
|
28
|
+
if options[:rm_rb_only]
|
29
|
+
Dir.glob(path_to_file.sub_ext('').to_s + '/**/*.rb').each { |f| FileUtils.rm_f(f) }
|
30
|
+
else
|
31
|
+
FileUtils.rm_rf(path_to_file.sub_ext('').to_s)
|
32
|
+
end
|
33
|
+
end
|
18
34
|
FileUtils.rm_rf(path_to_file.to_s) if File.exist?(path_to_file.to_s)
|
19
35
|
FileUtils.mkdir_p(path_to_file.dirname)
|
20
36
|
File.open(path_to_file, 'w') do |f|
|
@@ -224,7 +240,7 @@ module Origen
|
|
224
240
|
indent = ' ' * (options[:indent] || 0)
|
225
241
|
file_path = File.join(Pathname.new(options[:file_path]).sub_ext(''), "#{id}.rb")
|
226
242
|
dir_path = options[:dir_path]
|
227
|
-
line = indent + "model.sub_block :#{id}, file: '#{file_path}', dir: '#{
|
243
|
+
line = indent + "model.sub_block :#{id}, file: '#{file_path}', dir: \"#{dir_path.gsub(Origen.root.to_s, '#{Origen.root!}')}\", lazy: true"
|
228
244
|
unless block.base_address == 0
|
229
245
|
line << ", base_address: #{block.base_address.to_hex}"
|
230
246
|
end
|
@@ -148,7 +148,8 @@ module Origen
|
|
148
148
|
# Returns true if the current user can checkin to the given repo (means has permission
|
149
149
|
# to push in Git terms)
|
150
150
|
def can_checkin?
|
151
|
-
|
151
|
+
# dry run attempting to create a new remote branch named OrigenWritePermissionsTest
|
152
|
+
git('push --dry-run origin origin:refs/heads/OrigenWritePermissionsTest', verbose: false)
|
152
153
|
true
|
153
154
|
rescue
|
154
155
|
false
|
data/lib/origen/sub_blocks.rb
CHANGED
@@ -17,7 +17,7 @@ module Origen
|
|
17
17
|
# address API, but will accept any of these
|
18
18
|
@reg_base_address = options.delete(:reg_base_address) ||
|
19
19
|
options.delete(:base_address) || options.delete(:base) || 0
|
20
|
-
if options[:_instance]
|
20
|
+
if options[:_instance] # to be deprecated as part of multi-instance removal below
|
21
21
|
if @reg_base_address.is_a?(Array)
|
22
22
|
@reg_base_address = @reg_base_address[options[:_instance]]
|
23
23
|
elsif options[:base_address_step]
|
@@ -273,34 +273,40 @@ module Origen
|
|
273
273
|
|
274
274
|
def sub_block(name, options = {})
|
275
275
|
if i = options.delete(:instances)
|
276
|
-
a
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
276
|
+
# permit creating multiple instances of a particular sub_block class
|
277
|
+
# can pass array for base_address, which will be processed above
|
278
|
+
Origen.deprecate 'instances: option to sub_block is deprecated, use sub_block_groups instead'
|
279
|
+
group_name = name =~ /s$/ ? name : "#{name}s" # take care if name already with 's' is passed
|
280
|
+
unless respond_to?(group_name)
|
281
|
+
sub_block_groups group_name do
|
282
|
+
i.times do |j|
|
283
|
+
o = options.dup
|
284
|
+
o[:_instance] = j
|
285
|
+
sub_block("#{name}#{j}", o)
|
286
|
+
end
|
287
|
+
end
|
285
288
|
end
|
286
|
-
a
|
287
289
|
else
|
288
290
|
block = Placeholder.new(self, name, options)
|
289
|
-
if
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
291
|
+
# Allow additional attributes to be added to an existing sub-block if it hasn't
|
292
|
+
# been instantiated yet. This is not supported yet for instantiated sub-blocks since
|
293
|
+
# there are probably a lot more corner-cases to consider, and hopefully no one will
|
294
|
+
# really need this anyway.
|
295
|
+
if sub_blocks[name] && !sub_blocks[name].is_a?(Placeholder)
|
296
|
+
fail "You have already defined a sub-block named #{name} within class #{self.class}"
|
297
|
+
end
|
298
|
+
unless respond_to?(name)
|
299
|
+
define_singleton_method name do
|
300
|
+
get_sub_block(name)
|
298
301
|
end
|
302
|
+
end
|
303
|
+
if sub_blocks[name] && sub_blocks[name].is_a?(Placeholder)
|
304
|
+
sub_blocks[name].add_attributes(options)
|
299
305
|
else
|
300
306
|
sub_blocks[name] = block
|
301
307
|
end
|
302
|
-
|
303
|
-
|
308
|
+
unless @current_group.nil? # a group is currently open, store sub_block id only
|
309
|
+
@current_group << name
|
304
310
|
end
|
305
311
|
if options.key?(:lazy)
|
306
312
|
lazy = options[:lazy]
|
@@ -311,6 +317,53 @@ module Origen
|
|
311
317
|
end
|
312
318
|
end
|
313
319
|
|
320
|
+
# Create a group of associated sub_blocks under a group name
|
321
|
+
# permits each sub_block to be of a different class
|
322
|
+
# e.g.
|
323
|
+
# sub_block_group :my_ip_group do
|
324
|
+
# sub_block :ip0, class_name: 'IP0', base_address: 0x000000
|
325
|
+
# sub_block :ip1, class_name: 'IP1', base_address: 0x000200
|
326
|
+
# sub_block :ip2, class_name: 'IP2', base_address: 0x000400
|
327
|
+
# sub_block :ip3, class_name: 'IP3', base_address: 0x000600
|
328
|
+
# end
|
329
|
+
#
|
330
|
+
# creates an array referenced by method called 'my_ip_group'
|
331
|
+
# which contains the sub_blocks 'ip0', 'ip1', 'ip2', 'ip3'.
|
332
|
+
#
|
333
|
+
# Can also indicate a custom class container to hold these.
|
334
|
+
# This custom class container MUST support a '<<' method in
|
335
|
+
# order to add new sub_blocks to the container instance.
|
336
|
+
#
|
337
|
+
# e.g.
|
338
|
+
# sub_block_group :my_ip_group, class_name: 'MYGRP' do
|
339
|
+
# sub_block :ip0, class_name: 'IP0', base_address: 0x000000
|
340
|
+
# sub_block :ip1, class_name: 'IP1', base_address: 0x000200
|
341
|
+
# sub_block :ip2, class_name: 'IP2', base_address: 0x000400
|
342
|
+
# sub_block :ip3, class_name: 'IP3', base_address: 0x000600
|
343
|
+
# end
|
344
|
+
#
|
345
|
+
#
|
346
|
+
def sub_block_group(id, options = {})
|
347
|
+
@current_group = [] # open group
|
348
|
+
yield # any sub_block calls within this block will have their ID added to @current_group
|
349
|
+
my_group = @current_group.dup
|
350
|
+
define_singleton_method "#{id}" do
|
351
|
+
if options[:class_name]
|
352
|
+
b = Object.const_get(options[:class_name]).new
|
353
|
+
else
|
354
|
+
b = []
|
355
|
+
end
|
356
|
+
my_group.each do |group_id|
|
357
|
+
b << send(group_id)
|
358
|
+
end
|
359
|
+
b # return array inside new singleton method
|
360
|
+
end
|
361
|
+
@current_group = nil # close group
|
362
|
+
end
|
363
|
+
alias_method :sub_block_groups, :sub_block_group
|
364
|
+
alias_method :sub_blocks_groups, :sub_block_group
|
365
|
+
alias_method :sub_blocks_group, :sub_block_group
|
366
|
+
|
314
367
|
def namespace
|
315
368
|
self.class.to_s.sub(/::[^:]*$/, '')
|
316
369
|
end
|
@@ -8,16 +8,16 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.8.11".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Stephen McGinty".freeze]
|
11
|
-
s.date = "
|
11
|
+
s.date = "2019-01-22"
|
12
12
|
s.email = ["stephen.f.mcginty@gmail.com".freeze]
|
13
13
|
s.files = ["bin/boot.rb".freeze, "bin/fix_my_workspace".freeze, "config/application.rb".freeze, "config/boot.rb".freeze, "config/commands.rb".freeze, "config/shared_commands.rb".freeze, "config/version.rb".freeze, "lib/origen_app_generators.rb".freeze, "lib/origen_app_generators/application.rb".freeze, "lib/origen_app_generators/base.rb".freeze, "lib/origen_app_generators/empty_application.rb".freeze, "lib/origen_app_generators/empty_plugin.rb".freeze, "lib/origen_app_generators/new.rb".freeze, "lib/origen_app_generators/origen_infrastructure/app_generator_plugin.rb".freeze, "lib/origen_app_generators/plugin.rb".freeze, "lib/origen_app_generators/sub_block_parser.rb".freeze, "lib/origen_app_generators/test_engineering/stand_alone_application.rb".freeze, "lib/origen_app_generators/test_engineering/test_block.rb".freeze, "lib/tasks/app_generators.rake".freeze, "lib/tasks/new_app_tests.rake".freeze, "templates/app_generators".freeze, "templates/app_generators/application".freeze, "templates/app_generators/application/.gitignore".freeze, "templates/app_generators/application/.irbrc".freeze, "templates/app_generators/application/.rspec".freeze, "templates/app_generators/application/.travis.yml".freeze, "templates/app_generators/application/Gemfile".freeze, "templates/app_generators/application/Rakefile".freeze, "templates/app_generators/application/config".freeze, "templates/app_generators/application/config/application.rb".freeze, "templates/app_generators/application/config/boot.rb".freeze, "templates/app_generators/application/config/commands.rb".freeze, "templates/app_generators/application/config/maillist_dev.txt".freeze, "templates/app_generators/application/config/maillist_prod.txt".freeze, "templates/app_generators/application/config/version.rb".freeze, "templates/app_generators/application/doc".freeze, "templates/app_generators/application/doc/history".freeze, "templates/app_generators/application/dot_keep".freeze, "templates/app_generators/application/lib".freeze, "templates/app_generators/application/lib/app.rake".freeze, "templates/app_generators/application/lib/module.rb".freeze, "templates/app_generators/application/lib/top_level.rb".freeze, "templates/app_generators/application/origen_core_session".freeze, "templates/app_generators/application/spec".freeze, "templates/app_generators/application/spec/spec_helper.rb".freeze, "templates/app_generators/application/target".freeze, "templates/app_generators/application/target/debug.rb".freeze, "templates/app_generators/application/target/default.rb".freeze, "templates/app_generators/application/target/production.rb".freeze, "templates/app_generators/application/templates".freeze, "templates/app_generators/application/templates/web".freeze, "templates/app_generators/application/templates/web/index.md.erb".freeze, "templates/app_generators/application/templates/web/layouts".freeze, "templates/app_generators/application/templates/web/layouts/_basic.html.erb".freeze, "templates/app_generators/application/templates/web/partials".freeze, "templates/app_generators/application/templates/web/partials/_navbar.html.erb".freeze, "templates/app_generators/application/templates/web/release_notes.md.erb".freeze, "templates/app_generators/new".freeze, "templates/app_generators/new/generator.rb".freeze, "templates/app_generators/new/info.md.erb".freeze, "templates/app_generators/origen_infrastructure".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/config".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/config/load_generators.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/lib".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/lib/application.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/lib/base.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/lib/module.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/lib/plugin.rb".freeze, "templates/app_generators/plugin".freeze, "templates/app_generators/plugin/Gemfile".freeze, "templates/app_generators/plugin/Rakefile".freeze, "templates/app_generators/plugin/config".freeze, "templates/app_generators/plugin/config/boot.rb".freeze, "templates/app_generators/plugin/gemspec.rb".freeze, "templates/app_generators/plugin/lib".freeze, "templates/app_generators/plugin/lib/README".freeze, "templates/app_generators/plugin/lib_dev".freeze, "templates/app_generators/plugin/lib_dev/README".freeze, "templates/app_generators/plugin/templates".freeze, "templates/app_generators/plugin/templates/web".freeze, "templates/app_generators/plugin/templates/web/index.md.erb".freeze, "templates/app_generators/plugin/templates/web/partials".freeze, "templates/app_generators/plugin/templates/web/partials/_navbar_external.html.erb".freeze, "templates/app_generators/plugin/templates/web/partials/_navbar_internal.html.erb".freeze, "templates/app_generators/test_engineering".freeze, "templates/app_generators/test_engineering/stand_alone_application".freeze, "templates/app_generators/test_engineering/stand_alone_application/Gemfile".freeze, "templates/app_generators/test_engineering/stand_alone_application/environment".freeze, "templates/app_generators/test_engineering/stand_alone_application/environment/j750.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/environment/jlink.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/environment/uflex.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/environment/v93k.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/lib".freeze, "templates/app_generators/test_engineering/stand_alone_application/lib/ip_block.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/lib/ip_block_controller.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/lib/top_level.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/lib/top_level_controller.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/pattern".freeze, "templates/app_generators/test_engineering/stand_alone_application/pattern/example.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application/target".freeze, "templates/app_generators/test_engineering/stand_alone_application/target/top_level.rb".freeze, "templates/app_generators/test_engineering/test_block".freeze, "templates/app_generators/test_engineering/test_block/environment".freeze, "templates/app_generators/test_engineering/test_block/environment/j750.rb".freeze, "templates/app_generators/test_engineering/test_block/environment/ultraflex.rb".freeze, "templates/app_generators/test_engineering/test_block/environment/v93k.rb".freeze, "templates/app_generators/test_engineering/test_block/lib".freeze, "templates/app_generators/test_engineering/test_block/lib/controller.rb".freeze, "templates/app_generators/test_engineering/test_block/lib/interface.rb".freeze, "templates/app_generators/test_engineering/test_block/lib/model.rb".freeze, "templates/app_generators/test_engineering/test_block/lib_dev".freeze, "templates/app_generators/test_engineering/test_block/lib_dev/dut.rb".freeze, "templates/app_generators/test_engineering/test_block/lib_dev/dut_controller.rb".freeze, "templates/app_generators/test_engineering/test_block/pattern".freeze, "templates/app_generators/test_engineering/test_block/pattern/example.rb".freeze, "templates/app_generators/test_engineering/test_block/program".freeze, "templates/app_generators/test_engineering/test_block/program/prb1.rb".freeze, "templates/app_generators/test_engineering/test_block/target".freeze, "templates/app_generators/test_engineering/test_block/target/default.rb".freeze]
|
14
14
|
s.homepage = "http://origen-sdk.org/origen_app_generators".freeze
|
15
15
|
s.licenses = ["MIT".freeze]
|
16
16
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9.3".freeze)
|
17
|
-
s.rubygems_version = "2.7.
|
17
|
+
s.rubygems_version = "2.7.6".freeze
|
18
18
|
s.summary = "Origen application generators".freeze
|
19
19
|
|
20
|
-
s.installed_by_version = "2.7.
|
20
|
+
s.installed_by_version = "2.7.6" if s.respond_to? :installed_by_version
|
21
21
|
|
22
22
|
if s.respond_to? :specification_version then
|
23
23
|
s.specification_version = 4
|
@@ -69,7 +69,7 @@ module Origen
|
|
69
69
|
model.add_virtual_pin :relay1
|
70
70
|
model.add_virtual_pin :relay2, packages: { bga: {} }
|
71
71
|
|
72
|
-
model.sub_block :block1, file: 'origen/export1/block1.rb', dir:
|
72
|
+
model.sub_block :block1, file: 'origen/export1/block1.rb', dir: "#{Origen.root!}/vendor/lib/models", lazy: true
|
73
73
|
|
74
74
|
end
|
75
75
|
end
|
@@ -4,7 +4,7 @@ module Origen
|
|
4
4
|
module Export1
|
5
5
|
module Block1
|
6
6
|
def self.extended(model)
|
7
|
-
model.sub_block :x, file: 'origen/export1/block1/x.rb', dir:
|
7
|
+
model.sub_block :x, file: 'origen/export1/block1/x.rb', dir: "#{Origen.root!}/vendor/lib/models", lazy: true, base_address: 0x40000000
|
8
8
|
|
9
9
|
end
|
10
10
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
pretend metadata file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.42.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -731,6 +731,7 @@ files:
|
|
731
731
|
- vendor/lib/models/origen/export1.rb
|
732
732
|
- vendor/lib/models/origen/export1/block1.rb
|
733
733
|
- vendor/lib/models/origen/export1/block1/x.rb
|
734
|
+
- vendor/lib/models/origen/non_origen_meta_data.md
|
734
735
|
homepage: http://origen-sdk.org
|
735
736
|
licenses:
|
736
737
|
- MIT
|
@@ -751,7 +752,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
751
752
|
version: 1.8.11
|
752
753
|
requirements: []
|
753
754
|
rubyforge_project:
|
754
|
-
rubygems_version: 2.7.
|
755
|
+
rubygems_version: 2.7.6
|
755
756
|
signing_key:
|
756
757
|
specification_version: 4
|
757
758
|
summary: The Semiconductor Developer's Kit
|