-
Notifications
You must be signed in to change notification settings - Fork 24
new v93k loop PR #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
new v93k loop PR #158
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
|
@@ -1751,5 +1765,15 @@ flow FLOW_CONTROL { | |
| else | ||
| { | ||
| } | ||
| for @index = 0; @index < @loop ; @index = @index + 1; do | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
|---|---|---|
|
|
@@ -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" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you need to generate something more unique than just
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The current ATP loop API allows the user to pass an integer or a string representing a flow variable for the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
endIf 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) | ||
|
|
||
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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?