-
Notifications
You must be signed in to change notification settings - Fork 24
Misc #356
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
Conversation
… if a given object is a subblock
…page to 'Current and Default Plugins'. Moved the misc topics out of the plugins section and placed under the miscellaneous topics section.
…os-complement heleprs.
lib/origen/core_ext/object.rb
Outdated
| # 'hi'.origen_subblock? #=> false | ||
| # @see https://origen-sdk.org/origen/guides/models/defining/#Adding_Sub_Blocks | ||
| def origen_subblock? | ||
| self.class.ancestors.include?(Origen::Model) || self.class.ancestors.include?(Origen::Controller) |
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.
Could just be written as:
is_a?(Origen::Model) || is_a?(Origen::Controller)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.
Yes, that's much cleaner. I'll update this.
|
Lot's of good stuff in here! I don't think the On the multi-pin fetch feature, should it not return a |
|
Thanks for the feedback! I think references to As for the pins, I'll look into returning |
…in retrieval to return a PinCollection instance
|
I think doing the initial loading via something like this is not really the way it should be done: I think I saw similar issues in the past and decided that making references to apps/plugins/roots at the time when all that stuff was still being loaded was a bad idea. The solution is that if you are overriding 3rd party code, like origen_testers in this example, then you should not do it in a file called Then there is no ambiguity for you to resolve by an absolute reference and in your app you can just have |
|
If the former require statement isn't correct, then that's fine. I can change it. In this particular case, I inherited this code, but since it seemed to work at some point (got checked in after all) I figured I'd try to keep it as it was and make Origen support it. We're not actually overwriting something. We're trying to make an interface hierarchy for various testblocks, platforms and processes. It seemed that using the former syntax, Origen would require |
|
In any case, if the former isn't supported, I'll update our plugin accordingly. Since it seemed to work at some point, I went the route of making it work but I reinstated that call, so should be a non-issue, at least w.r.t. this PR. |
|
@ginty, are you okay with merging this? I've put |
Hello. I've got some small, miscellaneous stuff that I've added locally. Most of these are pretty small additions that I've needed for esoteric purposes, but instead of adding them to my own apps, I've added them here as they might be useful for others.
Some things, like the subblock or plugin additions I only discovered after I'd already added these (I've had this branch for a while), but since they were already added and in use, I didn't feel the need to take them out.
The only one I'm not sure on is the change for loading the application. There's a problem I'm encountering that I really can't find the cause of, but it seems related to loading OrigenTesters multiple times and having the ActiveConcern's
includedblock run more than once. This seems to happen when plugins useOrigen.app(plugin)before the application has loaded completely and I've found that if I take out loading the application when a plugin is given, everything resolves without any ill-effects. I've still been able to generate test program collateral and run normally without this, so I'm proposing we just remove it unless someone with more knowledge on the subject can weigh in.Everything else should be spec-ed or documented. I glossed over some of things which already had a solution, such as using sub_block groups (already in the docs) instead of searching based on a class name. A quick summary:
sub_blocksmethod to retrieve all sub_blocks of a given class. For example,dut.sub_blocks(GPIO)will return all sub_blocks of that class. You can also give it an instance of that class as well, yielding the same result. These some specs that show examples of this.origen_subblock?method toObjectthat'll return if a given instance inherits from eitherModelorController.httplinks tohttps.define filewill crash when used to generate the model page. Although I think this is more due to incomplete sub_block instantiation, I still don't think it should crash if not provided. This change will just return the register description if adefine_fileis not present.