origen_testers 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/config/application.rb +140 -0
- data/config/commands.rb +73 -0
- data/config/development.rb +12 -0
- data/config/environment.rb +1 -0
- data/config/shared_commands.rb +47 -0
- data/config/users.rb +18 -0
- data/config/version.rb +8 -0
- data/lib/commands/build.rb +69 -0
- data/lib/origen_testers.rb +23 -0
- data/lib/origen_testers/api.rb +258 -0
- data/lib/origen_testers/basic_test_setups.rb +105 -0
- data/lib/origen_testers/callback_handlers.rb +58 -0
- data/lib/origen_testers/generator.rb +279 -0
- data/lib/origen_testers/generator/flow_control_api.rb +611 -0
- data/lib/origen_testers/generator/identity_map.rb +23 -0
- data/lib/origen_testers/generator/placeholder.rb +11 -0
- data/lib/origen_testers/generator/test_numberer.rb +23 -0
- data/lib/origen_testers/igxl_based_tester.rb +12 -0
- data/lib/origen_testers/igxl_based_tester/base.rb +641 -0
- data/lib/origen_testers/igxl_based_tester/base/flow.rb +171 -0
- data/lib/origen_testers/igxl_based_tester/base/flow_line.rb +322 -0
- data/lib/origen_testers/igxl_based_tester/base/generator.rb +217 -0
- data/lib/origen_testers/igxl_based_tester/base/patgroup.rb +109 -0
- data/lib/origen_testers/igxl_based_tester/base/patgroups.rb +38 -0
- data/lib/origen_testers/igxl_based_tester/base/patset.rb +68 -0
- data/lib/origen_testers/igxl_based_tester/base/patset_pattern.rb +56 -0
- data/lib/origen_testers/igxl_based_tester/base/patsets.rb +38 -0
- data/lib/origen_testers/igxl_based_tester/base/patsubr.rb +68 -0
- data/lib/origen_testers/igxl_based_tester/base/patsubr_pattern.rb +56 -0
- data/lib/origen_testers/igxl_based_tester/base/patsubrs.rb +38 -0
- data/lib/origen_testers/igxl_based_tester/base/test_instance.rb +326 -0
- data/lib/origen_testers/igxl_based_tester/base/test_instance_group.rb +58 -0
- data/lib/origen_testers/igxl_based_tester/base/test_instances.rb +179 -0
- data/lib/origen_testers/igxl_based_tester/files.rb +43 -0
- data/lib/origen_testers/igxl_based_tester/j750.rb +248 -0
- data/lib/origen_testers/igxl_based_tester/j750/flow.rb +10 -0
- data/lib/origen_testers/igxl_based_tester/j750/flow_line.rb +19 -0
- data/lib/origen_testers/igxl_based_tester/j750/generator.rb +19 -0
- data/lib/origen_testers/igxl_based_tester/j750/patgroup.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750/patgroups.rb +10 -0
- data/lib/origen_testers/igxl_based_tester/j750/patset.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750/patset_pattern.rb +18 -0
- data/lib/origen_testers/igxl_based_tester/j750/patsets.rb +10 -0
- data/lib/origen_testers/igxl_based_tester/j750/patsubr.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750/patsubr_pattern.rb +18 -0
- data/lib/origen_testers/igxl_based_tester/j750/patsubrs.rb +10 -0
- data/lib/origen_testers/igxl_based_tester/j750/templates/flow.txt.erb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750/templates/instances.txt.erb +16 -0
- data/lib/origen_testers/igxl_based_tester/j750/templates/patgroups.txt.erb +8 -0
- data/lib/origen_testers/igxl_based_tester/j750/templates/patsets.txt.erb +10 -0
- data/lib/origen_testers/igxl_based_tester/j750/templates/patsubrs.txt.erb +10 -0
- data/lib/origen_testers/igxl_based_tester/j750/test_instance.rb +547 -0
- data/lib/origen_testers/igxl_based_tester/j750/test_instance_group.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750/test_instances.rb +10 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt.rb +34 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/flow.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/flow_line.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/generator.rb +19 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/patgroup.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/patgroups.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/patset.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/patset_pattern.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/patsets.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubr.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubr_pattern.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/patsubrs.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance.rb +515 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instance_group.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/j750_hpt/test_instances.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/parser.rb +102 -0
- data/lib/origen_testers/igxl_based_tester/parser/ac_spec.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/parser/ac_specs.rb +0 -0
- data/lib/origen_testers/igxl_based_tester/parser/dc_spec.rb +33 -0
- data/lib/origen_testers/igxl_based_tester/parser/dc_specs.rb +48 -0
- data/lib/origen_testers/igxl_based_tester/parser/descriptions.rb +339 -0
- data/lib/origen_testers/igxl_based_tester/parser/flow.rb +109 -0
- data/lib/origen_testers/igxl_based_tester/parser/flow_line.rb +203 -0
- data/lib/origen_testers/igxl_based_tester/parser/flows.rb +21 -0
- data/lib/origen_testers/igxl_based_tester/parser/pattern_set.rb +92 -0
- data/lib/origen_testers/igxl_based_tester/parser/pattern_sets.rb +31 -0
- data/lib/origen_testers/igxl_based_tester/parser/test_instance.rb +341 -0
- data/lib/origen_testers/igxl_based_tester/parser/test_instances.rb +24 -0
- data/lib/origen_testers/igxl_based_tester/parser/timeset.rb +13 -0
- data/lib/origen_testers/igxl_based_tester/parser/timesets.rb +0 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex.rb +477 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/flow.rb +10 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/flow_line.rb +19 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/generator.rb +19 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/patgroup.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/patgroups.rb +10 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/patset.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/patset_pattern.rb +18 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/patsets.rb +10 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/patsubr_pattern.rb +18 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/patsubrs.rb +10 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/templates/flow.txt.erb +9 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/templates/instances.txt.erb +16 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patgroups.txt.erb +9 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patsets.txt.erb +10 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/templates/patsubrs.txt.erb +10 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/test_instance.rb +270 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/test_instance_group.rb +9 -0
- data/lib/origen_testers/igxl_based_tester/ultraflex/test_instances.rb +10 -0
- data/lib/origen_testers/interface.rb +183 -0
- data/lib/origen_testers/parser.rb +22 -0
- data/lib/origen_testers/parser/description_lookup.rb +62 -0
- data/lib/origen_testers/parser/searchable_array.rb +30 -0
- data/lib/origen_testers/parser/searchable_hash.rb +30 -0
- data/lib/origen_testers/pattern_compilers.rb +116 -0
- data/lib/origen_testers/pattern_compilers/assembler.rb +88 -0
- data/lib/origen_testers/pattern_compilers/job.rb +96 -0
- data/lib/origen_testers/pattern_compilers/ultraflex_pattern_compiler.rb +599 -0
- data/lib/origen_testers/program_generators.rb +55 -0
- data/lib/origen_testers/smartest_based_tester.rb +8 -0
- data/lib/origen_testers/smartest_based_tester/base.rb +411 -0
- data/lib/origen_testers/smartest_based_tester/base/flow.rb +188 -0
- data/lib/origen_testers/smartest_based_tester/base/flow_node.rb +476 -0
- data/lib/origen_testers/smartest_based_tester/base/generator.rb +123 -0
- data/lib/origen_testers/smartest_based_tester/base/pattern_compiler.rb +23 -0
- data/lib/origen_testers/smartest_based_tester/base/pattern_master.rb +47 -0
- data/lib/origen_testers/smartest_based_tester/base/test_method.rb +143 -0
- data/lib/origen_testers/smartest_based_tester/base/test_methods.rb +73 -0
- data/lib/origen_testers/smartest_based_tester/base/test_methods/ac_tml.rb +33 -0
- data/lib/origen_testers/smartest_based_tester/base/test_methods/base_tml.rb +38 -0
- data/lib/origen_testers/smartest_based_tester/base/test_methods/custom_tml.rb +19 -0
- data/lib/origen_testers/smartest_based_tester/base/test_methods/dc_tml.rb +147 -0
- data/lib/origen_testers/smartest_based_tester/base/test_methods/limits.rb +43 -0
- data/lib/origen_testers/smartest_based_tester/base/test_suite.rb +166 -0
- data/lib/origen_testers/smartest_based_tester/base/test_suites.rb +58 -0
- data/lib/origen_testers/smartest_based_tester/v93k.rb +8 -0
- data/lib/origen_testers/smartest_based_tester/v93k/builder.rb +89 -0
- data/lib/origen_testers/smartest_based_tester/v93k/builder/flow.rb +169 -0
- data/lib/origen_testers/smartest_based_tester/v93k/builder/pattern_master.rb +54 -0
- data/lib/origen_testers/smartest_based_tester/v93k/flow.rb +10 -0
- data/lib/origen_testers/smartest_based_tester/v93k/flow_node.rb +9 -0
- data/lib/origen_testers/smartest_based_tester/v93k/generator.rb +19 -0
- data/lib/origen_testers/smartest_based_tester/v93k/pattern_compiler.rb +10 -0
- data/lib/origen_testers/smartest_based_tester/v93k/pattern_master.rb +10 -0
- data/lib/origen_testers/smartest_based_tester/v93k/templates/template.aiv.erb +17 -0
- data/lib/origen_testers/smartest_based_tester/v93k/templates/template.flow.erb +201 -0
- data/lib/origen_testers/smartest_based_tester/v93k/templates/template.pmfl.erb +13 -0
- data/lib/origen_testers/smartest_based_tester/v93k/test_method.rb +9 -0
- data/lib/origen_testers/smartest_based_tester/v93k/test_methods.rb +9 -0
- data/lib/origen_testers/smartest_based_tester/v93k/test_suite.rb +9 -0
- data/lib/origen_testers/smartest_based_tester/v93k/test_suites.rb +9 -0
- data/lib/origen_testers/test/basic_interface.rb +17 -0
- data/lib/origen_testers/test/block.rb +21 -0
- data/lib/origen_testers/test/dut.rb +184 -0
- data/lib/origen_testers/test/dut2.rb +76 -0
- data/lib/origen_testers/test/j750_base_interface.rb +119 -0
- data/lib/origen_testers/test/j750_hpt_interface.rb +8 -0
- data/lib/origen_testers/test/j750_interface.rb +8 -0
- data/lib/origen_testers/test/nvm.rb +94 -0
- data/lib/origen_testers/test/ultraflex_interface.rb +110 -0
- data/lib/origen_testers/test/v93k_interface.rb +115 -0
- data/lib/origen_testers/timing.rb +362 -0
- data/lib/origen_testers/vector.rb +203 -0
- data/lib/origen_testers/vector_based_tester.rb +42 -0
- data/lib/origen_testers/vector_generator.rb +623 -0
- data/lib/origen_testers/vector_pipeline.rb +288 -0
- data/pattern/dc_instr.rb +7 -0
- data/pattern/delay.rb +7 -0
- data/pattern/mem_test.rb +8 -0
- data/pattern/multi_vector.rb +117 -0
- data/pattern/multi_vector_plus1.rb +125 -0
- data/pattern/nvm/j750/add_late_pins.rb +3 -0
- data/pattern/nvm/j750/iterator_postfix_test_x_bx.rb +8 -0
- data/pattern/nvm/j750/iterator_test_x_bx.rb +8 -0
- data/pattern/nvm/j750/j750_halt.rb +159 -0
- data/pattern/nvm/j750/j750_workout.rb +202 -0
- data/pattern/nvm/j750/timing.rb +73 -0
- data/pattern/nvm/v93k/v93k_workout.rb +136 -0
- data/pattern/read_write_reg.rb +58 -0
- data/pattern/reset.rb +4 -0
- data/pattern/subroutines.rb +38 -0
- data/program/_additional_erase.rb +7 -0
- data/program/_efa_resources.rb +7 -0
- data/program/_erase.rb +25 -0
- data/program/_erase_vfy.rb +5 -0
- data/program/_iv_resources.rb +10 -0
- data/program/basic_interface.rb +5 -0
- data/program/components/_prb2_main.rb +6 -0
- data/program/flow_control.rb +164 -0
- data/program/prb1.rb +226 -0
- data/program/prb1_resources.rb +28 -0
- data/program/prb2.rb +40 -0
- data/program/test.rb +20 -0
- data/templates/example.txt.erb +53 -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/manifest/v93k.yaml.erb +22 -0
- data/templates/web/index.md.erb +51 -0
- data/templates/web/layouts/_basic.html.erb +15 -0
- data/templates/web/partials/_navbar.html.erb +22 -0
- data/templates/web/release_notes.md.erb +5 -0
- metadata +332 -0
@@ -0,0 +1,341 @@
|
|
1
|
+
module OrigenTesters
|
2
|
+
class IGXLBasedTester
|
3
|
+
class Parser
|
4
|
+
class TestInstance
|
5
|
+
attr_accessor :parser
|
6
|
+
|
7
|
+
TYPES = %w(
|
8
|
+
functional board_pmu empty pin_pmu power_supply mto_memory
|
9
|
+
)
|
10
|
+
|
11
|
+
TYPE_ALIASES = {
|
12
|
+
functional_t: :functional,
|
13
|
+
boardpmu_t: :board_pmu,
|
14
|
+
nvmboardpmucal_t: :board_pmu,
|
15
|
+
nvmboardpmumeasure_t: :board_pmu,
|
16
|
+
empty_t: :empty,
|
17
|
+
pinpmu_t: :pin_pmu,
|
18
|
+
nvmpinpmucal_t: :pin_pmu,
|
19
|
+
nvmpinpmumeas_t: :pin_pmu,
|
20
|
+
powersupply_t: :power_supply,
|
21
|
+
mto_memory_t: :mto_memory
|
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
|
+
mto_memory: {
|
179
|
+
patterns: :arg0,
|
180
|
+
pattern: :arg0,
|
181
|
+
start_func: :arg1,
|
182
|
+
start_of_body_f: :arg1,
|
183
|
+
pre_pat_func: :arg2,
|
184
|
+
pre_pat_f: :arg2,
|
185
|
+
pre_test_func: :arg3,
|
186
|
+
pre_test_f: :arg3,
|
187
|
+
post_test_func: :arg4,
|
188
|
+
post_test_f: :arg4,
|
189
|
+
post_pat_func: :arg5,
|
190
|
+
post_pat_f: :arg5,
|
191
|
+
end_of_body_func: :arg6,
|
192
|
+
end_of_body_f: :arg6,
|
193
|
+
set_pass_fail: :arg7,
|
194
|
+
init_lo: :arg8,
|
195
|
+
start_lo: :arg8,
|
196
|
+
init_hi: :arg9,
|
197
|
+
start_hi: :arg9,
|
198
|
+
init_hiz: :arg10,
|
199
|
+
start_hiz: :arg10,
|
200
|
+
float_pins: :arg11,
|
201
|
+
start_of_body_func_args: :arg12,
|
202
|
+
start_of_body_f_args: :arg12,
|
203
|
+
pre_pat_func_args: :arg13,
|
204
|
+
pre_pat_f_args: :arg13,
|
205
|
+
pre_test_func_args: :arg14,
|
206
|
+
pre_test_f_args: :arg14,
|
207
|
+
post_test_func_args: :arg15,
|
208
|
+
post_test_f_args: :arg15,
|
209
|
+
post_pat_f_args: :arg16,
|
210
|
+
end_of_body_func_args: :arg17,
|
211
|
+
end_of_body_f_args: :arg17,
|
212
|
+
utility_pins_1: :arg18,
|
213
|
+
utility_pins_0: :arg19,
|
214
|
+
wait_flags: :arg20,
|
215
|
+
wait_time_out: :arg21,
|
216
|
+
PatFlagF: :arg22,
|
217
|
+
pat_flag_f: :arg22,
|
218
|
+
pat_flag_func_args: :arg23,
|
219
|
+
pat_flag_f_args: :arg23,
|
220
|
+
relay_mode: :arg24,
|
221
|
+
x_enable_mask: :arg29,
|
222
|
+
x_shift_direction: :arg30,
|
223
|
+
x_shift_input: :arg31,
|
224
|
+
y_enable_mask: :arg36,
|
225
|
+
y_shift_direction: :arg37,
|
226
|
+
y_shift_input: :arg38,
|
227
|
+
dga: :arg39,
|
228
|
+
dgb: :arg40,
|
229
|
+
dgc: :arg41,
|
230
|
+
dgd: :arg42,
|
231
|
+
dg_enable_mask: :arg43,
|
232
|
+
dg_shift_direction: :arg44,
|
233
|
+
dg_shift_input: :arg45,
|
234
|
+
x_coincidence_enable_mask: :arg46,
|
235
|
+
y_coincidence_enable_mask: :arg47,
|
236
|
+
two_bit_dg_setup: :arg48,
|
237
|
+
x_scramble_algorithm: :arg49,
|
238
|
+
y_scramble_algorithm: :arg50,
|
239
|
+
topo_inversion_algorithm: :arg51,
|
240
|
+
utility_counter_a: :arg52,
|
241
|
+
utility_counter_b: :arg53,
|
242
|
+
utility_counter_c: :arg54,
|
243
|
+
dut_data_source: :arg55,
|
244
|
+
scramble_addr: :arg56,
|
245
|
+
speed_mode: :arg57,
|
246
|
+
resource_map: :arg58,
|
247
|
+
receive_data: :arg59,
|
248
|
+
data_to_capture: :arg60,
|
249
|
+
capture_marker: :arg61,
|
250
|
+
enable_wrapping: :arg62,
|
251
|
+
capture_scrambled_address: :arg63,
|
252
|
+
mapmem_0_input_set: :arg64,
|
253
|
+
mapmem_1_input_set: :arg65,
|
254
|
+
threading: :arg69,
|
255
|
+
match_all_sites: :arg70
|
256
|
+
}
|
257
|
+
|
258
|
+
}
|
259
|
+
|
260
|
+
# Make readers for each low level attribute
|
261
|
+
ATTRS.each do |attr|
|
262
|
+
attr_reader attr
|
263
|
+
end
|
264
|
+
|
265
|
+
# And the aliases
|
266
|
+
ALIASES.each do |_alias, attr|
|
267
|
+
define_method("#{_alias}") do
|
268
|
+
send(attr)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
def initialize(line, options = {})
|
273
|
+
@parser = options[:parser]
|
274
|
+
@line = line
|
275
|
+
parse
|
276
|
+
if valid?
|
277
|
+
ATTRS.each_with_index do |attr, i|
|
278
|
+
instance_variable_set("@#{attr}", components[i + 1])
|
279
|
+
end
|
280
|
+
if ALIASES[type]
|
281
|
+
ALIASES[type].each do |_alias, attr|
|
282
|
+
define_singleton_method("#{_alias}") do
|
283
|
+
send(attr)
|
284
|
+
end
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
def inspect # :nodoc:
|
291
|
+
"<TestInstance: #{name}, Type: #{type}>"
|
292
|
+
end
|
293
|
+
|
294
|
+
def description
|
295
|
+
parser.descriptions.test_instance(name: name)
|
296
|
+
end
|
297
|
+
|
298
|
+
def type
|
299
|
+
TYPE_ALIASES[proc_name.downcase.to_sym] || :unsupported
|
300
|
+
end
|
301
|
+
|
302
|
+
def parse
|
303
|
+
@components = @line.split("\t") unless @line.strip.empty?
|
304
|
+
end
|
305
|
+
|
306
|
+
def valid?
|
307
|
+
components[4] && ['Excel Macro', 'VB DLL'].include?(components[4])
|
308
|
+
end
|
309
|
+
|
310
|
+
def components
|
311
|
+
@components ||= []
|
312
|
+
end
|
313
|
+
|
314
|
+
# Returns an array of all pattern names referenced in this test instance
|
315
|
+
def patterns
|
316
|
+
if self.respond_to?(:pattern)
|
317
|
+
pattern.split(',').map do |pat|
|
318
|
+
extract_pattern_from_patset(pat)
|
319
|
+
end.flatten.map { |pat| pat.gsub(/.*[\\\/]/, '').gsub(/\..*/, '') }
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
def extract_pattern_from_patset(patset)
|
324
|
+
pset = parser.pattern_sets.where(name: patset, exact: true)
|
325
|
+
if pset.size > 1
|
326
|
+
puts "Warning multiple pattern sets called #{patset} found, using the first one"
|
327
|
+
end
|
328
|
+
if pset.size == 0
|
329
|
+
patset
|
330
|
+
else
|
331
|
+
pset.first.pattern_names
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
def vdd
|
336
|
+
parser.dc_specs.where(name: 'VDD', exact: true).first.lookup(dc_category, dc_selector)
|
337
|
+
end
|
338
|
+
end
|
339
|
+
end
|
340
|
+
end
|
341
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module OrigenTesters
|
2
|
+
class IGXLBasedTester
|
3
|
+
class Parser
|
4
|
+
class TestInstances < ::OrigenTesters::Parser::SearchableHash
|
5
|
+
attr_accessor :parser
|
6
|
+
|
7
|
+
def initialize(options = {})
|
8
|
+
@parser = options[:parser]
|
9
|
+
end
|
10
|
+
|
11
|
+
def import(file)
|
12
|
+
File.readlines(file).each do |line|
|
13
|
+
l = TestInstance.new(line, parser: parser)
|
14
|
+
self[l.name] = l if l.valid?
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def inspect
|
19
|
+
"<TestInstances: #{size}>"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
File without changes
|
@@ -0,0 +1,477 @@
|
|
1
|
+
module OrigenTesters
|
2
|
+
module IGXLBasedTester
|
3
|
+
class UltraFLEX < Base
|
4
|
+
autoload :Generator, 'origen_testers/igxl_based_tester/ultraflex/generator.rb'
|
5
|
+
|
6
|
+
# Tester model to generate .atp patterns for the Teradyne UltraFLEX
|
7
|
+
#
|
8
|
+
# == Basic Usage
|
9
|
+
# $tester = Testers::UltraFLEX.new
|
10
|
+
# $tester.cycle # Generate a vector
|
11
|
+
#
|
12
|
+
# Many more methods exist to generate UltraFLEX specific micro-code, see below for
|
13
|
+
# details.
|
14
|
+
#
|
15
|
+
# Also note that this class inherits from the base IGXLBasedTester class and so all methods
|
16
|
+
# described there are also available.
|
17
|
+
|
18
|
+
# Returns a new UltraFLEX instance, normally there would only ever be one of these
|
19
|
+
# assigned to the global variable such as $tester by your target.
|
20
|
+
def initialize
|
21
|
+
super
|
22
|
+
@pipeline_depth = 255 # for single mode
|
23
|
+
@software_version = '8.10.10'
|
24
|
+
@name = 'ultraflex'
|
25
|
+
@opcode_mode = :single # there is also :dual
|
26
|
+
@counter_lsb_bits = 16 # individual counter bit length
|
27
|
+
@counter_msb_bits = 12 # temporary register commonly used to extend all counters
|
28
|
+
|
29
|
+
@flags = %w(cpuA_cond cpuB_cond cpuC_cond cpuD_cond)
|
30
|
+
@microcode[:enable] = 'branch_expr ='
|
31
|
+
@microcode[:set_flag] = 'set_cpu_cond'
|
32
|
+
@microcode[:mask_vector] = 'mask'
|
33
|
+
|
34
|
+
# Min required for a VM module-- not for SRM modules
|
35
|
+
# this handled in pattern_header below
|
36
|
+
@min_pattern_vectors = (@opcode_mode == :single) ? 64 : 128
|
37
|
+
|
38
|
+
@digital_instrument = 'hsdm' # 'hsdm' for HSD1000 and UP800, ok with UP1600 though
|
39
|
+
|
40
|
+
@capture_state = 'V' # STV requires valid 'V' expect data
|
41
|
+
end
|
42
|
+
|
43
|
+
def freq_count(pin, options = {})
|
44
|
+
fail 'Method freq_count not yet supported for UltraFLEX!'
|
45
|
+
end
|
46
|
+
|
47
|
+
def memory_test(options = {})
|
48
|
+
options = {
|
49
|
+
gen_vector: true, # Default generate vector not just MTO opcode
|
50
|
+
init_counter_x: false, # initialize counter X
|
51
|
+
inc_counter_x: false, # increment counter X
|
52
|
+
init_counter_y: false, # initialize counter X
|
53
|
+
inc_counter_y: false, # increment counter X
|
54
|
+
capture_vector: false, # capture vector to memory using all mem types
|
55
|
+
capture_vector_mem0: false, # capture vector to memory type 0, here for J750 will be stv_m0
|
56
|
+
capture_vector_mem1: false, # capture vector to memory type 1, here for J750 will be stv_m1
|
57
|
+
capture_vector_mem2: false, # capture vector to memory type 2, here for J750 will be stv_c
|
58
|
+
pin: false, # pin on which to drive or expect data, pass pin object here!
|
59
|
+
pin_data: false, # pin data (:none, :drive, :expect)
|
60
|
+
use_dgen_group: false,
|
61
|
+
set_msb: false
|
62
|
+
}.merge(options)
|
63
|
+
|
64
|
+
mto_opcode = ''
|
65
|
+
|
66
|
+
if options[:init_counter_x]
|
67
|
+
mto_opcode += ' xenable_load jam_reg xa jam_reg'
|
68
|
+
end
|
69
|
+
|
70
|
+
if options[:init_counter_y]
|
71
|
+
mto_opcode += ' yenable_load jam_reg ya jam_reg'
|
72
|
+
end
|
73
|
+
|
74
|
+
if options[:inc_counter_x]
|
75
|
+
mto_opcode += ' xa inc'
|
76
|
+
end
|
77
|
+
|
78
|
+
if options[:inc_counter_y]
|
79
|
+
mto_opcode += ' ya inc'
|
80
|
+
end
|
81
|
+
|
82
|
+
if options[:use_dgen_group]
|
83
|
+
mto_opcode += ' dgroup 0'
|
84
|
+
end
|
85
|
+
|
86
|
+
if options[:set_msb]
|
87
|
+
microcode 'set_msb 1'
|
88
|
+
end
|
89
|
+
|
90
|
+
unless mto_opcode.eql?('')
|
91
|
+
mto_opcode = '(mto =' + mto_opcode + ')'
|
92
|
+
end
|
93
|
+
|
94
|
+
if options[:pin_data] == :expect
|
95
|
+
mto_opcode = 'stv'
|
96
|
+
end
|
97
|
+
|
98
|
+
if options[:gen_vector]
|
99
|
+
if options[:pin]
|
100
|
+
case options[:pin_data]
|
101
|
+
when :drive
|
102
|
+
# store current pin state
|
103
|
+
cur_pin_state = options[:pin].state.to_sym
|
104
|
+
options[:pin].drive_mem
|
105
|
+
when :expect
|
106
|
+
# store current pin state
|
107
|
+
cur_pin_state = options[:pin].state.to_sym
|
108
|
+
options[:pin].expect_mem
|
109
|
+
end
|
110
|
+
end
|
111
|
+
cycle(microcode: "#{mto_opcode}", dont_compress: false)
|
112
|
+
if options[:pin]
|
113
|
+
# restore previous pin state
|
114
|
+
case options[:pin_data]
|
115
|
+
when :drive
|
116
|
+
options[:pin].state = cur_pin_state
|
117
|
+
when :expect
|
118
|
+
options[:pin].state = cur_pin_state
|
119
|
+
end
|
120
|
+
end
|
121
|
+
else
|
122
|
+
microcode "#{mto_opcode}"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
def call_match
|
127
|
+
fail 'Method call_match not yet supported for UltraFLEX!'
|
128
|
+
end
|
129
|
+
|
130
|
+
def set_code(code)
|
131
|
+
Origen.log.warning 'Method set_code not supported for UltraFLEX! Find alternative solution.'
|
132
|
+
cc '*** WARNING! *** Method set_code not supported for UltraFLEX! Find alternative solution.'
|
133
|
+
end
|
134
|
+
|
135
|
+
def loop_vectors(name, number_of_loops, global = false, label_first = false)
|
136
|
+
if number_of_loops > 1
|
137
|
+
@loop_counters ||= {}
|
138
|
+
if @loop_counters[name]
|
139
|
+
@loop_counters[name] += 1
|
140
|
+
else
|
141
|
+
@loop_counters[name] = 0
|
142
|
+
end
|
143
|
+
loop_name = @loop_counters[name] == 0 ? name : "#{name}_#{@loop_counters[name]}"
|
144
|
+
if label_first
|
145
|
+
global_opt = (global) ? 'global ' : ''
|
146
|
+
microcode "#{global_opt}#{loop_name}: "
|
147
|
+
end
|
148
|
+
|
149
|
+
if "#{loop_name}" == 'row_loop'
|
150
|
+
cycle(microcode: 'loop c0')
|
151
|
+
elsif "#{loop_name}" == 'quad_loop'
|
152
|
+
cycle(microcode: 'loop c1')
|
153
|
+
elsif "#{loop_name}" == 'page_loop_red'
|
154
|
+
cycle(microcode: 'loop c2')
|
155
|
+
elsif "#{loop_name}" == 'page_loop_ecc'
|
156
|
+
cycle(microcode: 'loop c3')
|
157
|
+
elsif "#{loop_name}" == 'page_loop_data'
|
158
|
+
cycle(microcode: 'loop c4')
|
159
|
+
end
|
160
|
+
|
161
|
+
unless label_first
|
162
|
+
global_opt = (global) ? 'global ' : ''
|
163
|
+
cycle(microcode: "#{global_opt}#{loop_name}: ")
|
164
|
+
end
|
165
|
+
yield
|
166
|
+
cycle(microcode: "end_loop #{loop_name}")
|
167
|
+
else
|
168
|
+
yield
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
alias_method :loop_vector, :loop_vectors
|
173
|
+
|
174
|
+
def pattern_header(options = {})
|
175
|
+
options = {
|
176
|
+
instruments: {}
|
177
|
+
}.merge(options)
|
178
|
+
|
179
|
+
case $tester.vector_group_size
|
180
|
+
when 1
|
181
|
+
@opcode_mode = :single
|
182
|
+
when 2
|
183
|
+
@opcode_mode = :dual
|
184
|
+
when 4
|
185
|
+
@opcode_mode = :quad
|
186
|
+
end
|
187
|
+
|
188
|
+
options[:memory_test] = memory_test_en
|
189
|
+
options[:dc_pins] = get_dc_instr_pins
|
190
|
+
|
191
|
+
if options[:dc_pins]
|
192
|
+
options[:dc_pins].each do |pin|
|
193
|
+
options[:instruments].merge!(pin => 'DCVS')
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# If memory test, then add to instruments hash
|
198
|
+
if options[:memory_test]
|
199
|
+
options[:instruments].merge!('mto' => 'nil')
|
200
|
+
end
|
201
|
+
|
202
|
+
super(options.merge(digital_inst: @digital_instrument,
|
203
|
+
memory_test: false,
|
204
|
+
high_voltage: false,
|
205
|
+
svm_only: false
|
206
|
+
)) do |pin_list|
|
207
|
+
microcode "#{options[:subroutine_pat] ? 'srm_vector' : 'vm_vector'}"
|
208
|
+
microcode "#{options[:pattern]} ($tset, #{pin_list})"
|
209
|
+
microcode '{'
|
210
|
+
# override min vector limit if subroutine pattern
|
211
|
+
@min_pattern_vectors = 0 if options[:subroutine_pat]
|
212
|
+
unless options[:subroutine_pat]
|
213
|
+
microcode "start_label #{options[:pattern]}_st:"
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
def pattern_footer(options = {})
|
219
|
+
super(options.merge(end_module: false))
|
220
|
+
end
|
221
|
+
|
222
|
+
# Generates a match loop based on vector condition passed in via block
|
223
|
+
#
|
224
|
+
# This method is not really intended to be called directly, rather you should call
|
225
|
+
# via Tester#wait:
|
226
|
+
# e.g. $tester.wait(:match => true) do
|
227
|
+
# reg(:status_reg).bit(:done).read(1)! # vector condition that you want to match
|
228
|
+
# end
|
229
|
+
#
|
230
|
+
# The timeout should be provided in cycles, however when called via the wait method the
|
231
|
+
# time-based helpers (time_in_us, etc) will be converted to cycles for you.
|
232
|
+
#
|
233
|
+
# The following options are available to tailor the match loop behavior, defaults in
|
234
|
+
# parenthesis:
|
235
|
+
# * :force_fail_on_timeout (true) - Force a vector mis-compare if the match loop times out
|
236
|
+
# * :on_timeout_goto ("") - Optionally supply a label to branch to on timeout, by default will continue from the end of the match loop
|
237
|
+
# * :on_block_match_goto ("") - Optionally supply a label to branch to when block condition is met, by default will continue from the end of the match loop
|
238
|
+
# * :multiple_entries (false) - Supply an integer to generate multiple entries into the match (each with a unique readcode), this can be useful when debugging patterns with multiple matches
|
239
|
+
# * :force_fail_on_timeout (true) - force pattern to fail if timeout occurs
|
240
|
+
# * :global_loops (false) - whether match loop loops should use global labels
|
241
|
+
# * :manual_stop (false) - whether to use extra cpuB flag to resolve IG-XL v.3.50.xx bug where VBT clears cpuA immediately
|
242
|
+
# at start of PatFlagFunc instead of at end. Use will have to manually clear cpuB to resume this pattern.
|
243
|
+
# ==== Examples
|
244
|
+
# $tester.wait(:match => true, :time_in_us => 5000, :pin => $top.pin(:done), :state => :high) do
|
245
|
+
# <vectors>
|
246
|
+
# end
|
247
|
+
def match_block(timeout, options = {}, &block)
|
248
|
+
options = {
|
249
|
+
check_for_fails: false,
|
250
|
+
on_timeout_goto: false,
|
251
|
+
on_block_match_goto: false,
|
252
|
+
multiple_entries: false,
|
253
|
+
force_fail_on_timeout: true,
|
254
|
+
global_loops: false,
|
255
|
+
manual_stop: false,
|
256
|
+
clr_fail_post_match: false
|
257
|
+
}.merge(options)
|
258
|
+
|
259
|
+
unless block_given?
|
260
|
+
fail 'ERROR: block not passed to match_block!'
|
261
|
+
end
|
262
|
+
|
263
|
+
if options[:check_for_fails]
|
264
|
+
cc 'NOTE: check for fails prior to match loop not necessary on UltraFlex'
|
265
|
+
end
|
266
|
+
|
267
|
+
ss 'WARNING: MATCH LOOP FOR ULTRAFLEX STILL UNDER DEVELOPMENT'
|
268
|
+
|
269
|
+
# Create BlockArgs objects in order to receive multiple blocks
|
270
|
+
match_conditions = Origen::Utility::BlockArgs.new
|
271
|
+
fail_conditions = Origen::Utility::BlockArgs.new
|
272
|
+
|
273
|
+
# yield object to calling routine to get populated with blocks
|
274
|
+
if block.arity > 0
|
275
|
+
yield match_conditions, fail_conditions
|
276
|
+
else
|
277
|
+
# for backwards compatibility with Origen core call to match_block
|
278
|
+
match_conditions.add(&block)
|
279
|
+
fail_conditions.add(&block)
|
280
|
+
end
|
281
|
+
|
282
|
+
# Now do the main match loop
|
283
|
+
cc 'Start the match loop'
|
284
|
+
|
285
|
+
cycle # (:microcode => "set_msb #{counter_msb}") # set_msb microcode will be set below after counting match loop cycles
|
286
|
+
set_msb_vector = last_vector # remember the vector with set_msb opcode
|
287
|
+
|
288
|
+
cycle(microcode: 'branch_expr = (fail)')
|
289
|
+
|
290
|
+
global_opt = (options[:global_loops]) ? 'global ' : ''
|
291
|
+
microcode "#{global_opt}match_loop_#{@unique_counter}:"
|
292
|
+
|
293
|
+
cycle # (:microcode => "set c0 #{counter_lsb}")
|
294
|
+
set_c0_vector = last_vector # remember the vector with set_c0 opcode
|
295
|
+
|
296
|
+
microcode "match_result_loop_#{@unique_counter}:"
|
297
|
+
cycle(microcode: 'loop c0')
|
298
|
+
|
299
|
+
# count cycles in match loop block passed to help with meeting
|
300
|
+
# desired timeout value (have to back assign microcodes above)
|
301
|
+
prematch_cycle_count = cycle_count
|
302
|
+
match_conditions.each_with_index do |condition, i|
|
303
|
+
mask_fails(true)
|
304
|
+
condition.call # match condition
|
305
|
+
mask_fails(false)
|
306
|
+
|
307
|
+
cc ' Wait for the result to propagate through the pipeline'
|
308
|
+
cycle(microcode: 'pipe_minus 1')
|
309
|
+
inc_cycle_count(@pipeline_depth - 1) # Account for pipeline depth
|
310
|
+
cc "Branch if block condition #{i} not yet met"
|
311
|
+
cycle(microcode: "if (branch_expr) jump block_#{i}_notyet_matched_#{@unique_counter}")
|
312
|
+
cc 'Match found'
|
313
|
+
cycle(microcode: 'pop_loop')
|
314
|
+
cycle(microcode: 'return') # DH ONLY IF SUBROUTINE!!
|
315
|
+
cc 'Match not yet found'
|
316
|
+
cycle(microcode: "block_#{i}_notyet_matched_#{@unique_counter}:")
|
317
|
+
end
|
318
|
+
|
319
|
+
match_conditions_cycle_count = cycle_count - prematch_cycle_count
|
320
|
+
cc "Match loop cycle count = #{match_conditions_cycle_count}"
|
321
|
+
|
322
|
+
# reduce timeout requested by match loop cycle count
|
323
|
+
timeout = (timeout.to_f / match_conditions_cycle_count).ceil
|
324
|
+
|
325
|
+
# Calculate the counter values appropriately hit the timeout requested
|
326
|
+
match_delay_cycles = false
|
327
|
+
|
328
|
+
# Determine full value of counter0
|
329
|
+
counter_value = timeout.to_f.floor
|
330
|
+
|
331
|
+
if counter_value < (2**@counter_lsb_bits)
|
332
|
+
# small value, don't need msb temp register
|
333
|
+
counter_msb = 1
|
334
|
+
counter_lsb = counter_value
|
335
|
+
elsif counter_value < (2**(@counter_lsb_bits + @counter_msb_bits))
|
336
|
+
# larger value, but smaller than counter maximum
|
337
|
+
counter_msb = counter_value # set MSB (lowest LSB bits get ignored)
|
338
|
+
counter_lsb = counter_value & (2**@counter_lsb_bits - 1) # set LSB
|
339
|
+
elsif counter_value < (2**(@counter_lsb_bits + @counter_msb_bits)) * @max_repeat_loop
|
340
|
+
# larger value, greater than counter, so add time delay per instance of loop to avoid using second counter
|
341
|
+
match_delay_cycles = (counter_value.to_f / (2**(@counter_lsb_bits + @counter_msb_bits))).ceil
|
342
|
+
counter_msb = (counter_value / match_delay_cycles).floor # set MSB (lowest LSB bits get ignored)
|
343
|
+
counter_lsb = counter_msb & (2**@counter_lsb_bits - 1) # set LSB
|
344
|
+
else
|
345
|
+
abort 'ERROR: timeout value too large in tester match method!'
|
346
|
+
end
|
347
|
+
|
348
|
+
# retroactively modify the counters based on cycles in match loop conditions
|
349
|
+
set_msb_vector.microcode = "set_msb #{counter_msb}"
|
350
|
+
set_c0_vector.microcode = "set c0 #{counter_lsb}"
|
351
|
+
|
352
|
+
if match_delay_cycles
|
353
|
+
cc 'Delay to meet timeout value'
|
354
|
+
cycle(repeat: match_delay_cycles) if match_delay_cycles
|
355
|
+
end
|
356
|
+
|
357
|
+
cycle(microcode: "end_loop match_result_loop_#{@unique_counter}")
|
358
|
+
|
359
|
+
if options[:force_fail_on_timeout]
|
360
|
+
cc 'To get here something has gone wrong, check blocks again to force a pattern failure'
|
361
|
+
fail_conditions.each do |condition|
|
362
|
+
cycle(microcode: 'pipe_minus 1')
|
363
|
+
condition.call
|
364
|
+
end
|
365
|
+
end
|
366
|
+
|
367
|
+
@unique_counter += 1 # Increment so a different label will be applied if another
|
368
|
+
# handshake is called in the same pattern
|
369
|
+
end
|
370
|
+
|
371
|
+
# Handshake with the tester.
|
372
|
+
#
|
373
|
+
# Will set a cpu flag (A) and wait for it to be cleared by the tester, optionally
|
374
|
+
# pass in a read code to pass information to the tester.
|
375
|
+
#
|
376
|
+
# ==== Examples
|
377
|
+
# $tester.handshake # Pass control to the tester for a measurement
|
378
|
+
# $tester.handshake(:readcode => 10) # Trigger a specific action by the tester
|
379
|
+
def handshake(options = {})
|
380
|
+
options = {
|
381
|
+
readcode: false,
|
382
|
+
manual_stop: false, # set a 2nd CPU flag in case 1st flag is automatically cleared
|
383
|
+
}.merge(options)
|
384
|
+
if options[:readcode]
|
385
|
+
set_code(options[:readcode])
|
386
|
+
end
|
387
|
+
if options[:manual_stop]
|
388
|
+
cycle(microcode: "#{@microcode[:enable]} (#{@flags[1]})")
|
389
|
+
cycle(microcode: "#{@microcode[:set_flag]} (#{@flags[0]} #{@flags[1]})")
|
390
|
+
else
|
391
|
+
cycle(microcode: "#{@microcode[:enable]} (#{@flags[0]})")
|
392
|
+
cycle(microcode: "#{@microcode[:set_flag]} (#{@flags[0]})")
|
393
|
+
end
|
394
|
+
cycle(microcode: "loop_here_#{@unique_counter}: if (branch_expr) jump loop_here_#{@unique_counter}")
|
395
|
+
|
396
|
+
@unique_counter += 1 # Increment so a different label will be applied if another
|
397
|
+
# handshake is called in the same pattern
|
398
|
+
end
|
399
|
+
|
400
|
+
# Capture a vector to the tester HRAM.
|
401
|
+
#
|
402
|
+
# This method applys a store vector (stv) opcode to the previous vector, note that is does
|
403
|
+
# not actually generate a new vector.
|
404
|
+
#
|
405
|
+
# Sometimes when generating vectors within a loop you may want to apply a stv opcode
|
406
|
+
# retrospectively to a previous vector, passing in an offset option will allow you
|
407
|
+
# to do this.
|
408
|
+
#
|
409
|
+
# On J750 the pins argument is ignored since the tester only supports whole vector capture.
|
410
|
+
#
|
411
|
+
# @example
|
412
|
+
# $tester.cycle # This is the vector you want to capture
|
413
|
+
# $tester.store # This applys the STV opcode
|
414
|
+
#
|
415
|
+
# $tester.cycle # This one gets stored
|
416
|
+
# $tester.cycle
|
417
|
+
# $tester.cycle
|
418
|
+
# $tester.store(:offset => -2) # Just realized I need to capture that earlier vector
|
419
|
+
def store(*pins)
|
420
|
+
options = pins.last.is_a?(Hash) ? pins.pop : {}
|
421
|
+
options = { offset: 0
|
422
|
+
}.merge(options)
|
423
|
+
pins = pins.flatten.compact
|
424
|
+
if pins.empty?
|
425
|
+
fail 'For the UltraFLEX you must supply the pins to store/capture'
|
426
|
+
end
|
427
|
+
pins.each do |pin|
|
428
|
+
pin.restore_state do
|
429
|
+
pin.capture
|
430
|
+
update_vector microcode: 'stv', offset: options[:offset]
|
431
|
+
update_vector_pin_val pin, microcode: 'stv', offset: options[:offset]
|
432
|
+
last_vector(options[:offset]).dont_compress = true
|
433
|
+
end
|
434
|
+
end
|
435
|
+
end
|
436
|
+
alias_method :to_hram, :store
|
437
|
+
alias_method :capture, :store
|
438
|
+
|
439
|
+
def reload_counters(name)
|
440
|
+
microcode "reload #{name}"
|
441
|
+
end
|
442
|
+
|
443
|
+
def set_msb(name)
|
444
|
+
microcode "set_msb #{name}"
|
445
|
+
end
|
446
|
+
|
447
|
+
# Capture the next vector generated to HRAM
|
448
|
+
#
|
449
|
+
# This method applies a store vector (stv) opcode to the next vector to be generated,
|
450
|
+
# note that is does not actually generate a new vector.
|
451
|
+
#
|
452
|
+
# pin argument must be provided so that 'V' (valid) state can be applied to the pin
|
453
|
+
# if not already.
|
454
|
+
#
|
455
|
+
# @example
|
456
|
+
# $tester.store_next_cycle
|
457
|
+
# $tester.cycle # This is the vector that will be captured
|
458
|
+
def store_next_cycle(*pins)
|
459
|
+
options = pins.last.is_a?(Hash) ? pins.pop : {}
|
460
|
+
options = {
|
461
|
+
}.merge(options)
|
462
|
+
pins = pins.flatten.compact
|
463
|
+
if pins.empty?
|
464
|
+
fail 'For the UltraFLEX you must supply the pins to store/capture'
|
465
|
+
end
|
466
|
+
pins.each { |pin| pin.save; pin.capture }
|
467
|
+
# Register this clean up function to be run after the next vector
|
468
|
+
# is generated (SMcG: cool or what! DH: Yes, very cool!)
|
469
|
+
preset_next_vector(microcode: 'stv') do
|
470
|
+
pins.each(&:restore)
|
471
|
+
end
|
472
|
+
end
|
473
|
+
alias_method :store!, :store_next_cycle
|
474
|
+
end
|
475
|
+
end
|
476
|
+
UltraFLEX = IGXLBasedTester::UltraFLEX
|
477
|
+
end
|