% render "layouts/basic.html" do %# HTML tags can be embedded in mark down files if you want to do specific custom %# formatting like this, but in most cases that is not required.
CrossOrigen
module is included in a class it gets access
to an cr_import
method.
This will automatically detect the type of the given file and select the appropriate
import rules.
The file to be imported must exist locally or it can be pulled automatically from
a 3rd party respository in which case the file will be fetched the first time Origen
is invoked and then cached locally for future invocations.
Supported repositories are shown in the example below.
~~~ruby
class D_IP_ANA_TEST_ANNEX_SYN
include CrossOrigen
def initialize
# Import from a local file
cr_import(path: "#{Origen.root}/imports/test-annex-Block-registers.xml")
# Import from Design Sync
cr_import(vault: "sync://sync-15040:15040/Projects/nvm_c90tfsn2w/ftf2/rtl_v/kx2_4m/.regs", version: "ftf2_kx2_4096k2_256_128k_64_4k.00.00.01.00")
end
end
~~~
The plugin will add attribute getter and setter methods to the top-level object and to registers and bits
to contain any metadata information which does not have a direct equivalent within Origen. Generally
the name given to such data will be the lower cased and underscored (following std Ruby
conventions) version of the attribute name.
#### Data Export
The CrossOrigen
module adds some methods to export the given object
as a string in the given format, for example a to_ip_xact
method is available
to generate an IP-XACT XML representation of an object.
To create an actual XML file a simple template would be setup as shown below
and then compiled through Origen:
~~~eruby
<%= "<" + "%= $dut.to_ip_xact %" + ">" %>
~~~
In future support may be added to export directly to a 3rd party tool if
it provides such an API.
### How To Setup a Development Environment
[Clone the repository from Github](https://github.com/Origen-SDK/cross_origen).
Follow the instructions here if you want to make a 3rd party app
workspace use your development copy of the <%= Origen.app.config.initials %> plugin:
[Setting up a Plugin Development Environment](http://origen-sdk.org/origen/latest/guides/plugins)
This plugin also contains a test suite, make sure this passes before committing
any changes!
~~~text
origen test
~~~
% end