ipxact-ruby 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ipxact/component.rb +11 -0
- data/spec/integration/data_calculation_spec.rb +17 -0
- metadata +5 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.13.
|
1
|
+
0.13.1
|
data/lib/ipxact/component.rb
CHANGED
@@ -180,6 +180,17 @@ class IPXACT::Component
|
|
180
180
|
.first[:port_data][:registers]
|
181
181
|
end
|
182
182
|
|
183
|
+
# Returns the port that matches the given name, if any.
|
184
|
+
#
|
185
|
+
# @param [String] port_name The name of the port to search for
|
186
|
+
#
|
187
|
+
# @return [Hash] +nil+ if no port could be found, or else a Hash that with
|
188
|
+
# the port's data.
|
189
|
+
#
|
190
|
+
def port(port_name)
|
191
|
+
ports.detect{|p| p[:name] == port_name}
|
192
|
+
end
|
193
|
+
|
183
194
|
# Commodity method for getting a component instance called +instance_name+,
|
184
195
|
# either from the direct subcomponents of the component, or from the
|
185
196
|
# subcomponents hierarchy.
|
@@ -130,4 +130,21 @@ describe "The data calculation functions of our IPXACT tool" do
|
|
130
130
|
base_address.should == 0x30004000
|
131
131
|
end
|
132
132
|
|
133
|
+
it "should be able to take into account the component registers' corresponding address block's base address" do
|
134
|
+
components = IPXACT::load_components(PLATFORM_PATH)
|
135
|
+
designs = IPXACT::load_designs(PLATFORM_PATH)
|
136
|
+
platform = IPXACT::Parser::PlatformData.parse_platform(["Leon2Platform", "1.2"], components, designs)
|
137
|
+
data_path = platform.resolve_data_path('i_proc', 'i_uart_scml')
|
138
|
+
|
139
|
+
base_address = platform.resolve_base_address(data_path)
|
140
|
+
port_id = data_path.last[1]
|
141
|
+
component = platform.rec_get_subcomponent('i_uart_scml')
|
142
|
+
port = component.port(port_id[:port_name])
|
143
|
+
|
144
|
+
# N.B. There's a remap address error in the "IP-XACT_TLM_Examples_AppNote_V1.5" document that's
|
145
|
+
# released with the IP-XACT specification: remap address for the i_uart_scml instance does not match
|
146
|
+
# what is actually in the Leon2Platform file.
|
147
|
+
(base_address + port[:port_data][:base_address].to_i(16)).should == 0x30000000 + 0x2000 + 0xB0000000
|
148
|
+
end
|
149
|
+
|
133
150
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 13
|
8
|
-
-
|
9
|
-
version: 0.13.
|
8
|
+
- 1
|
9
|
+
version: 0.13.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Guillaume Godet-Bar
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-12-
|
17
|
+
date: 2010-12-20 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -190,8 +190,8 @@ homepage: http://tima-sls.imag.fr/www/research/ipxact/
|
|
190
190
|
licenses: []
|
191
191
|
|
192
192
|
post_install_message:
|
193
|
-
rdoc_options:
|
194
|
-
|
193
|
+
rdoc_options: []
|
194
|
+
|
195
195
|
require_paths:
|
196
196
|
- lib
|
197
197
|
required_ruby_version: !ruby/object:Gem::Requirement
|