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,65 @@
|
|
1
|
+
module Origen
|
2
|
+
module Tester
|
3
|
+
class V93K
|
4
|
+
module Generator
|
5
|
+
class TestSuites
|
6
|
+
# Origen::Tester::Generator not included since test suites do not have their
|
7
|
+
# own top-level sheet, they will be incorporated within the flow sheet
|
8
|
+
|
9
|
+
attr_accessor :flow, :collection
|
10
|
+
|
11
|
+
def initialize(flow)
|
12
|
+
@flow = flow
|
13
|
+
@collection = []
|
14
|
+
end
|
15
|
+
|
16
|
+
def filename
|
17
|
+
flow.filename
|
18
|
+
end
|
19
|
+
|
20
|
+
def add(name, options = {})
|
21
|
+
check_for_duplicates(name)
|
22
|
+
record_test_suite(name)
|
23
|
+
suite = TestSuite.new(name, options)
|
24
|
+
@collection << suite
|
25
|
+
# c = Origen.interface.consume_comments
|
26
|
+
# Origen.interface.descriptions.add_for_test_definition(name, c)
|
27
|
+
suite
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns true if the given test suite name has already been added to the current flow.
|
31
|
+
#
|
32
|
+
# Pass in :global => true for all test flows to be considered.
|
33
|
+
def duplicate?(name, options = {})
|
34
|
+
files = existing_test_suites[name]
|
35
|
+
if files && !files.empty?
|
36
|
+
options[:global] || files.include?(filename)
|
37
|
+
else
|
38
|
+
false
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def check_for_duplicates(name)
|
45
|
+
if duplicate?(name)
|
46
|
+
error "Duplicate test suite #{name} generated in #{filename}"
|
47
|
+
exit 1
|
48
|
+
elsif duplicate?(name, global: true)
|
49
|
+
warning "Test suite #{name} is duplicated in: #{existing_test_suites[name].join(', ')}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def existing_test_suites
|
54
|
+
@@existing_test_suites ||= {}
|
55
|
+
end
|
56
|
+
|
57
|
+
def record_test_suite(name)
|
58
|
+
existing_test_suites[name] ||= []
|
59
|
+
existing_test_suites[name] << filename
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'active_support/concern'
|
2
|
+
|
3
|
+
module Origen
|
4
|
+
module Tester
|
5
|
+
class V93K
|
6
|
+
module Generator
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
autoload :Flow, 'origen/tester/v93k/generator/flow'
|
10
|
+
autoload :FlowNode, 'origen/tester/v93k/generator/flow_node'
|
11
|
+
autoload :TestFunction, 'origen/tester/v93k/generator/test_function'
|
12
|
+
autoload :TestFunctions, 'origen/tester/v93k/generator/test_functions'
|
13
|
+
autoload :TestMethod, 'origen/tester/v93k/generator/test_method'
|
14
|
+
autoload :TestMethods, 'origen/tester/v93k/generator/test_methods'
|
15
|
+
autoload :TestSuite, 'origen/tester/v93k/generator/test_suite'
|
16
|
+
autoload :TestSuites, 'origen/tester/v93k/generator/test_suites'
|
17
|
+
autoload :Pattern, 'origen/tester/v93k/generator/pattern'
|
18
|
+
autoload :PatternMaster, 'origen/tester/v93k/generator/pattern_master'
|
19
|
+
autoload :Placeholder, 'origen/tester/generator/placeholder'
|
20
|
+
|
21
|
+
included do
|
22
|
+
include Origen::Tester::Interface # adds the interface helpers/Origen hook-up
|
23
|
+
include Origen::Tester::Generator::FlowControlAPI::Interface
|
24
|
+
PLATFORM = Origen::Tester::V93K
|
25
|
+
end
|
26
|
+
|
27
|
+
def flow
|
28
|
+
return @flow if @flow
|
29
|
+
@flow = Flow.new
|
30
|
+
@flow.test_functions ||= TestFunctions.new(@flow)
|
31
|
+
@flow.test_suites ||= TestSuites.new(@flow)
|
32
|
+
@flow.test_methods ||= TestMethods.new(@flow)
|
33
|
+
@flow
|
34
|
+
end
|
35
|
+
|
36
|
+
def pattern_master
|
37
|
+
@pattern_master_file ||= PatternMaster.new
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_functions
|
41
|
+
flow.test_functions
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_suites
|
45
|
+
flow.test_suites
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_methods
|
49
|
+
flow.test_methods
|
50
|
+
end
|
51
|
+
|
52
|
+
def flow_sheets
|
53
|
+
@@flow_sheets ||= {}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Returns an array containing all sheet generators.
|
57
|
+
# All Origen program generators must implement this method
|
58
|
+
def sheet_generators # :nodoc:
|
59
|
+
g = []
|
60
|
+
[flow_sheets].each do |sheets|
|
61
|
+
sheets.each do |_name, sheet|
|
62
|
+
g << sheet
|
63
|
+
end
|
64
|
+
end
|
65
|
+
g
|
66
|
+
end
|
67
|
+
|
68
|
+
# Returns an array containing all flow sheet generators.
|
69
|
+
# All Origen program generators must implement this method
|
70
|
+
def flow_generators
|
71
|
+
g = []
|
72
|
+
flow_sheets.each do |_name, sheet|
|
73
|
+
g << sheet
|
74
|
+
end
|
75
|
+
g
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,420 @@
|
|
1
|
+
Origen.deprecate <<-END
|
2
|
+
The V93K Tester in Origen core is being moved to a dedicated plugin,
|
3
|
+
use Testers::V93K from this plugin instead of Origen::Tester::V93K -
|
4
|
+
http://origen.freescale.net/testers
|
5
|
+
END
|
6
|
+
module Origen
|
7
|
+
module Tester
|
8
|
+
# Tester model to generate .avc patterns for the Verigy 930000
|
9
|
+
#
|
10
|
+
# == Basic Usage
|
11
|
+
# $tester = Origen::Tester::V93K.new
|
12
|
+
# $tester.cycle # Generate a vector
|
13
|
+
#
|
14
|
+
# Many more methods exist to generate V93K specific micro-code, see below for
|
15
|
+
# details.
|
16
|
+
#
|
17
|
+
# Also note that this class includes the base Tester module and so all methods
|
18
|
+
# described there are also available.
|
19
|
+
class V93K
|
20
|
+
include Tester
|
21
|
+
|
22
|
+
autoload :Generator, 'origen/tester/v93k/generator'
|
23
|
+
|
24
|
+
# Returns a new J750 instance, normally there would only ever be one of these
|
25
|
+
# assigned to the global variable such as $tester by your target:
|
26
|
+
# $tester = J750.new
|
27
|
+
def initialize
|
28
|
+
@max_repeat_loop = 65_535
|
29
|
+
@pat_extension = 'avc'
|
30
|
+
@compress = true
|
31
|
+
# @support_repeat_previous = true
|
32
|
+
@match_entries = 10
|
33
|
+
@name = 'v93k'
|
34
|
+
@comment_char = '#'
|
35
|
+
end
|
36
|
+
|
37
|
+
# Capture the pin data from a vector to the tester.
|
38
|
+
#
|
39
|
+
# This method uses the Digital Capture feature (Selective mode) of the V93000 to capture
|
40
|
+
# the data from the given pins on the previous vector.
|
41
|
+
# Note that is does not actually generate a new vector.
|
42
|
+
#
|
43
|
+
# Note also that any drive cycles on the target pins can also be captured, to avoid this
|
44
|
+
# the wavetable should be set up like this to infer a 'D' (Don't Capture) on vectors where
|
45
|
+
# the target pin is being used to drive data:
|
46
|
+
#
|
47
|
+
# PINS nvm_fail
|
48
|
+
# 0 d1:0 r1:D 0
|
49
|
+
# 1 d1:1 r1:D 1
|
50
|
+
# 2 r1:C Capt
|
51
|
+
# 3 r1:D NoCapt
|
52
|
+
#
|
53
|
+
# Sometimes when generating vectors within a loop you may want to apply a capture
|
54
|
+
# retrospectively to a previous vector, passing in an offset option will allow you
|
55
|
+
# to do this.
|
56
|
+
#
|
57
|
+
# ==== Examples
|
58
|
+
# $tester.cycle # This is the vector you want to capture
|
59
|
+
# $tester.store :pin => pin(:fail) # This applys the required opcode to the given pins
|
60
|
+
#
|
61
|
+
# $tester.cycle # This one gets captured
|
62
|
+
# $tester.cycle
|
63
|
+
# $tester.cycle
|
64
|
+
# $tester.store(:pin => pin(:fail), :offset => -2) # Just realized I need to capture that earlier vector
|
65
|
+
#
|
66
|
+
# # Capturing multiple pins:
|
67
|
+
# $tester.cycle
|
68
|
+
# $tester.store :pins => [pin(:fail), pin(:done)]
|
69
|
+
#
|
70
|
+
# Since the V93K store operates on a pin level (rather than vector level as on the J750)
|
71
|
+
# equivalent functionality can also be achieved by setting the store attribute of the pin
|
72
|
+
# itself prior to calling $tester.cycle.
|
73
|
+
# However it is recommended to use the tester API to do the store if cross-compatiblity with
|
74
|
+
# other platforms, such as the J750, is required.
|
75
|
+
def store(*pins)
|
76
|
+
options = pins.last.is_a?(Hash) ? pins.pop : {}
|
77
|
+
options = { offset: 0
|
78
|
+
}.merge(options)
|
79
|
+
pins = pins.flatten.compact
|
80
|
+
if pins.empty?
|
81
|
+
fail 'For the V93K you must supply the pins to store/capture'
|
82
|
+
end
|
83
|
+
pins.each do |pin|
|
84
|
+
pin.restore_state do
|
85
|
+
pin.capture
|
86
|
+
update_vector_pin_val pin, offset: options[:offset]
|
87
|
+
last_vector(options[:offset]).dont_compress = true
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
alias_method :capture, :store
|
92
|
+
|
93
|
+
# Capture the next vector generated to HRAM
|
94
|
+
#
|
95
|
+
# This method applys a store vector (stv) opcode to the next vector to be generated,
|
96
|
+
# note that is does not actually generate a new vector.
|
97
|
+
#
|
98
|
+
# On J750 the pins argument is ignored since the tester only supports whole vector capture.
|
99
|
+
#
|
100
|
+
# @example
|
101
|
+
# $tester.store_next_cycle
|
102
|
+
# $tester.cycle # This is the vector that will be captured
|
103
|
+
def store_next_cycle(*pins)
|
104
|
+
options = pins.last.is_a?(Hash) ? pins.pop : {}
|
105
|
+
options = {
|
106
|
+
}.merge(options)
|
107
|
+
pins = pins.flatten.compact
|
108
|
+
if pins.empty?
|
109
|
+
fail 'For the V93K you must supply the pins to store/capture'
|
110
|
+
end
|
111
|
+
pins.each { |pin| pin.save; pin.capture }
|
112
|
+
# Register this clean up function to be run after the next vector
|
113
|
+
# is generated, cool or what!
|
114
|
+
preset_next_vector do
|
115
|
+
pins.each(&:restore)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
# Start a subroutine.
|
120
|
+
#
|
121
|
+
# Generates a global subroutine label. Global is used to adhere to the best practice of
|
122
|
+
# containing all subroutines in dedicated patterns, e.g. global_subs.atp
|
123
|
+
#
|
124
|
+
# ==== Examples
|
125
|
+
# $tester.start_subroutine("wait_for_done")
|
126
|
+
# < generate your subroutine vectors here >
|
127
|
+
# $tester.end_subroutine
|
128
|
+
def start_subroutine(name)
|
129
|
+
local_subroutines << name.to_s.chomp unless local_subroutines.include?(name.to_s.chomp) || @inhibit_vectors
|
130
|
+
# name += "_subr" unless name =~ /sub/
|
131
|
+
Pattern.open name: name, call_startup_callbacks: false
|
132
|
+
end
|
133
|
+
|
134
|
+
# Ends the current subroutine that was started with a previous call to start_subroutine
|
135
|
+
def end_subroutine(_cond = false)
|
136
|
+
Pattern.close call_shutdown_callbacks: false
|
137
|
+
end
|
138
|
+
|
139
|
+
# Call a subroutine.
|
140
|
+
#
|
141
|
+
# This calls a subroutine immediately following previous vector, it does not
|
142
|
+
# generate a new vector.
|
143
|
+
#
|
144
|
+
# Subroutines should always be called through this method as it ensures a running
|
145
|
+
# log of called subroutines is maintained and which then gets output in the pattern
|
146
|
+
# header to import the right dependencies.
|
147
|
+
#
|
148
|
+
# An offset option is available to make the call on earlier vectors.
|
149
|
+
#
|
150
|
+
# Repeated calls to the same subroutine will automatically be compressed unless
|
151
|
+
# option :suppress_repeated_calls is supplied and set to false. This means that for
|
152
|
+
# the common use case of calling a subroutine to implement an overlay the subroutine
|
153
|
+
# can be called for every bit that has the overlay and the pattern will automatically
|
154
|
+
# generate correctly.
|
155
|
+
#
|
156
|
+
# ==== Examples
|
157
|
+
# $tester.call_subroutine("mysub")
|
158
|
+
# $tester.call_subroutine("my_other_sub", :offset => -1)
|
159
|
+
def call_subroutine(name, options = {})
|
160
|
+
options = {
|
161
|
+
offset: 0,
|
162
|
+
suppress_repeated_calls: true
|
163
|
+
}.merge(options)
|
164
|
+
called_subroutines << name.to_s.chomp unless called_subroutines.include?(name.to_s.chomp) || @inhibit_vectors
|
165
|
+
|
166
|
+
code = "SQPG JSUB #{name};"
|
167
|
+
if !options[:suppress_repeated_calls] ||
|
168
|
+
last_object != code
|
169
|
+
microcode code, offset: (options[:offset] * -1)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Handshake with the tester.
|
174
|
+
#
|
175
|
+
# ==== Examples
|
176
|
+
# $tester.handshake # Pass control to the tester for a measurement
|
177
|
+
def handshake(options = {})
|
178
|
+
options = {
|
179
|
+
}.merge(options)
|
180
|
+
Pattern.split(options)
|
181
|
+
end
|
182
|
+
|
183
|
+
# Do a frequency measure.
|
184
|
+
#
|
185
|
+
# ==== Examples
|
186
|
+
# $tester.freq_count($top.pin(:d_out)) # Freq measure on pin "d_out"
|
187
|
+
def freq_count(_pin, options = {})
|
188
|
+
options = {
|
189
|
+
}.merge(options)
|
190
|
+
Pattern.split(options)
|
191
|
+
end
|
192
|
+
|
193
|
+
# Generates a match loop on up to two pins.
|
194
|
+
#
|
195
|
+
# This method is not really intended to be called directly, rather you should call
|
196
|
+
# via Tester#wait e.g. $tester.wait(:match => true).
|
197
|
+
#
|
198
|
+
# The timeout should be provided in cycles, however when called via the wait method the
|
199
|
+
# time-based helpers (time_in_us, etc) will be converted to cycles for you.
|
200
|
+
# The following options are available to tailor the match loop behavior, defaults in
|
201
|
+
# parenthesis:
|
202
|
+
#
|
203
|
+
# * :pin - The pin object to match on (*required*)
|
204
|
+
# * :state - The pin state to match on, :low or :high (*required*)
|
205
|
+
# * :check_for_fails (false) - Flushes the pipeline and checks for fails prior to the match (to allow binout of fails encountered before the match)
|
206
|
+
# * :pin2 (nil) - Optionally supply a second pin to match on
|
207
|
+
# * :state2 (nil) - State for the second pin (required if :pin2 is supplied)
|
208
|
+
# * :force_fail_on_timeout (true) - Force a vector mis-compare if the match loop times out
|
209
|
+
#
|
210
|
+
# ==== Examples
|
211
|
+
# $tester.wait(:match => true, :time_in_us => 5000, :pin => $top.pin(:done), :state => :high)
|
212
|
+
def match(pin, state, timeout, options = {})
|
213
|
+
options = {
|
214
|
+
check_for_fails: false,
|
215
|
+
pin2: false,
|
216
|
+
state2: false,
|
217
|
+
force_fail_on_timeout: true,
|
218
|
+
global_loops: false,
|
219
|
+
generate_subroutine: false,
|
220
|
+
force_fail_on_timeout: true
|
221
|
+
}.merge(options)
|
222
|
+
|
223
|
+
# Ensure the match pins are don't care by default
|
224
|
+
pin.dont_care
|
225
|
+
options[:pin2].dont_care if options[:pin2]
|
226
|
+
|
227
|
+
# Single condition loops are simple
|
228
|
+
if !options[:pin2]
|
229
|
+
# Use the counted match loop (rather than timed) which is recommended in the V93K docs for new applications
|
230
|
+
# No pre-match failure handling is required here because the system will cleanly record failure info
|
231
|
+
# for this kind of match loop
|
232
|
+
|
233
|
+
cc "for the #{pin.name.upcase} pin to go #{state.to_s.upcase}"
|
234
|
+
number_of_loops = (timeout.to_f / 8).ceil
|
235
|
+
microcode "SQPG MACT #{number_of_loops};"
|
236
|
+
# Strobe the pin for the required state
|
237
|
+
state == :low ? pin.expect_lo! : pin.expect_hi!
|
238
|
+
pin.dont_care
|
239
|
+
# Wait for 7 vectors before re-checking, this keeps the loop to 8 vectors which allows the test results
|
240
|
+
# to be reconstructed cleanly if multiple loops are called in a pattern
|
241
|
+
microcode 'SQPG MRPT 7;'
|
242
|
+
# Not sure if no compression is really required here...
|
243
|
+
7.times do
|
244
|
+
cycle(dont_compress: true)
|
245
|
+
end
|
246
|
+
microcode 'SQPG PADDING;'
|
247
|
+
|
248
|
+
else
|
249
|
+
|
250
|
+
# For two pins do something more like the J750 approach where branching based on miscompares is used
|
251
|
+
# to keep the loop going
|
252
|
+
cc "for the #{pin.name.upcase} pin to go #{state.to_s.upcase}"
|
253
|
+
cc "or the #{options[:pin2].name.upcase} pin to go #{options[:state2].to_s.upcase}"
|
254
|
+
|
255
|
+
if options[:check_for_fails]
|
256
|
+
cc 'Return preserving existing errors if the pattern has already failed before arriving here'
|
257
|
+
cycle(repeat: propagation_delay)
|
258
|
+
microcode 'SQPG RETC 1 1;'
|
259
|
+
end
|
260
|
+
number_of_loops = (timeout.to_f / ((propagation_delay * 2) + 2)).ceil
|
261
|
+
|
262
|
+
loop_vectors number_of_loops do
|
263
|
+
# Check pin 1
|
264
|
+
cc "Check if #{pin.name.upcase} is #{state.to_s.upcase} yet"
|
265
|
+
state == :low ? pin.expect_lo! : pin.expect_hi!
|
266
|
+
pin.dont_care
|
267
|
+
cc 'Wait for failure to propagate'
|
268
|
+
cycle(repeat: propagation_delay)
|
269
|
+
cc 'Exit match loop if pin has matched (no error), otherwise clear error and remain in loop'
|
270
|
+
microcode 'SQPG RETC 0 0;'
|
271
|
+
|
272
|
+
# Check pin 2
|
273
|
+
cc "Check if #{options[:pin2].name.upcase} is #{options[:state2].to_s.upcase} yet"
|
274
|
+
options[:state2] == :low ? options[:pin2].expect_lo! : options[:pin2].expect_hi!
|
275
|
+
options[:pin2].dont_care
|
276
|
+
cc 'Wait for failure to propagate'
|
277
|
+
cycle(repeat: propagation_delay)
|
278
|
+
cc 'Exit match loop if pin has matched (no error), otherwise clear error and remain in loop'
|
279
|
+
microcode 'SQPG RETC 0 0;'
|
280
|
+
end
|
281
|
+
|
282
|
+
if options[:force_fail_on_timeout]
|
283
|
+
cc 'To get here something has gone wrong, strobe again to force a pattern failure'
|
284
|
+
state == :low ? pin.expect_lo : pin.expect_hi
|
285
|
+
options[:state2] == :low ? options[:pin2].expect_lo : options[:pin2].expect_hi if options[:pin2]
|
286
|
+
cycle
|
287
|
+
pin.dont_care
|
288
|
+
options[:pin2].dont_care if options[:pin2]
|
289
|
+
end
|
290
|
+
microcode 'SQPG RSUB;'
|
291
|
+
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
# Returns the number of cycles to wait for any fails to propagate through the pipeline based on
|
296
|
+
# the current timeset
|
297
|
+
def propagation_delay
|
298
|
+
# From 'Calculating the buffer cycles for JMPE and RETC (and match loops)' in SmarTest docs
|
299
|
+
data_queue_buffer = (([105, 64 + ((125 + current_period_in_ns - 1) / current_period_in_ns).ceil].min + 3) * 8) + 72
|
300
|
+
# Don't know how to calculate at runtime, hardcoding these to some default values for now
|
301
|
+
number_of_sites = 128
|
302
|
+
sclk_period = 40
|
303
|
+
prop_delay_buffer = 195 + ((2 * number_of_sites + 3) * (sclk_period / 2))
|
304
|
+
data_queue_buffer + prop_delay_buffer
|
305
|
+
end
|
306
|
+
|
307
|
+
# Add a loop to the pattern.
|
308
|
+
#
|
309
|
+
# Pass in the number of times to execute it, all vectors
|
310
|
+
# generated by the given block will be captured in the loop.
|
311
|
+
#
|
312
|
+
# ==== Examples
|
313
|
+
# $tester.loop_vectors 3 do # Do this 3 times...
|
314
|
+
# $tester.cycle
|
315
|
+
# some_other_method_to_generate_vectors
|
316
|
+
# end
|
317
|
+
#
|
318
|
+
# For compatibility with the J750 you can supply a name as the first argument
|
319
|
+
# and that will simply be ignored when generated for the V93K tester...
|
320
|
+
#
|
321
|
+
# $tester.loop_vectors "my_loop", 3 do # Do this 3 times...
|
322
|
+
# $tester.cycle
|
323
|
+
# some_other_method_to_generate_vectors
|
324
|
+
# end
|
325
|
+
def loop_vectors(name = nil, number_of_loops = 1, _global = false)
|
326
|
+
# The name argument is present to maych J750 API, sort out the
|
327
|
+
unless name.is_a?(String)
|
328
|
+
name, number_of_loops, global = nil, name, number_of_loops
|
329
|
+
end
|
330
|
+
if number_of_loops > 1
|
331
|
+
microcode "SQPG LBGN #{number_of_loops};"
|
332
|
+
yield
|
333
|
+
microcode 'SQPG LEND;'
|
334
|
+
else
|
335
|
+
yield
|
336
|
+
end
|
337
|
+
end
|
338
|
+
alias_method :loop_vector, :loop_vectors
|
339
|
+
|
340
|
+
# An internal method called by Origen to create the pattern header
|
341
|
+
def pattern_header(options = {})
|
342
|
+
options = {
|
343
|
+
}.merge(options)
|
344
|
+
pin_list = ordered_pins.map do |p|
|
345
|
+
if Origen.app.pin_pattern_order.include?(p.id)
|
346
|
+
p.id # specified name overrides pin name
|
347
|
+
else
|
348
|
+
p.name
|
349
|
+
end
|
350
|
+
end.join(' ')
|
351
|
+
microcode "FORMAT #{pin_list};"
|
352
|
+
max_pin_name_length = ordered_pins.map(&:name).max { |a, b| a.length <=> b.length }.length
|
353
|
+
pin_widths = ordered_pins.map { |p| p.size - 1 }
|
354
|
+
|
355
|
+
max_pin_name_length.times do |i|
|
356
|
+
cc((' ' * 50) + ordered_pins.map.with_index { |p, x| ((p.name[i] || ' ') + ' ' * pin_widths[x]).gsub('_', '-') }.join(' '))
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
360
|
+
# An internal method called by Origen to generate the pattern footer
|
361
|
+
def pattern_footer(_options = {})
|
362
|
+
microcode 'SQPG STOP;'
|
363
|
+
end
|
364
|
+
|
365
|
+
# Returns an array of subroutines called while generating the current pattern
|
366
|
+
def called_subroutines
|
367
|
+
@called_subroutines ||= []
|
368
|
+
end
|
369
|
+
|
370
|
+
# Returns an array of subroutines created by the current pattern
|
371
|
+
def local_subroutines # :nodoc:
|
372
|
+
@local_subroutines ||= []
|
373
|
+
end
|
374
|
+
|
375
|
+
# This is an internal method use by Origen which returns a fully formatted vector
|
376
|
+
# You can override this if you wish to change the output formatting at vector level
|
377
|
+
def format_vector(vec)
|
378
|
+
timeset = vec.timeset ? "#{vec.timeset.name}" : ''
|
379
|
+
pin_vals = vec.pin_vals ? "#{vec.pin_vals} ;" : ''
|
380
|
+
if vec.repeat # > 1
|
381
|
+
microcode = "R#{vec.repeat}"
|
382
|
+
else
|
383
|
+
microcode = vec.microcode ? vec.microcode : ''
|
384
|
+
end
|
385
|
+
# if vec.pin_vals && vec.number && vec.cycle_number
|
386
|
+
# comment = " // Vector #{@pattern_vectors}, Cycle #{@pattern_cycles}"
|
387
|
+
# else
|
388
|
+
comment = ''
|
389
|
+
# end
|
390
|
+
"#{microcode.ljust(25)} #{timeset.ljust(25)} #{pin_vals} #{comment}"
|
391
|
+
end
|
392
|
+
|
393
|
+
# All vectors generated with the supplied block will have all pins set
|
394
|
+
# to the repeat previous state. Any pins that are changed state within
|
395
|
+
# the block will still update to the supplied value.
|
396
|
+
# ==== Example
|
397
|
+
# # All pins except invoke will be assigned the repeat previous code
|
398
|
+
# # in the generated vector. On completion of the block they will
|
399
|
+
# # return to their previous state, except for invoke which will
|
400
|
+
# # retain the value assigned within the block.
|
401
|
+
# $tester.repeat_previous do
|
402
|
+
# $top.pin(:invoke).drive(1)
|
403
|
+
# $tester.cycle
|
404
|
+
# end
|
405
|
+
def repeat_previous
|
406
|
+
Origen.app.pin_map.each { |_id, pin| pin.repeat_previous = true }
|
407
|
+
yield
|
408
|
+
Origen.app.pin_map.each { |_id, pin| pin.repeat_previous = false }
|
409
|
+
end
|
410
|
+
|
411
|
+
def before_timeset_change(options = {})
|
412
|
+
microcode "SQPG CTIM #{options[:new].name};"
|
413
|
+
end
|
414
|
+
|
415
|
+
def v93k?
|
416
|
+
true
|
417
|
+
end
|
418
|
+
end
|
419
|
+
end
|
420
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
module Origen
|
2
|
+
module Tester
|
3
|
+
# A simple class to model a vector
|
4
|
+
class Vector
|
5
|
+
attr_accessor :repeat, :microcode, :timeset, :pin_vals,
|
6
|
+
:number, :cycle_number, :dont_compress,
|
7
|
+
:comments
|
8
|
+
|
9
|
+
def initialize(attrs = {})
|
10
|
+
attrs.each do |attribute, value|
|
11
|
+
send("#{attribute}=", value)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def comments
|
16
|
+
@comments ||= []
|
17
|
+
end
|
18
|
+
|
19
|
+
def update(attrs = {})
|
20
|
+
attrs.each do |attribute, value|
|
21
|
+
send("#{attribute}=", value)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Updates the pin values to reflect the value currently held by the given pin
|
26
|
+
def update_pin_val(pin)
|
27
|
+
vals = pin_vals.split(' ')
|
28
|
+
if pin.belongs_to_a_pin_group? && !pin.is_a?(Origen::Pins::PinCollection)
|
29
|
+
port = nil
|
30
|
+
pin.groups.each { |i| port = i[1] if port.nil? && Origen.tester.ordered_pins.include?(i[1]) } # see if group is included in ordered pins
|
31
|
+
if port
|
32
|
+
ix = Origen.tester.ordered_pins.index(port) # find index of port
|
33
|
+
i = port.index(pin)
|
34
|
+
else
|
35
|
+
ix = Origen.tester.ordered_pins.index(pin)
|
36
|
+
i = 0
|
37
|
+
end
|
38
|
+
else
|
39
|
+
ix = Origen.tester.ordered_pins.index(pin)
|
40
|
+
i = 0
|
41
|
+
end
|
42
|
+
|
43
|
+
if Origen.pin_bank.pin_groups.keys.include? pin.id
|
44
|
+
val = pin.map { |p| Origen.tester.format_pin_state(p) }.join('')
|
45
|
+
vals[ix] = val
|
46
|
+
else
|
47
|
+
val = Origen.tester.format_pin_state(pin)
|
48
|
+
vals[ix][i] = val
|
49
|
+
end
|
50
|
+
|
51
|
+
self.pin_vals = vals.join(' ')
|
52
|
+
end
|
53
|
+
|
54
|
+
def ordered_pins
|
55
|
+
Origen.app.pin_map.sort_by { |_id, pin| pin.order }.map { |_id, pin| pin }
|
56
|
+
end
|
57
|
+
|
58
|
+
def microcode=(val)
|
59
|
+
if has_microcode? && @microcode != val
|
60
|
+
fail "Trying to assign microcode: #{val}, but vector already has microcode: #{@microcode}"
|
61
|
+
else
|
62
|
+
@microcode = val
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Since repeat 0 is non-intuitive every vector implicitly has a repeat of 1
|
67
|
+
def repeat
|
68
|
+
@repeat || 1
|
69
|
+
end
|
70
|
+
|
71
|
+
def has_microcode?
|
72
|
+
@microcode && !@microcode.empty?
|
73
|
+
end
|
74
|
+
|
75
|
+
def ==(obj)
|
76
|
+
if obj.is_a?(Vector)
|
77
|
+
self.has_microcode? == obj.has_microcode? &&
|
78
|
+
timeset == obj.timeset &&
|
79
|
+
pin_vals == obj.pin_vals
|
80
|
+
else
|
81
|
+
super obj
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|