origen 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ctags +0 -0
- data/bin/origen +165 -1
- data/bin/rgen +2 -0
- data/config/application.rb +141 -0
- data/config/commands.rb +72 -0
- data/config/development.rb +7 -0
- data/config/environment.rb +0 -0
- data/config/rgen.policy +7 -0
- data/config/rubocop/easy.yml +620 -0
- data/config/rubocop/easy_disabled.yml +271 -0
- data/config/rubocop/easy_enabled.yml +731 -0
- data/config/rubocop/strict.yml +620 -0
- data/config/rubocop/strict_disabled.yml +247 -0
- data/config/rubocop/strict_enabled.yml +755 -0
- data/config/users.rb +20 -0
- data/config/version.rb +1 -1
- data/helpers/url.rb +68 -0
- data/lib/c99/doc_interface.rb +56 -0
- data/lib/c99/j750_interface.rb +85 -0
- data/lib/c99/nvm.rb +89 -0
- data/lib/c99/target/mock2.rb +1 -0
- data/lib/c99/target/subdir/mock3.rb +1 -0
- data/lib/option_parser/optparse.rb +12 -0
- data/lib/origen/acronyms.rb +60 -0
- data/lib/origen/application/command_dispatcher.rb +12 -0
- data/lib/origen/application/configuration.rb +206 -0
- data/lib/origen/application/configuration_manager.rb +78 -0
- data/lib/origen/application/deployer.rb +367 -0
- data/lib/origen/application/environment.rb +186 -0
- data/lib/origen/application/lsf.rb +145 -0
- data/lib/origen/application/lsf_manager.rb +657 -0
- data/lib/origen/application/plugins_manager.rb +280 -0
- data/lib/origen/application/release.rb +359 -0
- data/lib/origen/application/runner.rb +246 -0
- data/lib/origen/application/statistics.rb +191 -0
- data/lib/origen/application/target.rb +374 -0
- data/lib/origen/application/version_tracker.rb +59 -0
- data/lib/origen/application/workspace_manager.rb +151 -0
- data/lib/origen/application.rb +746 -0
- data/lib/origen/bugs/bug.rb +36 -0
- data/lib/origen/bugs.rb +45 -0
- data/lib/origen/callbacks.rb +35 -0
- data/lib/origen/chip_mode.rb +118 -0
- data/lib/origen/chip_package.rb +461 -0
- data/lib/origen/client.rb +87 -0
- data/lib/origen/code_generators/actions.rb +258 -0
- data/lib/origen/code_generators/base.rb +57 -0
- data/lib/origen/code_generators/bundler.rb +17 -0
- data/lib/origen/code_generators/gem_setup.rb +49 -0
- data/lib/origen/code_generators/rake.rb +13 -0
- data/lib/origen/code_generators/rspec.rb +12 -0
- data/lib/origen/code_generators/semver.rb +39 -0
- data/lib/origen/code_generators/timever.rb +37 -0
- data/lib/origen/code_generators.rb +111 -0
- data/lib/origen/commands/add.rb +12 -0
- data/lib/origen/commands/compile.rb +62 -0
- data/lib/origen/commands/ctags.rb +9 -0
- data/lib/origen/commands/dispatch.rb +22 -0
- data/lib/origen/commands/environment.rb +11 -0
- data/lib/origen/commands/fetch.rb +63 -0
- data/lib/origen/commands/generate.rb +130 -0
- data/lib/origen/commands/interactive.rb +73 -0
- data/lib/origen/commands/lint.rb +82 -0
- data/lib/origen/commands/lsf.rb +93 -0
- data/lib/origen/commands/merge.rb +55 -0
- data/lib/origen/commands/modifications.rb +12 -0
- data/lib/origen/commands/new.rb +113 -0
- data/lib/origen/commands/plugin.rb +105 -0
- data/lib/origen/commands/program.rb +70 -0
- data/lib/origen/commands/rc.rb +442 -0
- data/lib/origen/commands/save.rb +56 -0
- data/lib/origen/commands/target.rb +27 -0
- data/lib/origen/commands/time.rb +127 -0
- data/lib/origen/commands/version.rb +17 -0
- data/lib/origen/commands/web.rb +221 -0
- data/lib/origen/commands.rb +272 -0
- data/lib/origen/commands_global.rb +76 -0
- data/lib/origen/controller.rb +94 -0
- data/lib/origen/core_ext/array.rb +23 -0
- data/lib/origen/core_ext/bignum.rb +36 -0
- data/lib/origen/core_ext/enumerable.rb +76 -0
- data/lib/origen/core_ext/fixnum.rb +46 -0
- data/lib/origen/core_ext/hash.rb +52 -0
- data/lib/origen/core_ext/module.rb +14 -0
- data/lib/origen/core_ext/numeric.rb +126 -0
- data/lib/origen/core_ext/object.rb +13 -0
- data/lib/origen/core_ext/range.rb +7 -0
- data/lib/origen/core_ext/string.rb +124 -0
- data/lib/origen/core_ext.rb +10 -0
- data/lib/origen/database/key_value_store.rb +111 -0
- data/lib/origen/database/key_value_stores.rb +108 -0
- data/lib/origen/database.rb +6 -0
- data/lib/origen/encodings.rb +102 -0
- data/lib/origen/features/feature.rb +22 -0
- data/lib/origen/features.rb +104 -0
- data/lib/origen/file_handler.rb +429 -0
- data/lib/origen/generator/comparator.rb +56 -0
- data/lib/origen/generator/compiler.rb +277 -0
- data/lib/origen/generator/flow.rb +49 -0
- data/lib/origen/generator/job.rb +131 -0
- data/lib/origen/generator/pattern.rb +356 -0
- data/lib/origen/generator/pattern_finder.rb +155 -0
- data/lib/origen/generator/pattern_iterator.rb +55 -0
- data/lib/origen/generator/renderer.rb +113 -0
- data/lib/origen/generator/resources.rb +40 -0
- data/lib/origen/generator/stage.rb +89 -0
- data/lib/origen/generator.rb +85 -0
- data/lib/origen/global_methods.rb +205 -0
- data/lib/origen/import_manager.rb +596 -0
- data/lib/origen/location/base.rb +116 -0
- data/lib/origen/location/map.rb +83 -0
- data/lib/origen/location.rb +6 -0
- data/lib/origen/log.rb +217 -0
- data/lib/origen/logger_methods.rb +56 -0
- data/lib/origen/mode.rb +61 -0
- data/lib/origen/model.rb +267 -0
- data/lib/origen/model_initializer.rb +45 -0
- data/lib/origen/nvm/block_array.rb +72 -0
- data/lib/origen/nvm.rb +6 -0
- data/lib/origen/parameters/live.rb +22 -0
- data/lib/origen/parameters/missing.rb +28 -0
- data/lib/origen/parameters/set.rb +144 -0
- data/lib/origen/parameters.rb +107 -0
- data/lib/origen/pdm.rb +218 -0
- data/lib/origen/pins/function_proxy.rb +36 -0
- data/lib/origen/pins/ground_pin.rb +6 -0
- data/lib/origen/pins/pin.rb +860 -0
- data/lib/origen/pins/pin_bank.rb +349 -0
- data/lib/origen/pins/pin_clock.rb +124 -0
- data/lib/origen/pins/pin_collection.rb +492 -0
- data/lib/origen/pins/pin_common.rb +206 -0
- data/lib/origen/pins/port.rb +268 -0
- data/lib/origen/pins/power_pin.rb +30 -0
- data/lib/origen/pins.rb +696 -0
- data/lib/origen/registers/bit.rb +562 -0
- data/lib/origen/registers/bit_collection.rb +787 -0
- data/lib/origen/registers/container.rb +288 -0
- data/lib/origen/registers/domain.rb +16 -0
- data/lib/origen/registers/reg.rb +1406 -0
- data/lib/origen/registers/reg_collection.rb +24 -0
- data/lib/origen/registers.rb +652 -0
- data/lib/origen/regression_manager.rb +251 -0
- data/lib/origen/remote_manager.rb +340 -0
- data/lib/origen/revision_control/base.rb +257 -0
- data/lib/origen/revision_control/design_sync.rb +276 -0
- data/lib/origen/revision_control/git.rb +243 -0
- data/lib/origen/revision_control/subversion.rb +6 -0
- data/lib/origen/revision_control.rb +44 -0
- data/lib/origen/ruby_version_check.rb +131 -0
- data/lib/origen/site_config.rb +61 -0
- data/lib/origen/specs/checkers.rb +103 -0
- data/lib/origen/specs/creation_info.rb +17 -0
- data/lib/origen/specs/doc_resource.rb +91 -0
- data/lib/origen/specs/exhibit.rb +17 -0
- data/lib/origen/specs/mode_select.rb +16 -0
- data/lib/origen/specs/note.rb +17 -0
- data/lib/origen/specs/override.rb +21 -0
- data/lib/origen/specs/power_supply.rb +13 -0
- data/lib/origen/specs/spec.rb +226 -0
- data/lib/origen/specs/version_history.rb +14 -0
- data/lib/origen/specs.rb +552 -0
- data/lib/origen/sub_blocks.rb +298 -0
- data/lib/origen/tester/api.rb +277 -0
- data/lib/origen/tester/bdm/bdm.rb +25 -0
- data/lib/origen/tester/command_based_tester.rb +46 -0
- data/lib/origen/tester/doc/doc.rb +226 -0
- data/lib/origen/tester/doc/generator/flow.rb +71 -0
- data/lib/origen/tester/doc/generator/flow_line.rb +203 -0
- data/lib/origen/tester/doc/generator/test.rb +68 -0
- data/lib/origen/tester/doc/generator/test_group.rb +66 -0
- data/lib/origen/tester/doc/generator/tests.rb +47 -0
- data/lib/origen/tester/doc/generator.rb +126 -0
- data/lib/origen/tester/doc/model.rb +162 -0
- data/lib/origen/tester/generator/flow_control_api.rb +606 -0
- data/lib/origen/tester/generator/identity_map.rb +25 -0
- data/lib/origen/tester/generator/placeholder.rb +13 -0
- data/lib/origen/tester/generator/test_numberer.rb +25 -0
- data/lib/origen/tester/generator.rb +271 -0
- data/lib/origen/tester/interface.rb +154 -0
- data/lib/origen/tester/j750/files.rb +45 -0
- data/lib/origen/tester/j750/generator/flow.rb +123 -0
- data/lib/origen/tester/j750/generator/flow_line.rb +288 -0
- data/lib/origen/tester/j750/generator/patgroup.rb +111 -0
- data/lib/origen/tester/j750/generator/patgroups.rb +41 -0
- data/lib/origen/tester/j750/generator/patset.rb +111 -0
- data/lib/origen/tester/j750/generator/patsets.rb +41 -0
- data/lib/origen/tester/j750/generator/templates/flow.txt.erb +9 -0
- data/lib/origen/tester/j750/generator/templates/instances.txt.erb +16 -0
- data/lib/origen/tester/j750/generator/templates/patgroups.txt.erb +8 -0
- data/lib/origen/tester/j750/generator/templates/patsets.txt.erb +10 -0
- data/lib/origen/tester/j750/generator/test_instance.rb +846 -0
- data/lib/origen/tester/j750/generator/test_instance_group.rb +60 -0
- data/lib/origen/tester/j750/generator/test_instances.rb +182 -0
- data/lib/origen/tester/j750/generator.rb +203 -0
- data/lib/origen/tester/j750/j750.rb +845 -0
- data/lib/origen/tester/j750/j750_hpt.rb +35 -0
- data/lib/origen/tester/j750/parser/ac_spec.rb +11 -0
- data/lib/origen/tester/j750/parser/ac_specs.rb +0 -0
- data/lib/origen/tester/j750/parser/dc_spec.rb +36 -0
- data/lib/origen/tester/j750/parser/dc_specs.rb +50 -0
- data/lib/origen/tester/j750/parser/descriptions.rb +340 -0
- data/lib/origen/tester/j750/parser/flow.rb +111 -0
- data/lib/origen/tester/j750/parser/flow_line.rb +207 -0
- data/lib/origen/tester/j750/parser/flows.rb +23 -0
- data/lib/origen/tester/j750/parser/pattern_set.rb +94 -0
- data/lib/origen/tester/j750/parser/pattern_sets.rb +33 -0
- data/lib/origen/tester/j750/parser/test_instance.rb +322 -0
- data/lib/origen/tester/j750/parser/test_instances.rb +26 -0
- data/lib/origen/tester/j750/parser/timeset.rb +15 -0
- data/lib/origen/tester/j750/parser/timesets.rb +0 -0
- data/lib/origen/tester/j750/parser.rb +104 -0
- data/lib/origen/tester/jlink/jlink.rb +33 -0
- data/lib/origen/tester/parser/description_lookup.rb +64 -0
- data/lib/origen/tester/parser/searchable_array.rb +32 -0
- data/lib/origen/tester/parser/searchable_hash.rb +32 -0
- data/lib/origen/tester/parser.rb +24 -0
- data/lib/origen/tester/time.rb +338 -0
- data/lib/origen/tester/timing.rb +253 -0
- data/lib/origen/tester/ultraflex/files.rb +45 -0
- data/lib/origen/tester/ultraflex/generator/flow.rb +119 -0
- data/lib/origen/tester/ultraflex/generator/flow_line.rb +269 -0
- data/lib/origen/tester/ultraflex/generator/patgroup.rb +111 -0
- data/lib/origen/tester/ultraflex/generator/patgroups.rb +41 -0
- data/lib/origen/tester/ultraflex/generator/patset.rb +111 -0
- data/lib/origen/tester/ultraflex/generator/patsets.rb +41 -0
- data/lib/origen/tester/ultraflex/generator/templates/flow.txt.erb +9 -0
- data/lib/origen/tester/ultraflex/generator/templates/instances.txt.erb +16 -0
- data/lib/origen/tester/ultraflex/generator/templates/patgroups.txt.erb +8 -0
- data/lib/origen/tester/ultraflex/generator/templates/patsets.txt.erb +10 -0
- data/lib/origen/tester/ultraflex/generator/test_instance.rb +622 -0
- data/lib/origen/tester/ultraflex/generator/test_instance_group.rb +60 -0
- data/lib/origen/tester/ultraflex/generator/test_instances.rb +174 -0
- data/lib/origen/tester/ultraflex/generator.rb +200 -0
- data/lib/origen/tester/ultraflex/parser/ac_spec.rb +11 -0
- data/lib/origen/tester/ultraflex/parser/ac_specs.rb +0 -0
- data/lib/origen/tester/ultraflex/parser/dc_spec.rb +36 -0
- data/lib/origen/tester/ultraflex/parser/dc_specs.rb +50 -0
- data/lib/origen/tester/ultraflex/parser/descriptions.rb +342 -0
- data/lib/origen/tester/ultraflex/parser/flow.rb +111 -0
- data/lib/origen/tester/ultraflex/parser/flow_line.rb +207 -0
- data/lib/origen/tester/ultraflex/parser/flows.rb +23 -0
- data/lib/origen/tester/ultraflex/parser/pattern_set.rb +94 -0
- data/lib/origen/tester/ultraflex/parser/pattern_sets.rb +33 -0
- data/lib/origen/tester/ultraflex/parser/test_instance.rb +262 -0
- data/lib/origen/tester/ultraflex/parser/test_instances.rb +26 -0
- data/lib/origen/tester/ultraflex/parser/timeset.rb +15 -0
- data/lib/origen/tester/ultraflex/parser/timesets.rb +0 -0
- data/lib/origen/tester/ultraflex/parser.rb +104 -0
- data/lib/origen/tester/ultraflex/ultraflex.rb +759 -0
- data/lib/origen/tester/v93k/generator/flow.rb +63 -0
- data/lib/origen/tester/v93k/generator/flow_node/print.rb +10 -0
- data/lib/origen/tester/v93k/generator/flow_node.rb +17 -0
- data/lib/origen/tester/v93k/generator/pattern.rb +16 -0
- data/lib/origen/tester/v93k/generator/pattern_master.rb +54 -0
- data/lib/origen/tester/v93k/generator/templates/_test_method.txt.erb +6 -0
- data/lib/origen/tester/v93k/generator/templates/_test_suite.txt.erb +11 -0
- data/lib/origen/tester/v93k/generator/templates/template.flow.erb +121 -0
- data/lib/origen/tester/v93k/generator/templates/template.pmfl.erb +9 -0
- data/lib/origen/tester/v93k/generator/test_function.rb +103 -0
- data/lib/origen/tester/v93k/generator/test_functions.rb +79 -0
- data/lib/origen/tester/v93k/generator/test_method.rb +46 -0
- data/lib/origen/tester/v93k/generator/test_methods.rb +75 -0
- data/lib/origen/tester/v93k/generator/test_suite.rb +54 -0
- data/lib/origen/tester/v93k/generator/test_suites.rb +65 -0
- data/lib/origen/tester/v93k/generator.rb +80 -0
- data/lib/origen/tester/v93k/v93k.rb +420 -0
- data/lib/origen/tester/vector.rb +86 -0
- data/lib/origen/tester/vector_generator.rb +633 -0
- data/lib/origen/tester/vector_pipeline.rb +150 -0
- data/lib/origen/tester.rb +56 -0
- data/lib/origen/top_level.rb +134 -0
- data/lib/origen/users/ldap.rb +65 -0
- data/lib/origen/users/user.rb +149 -0
- data/lib/origen/users.rb +30 -0
- data/lib/origen/utility/block_args.rb +93 -0
- data/lib/origen/utility/csv_data.rb +110 -0
- data/lib/origen/utility/design_sync.rb +494 -0
- data/lib/origen/utility/diff.rb +158 -0
- data/lib/origen/utility/input_capture.rb +121 -0
- data/lib/origen/utility/mailer.rb +143 -0
- data/lib/origen/utility/s_record.rb +205 -0
- data/lib/origen/utility/time_and_date.rb +30 -0
- data/lib/origen/utility.rb +12 -0
- data/lib/origen/version_checker.rb +117 -0
- data/lib/origen/version_string.rb +356 -0
- data/lib/origen.rb +648 -0
- data/lib/tasks/gem.rake +27 -22
- data/origen_site_config.yml +36 -0
- data/source_setup +17 -0
- data/spec/format/rgen_formatter.rb +14 -0
- data/templates/api_doc/README.txt.erb +24 -0
- data/templates/code_generators/gemfile_app.rb +4 -0
- data/templates/code_generators/gemfile_plugin.rb +6 -0
- data/templates/code_generators/gemspec.rb +33 -0
- data/templates/code_generators/rakefile.rb +10 -0
- data/templates/code_generators/spec_helper.rb +49 -0
- data/templates/code_generators/version.rb +8 -0
- data/templates/code_generators/version_time.rb +3 -0
- data/templates/git/gitignore.erb +33 -0
- data/templates/j750/_vt_flow.txt.erb +8 -0
- data/templates/j750/_vt_instances.txt.erb +4 -0
- data/templates/j750/program_sheet.txt.erb +9 -0
- data/templates/nanoc/Rules +74 -0
- data/templates/nanoc/config.yaml +77 -0
- data/templates/nanoc/content/favicon.ico +0 -0
- data/templates/nanoc/layouts/bootstrap.html.erb +63 -0
- data/templates/nanoc/layouts/bootstrap3.html.erb +71 -0
- data/templates/nanoc/layouts/freescale.html.erb +79 -0
- data/templates/nanoc/lib/bootstrap_filter.rb +49 -0
- data/templates/nanoc/lib/codeblocks_filter.rb +41 -0
- data/templates/nanoc/lib/default.rb +2 -0
- data/templates/nanoc/lib/gzip_filter.rb +16 -0
- data/templates/nanoc/lib/haml_code_filter.rb +41 -0
- data/templates/nanoc/lib/helpers.rb +1 -0
- data/templates/nanoc/lib/search_filter.rb +62 -0
- data/templates/nanoc_dynamic/content/search.js.erb +92 -0
- data/templates/shared/web/_logo.html +10 -0
- data/templates/test/_inline_sub.txt.erb +2 -0
- data/templates/test/environment.txt.erb +1 -0
- data/templates/test/inline.txt.erb +11 -0
- data/templates/test/inspections.txt.erb +19 -0
- data/templates/test/set1/_sub1.txt.erb +12 -0
- data/templates/test/set1/_sub4.txt.erb +1 -0
- data/templates/test/set1/_sub5.txt.erb +1 -0
- data/templates/test/set1/main.txt.erb +53 -0
- data/templates/test/set1/sub_dir/_sub2.txt.erb +20 -0
- data/templates/test/set1/sub_dir/_sub3.txt.erb +12 -0
- data/templates/test/set1/sub_dir/main2.txt.erb +4 -0
- data/templates/test/set2/template_with_no_erb_1.txt +9 -0
- data/templates/test/set2/template_with_no_erb_2.txt +9 -0
- data/templates/test/set3/_layout.html.erb +4 -0
- data/templates/test/set3/content.html.erb +6 -0
- data/templates/time/filter.rb.erb +15 -0
- data/templates/time/rules.rb.erb +45 -0
- metadata +639 -5
@@ -0,0 +1,94 @@
|
|
1
|
+
module Origen
|
2
|
+
module Tester
|
3
|
+
class Ultraflex
|
4
|
+
class Parser
|
5
|
+
class PatternSet
|
6
|
+
class Pattern
|
7
|
+
attr_accessor :parser
|
8
|
+
|
9
|
+
ATTRS = %w(pattern_set file_name start_label stop_label comment)
|
10
|
+
|
11
|
+
ALIASES = {
|
12
|
+
pattern: :file_name,
|
13
|
+
file: :file_name,
|
14
|
+
name: :file_name
|
15
|
+
}
|
16
|
+
|
17
|
+
# Generate readers for all attributes and their aliases
|
18
|
+
ATTRS.each do |attr|
|
19
|
+
attr_reader attr.to_sym
|
20
|
+
end
|
21
|
+
|
22
|
+
ALIASES.each do |_alias, attr|
|
23
|
+
define_method("#{_alias}") do
|
24
|
+
send(attr)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def initialize(line)
|
29
|
+
@line = line
|
30
|
+
parse
|
31
|
+
if valid?
|
32
|
+
ATTRS.each_with_index do |attr, i|
|
33
|
+
instance_variable_set("@#{attr}", components[i + 1])
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def parse
|
39
|
+
@components = @line.split("\t") unless @line.strip.empty?
|
40
|
+
end
|
41
|
+
|
42
|
+
def valid?
|
43
|
+
components[1] && !components[1].empty? && components[1] != 'Pattern Set' &&
|
44
|
+
components[2] && !components[2].empty?
|
45
|
+
end
|
46
|
+
|
47
|
+
def components
|
48
|
+
@components ||= []
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def initialize(line, options = {})
|
53
|
+
@parser = options[:parser]
|
54
|
+
p = add_pattern_line(line)
|
55
|
+
@name = p.pattern_set if p.valid?
|
56
|
+
end
|
57
|
+
|
58
|
+
def inspect # :nodoc:
|
59
|
+
"<PatternSet: #{name}>"
|
60
|
+
end
|
61
|
+
|
62
|
+
def name
|
63
|
+
@name
|
64
|
+
end
|
65
|
+
|
66
|
+
def patterns
|
67
|
+
@patterns ||= []
|
68
|
+
end
|
69
|
+
|
70
|
+
def self.extract_name(line)
|
71
|
+
new(line).name
|
72
|
+
end
|
73
|
+
|
74
|
+
def add_pattern_line(line)
|
75
|
+
p = Pattern.new(line)
|
76
|
+
patterns << Pattern.new(line) if p.valid?
|
77
|
+
p
|
78
|
+
end
|
79
|
+
|
80
|
+
def valid?
|
81
|
+
patterns.all?(&:valid?)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Returns an array containing all pattern names contained in this
|
85
|
+
# pattern set
|
86
|
+
def pattern_names
|
87
|
+
# This removes the path and extensions
|
88
|
+
patterns.map { |pat| pat.name.gsub(/.*[\\\/]/, '').gsub(/\..*/, '') }
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Origen
|
2
|
+
module Tester
|
3
|
+
class Ultraflex
|
4
|
+
class Parser
|
5
|
+
class PatternSets < Origen::Tester::Parser::SearchableHash
|
6
|
+
attr_accessor :parser
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@parser = options[:parser]
|
10
|
+
end
|
11
|
+
|
12
|
+
def import(file)
|
13
|
+
File.readlines(file).each do |line|
|
14
|
+
name = PatternSet.extract_name(line)
|
15
|
+
if name
|
16
|
+
if self[name]
|
17
|
+
self[name].add_pattern_line(line)
|
18
|
+
else
|
19
|
+
l = PatternSet.new(line, parser: parser)
|
20
|
+
self[l.name] = l if l.valid?
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def inspect
|
27
|
+
"<Patsets: #{size}>"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,262 @@
|
|
1
|
+
module Origen
|
2
|
+
module Tester
|
3
|
+
class Ultraflex
|
4
|
+
class Parser
|
5
|
+
class TestInstance
|
6
|
+
attr_accessor :parser
|
7
|
+
|
8
|
+
TYPES = %w(
|
9
|
+
functional board_pmu empty pin_pmu power_supply
|
10
|
+
)
|
11
|
+
|
12
|
+
TYPE_ALIASES = {
|
13
|
+
functional_t: :functional,
|
14
|
+
boardpmu_t: :board_pmu,
|
15
|
+
nvmboardpmucal_t: :board_pmu,
|
16
|
+
nvmboardpmumeasure_t: :board_pmu,
|
17
|
+
empty_t: :empty,
|
18
|
+
pinpmu_t: :pin_pmu,
|
19
|
+
nvmpinpmucal_t: :pin_pmu,
|
20
|
+
nvmpinpmumeas_t: :pin_pmu,
|
21
|
+
powersupply_t: :power_supply
|
22
|
+
}
|
23
|
+
|
24
|
+
attributes = %w(
|
25
|
+
test_name proc_type proc_name proc_called_as dc_category dc_selector ac_category ac_selector
|
26
|
+
time_sets edge_sets pin_levels overlay
|
27
|
+
)
|
28
|
+
80.times do |i|
|
29
|
+
attributes << "arg#{i}"
|
30
|
+
end
|
31
|
+
attributes << 'comment'
|
32
|
+
|
33
|
+
ATTRS = attributes
|
34
|
+
|
35
|
+
ALIASES = {
|
36
|
+
name: :test_name,
|
37
|
+
|
38
|
+
functional: {
|
39
|
+
pattern: :arg0,
|
40
|
+
start_func: :arg1,
|
41
|
+
pre_pat_func: :arg2,
|
42
|
+
pre_test_func: :arg3,
|
43
|
+
post_test_func: :arg4,
|
44
|
+
post_pat_func: :arg5,
|
45
|
+
end_func: :arg6,
|
46
|
+
set_pass_fail: :arg7,
|
47
|
+
start_func_args: :arg13,
|
48
|
+
pre_pat_func_args: :arg14,
|
49
|
+
pre_test_func_args: :arg15,
|
50
|
+
post_test_func_args: :arg16,
|
51
|
+
post_pat_func_args: :arg17,
|
52
|
+
end_func_args: :arg18,
|
53
|
+
wait_flags: :arg21,
|
54
|
+
wait_time: :arg22,
|
55
|
+
pat_flag_func: :arg23,
|
56
|
+
pat_flag_func_args: :arg24,
|
57
|
+
relay_mode: :arg25,
|
58
|
+
threading: :arg26,
|
59
|
+
match_all_sites: :arg27,
|
60
|
+
capture_mode: :arg30,
|
61
|
+
capture_what: :arg31,
|
62
|
+
capture_memory: :arg32,
|
63
|
+
capture_size: :arg33,
|
64
|
+
datalog_mode: :arg34,
|
65
|
+
data_type: :arg35
|
66
|
+
},
|
67
|
+
|
68
|
+
board_pmu: {
|
69
|
+
hsp_start: :arg0,
|
70
|
+
start_func: :arg1,
|
71
|
+
pre_pat_func: :arg2,
|
72
|
+
pre_test_func: :arg3,
|
73
|
+
post_test_func: :arg4,
|
74
|
+
post_pat_func: :arg5,
|
75
|
+
end_func: :arg6,
|
76
|
+
precond_pat: :arg7,
|
77
|
+
hold_state_pat: :arg8,
|
78
|
+
holdstate_pat: :arg8,
|
79
|
+
pattern: :arg8,
|
80
|
+
pcp_stop: :arg9,
|
81
|
+
wait_flags: :arg10,
|
82
|
+
start_lo: :arg11,
|
83
|
+
init_lo: :arg11,
|
84
|
+
start_hi: :arg12,
|
85
|
+
init_hi: :arg12,
|
86
|
+
start_hiz: :arg13,
|
87
|
+
init_hiz: :arg13,
|
88
|
+
float_pins: :arg14,
|
89
|
+
pinlist: :arg15,
|
90
|
+
measure_mode: :arg16,
|
91
|
+
irange: :arg17,
|
92
|
+
clamp: :arg18,
|
93
|
+
vrange: :arg19,
|
94
|
+
sampling_time: :arg20,
|
95
|
+
samples: :arg21,
|
96
|
+
setting_time: :arg22,
|
97
|
+
hi_lo_lim_valid: :arg23,
|
98
|
+
hi_limit: :arg24,
|
99
|
+
lo_limit: :arg25,
|
100
|
+
force_cond_1: :arg26,
|
101
|
+
force_cond_2: :arg27,
|
102
|
+
gang_pins_tested: :arg28,
|
103
|
+
relay_mode: :arg29,
|
104
|
+
wait_time_out: :arg30,
|
105
|
+
start_func_args: :arg31,
|
106
|
+
pre_pat_func_args: :arg32,
|
107
|
+
pre_test_func_args: :arg33,
|
108
|
+
post_test_func_args: :arg34,
|
109
|
+
post_pat_func_args: :arg35,
|
110
|
+
end_func_args: :arg36,
|
111
|
+
pcp_start: :arg37,
|
112
|
+
pcp_check_pg: :arg38,
|
113
|
+
hsp_stop: :arg39,
|
114
|
+
hsp_check_pg: :arg40,
|
115
|
+
resume_pat: :arg41,
|
116
|
+
utility_pins_1: :arg42,
|
117
|
+
utility_pins_0: :arg43,
|
118
|
+
pre_charge_enable: :arg44,
|
119
|
+
pre_charge: :arg45,
|
120
|
+
threading: :arg46
|
121
|
+
},
|
122
|
+
|
123
|
+
pin_pmu: {
|
124
|
+
hsp_start: :arg0,
|
125
|
+
start_func: :arg1,
|
126
|
+
pre_pat_func: :arg2,
|
127
|
+
pre_test_func: :arg3,
|
128
|
+
post_test_func: :arg4,
|
129
|
+
post_pat_func: :arg5,
|
130
|
+
end_func: :arg6,
|
131
|
+
precond_pat: :arg7,
|
132
|
+
hold_state_pat: :arg8,
|
133
|
+
holdstate_pat: :arg8,
|
134
|
+
pattern: :arg8,
|
135
|
+
pcp_stop: :arg9,
|
136
|
+
wait_flags: :arg10,
|
137
|
+
start_lo: :arg11,
|
138
|
+
init_lo: :arg11,
|
139
|
+
start_hi: :arg12,
|
140
|
+
init_hi: :arg12,
|
141
|
+
start_hiz: :arg13,
|
142
|
+
init_hiz: :arg13,
|
143
|
+
float_pins: :arg14,
|
144
|
+
pinlist: :arg15,
|
145
|
+
measure_mode: :arg16,
|
146
|
+
irange: :arg17,
|
147
|
+
setting_time: :arg18,
|
148
|
+
hi_lo_lim_valid: :arg19,
|
149
|
+
hi_limit: :arg20,
|
150
|
+
lo_limit: :arg21,
|
151
|
+
force_cond_1: :arg22,
|
152
|
+
force_cond_2: :arg23,
|
153
|
+
fload: :arg24,
|
154
|
+
f_load: :arg24,
|
155
|
+
relay_mode: :arg25,
|
156
|
+
wait_time_out: :arg26,
|
157
|
+
start_func_args: :arg27,
|
158
|
+
pre_pat_func_args: :arg28,
|
159
|
+
pre_test_func_args: :arg29,
|
160
|
+
post_test_func_args: :arg30,
|
161
|
+
post_pat_func_args: :arg31,
|
162
|
+
end_func_args: :arg32,
|
163
|
+
pcp_start: :arg33,
|
164
|
+
pcp_check_pg: :arg34,
|
165
|
+
hsp_stop: :arg35,
|
166
|
+
hsp_check_pg: :arg36,
|
167
|
+
sampling_time: :arg37,
|
168
|
+
samples: :arg38,
|
169
|
+
resume_pat: :arg39,
|
170
|
+
vcl: :arg40,
|
171
|
+
vch: :arg41,
|
172
|
+
utility_pins_1: :arg42,
|
173
|
+
utility_pins_0: :arg43,
|
174
|
+
pre_charge_enable: :arg44,
|
175
|
+
pre_charge: :arg45,
|
176
|
+
threading: :arg46
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
# Make readers for each low level attribute
|
181
|
+
ATTRS.each do |attr|
|
182
|
+
attr_reader attr
|
183
|
+
end
|
184
|
+
|
185
|
+
# And the aliases
|
186
|
+
ALIASES.each do |alias_, attr|
|
187
|
+
define_method("#{alias_}") do
|
188
|
+
send(attr)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
def initialize(line, options = {})
|
193
|
+
@parser = options[:parser]
|
194
|
+
@line = line
|
195
|
+
parse
|
196
|
+
if valid?
|
197
|
+
ATTRS.each_with_index do |attr, i|
|
198
|
+
instance_variable_set("@#{attr}", components[i + 1])
|
199
|
+
end
|
200
|
+
if ALIASES[type]
|
201
|
+
ALIASES[type].each do |alias_, attr|
|
202
|
+
define_singleton_method("#{alias_}") do
|
203
|
+
send(attr)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
def inspect # :nodoc:
|
211
|
+
"<TestInstance: #{name}, Type: #{type}>"
|
212
|
+
end
|
213
|
+
|
214
|
+
def description
|
215
|
+
parser.descriptions.test_instance(name: name)
|
216
|
+
end
|
217
|
+
|
218
|
+
def type
|
219
|
+
TYPE_ALIASES[proc_name.downcase.to_sym] || :unsupported
|
220
|
+
end
|
221
|
+
|
222
|
+
def parse
|
223
|
+
@components = @line.split("\t") unless @line.strip.empty?
|
224
|
+
end
|
225
|
+
|
226
|
+
def valid?
|
227
|
+
components[4] && ['Excel Macro', 'VB DLL'].include?(components[4])
|
228
|
+
end
|
229
|
+
|
230
|
+
def components
|
231
|
+
@components ||= []
|
232
|
+
end
|
233
|
+
|
234
|
+
# Returns an array of all pattern names referenced in this test instance
|
235
|
+
def patterns
|
236
|
+
if self.respond_to?(:pattern)
|
237
|
+
pattern.split(',').map do |pat|
|
238
|
+
extract_pattern_from_patset(pat)
|
239
|
+
end.flatten.map { |pat| pat.gsub(/.*[\\\/]/, '').gsub(/\..*/, '') }
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
def extract_pattern_from_patset(patset)
|
244
|
+
pset = parser.pattern_sets.where(name: patset, exact: true)
|
245
|
+
if pset.size > 1
|
246
|
+
puts "Warning multiple pattern sets called #{patset} found, using the first one"
|
247
|
+
end
|
248
|
+
if pset.size == 0
|
249
|
+
patset
|
250
|
+
else
|
251
|
+
pset.first.pattern_names
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
def vdd
|
256
|
+
parser.dc_specs.where(name: 'VDD', exact: true).first.lookup(dc_category, dc_selector)
|
257
|
+
end
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Origen
|
2
|
+
module Tester
|
3
|
+
class Ultraflex
|
4
|
+
class Parser
|
5
|
+
class TestInstances < Origen::Tester::Parser::SearchableHash
|
6
|
+
attr_accessor :parser
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
@parser = options[:parser]
|
10
|
+
end
|
11
|
+
|
12
|
+
def import(file)
|
13
|
+
File.readlines(file).each do |line|
|
14
|
+
l = TestInstance.new(line, parser: parser)
|
15
|
+
self[l.name] = l if l.valid?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def inspect
|
20
|
+
"<TestInstances: #{size}>"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
File without changes
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module Origen
|
2
|
+
module Tester
|
3
|
+
class Ultraflex
|
4
|
+
class Parser
|
5
|
+
autoload :Flows, 'origen/tester/ultraflex/parser/flows'
|
6
|
+
autoload :Flow, 'origen/tester/ultraflex/parser/flow'
|
7
|
+
autoload :FlowLine, 'origen/tester/ultraflex/parser/flow_line'
|
8
|
+
autoload :TestInstances, 'origen/tester/ultraflex/parser/test_instances'
|
9
|
+
autoload :TestInstance, 'origen/tester/ultraflex/parser/test_instance'
|
10
|
+
autoload :PatternSets, 'origen/tester/ultraflex/parser/pattern_sets'
|
11
|
+
autoload :PatternSet, 'origen/tester/ultraflex/parser/pattern_set'
|
12
|
+
autoload :DCSpecs, 'origen/tester/ultraflex/parser/dc_specs'
|
13
|
+
autoload :DCSpec, 'origen/tester/ultraflex/parser/dc_spec'
|
14
|
+
autoload :ACSpecs, 'origen/tester/ultraflex/parser/ac_specs'
|
15
|
+
autoload :ACSpec, 'origen/tester/ultraflex/parser/ac_spec'
|
16
|
+
autoload :Descriptions, 'origen/tester/ultraflex/parser/descriptions'
|
17
|
+
|
18
|
+
def reset
|
19
|
+
@flows = nil
|
20
|
+
@test_instances = nil
|
21
|
+
@pattern_sets = nil
|
22
|
+
@dc_specs = nil
|
23
|
+
@ac_specs = nil
|
24
|
+
end
|
25
|
+
|
26
|
+
def descriptions
|
27
|
+
@descriptions ||= Descriptions.new(parser: self)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns an array of test flows
|
31
|
+
def flows
|
32
|
+
@flows ||= Flows.new(parser: self)
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_instances
|
36
|
+
@test_instances ||= TestInstances.new(parser: self)
|
37
|
+
end
|
38
|
+
alias_method :instances, :test_instances
|
39
|
+
|
40
|
+
def pattern_sets
|
41
|
+
@pattern_sets ||= PatternSets.new(parser: self)
|
42
|
+
end
|
43
|
+
alias_method :patsets, :pattern_sets
|
44
|
+
alias_method :pat_sets, :pattern_sets
|
45
|
+
|
46
|
+
def dc_specs
|
47
|
+
@dc_specs ||= DCSpecs.new(parser: self)
|
48
|
+
end
|
49
|
+
|
50
|
+
def ac_specs
|
51
|
+
@ac_specs ||= ACSpecs.new(parser: self)
|
52
|
+
end
|
53
|
+
|
54
|
+
def inspect
|
55
|
+
"<Parsed Program: Flows: #{flows.size}>"
|
56
|
+
end
|
57
|
+
|
58
|
+
# Parse a file, array of files, or a directory.
|
59
|
+
#
|
60
|
+
# This can be called multiple times to add new files to the
|
61
|
+
# program model.
|
62
|
+
def parse(file)
|
63
|
+
Origen.log.info ''
|
64
|
+
Origen.log.info "Parsing Ultraflex test program from: #{file}"
|
65
|
+
Origen.log.info ''
|
66
|
+
reset
|
67
|
+
# Note use of local file handler here, this should be how it is
|
68
|
+
# done globally, otherwise we can run into hard to debug problems
|
69
|
+
# due to state/reference dir changes in the single Origen.file_handler
|
70
|
+
Origen::FileHandler.new.resolve_files(file) do |f|
|
71
|
+
parse_file(f)
|
72
|
+
end
|
73
|
+
Origen.log.info ''
|
74
|
+
self
|
75
|
+
end
|
76
|
+
|
77
|
+
def parse_file(file)
|
78
|
+
line = File.readlines(file).first
|
79
|
+
begin
|
80
|
+
if line =~ /Flow Table/
|
81
|
+
flows.import(file)
|
82
|
+
elsif line =~ /Instances/
|
83
|
+
test_instances.import(file)
|
84
|
+
elsif line =~ /Pattern Sets/
|
85
|
+
patsets.import(file)
|
86
|
+
elsif line =~ /DC Spec/
|
87
|
+
dc_specs.import(file)
|
88
|
+
else
|
89
|
+
puts "Skipped (un-supported file type): #{file}"
|
90
|
+
end
|
91
|
+
rescue Exception => e
|
92
|
+
if e.is_a?(ArgumentError) && e.message =~ /invalid byte sequence/
|
93
|
+
puts "Skipped (not ASCII): #{file}"
|
94
|
+
else
|
95
|
+
puts e.message
|
96
|
+
puts e.backtrace
|
97
|
+
exit 1
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|