origen 0.2.6 → 0.3.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/bin/origen +3 -1
- data/config/boot.rb +1 -7
- data/config/commands.rb +0 -1
- data/config/version.rb +2 -2
- data/lib/c99/{j750_interface.rb → ate_interface.rb} +3 -11
- data/lib/c99/doc_interface.rb +1 -1
- data/lib/origen.rb +9 -30
- data/lib/origen/application.rb +10 -8
- data/lib/origen/application/configuration.rb +13 -26
- data/lib/origen/application/plugins.rb +122 -0
- data/lib/origen/application/plugins_manager.rb +16 -254
- data/lib/origen/application/release.rb +2 -2
- data/lib/origen/application/runner.rb +2 -4
- data/lib/origen/chips.rb +0 -0
- data/lib/origen/chips/chip.rb +0 -0
- data/lib/origen/chips/design_entry.rb +0 -0
- data/lib/origen/chips/doc_entry.rb +0 -0
- data/lib/origen/chips/note.rb +0 -0
- data/lib/origen/commands.rb +4 -44
- data/lib/origen/commands/compile.rb +1 -2
- data/lib/origen/commands/generate.rb +1 -1
- data/lib/origen/commands/interactive.rb +1 -2
- data/lib/origen/commands/plugin.rb +49 -56
- data/lib/origen/commands/program.rb +1 -1
- data/lib/origen/commands/rc.rb +2 -2
- data/lib/origen/commands/version.rb +2 -17
- data/lib/origen/commands_global.rb +3 -0
- data/lib/origen/file_handler.rb +10 -10
- data/lib/origen/generator.rb +1 -1
- data/lib/origen/generator/job.rb +1 -1
- data/lib/origen/generator/pattern.rb +2 -2
- data/lib/origen/generator/pattern_finder.rb +10 -9
- data/lib/origen/pins/pin.rb +0 -0
- data/lib/origen/regression_manager.rb +0 -0
- data/lib/origen/remote_manager.rb +2 -8
- data/lib/origen/revision_control/design_sync.rb +0 -0
- data/lib/origen/revision_control/git.rb +0 -0
- data/lib/origen/specs.rb +0 -0
- data/lib/origen/specs/checkers.rb +0 -0
- data/lib/origen/specs/creation_info.rb +0 -0
- data/lib/origen/specs/exhibit.rb +0 -0
- data/lib/origen/specs/spec.rb +0 -0
- data/lib/origen/utility.rb +0 -1
- data/lib/origen/utility/diff.rb +0 -0
- metadata +42 -119
- data/lib/origen/import_manager.rb +0 -596
- data/lib/origen/nvm.rb +0 -6
- data/lib/origen/nvm/block_array.rb +0 -72
- data/lib/origen/tester.rb +0 -56
- data/lib/origen/tester/api.rb +0 -277
- data/lib/origen/tester/bdm/bdm.rb +0 -25
- data/lib/origen/tester/doc/doc.rb +0 -226
- data/lib/origen/tester/doc/generator.rb +0 -126
- data/lib/origen/tester/doc/generator/flow.rb +0 -71
- data/lib/origen/tester/doc/generator/flow_line.rb +0 -203
- data/lib/origen/tester/doc/generator/test.rb +0 -68
- data/lib/origen/tester/doc/generator/test_group.rb +0 -66
- data/lib/origen/tester/doc/generator/tests.rb +0 -47
- data/lib/origen/tester/doc/model.rb +0 -162
- data/lib/origen/tester/generator.rb +0 -271
- data/lib/origen/tester/generator/flow_control_api.rb +0 -606
- data/lib/origen/tester/generator/identity_map.rb +0 -25
- data/lib/origen/tester/generator/placeholder.rb +0 -13
- data/lib/origen/tester/generator/test_numberer.rb +0 -25
- data/lib/origen/tester/interface.rb +0 -154
- data/lib/origen/tester/j750/files.rb +0 -45
- data/lib/origen/tester/j750/generator.rb +0 -203
- data/lib/origen/tester/j750/generator/flow.rb +0 -123
- data/lib/origen/tester/j750/generator/flow_line.rb +0 -288
- data/lib/origen/tester/j750/generator/patgroup.rb +0 -111
- data/lib/origen/tester/j750/generator/patgroups.rb +0 -41
- data/lib/origen/tester/j750/generator/patset.rb +0 -111
- data/lib/origen/tester/j750/generator/patsets.rb +0 -41
- data/lib/origen/tester/j750/generator/templates/flow.txt.erb +0 -9
- data/lib/origen/tester/j750/generator/templates/instances.txt.erb +0 -16
- data/lib/origen/tester/j750/generator/templates/patgroups.txt.erb +0 -8
- data/lib/origen/tester/j750/generator/templates/patsets.txt.erb +0 -10
- data/lib/origen/tester/j750/generator/test_instance.rb +0 -846
- data/lib/origen/tester/j750/generator/test_instance_group.rb +0 -60
- data/lib/origen/tester/j750/generator/test_instances.rb +0 -182
- data/lib/origen/tester/j750/j750.rb +0 -845
- data/lib/origen/tester/j750/j750_hpt.rb +0 -35
- data/lib/origen/tester/j750/parser.rb +0 -104
- data/lib/origen/tester/j750/parser/ac_spec.rb +0 -11
- data/lib/origen/tester/j750/parser/ac_specs.rb +0 -0
- data/lib/origen/tester/j750/parser/dc_spec.rb +0 -36
- data/lib/origen/tester/j750/parser/dc_specs.rb +0 -50
- data/lib/origen/tester/j750/parser/descriptions.rb +0 -340
- data/lib/origen/tester/j750/parser/flow.rb +0 -111
- data/lib/origen/tester/j750/parser/flow_line.rb +0 -207
- data/lib/origen/tester/j750/parser/flows.rb +0 -23
- data/lib/origen/tester/j750/parser/pattern_set.rb +0 -94
- data/lib/origen/tester/j750/parser/pattern_sets.rb +0 -33
- data/lib/origen/tester/j750/parser/test_instance.rb +0 -322
- data/lib/origen/tester/j750/parser/test_instances.rb +0 -26
- data/lib/origen/tester/j750/parser/timeset.rb +0 -15
- data/lib/origen/tester/j750/parser/timesets.rb +0 -0
- data/lib/origen/tester/jlink/jlink.rb +0 -33
- data/lib/origen/tester/parser.rb +0 -24
- data/lib/origen/tester/parser/description_lookup.rb +0 -64
- data/lib/origen/tester/parser/searchable_array.rb +0 -32
- data/lib/origen/tester/parser/searchable_hash.rb +0 -32
- data/lib/origen/tester/time.rb +0 -338
- data/lib/origen/tester/timing.rb +0 -253
- data/lib/origen/tester/ultraflex/files.rb +0 -45
- data/lib/origen/tester/ultraflex/generator.rb +0 -200
- data/lib/origen/tester/ultraflex/generator/flow.rb +0 -119
- data/lib/origen/tester/ultraflex/generator/flow_line.rb +0 -269
- data/lib/origen/tester/ultraflex/generator/patgroup.rb +0 -111
- data/lib/origen/tester/ultraflex/generator/patgroups.rb +0 -41
- data/lib/origen/tester/ultraflex/generator/patset.rb +0 -111
- data/lib/origen/tester/ultraflex/generator/patsets.rb +0 -41
- data/lib/origen/tester/ultraflex/generator/templates/flow.txt.erb +0 -9
- data/lib/origen/tester/ultraflex/generator/templates/instances.txt.erb +0 -16
- data/lib/origen/tester/ultraflex/generator/templates/patgroups.txt.erb +0 -8
- data/lib/origen/tester/ultraflex/generator/templates/patsets.txt.erb +0 -10
- data/lib/origen/tester/ultraflex/generator/test_instance.rb +0 -622
- data/lib/origen/tester/ultraflex/generator/test_instance_group.rb +0 -60
- data/lib/origen/tester/ultraflex/generator/test_instances.rb +0 -174
- data/lib/origen/tester/ultraflex/parser.rb +0 -104
- data/lib/origen/tester/ultraflex/parser/ac_spec.rb +0 -11
- data/lib/origen/tester/ultraflex/parser/ac_specs.rb +0 -0
- data/lib/origen/tester/ultraflex/parser/dc_spec.rb +0 -36
- data/lib/origen/tester/ultraflex/parser/dc_specs.rb +0 -50
- data/lib/origen/tester/ultraflex/parser/descriptions.rb +0 -342
- data/lib/origen/tester/ultraflex/parser/flow.rb +0 -111
- data/lib/origen/tester/ultraflex/parser/flow_line.rb +0 -207
- data/lib/origen/tester/ultraflex/parser/flows.rb +0 -23
- data/lib/origen/tester/ultraflex/parser/pattern_set.rb +0 -94
- data/lib/origen/tester/ultraflex/parser/pattern_sets.rb +0 -33
- data/lib/origen/tester/ultraflex/parser/test_instance.rb +0 -262
- data/lib/origen/tester/ultraflex/parser/test_instances.rb +0 -26
- data/lib/origen/tester/ultraflex/parser/timeset.rb +0 -15
- data/lib/origen/tester/ultraflex/parser/timesets.rb +0 -0
- data/lib/origen/tester/ultraflex/ultraflex.rb +0 -759
- data/lib/origen/tester/v93k/generator.rb +0 -80
- data/lib/origen/tester/v93k/generator/flow.rb +0 -63
- data/lib/origen/tester/v93k/generator/flow_node.rb +0 -17
- data/lib/origen/tester/v93k/generator/flow_node/print.rb +0 -10
- data/lib/origen/tester/v93k/generator/pattern.rb +0 -16
- data/lib/origen/tester/v93k/generator/pattern_master.rb +0 -54
- data/lib/origen/tester/v93k/generator/templates/_test_method.txt.erb +0 -6
- data/lib/origen/tester/v93k/generator/templates/_test_suite.txt.erb +0 -11
- data/lib/origen/tester/v93k/generator/templates/template.flow.erb +0 -121
- data/lib/origen/tester/v93k/generator/templates/template.pmfl.erb +0 -9
- data/lib/origen/tester/v93k/generator/test_function.rb +0 -103
- data/lib/origen/tester/v93k/generator/test_functions.rb +0 -79
- data/lib/origen/tester/v93k/generator/test_method.rb +0 -46
- data/lib/origen/tester/v93k/generator/test_methods.rb +0 -75
- data/lib/origen/tester/v93k/generator/test_suite.rb +0 -54
- data/lib/origen/tester/v93k/generator/test_suites.rb +0 -65
- data/lib/origen/tester/v93k/v93k.rb +0 -420
- data/lib/origen/tester/vector.rb +0 -86
- data/lib/origen/tester/vector_generator.rb +0 -637
- data/lib/origen/tester/vector_pipeline.rb +0 -150
- data/lib/origen/utility/design_sync.rb +0 -494
- data/lib/origen/version_checker.rb +0 -117
data/lib/origen/nvm.rb
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
module Origen
|
|
2
|
-
module NVM
|
|
3
|
-
# A block array is a standard Ruby array that has been enhanced with additional
|
|
4
|
-
# methods related to the fact that it is intended to hold NVM block objects.
|
|
5
|
-
#
|
|
6
|
-
# This for example allows a block select value to be automatically generated for
|
|
7
|
-
# whatever blocks are contained in the array by calling the bsel method.
|
|
8
|
-
class BlockArray < ::Array
|
|
9
|
-
# Return all single blocks wrapped in a block array
|
|
10
|
-
def [](ix)
|
|
11
|
-
BlockArray.new << super(ix)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# Extract a subset of blocks based on ids
|
|
15
|
-
#
|
|
16
|
-
# $nvm.blocks.find(0,3)
|
|
17
|
-
#
|
|
18
|
-
# An elegant way to implement this is via an accessor like this on your top-level
|
|
19
|
-
# object which owns the blocks:
|
|
20
|
-
#
|
|
21
|
-
# def blocks(*args)
|
|
22
|
-
# if args.empty?
|
|
23
|
-
# @blocks
|
|
24
|
-
# else
|
|
25
|
-
# @blocks.find(*args)
|
|
26
|
-
# end
|
|
27
|
-
# end
|
|
28
|
-
# alias :block :blocks
|
|
29
|
-
#
|
|
30
|
-
# This provides the following API:
|
|
31
|
-
#
|
|
32
|
-
# $nvm.blocks # Returns all blocks
|
|
33
|
-
# $nvm.block(0) # Returns block 0 wrapped in a block array
|
|
34
|
-
# $nvm.blocks(0, 3) # Returns blocks 0 and 3 wrapped in a block array
|
|
35
|
-
def find(*ids)
|
|
36
|
-
b = BlockArray.new
|
|
37
|
-
ids.each do |id|
|
|
38
|
-
b << self[id]
|
|
39
|
-
end
|
|
40
|
-
b
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# def method_missing(method, *args, &blk)
|
|
44
|
-
# if self.size == 1
|
|
45
|
-
# self.first.send(method, *args, &blk)
|
|
46
|
-
# else
|
|
47
|
-
# super
|
|
48
|
-
# end
|
|
49
|
-
# end
|
|
50
|
-
|
|
51
|
-
# Returns the block select value required to select all contained blocks, the block object
|
|
52
|
-
# must implement a method called bsel for this to work
|
|
53
|
-
def bsel
|
|
54
|
-
reduce(0) { |bsels, block| bsels | block.bsel }
|
|
55
|
-
end
|
|
56
|
-
alias_method :block_select, :bsel
|
|
57
|
-
alias_method :block_select_value, :bsel
|
|
58
|
-
|
|
59
|
-
# Returns the sum of the size of all contained blocks in KB, the block object must implement
|
|
60
|
-
# a method called size_in_kb for this to work
|
|
61
|
-
def size_in_kb
|
|
62
|
-
reduce(0) { |sum, block| sum + block.size_in_kb }
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
# Returns the sum of the size of all contained blocks in bytes, the block object must implement
|
|
66
|
-
# a method called size_in_kb for this to work
|
|
67
|
-
def size_in_bytes
|
|
68
|
-
size_in_kb * 1024
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
data/lib/origen/tester.rb
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
require 'active_support/concern'
|
|
2
|
-
module Origen
|
|
3
|
-
module Tester
|
|
4
|
-
autoload :J750, 'origen/tester/j750/j750'
|
|
5
|
-
autoload :J750_HPT, 'origen/tester/j750/j750_hpt'
|
|
6
|
-
autoload :Ultraflex, 'origen/tester/ultraflex/ultraflex'
|
|
7
|
-
autoload :V93K, 'origen/tester/v93k/v93k'
|
|
8
|
-
autoload :BDM, 'origen/tester/bdm/bdm'
|
|
9
|
-
autoload :JLink, 'origen/tester/jlink/jlink'
|
|
10
|
-
autoload :Doc, 'origen/tester/doc/doc'
|
|
11
|
-
|
|
12
|
-
autoload :Vector, 'origen/tester/vector'
|
|
13
|
-
autoload :VectorPipeline, 'origen/tester/vector_pipeline'
|
|
14
|
-
autoload :CommandBasedTester, 'origen/tester/command_based_tester'
|
|
15
|
-
autoload :Interface, 'origen/tester/interface'
|
|
16
|
-
autoload :Generator, 'origen/tester/generator'
|
|
17
|
-
autoload :Parser, 'origen/tester/parser'
|
|
18
|
-
autoload :Time, 'origen/tester/time'
|
|
19
|
-
|
|
20
|
-
extend ActiveSupport::Concern
|
|
21
|
-
|
|
22
|
-
require 'origen/tester/vector_generator'
|
|
23
|
-
require 'origen/tester/timing'
|
|
24
|
-
require 'origen/tester/api'
|
|
25
|
-
|
|
26
|
-
include VectorGenerator
|
|
27
|
-
include Timing
|
|
28
|
-
include API
|
|
29
|
-
|
|
30
|
-
included do
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
module ClassMethods # :nodoc:
|
|
34
|
-
# This overrides the new method of any class which includes this
|
|
35
|
-
# module to force the newly created instance to be registered as
|
|
36
|
-
# a tester with Origen
|
|
37
|
-
def new(*args, &block) # :nodoc:
|
|
38
|
-
if Origen.app.with_doc_tester?
|
|
39
|
-
x = Origen::Tester::Doc.allocate
|
|
40
|
-
if Origen.app.with_html_doc_tester?
|
|
41
|
-
x.html_mode = true
|
|
42
|
-
end
|
|
43
|
-
else
|
|
44
|
-
x = allocate
|
|
45
|
-
end
|
|
46
|
-
x.send(:initialize, *args, &block)
|
|
47
|
-
x.register_tester
|
|
48
|
-
x
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def register_tester # :nodoc:
|
|
53
|
-
Origen.app.tester = self
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
data/lib/origen/tester/api.rb
DELETED
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
module Origen
|
|
2
|
-
module Tester
|
|
3
|
-
# This module implements the basic set of methods that a tester must have
|
|
4
|
-
# in order for Origen to talk to it.
|
|
5
|
-
#
|
|
6
|
-
# They can be overridden by tester specific classes and who may go on to add
|
|
7
|
-
# additional methods of their own.
|
|
8
|
-
#
|
|
9
|
-
# Essentially this API means that any class that includes Origen::Tester will
|
|
10
|
-
# function as a tester, although it might not do very much!
|
|
11
|
-
module API
|
|
12
|
-
attr_accessor :includes
|
|
13
|
-
attr_accessor :comment_level
|
|
14
|
-
attr_accessor :generating
|
|
15
|
-
attr_accessor :inhibit_comments
|
|
16
|
-
attr_accessor :inhibit_vectors
|
|
17
|
-
|
|
18
|
-
def name
|
|
19
|
-
@name || self.class
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def generate?
|
|
23
|
-
true
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def generating_pattern?
|
|
27
|
-
@generating == :pattern
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def generating_program?
|
|
31
|
-
@generating == :program
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def pat_extension
|
|
35
|
-
@pat_extension || 'txt'
|
|
36
|
-
end
|
|
37
|
-
alias_method :pattern_extension, :pat_extension
|
|
38
|
-
|
|
39
|
-
def comment_char
|
|
40
|
-
@comment_char || '//'
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def program_comment_char
|
|
44
|
-
@program_comment_char || comment_char
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def pattern_header(*_args)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def pattern_footer(*_args)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def step_comment_prefix
|
|
54
|
-
@step_comment_prefix || '##'
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def is_vector_based?
|
|
58
|
-
return @vector_based if defined?(@vector_based)
|
|
59
|
-
true
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def is_command_based?
|
|
63
|
-
!is_vector_based?
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def j750?
|
|
67
|
-
false
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def v93k?
|
|
71
|
-
false
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def ultraflex?
|
|
75
|
-
false
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def doc?
|
|
79
|
-
false
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def j750_hpt?
|
|
83
|
-
false
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
def annotate(_msg, _options = {})
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
# Ignore fails on the given pins for the duration of the given block, this
|
|
90
|
-
# has the effect of temporarily setting the states of the given pins to
|
|
91
|
-
# don't care.
|
|
92
|
-
def ignore_fails(*pins)
|
|
93
|
-
pins.each(&:suspend)
|
|
94
|
-
yield
|
|
95
|
-
pins.each(&:resume)
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
# Output a comment in the pattern, normally you would not call this directly
|
|
99
|
-
# and instead use these shorthand methods:
|
|
100
|
-
# cc "Some comment"
|
|
101
|
-
# ss "A single line step comment"
|
|
102
|
-
# step_comment do
|
|
103
|
-
# cc "A multi line"
|
|
104
|
-
# cc "step comment"
|
|
105
|
-
# end
|
|
106
|
-
def c1(msg, _options = {})
|
|
107
|
-
prefix = comment_char + ' '
|
|
108
|
-
prefix += step_comment_prefix + ' ' if @step_comment_on
|
|
109
|
-
push_comment(prefix + msg.to_s)
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def c2(msg, options = {})
|
|
113
|
-
c1(msg, options)
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
def pattern_section(msg)
|
|
117
|
-
if generating_program?
|
|
118
|
-
yield
|
|
119
|
-
else
|
|
120
|
-
step_comment(msg)
|
|
121
|
-
yield
|
|
122
|
-
end
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
def ss(msg = nil)
|
|
126
|
-
div = step_comment_prefix.length
|
|
127
|
-
div = 1 if div == 0
|
|
128
|
-
c1(step_comment_prefix * (70 / div))
|
|
129
|
-
@step_comment_on = true
|
|
130
|
-
if block_given?
|
|
131
|
-
yield
|
|
132
|
-
else
|
|
133
|
-
c1(msg)
|
|
134
|
-
end
|
|
135
|
-
@step_comment_on = false
|
|
136
|
-
c1(step_comment_prefix * (70 / div))
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
def snip(_number, _options = {})
|
|
140
|
-
yield
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
# Allows a section to be run without actually generating any vectors. This can be useful
|
|
144
|
-
# to ensure the pin states end up as they otherwise would have if the section had been run.
|
|
145
|
-
# Classic example of this is a subroutine pattern, wrap this around a call to the startup
|
|
146
|
-
# routine to ensure the pin states are as they would have been immediately after the startup.
|
|
147
|
-
# ==== Example
|
|
148
|
-
# # Setup state as if I had run startup without actually doing so
|
|
149
|
-
# $tester.inhibit_vectors_and_comments do
|
|
150
|
-
# $soc.startup
|
|
151
|
-
# $top.startup
|
|
152
|
-
# end
|
|
153
|
-
def inhibit_vectors_and_comments
|
|
154
|
-
inhibit_vectors = @inhibit_vectors
|
|
155
|
-
inhibit_comments = @inhibit_comments
|
|
156
|
-
@inhibit_vectors = true
|
|
157
|
-
@inhibit_comments = true
|
|
158
|
-
yield
|
|
159
|
-
@inhibit_vectors = inhibit_vectors # Restore to their initial state
|
|
160
|
-
@inhibit_comments = inhibit_comments
|
|
161
|
-
end
|
|
162
|
-
|
|
163
|
-
# @see inhibit_vectors_and_comments
|
|
164
|
-
def inhibit_vectors
|
|
165
|
-
inhibit_vectors = @inhibit_vectors
|
|
166
|
-
@inhibit_vectors = true
|
|
167
|
-
yield
|
|
168
|
-
@inhibit_vectors = inhibit_vectors # Restore to their initial state
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
# @see inhibit_vectors_and_comments
|
|
172
|
-
def inhibit_comments
|
|
173
|
-
inhibit_comments = @inhibit_comments
|
|
174
|
-
@inhibit_comments = true
|
|
175
|
-
yield
|
|
176
|
-
@inhibit_comments = inhibit_comments
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
# Generate a vector.
|
|
180
|
-
# Calling this method will generate a vector in the output pattern based on the
|
|
181
|
-
# current pin states and timeset.
|
|
182
|
-
def cycle(options = {})
|
|
183
|
-
options = {
|
|
184
|
-
microcode: '',
|
|
185
|
-
timeset: current_timeset,
|
|
186
|
-
pin_vals: current_pin_vals,
|
|
187
|
-
repeat: nil
|
|
188
|
-
}.merge(options)
|
|
189
|
-
|
|
190
|
-
if any_clocks_running?
|
|
191
|
-
update_running_clocks
|
|
192
|
-
if options[:repeat]
|
|
193
|
-
slice_repeats(options).each do |slice|
|
|
194
|
-
options[:repeat] = slice[0]
|
|
195
|
-
delay(options.delete(:repeat), options) do |options|
|
|
196
|
-
push_vector(options)
|
|
197
|
-
end
|
|
198
|
-
slice[1].each { |clock_pin_name| clocks_running[clock_pin_name].toggle_clock }
|
|
199
|
-
options[:pin_vals] = current_pin_vals
|
|
200
|
-
end
|
|
201
|
-
else
|
|
202
|
-
push_vector(options)
|
|
203
|
-
pins_need_toggling.each { |clock_pin_name| clocks_running[clock_pin_name].toggle_clock }
|
|
204
|
-
end
|
|
205
|
-
else
|
|
206
|
-
if options[:repeat]
|
|
207
|
-
delay(options.delete(:repeat), options) do |options|
|
|
208
|
-
push_vector(options)
|
|
209
|
-
end
|
|
210
|
-
else
|
|
211
|
-
push_vector(options)
|
|
212
|
-
end
|
|
213
|
-
end
|
|
214
|
-
end
|
|
215
|
-
|
|
216
|
-
def import_test_time(_file, _options = {})
|
|
217
|
-
puts "Sorry but an importer doesn't exist for: #{Origen.tester.class}"
|
|
218
|
-
end
|
|
219
|
-
|
|
220
|
-
def any_clocks_running?
|
|
221
|
-
@clocks_running.nil? ? false : @clocks_running.count > 0
|
|
222
|
-
end
|
|
223
|
-
|
|
224
|
-
def clocks_running
|
|
225
|
-
@clocks_running
|
|
226
|
-
end
|
|
227
|
-
alias_method :running_clocks, :clocks_running
|
|
228
|
-
|
|
229
|
-
def push_running_clock(pin)
|
|
230
|
-
@clocks_running.nil? ? @clocks_running = { pin.name.to_s => pin } : @clocks_running[pin.name.to_s] = pin
|
|
231
|
-
end
|
|
232
|
-
|
|
233
|
-
def pop_running_clock(pin)
|
|
234
|
-
fail "ERROR: No clocks running, doesn't make sense to pop one" unless any_clocks_running?
|
|
235
|
-
@clocks_running.delete(pin.name.to_s)
|
|
236
|
-
end
|
|
237
|
-
|
|
238
|
-
def slice_repeats(options = {})
|
|
239
|
-
slices = {}
|
|
240
|
-
repeat_ary = []
|
|
241
|
-
clocks_running.each do |name, clock_pin|
|
|
242
|
-
if clock_pin.next_edge < (cycle_count + options[:repeat])
|
|
243
|
-
pin_slices = (clock_pin.next_edge..(cycle_count + options[:repeat])).step(clock_pin.half_period).to_a
|
|
244
|
-
pin_slices.insert(0, cycle_count)
|
|
245
|
-
else
|
|
246
|
-
pin_slices = [cycle_count]
|
|
247
|
-
end
|
|
248
|
-
pin_slices.each do |cycle|
|
|
249
|
-
slices[cycle].nil? ? slices[cycle] = name : slices[cycle] = "#{slices[cycle]},#{name}"
|
|
250
|
-
end
|
|
251
|
-
slices[cycle_count + options[:repeat]] = '' if pin_slices[-1] != cycle_count + options[:repeat]
|
|
252
|
-
end
|
|
253
|
-
slices.keys.sort.each do |edge_cycles|
|
|
254
|
-
# puts "Toggle #{slices[edge_cycles]} on #{edge_cycles}"
|
|
255
|
-
repeat_ary.push([edge_cycles, slices[edge_cycles].split(',')])
|
|
256
|
-
end
|
|
257
|
-
|
|
258
|
-
(repeat_ary.count - 1).downto(1).each { |i| repeat_ary[i][0] = repeat_ary[i][0] - repeat_ary[i - 1][0] }
|
|
259
|
-
repeat_ary[1..-1]
|
|
260
|
-
end
|
|
261
|
-
|
|
262
|
-
def pins_need_toggling
|
|
263
|
-
toggle_ary = []
|
|
264
|
-
clocks_running.each do |name, clock_pin|
|
|
265
|
-
toggle_ary.push("#{name}") if clock_pin.next_edge == cycle_count
|
|
266
|
-
end
|
|
267
|
-
toggle_ary
|
|
268
|
-
end
|
|
269
|
-
|
|
270
|
-
def update_running_clocks
|
|
271
|
-
clocks_running.each do |_name, clock_pin|
|
|
272
|
-
clock_pin.update_clock
|
|
273
|
-
end
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
|
-
end
|
|
277
|
-
end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
module Origen
|
|
2
|
-
module Tester
|
|
3
|
-
class BDM < CommandBasedTester
|
|
4
|
-
def initialize
|
|
5
|
-
super
|
|
6
|
-
# The minimum time unit is 0.1s
|
|
7
|
-
set_timeset('default', 100_000_000)
|
|
8
|
-
@pat_extension = 'cmd'
|
|
9
|
-
@comment_char = '//'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def delay(cycles)
|
|
13
|
-
microcode "WAIT #{cycles_to_ts(cycles)}"
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def write_byte(address, data)
|
|
17
|
-
microcode "WB 0x#{address.to_s(16).upcase} 0x#{data.to_s(16).upcase}"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def write_word(address, data)
|
|
21
|
-
microcode "WW 0x#{address.to_s(16).upcase} 0x#{data.to_s(16).upcase}"
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
module Origen
|
|
2
|
-
module Tester
|
|
3
|
-
# Tester model to generate test program documentation from your pattern sources.
|
|
4
|
-
# This is intended to be a drop in replacement for existing testers and instead
|
|
5
|
-
# of generating patterns or test program sheets it will generate a document object
|
|
6
|
-
# which you can then render out via a template or manually.
|
|
7
|
-
class Doc
|
|
8
|
-
include Tester
|
|
9
|
-
|
|
10
|
-
autoload :Generator, 'origen/tester/doc/generator'
|
|
11
|
-
autoload :Model, 'origen/tester/doc/model'
|
|
12
|
-
|
|
13
|
-
attr_accessor :html_mode
|
|
14
|
-
|
|
15
|
-
def generate?
|
|
16
|
-
html_mode
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def initialize(*_args)
|
|
20
|
-
@pat_extension = 'md'
|
|
21
|
-
@indent = 0
|
|
22
|
-
@snip_counters = []
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# Snip the number of comment lines generated by the contained block
|
|
26
|
-
# to the number given, this is useful for keeping files sizes down and
|
|
27
|
-
# is typically used to snip sections like downloading LRE code.
|
|
28
|
-
def snip(number, _options = {})
|
|
29
|
-
@snip_counters.push number + 1
|
|
30
|
-
yield
|
|
31
|
-
@snip_counters.pop
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def pc(msg)
|
|
35
|
-
if @snip_counters.last
|
|
36
|
-
if @snip_counters.last == 1
|
|
37
|
-
@snip_counters[@snip_counters.size - 1] = 0
|
|
38
|
-
msg = ' ...snipped'
|
|
39
|
-
elsif @snip_counters.last == 0
|
|
40
|
-
return
|
|
41
|
-
else
|
|
42
|
-
@snip_counters[@snip_counters.size - 1] -= 1
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
if html_mode
|
|
46
|
-
push_comment(msg)
|
|
47
|
-
else
|
|
48
|
-
Origen.log.info((' ' * @indent) + msg)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def c1(msg, options = {})
|
|
53
|
-
if generating_program?
|
|
54
|
-
Origen.interface.doc_comments_capture(msg)
|
|
55
|
-
else
|
|
56
|
-
unless @inhibit_comments
|
|
57
|
-
options = {
|
|
58
|
-
prefix: true
|
|
59
|
-
}.merge(options)
|
|
60
|
-
if @step_comment_on
|
|
61
|
-
open_text_block
|
|
62
|
-
if options[:prefix]
|
|
63
|
-
pc "# #{msg}"
|
|
64
|
-
else
|
|
65
|
-
pc "#{msg}"
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
def c2(msg, options = {})
|
|
73
|
-
unless @inhibit_comments
|
|
74
|
-
options = {
|
|
75
|
-
prefix: true
|
|
76
|
-
}.merge(options)
|
|
77
|
-
open_text_block
|
|
78
|
-
if options[:prefix]
|
|
79
|
-
pc "# #{msg}"
|
|
80
|
-
else
|
|
81
|
-
pc "#{msg}"
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
def annotate(msg, _options)
|
|
87
|
-
unless @inhibit_comments
|
|
88
|
-
if html_mode
|
|
89
|
-
pc ''
|
|
90
|
-
lines = msg.split("\n")
|
|
91
|
-
leading_spaces = lines.first[/\A */].size
|
|
92
|
-
lines.each do |line|
|
|
93
|
-
pc line.gsub(/^.{#{leading_spaces}}/, '')
|
|
94
|
-
end
|
|
95
|
-
pc ''
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
def open_text_block
|
|
101
|
-
if html_mode
|
|
102
|
-
unless @text_block_open
|
|
103
|
-
pc ''
|
|
104
|
-
pc '~~~text'
|
|
105
|
-
@text_block_open = true
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
def close_text_block
|
|
111
|
-
if html_mode
|
|
112
|
-
if @text_block_open
|
|
113
|
-
pc '~~~'
|
|
114
|
-
pc ''
|
|
115
|
-
@text_block_open = false
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
def pattern_name
|
|
121
|
-
Origen.app.current_job.output_pattern_filename.gsub('.md', '')
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
def pre_header
|
|
125
|
-
# pc "---"
|
|
126
|
-
# pc "layout: bootstrap"
|
|
127
|
-
# pc "title: #{pattern_name}"
|
|
128
|
-
# pc "gzip: false"
|
|
129
|
-
# pc "---"
|
|
130
|
-
# pc ""
|
|
131
|
-
# pc "# #{pattern_name}"
|
|
132
|
-
# pc ""
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
def pattern_section(msg)
|
|
136
|
-
unless @inhibit_comments
|
|
137
|
-
if generating_program?
|
|
138
|
-
Origen.interface.flow.start_section(name: msg)
|
|
139
|
-
yield
|
|
140
|
-
Origen.interface.flow.stop_section
|
|
141
|
-
else
|
|
142
|
-
if html_mode
|
|
143
|
-
counter = next_accordion_counter
|
|
144
|
-
close_text_block
|
|
145
|
-
pc ''
|
|
146
|
-
pc "<div class=\"accordion-group\">"
|
|
147
|
-
pc "<div class=\"accordion-heading\">"
|
|
148
|
-
pc "<a class=\"accordion-toggle\" data-toggle=\"collapse\" data-parent=\"#accordion2\" href=\"#collapseComment#{counter}\">"
|
|
149
|
-
pc "#{msg}"
|
|
150
|
-
pc '</a>'
|
|
151
|
-
pc '</div>'
|
|
152
|
-
pc "<div id=\"collapseComment#{counter}\" class=\"accordion-body collapse\">"
|
|
153
|
-
pc "<div class=\"accordion-inner\" markdown=\"1\">"
|
|
154
|
-
yield
|
|
155
|
-
close_text_block
|
|
156
|
-
pc '</div>'
|
|
157
|
-
pc '</div>'
|
|
158
|
-
pc '</div>'
|
|
159
|
-
else
|
|
160
|
-
pc ''
|
|
161
|
-
pc "#{msg}"
|
|
162
|
-
pc ''
|
|
163
|
-
@indent += 4
|
|
164
|
-
yield
|
|
165
|
-
@indent -= 4
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
def next_accordion_counter
|
|
172
|
-
@accordion_counter ||= 0
|
|
173
|
-
@accordion_counter += 1
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
def ss(msg = nil)
|
|
177
|
-
unless @inhibit_comments
|
|
178
|
-
@step_comment_on = true
|
|
179
|
-
if block_given?
|
|
180
|
-
yield
|
|
181
|
-
else
|
|
182
|
-
c2(msg)
|
|
183
|
-
end
|
|
184
|
-
@step_comment_on = false
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
def self.generate_program_model(files, options = {})
|
|
189
|
-
options = {
|
|
190
|
-
action: :program,
|
|
191
|
-
return_model: true,
|
|
192
|
-
skip_diff: true
|
|
193
|
-
}.merge(options)
|
|
194
|
-
Origen.app.with_doc_tester do
|
|
195
|
-
Origen.target.temporary = options[:target] if options[:target]
|
|
196
|
-
Origen.app.load_target!
|
|
197
|
-
Origen.interface.reset_globals
|
|
198
|
-
options[:files] = files
|
|
199
|
-
Origen.file_handler.preserve_and_clear_state do
|
|
200
|
-
Origen.app.runner.launch(options)
|
|
201
|
-
end
|
|
202
|
-
end
|
|
203
|
-
model.target = Origen.target.name
|
|
204
|
-
model
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
def self.model
|
|
208
|
-
@model ||= Model.new
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
def doc?
|
|
212
|
-
true
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
def cycle(_options = {})
|
|
216
|
-
end
|
|
217
|
-
|
|
218
|
-
# Ignore any tester-specific methods
|
|
219
|
-
def method_missing(_method, *_args, &_block)
|
|
220
|
-
if block_given?
|
|
221
|
-
yield
|
|
222
|
-
end
|
|
223
|
-
end
|
|
224
|
-
end
|
|
225
|
-
end
|
|
226
|
-
end
|