cross_origen 0.7.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/fix_my_workspace +10 -2
- data/config/{development.rb → boot.rb} +1 -5
- data/config/shared_commands.rb +10 -6
- data/config/version.rb +2 -2
- data/lib/cross_origen/cmsis_svd.rb +133 -121
- data/lib/cross_origen/ip_xact.rb +51 -7
- data/lib/cross_origen/xml_doc.rb +1 -1
- data/lib/cross_origen.rb +40 -28
- data/lib/cross_origen_dev/dut.rb +62 -0
- data/templates/web/index.md.erb +26 -9
- metadata +8 -12
- data/config/environment.rb +0 -36
- data/config/users.rb +0 -18
- data/lib/cross_origen/commands/import.rb +0 -32
- data/lib/cross_origen/origen_format.rb +0 -554
- data/lib/cross_origen/test/dut.rb +0 -64
data/templates/web/index.md.erb
CHANGED
@@ -32,8 +32,8 @@ spec.add_runtime_dependency "<%= Origen.app.name %>", ">= <%= Origen.app.version
|
|
32
32
|
Currently the following formats are supported:
|
33
33
|
|
34
34
|
* IP-XACT - Import and Export registers and hierarchy
|
35
|
+
* CMSIS-SVD - Import registers and hierarchy
|
35
36
|
* RALF (Synopsys format) - Export registers
|
36
|
-
* Origen - Export registers and hierarchy
|
37
37
|
|
38
38
|
See the [examples](<%= path "examples" %>) for format specific documentation, but
|
39
39
|
most formats should follow this basic structure...
|
@@ -41,17 +41,17 @@ most formats should follow this basic structure...
|
|
41
41
|
#### Data Import
|
42
42
|
|
43
43
|
When the <code>CrossOrigen</code> module is included in a class it gets access
|
44
|
-
to
|
44
|
+
to a <code>cr_import</code> method.
|
45
45
|
This will automatically detect the type of the given file and select the appropriate
|
46
46
|
import rules.
|
47
47
|
|
48
48
|
The file to be imported must exist locally or it can be pulled automatically from
|
49
|
-
a 3rd party
|
49
|
+
a 3rd party repository in which case the file will be fetched the first time Origen
|
50
50
|
is invoked and then cached locally for future invocations.
|
51
51
|
Supported repositories are shown in the example below.
|
52
52
|
|
53
53
|
~~~ruby
|
54
|
-
class
|
54
|
+
class MyDevice
|
55
55
|
|
56
56
|
include CrossOrigen
|
57
57
|
|
@@ -61,14 +61,31 @@ class D_IP_ANA_TEST_ANNEX_SYN
|
|
61
61
|
# Import from Design Sync
|
62
62
|
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")
|
63
63
|
end
|
64
|
-
|
65
64
|
end
|
66
65
|
~~~
|
67
66
|
|
68
|
-
The
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
The given file(s) will be parsed the first time the model is instantiated, which could take some time
|
68
|
+
depending on the amount of data being imported.
|
69
|
+
|
70
|
+
During the import process, the data from the files will be converted to Origen native format and stored
|
71
|
+
to the application's `vendor` directory. You should check these generated files into your revision control
|
72
|
+
system, although you should refrain from modifying them by hand since edits will be lost if the import
|
73
|
+
process is repeated in future.
|
74
|
+
|
75
|
+
On subsequent model instantiations, the `cr_import` method will recognize that the data has already been
|
76
|
+
imported and it will load directly from the `vendor` dir. Generally speaking, this will make the model
|
77
|
+
instantiation time instant, regardless of how much data was originally imported.
|
78
|
+
|
79
|
+
If you obtain a new version of the 3rd party source file, it can be re-imported by passing a
|
80
|
+
`refresh` option to `cr_import`:
|
81
|
+
|
82
|
+
~~~ruby
|
83
|
+
cr_import(path: "#{Origen.root}/imports/test-annex-Block-registers.xml", refresh: true)
|
84
|
+
~~~
|
85
|
+
|
86
|
+
Or, a global refresh (meaning every `cr_import` that is encountered with a given Origen command) can be
|
87
|
+
invoked by passing the `--refresh` option to any Origen command which will instantiate the model you
|
88
|
+
wish to refresh.
|
72
89
|
|
73
90
|
#### Data Export
|
74
91
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cross_origen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.32'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.32'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sanitize
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,22 +47,18 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- bin/fix_my_workspace
|
49
49
|
- config/application.rb
|
50
|
+
- config/boot.rb
|
50
51
|
- config/commands.rb
|
51
|
-
- config/development.rb
|
52
|
-
- config/environment.rb
|
53
52
|
- config/shared_commands.rb
|
54
|
-
- config/users.rb
|
55
53
|
- config/version.rb
|
56
54
|
- lib/cross_origen.rb
|
57
55
|
- lib/cross_origen/cmsis_svd.rb
|
58
|
-
- lib/cross_origen/commands/import.rb
|
59
56
|
- lib/cross_origen/design_sync.rb
|
60
57
|
- lib/cross_origen/headers.rb
|
61
58
|
- lib/cross_origen/ip_xact.rb
|
62
|
-
- lib/cross_origen/origen_format.rb
|
63
59
|
- lib/cross_origen/ralf.rb
|
64
|
-
- lib/cross_origen/test/dut.rb
|
65
60
|
- lib/cross_origen/xml_doc.rb
|
61
|
+
- lib/cross_origen_dev/dut.rb
|
66
62
|
- templates/headers/default.h.erb
|
67
63
|
- templates/ralf/_register.ralf.erb
|
68
64
|
- templates/ralf/default.ralf.erb
|
@@ -91,7 +87,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
87
|
requirements:
|
92
88
|
- - ">="
|
93
89
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
90
|
+
version: '2'
|
95
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
92
|
requirements:
|
97
93
|
- - ">="
|
@@ -99,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
95
|
version: 1.8.11
|
100
96
|
requirements: []
|
101
97
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.6.
|
98
|
+
rubygems_version: 2.6.8
|
103
99
|
signing_key:
|
104
100
|
specification_version: 4
|
105
101
|
summary: Translators for importing and exporting Origen data to/from 3rd party formats
|
data/config/environment.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
# This file will be required by Origen before your target is loaded, you
|
2
|
-
# can use this to require all of your files, which is the easiest way
|
3
|
-
# to get started. As your experience grows you may wish to require only the
|
4
|
-
# minimum files required to allow the target to be initialized and let
|
5
|
-
# each class require its own dependencies.
|
6
|
-
#
|
7
|
-
# It is recommended that you keep all of your application logic in lib/
|
8
|
-
# The lib directory has already been added to the search path and so any files
|
9
|
-
# in there can be referenced from here with a relative path.
|
10
|
-
#
|
11
|
-
# Note that pattern files do not need to be referenced from here and these
|
12
|
-
# will be located automatically by origen.
|
13
|
-
|
14
|
-
# This says load the file "lib/pioneer.rb" the first time anyone makes a
|
15
|
-
# reference to the class name 'Pioneer'.
|
16
|
-
#autoload :Pioneer, "pioneer"
|
17
|
-
# This is generally preferable to using require which will load the file
|
18
|
-
# regardless of whether it is needed by the current target or not:
|
19
|
-
#require "pioneer"
|
20
|
-
# Sometimes you have to use require however:-
|
21
|
-
# 1. When defining a test program interface:
|
22
|
-
#require "interfaces/j750"
|
23
|
-
# 2. If you want to extend a class defined by an imported application, in
|
24
|
-
# this case your must use required and supply a full path (to distinguish
|
25
|
-
# it from the one in the parent application):
|
26
|
-
#require "#{Origen.root}/c90_top_level/p2"
|
27
|
-
module CrossOrigen
|
28
|
-
autoload :XMLDoc, "cross_origen/xml_doc"
|
29
|
-
autoload :Headers, "cross_origen/headers"
|
30
|
-
autoload :Ralf, "cross_origen/ralf"
|
31
|
-
autoload :IpXact, "cross_origen/ip_xact"
|
32
|
-
autoload :DesignSync, "cross_origen/design_sync"
|
33
|
-
autoload :OrigenFormat, "cross_origen/origen_format"
|
34
|
-
autoload :CMSISSVD, "cross_origen/cmsis_svd"
|
35
|
-
end
|
36
|
-
require "cross_origen"
|
data/config/users.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# This file defines the users associated with your project, it is basically the
|
2
|
-
# mailing list for release notes.
|
3
|
-
#
|
4
|
-
# You can split your users into "admin" and "user" groups, the main difference
|
5
|
-
# between the two is that admin users will get all tag emails, users will get
|
6
|
-
# emails on external/official releases only.
|
7
|
-
#
|
8
|
-
# Users are also prohibited from running the "origen tag" task, but this is
|
9
|
-
# really just to prevent a casual user from executing it inadvertently and is
|
10
|
-
# not intended to be a serious security gate.
|
11
|
-
module Origen
|
12
|
-
module Users
|
13
|
-
def users
|
14
|
-
@users ||= [
|
15
|
-
]
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
options = {}
|
2
|
-
opt_parser = OptionParser.new do |opts|
|
3
|
-
opts.banner = <<-END
|
4
|
-
Usage: origen cr:import FILE [options]
|
5
|
-
|
6
|
-
Import the given file into Origen format.
|
7
|
-
This will output a Ruby module that can then be included in an Origen model
|
8
|
-
to add the contained registers, sub-blocks, etc.
|
9
|
-
|
10
|
-
END
|
11
|
-
opts.on('-o', '--output PATH', String, 'Override the default output file') { |t| options[:output] = t }
|
12
|
-
end
|
13
|
-
opt_parser.parse! ARGV
|
14
|
-
|
15
|
-
file = ARGV[0]
|
16
|
-
unless file
|
17
|
-
puts 'You must supply a file to import!'
|
18
|
-
exit
|
19
|
-
end
|
20
|
-
|
21
|
-
unless File.exist?(file)
|
22
|
-
puts 'That file does not exist!'
|
23
|
-
exit
|
24
|
-
end
|
25
|
-
|
26
|
-
snippet = IO.read(file, 2000) # Read first 2000 characters
|
27
|
-
case snippet
|
28
|
-
when /CMSIS-SVD.xsd/
|
29
|
-
CrossOrigen::CMSISSVD.new(nil).import(file, options)
|
30
|
-
else
|
31
|
-
puts 'Unknown file format!'
|
32
|
-
end
|