origen 0.55.5 → 0.56.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.
- checksums.yaml +4 -4
- data/config/version.rb +2 -2
- data/lib/origen/generator/pattern.rb +16 -2
- data/lib/origen/generator/pattern_sequence.rb +49 -5
- data/lib/origen/generator/pattern_sequencer.rb +19 -0
- data/lib/origen/generator/pattern_thread.rb +3 -1
- data/origen_app_generators/origen_app_generators.gemspec +3 -3
- 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: d785350a667cc70a8ef0915fb8ea4f4c0bb0f70dc29159ac09a5112e3e72ec78
|
|
4
|
+
data.tar.gz: 918ebaae4f7f664904f016a0b150123fb515d1f0e8eb86775eee1db1e2bcfc14
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0f58ff06e30b0c5687c562abfe5c1392b2cdd18b2eb50bb176f35d35764856091f9adaa5472886d51684277eb8b931a75745f487ff63fa62fb3b344338e7173f
|
|
7
|
+
data.tar.gz: 60e67f10a5c318593d9f842c3e880bfe1301130cba17c6030127bf69dead91951bd59bb79007a34a80adc2da83817333323bb4eda0904687db0b24d6f4e14da6
|
data/config/version.rb
CHANGED
|
@@ -91,9 +91,23 @@ module Origen
|
|
|
91
91
|
# end
|
|
92
92
|
|
|
93
93
|
@pattern_sequence = true
|
|
94
|
-
|
|
94
|
+
|
|
95
|
+
# The startup callbacks need to be skipped for now until the main thread is open for business
|
|
96
|
+
pattern_wrapper([], [], options.merge(call_startup_callbacks: false)) do
|
|
97
|
+
# The startup callbacks, if required, need to be wrapped up in a closure for calling
|
|
98
|
+
# later by the main thread
|
|
99
|
+
if (options.key?(:call_startup_callbacks) && !options[:call_startup_callbacks]) || options[:skip_startup]
|
|
100
|
+
pre_block = nil
|
|
101
|
+
else
|
|
102
|
+
pre_block = proc do
|
|
103
|
+
# Call startup callbacks
|
|
104
|
+
Origen.app.listeners_for(:startup).each do |listener|
|
|
105
|
+
listener.startup(options)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
95
109
|
PatternSequencer.send(:active=, true)
|
|
96
|
-
@pattern_sequence = PatternSequence.new(job.output_pattern_filename, block)
|
|
110
|
+
@pattern_sequence = PatternSequence.new(job.output_pattern_filename, block, pre_block)
|
|
97
111
|
@pattern_sequence.send(:execute)
|
|
98
112
|
PatternSequencer.send(:active=, false)
|
|
99
113
|
end
|
|
@@ -5,15 +5,17 @@ module Origen
|
|
|
5
5
|
# Manages a single pattern sequence, i.e. an instance of PatternSequence is
|
|
6
6
|
# created for every Pattern.sequence do ... end block
|
|
7
7
|
class PatternSequence
|
|
8
|
-
def initialize(name, block)
|
|
8
|
+
def initialize(name, block, pre_block = nil)
|
|
9
9
|
@number_of_threads = 1
|
|
10
10
|
@name = name
|
|
11
11
|
@running_thread_ids = { main: true }
|
|
12
12
|
# The contents of the main Pattern.sequence block will be executed as a thread and treated
|
|
13
13
|
# like any other parallel block
|
|
14
|
-
thread = PatternThread.new(:main, self, block, true)
|
|
14
|
+
thread = PatternThread.new(:main, self, block, true, pre_block)
|
|
15
15
|
threads << thread
|
|
16
16
|
active_threads << thread
|
|
17
|
+
PatSeq.send(:current_sequence=, self)
|
|
18
|
+
@sync_ups = {}
|
|
17
19
|
end
|
|
18
20
|
|
|
19
21
|
# Execute the given pattern
|
|
@@ -45,7 +47,7 @@ module Origen
|
|
|
45
47
|
end
|
|
46
48
|
alias_method :in_parallel, :thread
|
|
47
49
|
|
|
48
|
-
def
|
|
50
|
+
def wait_for_threads_to_complete(*ids)
|
|
49
51
|
completed = false
|
|
50
52
|
blocked = false
|
|
51
53
|
ids = ids.map(&:to_sym)
|
|
@@ -71,10 +73,48 @@ module Origen
|
|
|
71
73
|
end
|
|
72
74
|
end
|
|
73
75
|
end
|
|
74
|
-
alias_method :wait_for_thread, :
|
|
76
|
+
alias_method :wait_for_thread, :wait_for_threads_to_complete
|
|
77
|
+
alias_method :wait_for_threads, :wait_for_threads_to_complete
|
|
78
|
+
alias_method :wait_for_thread_to_complete, :wait_for_threads_to_complete
|
|
75
79
|
|
|
76
80
|
private
|
|
77
81
|
|
|
82
|
+
def sync_up(location, *ids)
|
|
83
|
+
options = ids.pop if ids.last.is_a?(Hash)
|
|
84
|
+
options ||= {}
|
|
85
|
+
ids = ids.map(&:to_sym)
|
|
86
|
+
if ids.empty? || ids.include?(:all)
|
|
87
|
+
ids = @running_thread_ids.keys
|
|
88
|
+
ids.delete(:main) unless options[:include_main]
|
|
89
|
+
end
|
|
90
|
+
# Just continue if this thread is not in the list
|
|
91
|
+
return unless ids.include?(current_thread.id)
|
|
92
|
+
# If we have entered the same sync up point after having previously completed it,
|
|
93
|
+
# then clear it and start again
|
|
94
|
+
if @sync_ups[location] && @sync_ups[location][:completed]
|
|
95
|
+
@sync_ups[location] = nil
|
|
96
|
+
end
|
|
97
|
+
# Don't need to worry about race conditions here as Origen only allows 1 thread
|
|
98
|
+
# to be active at a time
|
|
99
|
+
if @sync_ups[location]
|
|
100
|
+
@sync_ups[location][:arrived] << current_thread.id
|
|
101
|
+
else
|
|
102
|
+
@sync_ups[location] = { required: Set.new, arrived: Set.new, completed: false }
|
|
103
|
+
ids.each { |id| @sync_ups[location][:required] << id }
|
|
104
|
+
@sync_ups[location][:arrived] << current_thread.id
|
|
105
|
+
end
|
|
106
|
+
if @sync_ups[location][:required] == @sync_ups[location][:arrived]
|
|
107
|
+
@sync_ups[location][:completed] = true
|
|
108
|
+
end
|
|
109
|
+
blocked = false
|
|
110
|
+
until @sync_ups[location][:completed]
|
|
111
|
+
current_thread.waiting_for_thread(blocked)
|
|
112
|
+
blocked = true
|
|
113
|
+
Origen.log.debug "Waiting for sync_up: #{@sync_ups}"
|
|
114
|
+
end
|
|
115
|
+
current_thread.record_active if blocked
|
|
116
|
+
end
|
|
117
|
+
|
|
78
118
|
def thread_running?(id)
|
|
79
119
|
@running_thread_ids[id]
|
|
80
120
|
end
|
|
@@ -86,7 +126,11 @@ module Origen
|
|
|
86
126
|
def log_execution_profile
|
|
87
127
|
if threads.size > 1
|
|
88
128
|
thread_id_size = threads.map { |t| t.id.to_s.size }.max
|
|
89
|
-
|
|
129
|
+
begin
|
|
130
|
+
line_size = IO.console.winsize[1] - 35 - thread_id_size
|
|
131
|
+
rescue
|
|
132
|
+
line_size = 150
|
|
133
|
+
end
|
|
90
134
|
line_size -= 16 if tester.try(:sim?)
|
|
91
135
|
cycles_per_tick = (@cycle_count_stop / (line_size * 1.0)).ceil
|
|
92
136
|
if tester.try(:sim?)
|
|
@@ -81,8 +81,27 @@ module Origen
|
|
|
81
81
|
str
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
# Wait for the given threads to complete. If no IDs given it will wait for all currently running
|
|
85
|
+
# threads (except for the one who called this) to complete.
|
|
86
|
+
def wait_for_threads_to_complete(*ids)
|
|
87
|
+
@current_sequence.wait_for_threads_to_complete(*ids)
|
|
88
|
+
end
|
|
89
|
+
alias_method :wait_for_thread, :wait_for_threads_to_complete
|
|
90
|
+
alias_method :wait_for_threads, :wait_for_threads_to_complete
|
|
91
|
+
alias_method :wait_for_thread_to_complete, :wait_for_threads_to_complete
|
|
92
|
+
|
|
93
|
+
def sync_up(*ids)
|
|
94
|
+
if @current_sequence
|
|
95
|
+
@current_sequence.send(:sync_up, caller[0], *ids)
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
84
99
|
private
|
|
85
100
|
|
|
101
|
+
def current_sequence=(seq)
|
|
102
|
+
@current_sequence = seq
|
|
103
|
+
end
|
|
104
|
+
|
|
86
105
|
def active=(val)
|
|
87
106
|
@active = val
|
|
88
107
|
end
|
|
@@ -14,7 +14,7 @@ module Origen
|
|
|
14
14
|
# A record of when the thread is active to construct the execution profile
|
|
15
15
|
attr_reader :events
|
|
16
16
|
|
|
17
|
-
def initialize(id, sequence, block, primary = false)
|
|
17
|
+
def initialize(id, sequence, block, primary = false, pre_block = nil)
|
|
18
18
|
if primary
|
|
19
19
|
@cycle_count_start = 0
|
|
20
20
|
else
|
|
@@ -24,6 +24,7 @@ module Origen
|
|
|
24
24
|
@id = id.to_sym
|
|
25
25
|
@sequence = sequence
|
|
26
26
|
@block = block
|
|
27
|
+
@pre_block = pre_block
|
|
27
28
|
@primary = primary
|
|
28
29
|
@running = Concurrent::Event.new
|
|
29
30
|
@waiting = Concurrent::Event.new
|
|
@@ -46,6 +47,7 @@ module Origen
|
|
|
46
47
|
@thread = Thread.new do
|
|
47
48
|
PatSeq.send(:thread=, self)
|
|
48
49
|
wait
|
|
50
|
+
@pre_block.call if @pre_block
|
|
49
51
|
@block.call(sequence)
|
|
50
52
|
sequence.send(:thread_completed, self)
|
|
51
53
|
record_cycle_count_stop
|
|
@@ -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 = "2020-05-
|
|
11
|
+
s.date = "2020-05-15"
|
|
12
12
|
s.email = ["stephen.f.mcginty@gmail.com".freeze]
|
|
13
13
|
s.files = ["bin/boot.rb".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/new_app_tests.rb".freeze, "lib/origen_app_generators/origen_infrastructure/app_generator_plugin.rb".freeze, "lib/origen_app_generators/plugin.rb".freeze, "lib/origen_app_generators/test_engineering/common.rb".freeze, "lib/origen_app_generators/test_engineering/stand_alone_application.rb".freeze, "lib/origen_app_generators/test_engineering/test_block.rb".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/app".freeze, "templates/app_generators/application/app/blocks".freeze, "templates/app_generators/application/app/blocks/top_level.rb".freeze, "templates/app_generators/application/app/lib".freeze, "templates/app_generators/application/app/lib/module.rb".freeze, "templates/app_generators/application/app/templates".freeze, "templates/app_generators/application/app/templates/web".freeze, "templates/app_generators/application/app/templates/web/index.md.erb".freeze, "templates/app_generators/application/app/templates/web/layouts".freeze, "templates/app_generators/application/app/templates/web/layouts/_basic.html.erb".freeze, "templates/app_generators/application/app/templates/web/partials".freeze, "templates/app_generators/application/app/templates/web/partials/_navbar.html.erb".freeze, "templates/app_generators/application/app/templates/web/release_notes.md.erb".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/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/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/app".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/application.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/base.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/module.rb".freeze, "templates/app_generators/origen_infrastructure/app_generator_plugin/app/lib/plugin.rb".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/plugin".freeze, "templates/app_generators/plugin/Gemfile".freeze, "templates/app_generators/plugin/Rakefile".freeze, "templates/app_generators/plugin/app".freeze, "templates/app_generators/plugin/app/templates".freeze, "templates/app_generators/plugin/app/templates/web".freeze, "templates/app_generators/plugin/app/templates/web/index.md.erb".freeze, "templates/app_generators/plugin/app/templates/web/partials".freeze, "templates/app_generators/plugin/app/templates/web/partials/_navbar_external.html.erb".freeze, "templates/app_generators/plugin/app/templates/web/partials/_navbar_internal.html.erb".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/test_engineering".freeze, "templates/app_generators/test_engineering/environment".freeze, "templates/app_generators/test_engineering/environment/j750.rb".freeze, "templates/app_generators/test_engineering/environment/uflex.rb".freeze, "templates/app_generators/test_engineering/environment/v93k.rb".freeze, "templates/app_generators/test_engineering/stand_alone_application".freeze, "templates/app_generators/test_engineering/stand_alone_application/.keep".freeze, "templates/app_generators/test_engineering/test_block".freeze, "templates/app_generators/test_engineering/test_block/.keep".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 = "
|
|
17
|
+
s.rubygems_version = "2.7.7".freeze
|
|
18
18
|
s.summary = "Origen application generators".freeze
|
|
19
19
|
|
|
20
|
-
s.installed_by_version = "
|
|
20
|
+
s.installed_by_version = "2.7.7" if s.respond_to? :installed_by_version
|
|
21
21
|
|
|
22
22
|
if s.respond_to? :specification_version then
|
|
23
23
|
s.specification_version = 4
|
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.56.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: 2020-05-
|
|
11
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -749,7 +749,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
749
749
|
- !ruby/object:Gem::Version
|
|
750
750
|
version: 1.8.11
|
|
751
751
|
requirements: []
|
|
752
|
-
|
|
752
|
+
rubyforge_project:
|
|
753
|
+
rubygems_version: 2.7.7
|
|
753
754
|
signing_key:
|
|
754
755
|
specification_version: 4
|
|
755
756
|
summary: The Semiconductor Developer's Kit
|