Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions approved/v93k/flow_control.aiv
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ lev2_test5 .tmf
long_test .tmf
long_test1 .tmf
long_test2 .tmf
loop_check .tmf
loop_check_no_var .tmf
nt1 .tmf
nt2 .tmf
nt3 .tmf
Expand Down
2 changes: 2 additions & 0 deletions approved/v93k/referenced.list
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ lev2_test5
long_test
long_test1
long_test2
loop_check
loop_check_no_var
margin_read0_ckbd
margin_read1_all1
margin_read1_ckbd
Expand Down
40 changes: 40 additions & 0 deletions approved/v93k/testflow/mfh.testflow.group/flow_control.tf
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ tm_172:
tm_173:
"output" = "None";
"testName" = "Functional";
tm_174:
"output" = "None";
"testName" = "Functional";
tm_175:
"output" = "None";
"testName" = "Functional";
tm_18:
"output" = "None";
"testName" = "Functional";
Expand Down Expand Up @@ -693,6 +699,10 @@ tm_172:
"Functional" = "":"NA":"":"NA":"":"":"";
tm_173:
"Functional" = "":"NA":"":"NA":"":"":"";
tm_174:
"Functional" = "":"NA":"":"NA":"":"":"";
tm_175:
"Functional" = "":"NA":"":"NA":"":"":"";
tm_18:
"Functional" = "":"NA":"":"NA":"":"":"";
tm_19:
Expand Down Expand Up @@ -1044,6 +1054,10 @@ tm_172:
testmethod_class = "ac_tml.AcTest.FunctionalTest";
tm_173:
testmethod_class = "ac_tml.AcTest.FunctionalTest";
tm_174:
testmethod_class = "ac_tml.AcTest.FunctionalTest";
tm_175:
testmethod_class = "ac_tml.AcTest.FunctionalTest";
tm_18:
testmethod_class = "ac_tml.AcTest.FunctionalTest";
tm_19:
Expand Down Expand Up @@ -1481,6 +1495,22 @@ long_test_BEA7F3B:
override_testf = tm_31;
site_control = "parallel:";
site_match = 2;
loop_check_BEA7F3B:
local_flags = output_on_pass, output_on_fail, value_on_pass, value_on_fail, per_pin_on_pass, per_pin_on_fail;
override = 1;
override_seqlbl = "loop_check";
override_test_number = 60001;
override_testf = tm_174;
site_control = "parallel:";
site_match = 2;
loop_check_no_var_BEA7F3B:
local_flags = output_on_pass, output_on_fail, value_on_pass, value_on_fail, per_pin_on_pass, per_pin_on_fail;
override = 1;
override_seqlbl = "loop_check_no_var";
override_test_number = 60002;
override_testf = tm_175;
site_control = "parallel:";
site_match = 2;
nt1_BEA7F3B:
local_flags = output_on_pass, output_on_fail, value_on_pass, value_on_fail, per_pin_on_pass, per_pin_on_fail;
override = 1;
Expand Down Expand Up @@ -3764,6 +3794,16 @@ test_flow
else
{
}
for @loop = 1; @loop < 5 ; @loop = @loop + 1; do
test_number_loop_increment = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this test_number_loop_increment ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@info-rchitect is this something that just needs to be removed from here?

{
run(loop_check_BEA7F3B);
}
for @index = 1; @index < 5 ; @index = @index + 1; do
test_number_loop_increment = 0
{
run(loop_check_no_var_BEA7F3B);
}

}, open,"Flow Control Testing","Flow to exercise the Flow Control API"

Expand Down
2 changes: 2 additions & 0 deletions approved/v93k/vectors/flow_control.pmfl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ lev2_test5.binl.gz
long_test.binl.gz
long_test1.binl.gz
long_test2.binl.gz
loop_check.binl.gz
loop_check_no_var.binl.gz
nt1.binl.gz
nt2.binl.gz
nt3.binl.gz
Expand Down
24 changes: 24 additions & 0 deletions approved/v93k_smt8/OrigenTesters/flows/FLOW_CONTROL.flow
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,20 @@ flow FLOW_CONTROL {
testName = "Functional";
}

suite loop_check calls ac_tml.AcTest.FunctionalTest {
measurement.pattern = setupRef(OrigenTesters.patterns.loop_check);
measurement.specification = setupRef(OrigenTesters.specs.specs.Nominal);
output = "None";
testName = "Functional";
}

suite loop_check_no_var calls ac_tml.AcTest.FunctionalTest {
measurement.pattern = setupRef(OrigenTesters.patterns.loop_check_no_var);
measurement.specification = setupRef(OrigenTesters.specs.specs.Nominal);
output = "None";
testName = "Functional";
}

suite nt1 calls ac_tml.AcTest.FunctionalTest {
measurement.pattern = setupRef(OrigenTesters.patterns.nt1);
measurement.specification = setupRef(OrigenTesters.specs.specs.Nominal);
Expand Down Expand Up @@ -1751,5 +1765,15 @@ flow FLOW_CONTROL {
else
{
}
for @index = 0; @index < @loop ; @index = @index + 1; do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt this is valid smt8, its fine to not support it on SMT8 yet, but in that case either output nothing and emit a warning, or else raise an error rather than generating garbage.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@info-rchitect can you look at this? adding it in a tester.smt7? check should be okay

test_number_loop_increment = 0
{
loop_check.execute();
}
for @index = 0; @index < 5 ; @index = @index + 1; do
test_number_loop_increment = 0
{
loop_check_no_var.execute();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,5 @@ SMALL.test2,test2,54110,test2,0,0,,
test_3lt5,test_3lt5,55000,test_3lt5,0,0,,
test_5gt4_or_4gt5,test_5gt4_or_4gt5,55002,test_5gt4_or_4gt5,0,0,,
test_5gt4_and_4gt3,test_5gt4_and_4gt3,55004,test_5gt4_and_4gt3,0,0,,
loop_check,loop_check,60001,loop_check,0,0,,
loop_check_no_var,loop_check_no_var,60002,loop_check_no_var,0,0,,
2 changes: 2 additions & 0 deletions approved/v93k_smt8/referenced.list
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ lev2_test5
long_test
long_test1
long_test2
loop_check
loop_check_no_var
margin_read0_ckbd
margin_read1_all1
margin_read1_ckbd
Expand Down
19 changes: 19 additions & 0 deletions lib/origen_testers/smartest_based_tester/base/flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,25 @@ def capture_lines
@lines_buffer.pop
end

def on_loop(node)
loop_start = node.children[0]
loop_end = node.children[1]
loop_inc = node.children[2]
index_flag = node.children[3] if node.children[3].is_a?(String)
if index_flag.is_a?(String)
line "for @#{index_flag} = #{loop_start}; @#{index_flag} < #{loop_end} ; @#{index_flag} = @#{index_flag} + #{loop_inc}; do"
else
line "for @index = #{loop_start}; @index < #{loop_end} ; @index = @index + #{loop_inc}; do"
Copy link
Member

@ginty ginty May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to generate something more unique than just @index, e.g. consider the case of nested loops.
If you look around in here there should be other examples of generating unique ids.

Copy link
Member Author

@info-rchitect info-rchitect May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ginty Is that the responsibility of Origen? Seems like that should be up to the user similar to how one would use different variables in a C for loop.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the kind of detail that a framework should take care of

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also consider the Origen API is trying to be as ATE-agnostic as possible. If a user only wants to loop X times, then they should be able to express that without worrying about flow vars. Such things may not even make sense on other platforms.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also consider the Origen API is trying to be as ATE-agnostic as possible. If a user only wants to loop X times, then they should be able to express that without worrying about flow vars. Such things may not even make sense on other platforms.

The current ATP loop API allows the user to pass an integer or a string representing a flow variable for the to option. Wouldn't we just handle that in each of the tester generators? If a particular generator does not use an option available in the ATP flow method then it errors and instructs the user.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the way Origen works man, with the current loop API I would and should expect this to just work:

loop from: 1, to: dut.number_of_x, step: 1 do
    loop from: 1, to: dut.number_of_y, step: 1 do
      func :some_test
    end
end

If the v93k needs a flow var to be defined to enable that to work, then its Origen's responsibility to create one (if the user doesn't care about what it's called), and make sure what it is creating will work in cases like the above.

end
line 'test_number_loop_increment = 0'
line '{'
@indent += 1
children_start_index = index_flag.nil? ? 3 : 4
process_all(node.children[children_start_index..-1])
@indent -= 1
line '}'
end

def on_test(node)
test_suite = node.find(:object).to_a[0]
if test_suite.is_a?(String)
Expand Down
9 changes: 9 additions & 0 deletions program/flow_control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -521,4 +521,13 @@
func :read1, id: :ta5, bin: 10, number: 60000
func :erase1, if_all_sites_passed: :ta5, bin: 12, number: 60010
end

if tester.smt7?
loop from: 1, to: 5, step: 1, var: "loop" do
func :loop_check, test_number: 60001
end
loop from: 1, to: 5, step: 1 do
func :loop_check_no_var, test_number: 60002
end
end
end
30 changes: 30 additions & 0 deletions templates/origen_guides/program/flowapi.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,35 @@ group :my_other_group, comment: "This is the other group" do
end
~~~

#### Looping

A loop API exists, though it currently only generates content for the V93K platform.

~~~ruby
loop from: 1, to: 5, step: 1, var: "loop" do
func :loop_check, test_number: 60001
end
loop from: 1, to: 5, step: 1 do
func :loop_check_no_var, test_number: 60002
end
~~~

If the optional `var` option is passed it will replace the `to` option. The user is expected to handle setting the flow variable to a proper value.

~~~text
for @index = 0; @index < @loop ; @index = @index + 1; do
test_number_loop_increment = 0
{
run(loop_check_BEA7F3B);
}
for @index = 0; @index < 5 ; @index = @index + 1; do
test_number_loop_increment = 0
{
run(loop_check_no_var_BEA7F3B);
}
~~~




% end