Conversation
pderouen
approved these changes
Jan 18, 2018
Member
|
Thanks for this! This looks good. I can pull it down soon and start messing with it. I'll trial it with some basics on Linux then move it over to Windows. Is the simulator ready to actually replay sims yet? I saw that it can sample them but did it have the replay feature as well? |
Member
Author
|
@coreyeng, yes the replay feature is working as described in the PR. I'll go ahead and merge this now since I want to get OrigenSim installed globally in our environment for a project I am working on, obviously we can open another PR to tweak if necessary once you starto to use this. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the ability to generate org files (Origen vector file format) as described in this RFC: Origen-SDK/rfcs#7
This is not intended to be a user-facing feature, but is internal architecture for use within Origen and its plugins to generate org files or to otherwise capture and process sequences of operations.
To open an Org File for read or write
By default, the Org file will be created at
#{Origen.root}/pattern/org/#{current_target}/#{id}.org, though theopenmethod will accept:pathand:filenameoptions is you want to change it.The only API the org_file object itself really provides to the application space is to check whether or not the underlying file exists:
To Read an Org File
An example of reading and executing an Org file is shown below:
To Write an Org File
The
org_fileinstance is not intended to be written to directly by application code. Rather objects such as the pins, tester, etc. can be enabled to record the operations that are performed on them into the currently open org file:Giving objects record capability
This PR enables this recording feature on Pins and PinCollections (groups).
It can be quite easily enabled for other objects like this:
By default the above won't capture any methods unless the user defines them when calling
record_to_org_fileas shown in the above examples.To define a default set of methods to be captured for the given class, define a method like
this:
A note on self!
TL:DR - If you include
OrgFile::Interceptablein a class, never use theselfkeyword with that class's methods, usemyselfinstead.The capture works here by wrapping the object being recorded with a thin wrapper object which intercepts all operations called on the object and selectively records them as they go past before always passing on to the underlying object.
In order for the org file to be an accurate reflection of what a pattern does, it is vital that an un-wrapped copy of the object being recorded never finds its way into user space. i.e. if the application calls an operation on an un-wrapped object then it will not be be recorded.
I think the only way to generate such a reference to the un-wrapped object is when calling
selffrom within the object's own methods.Unfortunately,
self, being a keyword rather than a method, is one of the few things that you can't override in Ruby.So to get around that I created the
myselfmethod which returns the wrapped version of the object rather than the un-wrapped version you would get fromself.Generally all you need to do here is find/replace
selfwithmyselfand you will see that in the Pin and PinCollection classes in this PR.Notes on creating an Org file generator
@coreyeng, I think this is mostly all useful to you to help create the org file output of a whole pattern so that it can be replayed without the whole app being available.
I think we probably don't want to create an Org file tester driver, rather I would add a
--org-fileswitch toorigen g.Then enable interceptable on the
OrigenTestersbase class and when you see the switch being set, open up an org file and call record on the tester and all DUT pins.The
tester.cyclemethod may need some special handling, currently there is aOrigen::OrgFile.cyclemethod that should be called whenever a cycle occurs.