ipxact-ruby 0.13.2 → 0.14.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.
- data/Rakefile +14 -2
- data/VERSION +1 -1
- data/lib/ipxact.rb +0 -1
- data/lib/ipxact/component.rb +0 -132
- data/spec/integration/data_calculation_spec.rb +0 -93
- metadata +105 -10
- data/lib/ipxact/pathfinder/graph_pathfinder.rb +0 -191
- data/spec/unit/graph_pathfinder_spec.rb +0 -128
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2010 TIMA Laboratory
|
1
|
+
# Copyright (C) 2010, 2011 TIMA Laboratory
|
2
2
|
#
|
3
3
|
# This program is free software: you can redistribute it and/or modify
|
4
4
|
# it under the terms of the GNU General Public License as published by
|
@@ -22,8 +22,20 @@ begin
|
|
22
22
|
gemspec.email = "guillaume.godetbar@gmail.com "
|
23
23
|
gemspec.homepage = "http://tima-sls.imag.fr/www/research/ipxact/"
|
24
24
|
gemspec.authors = ["Guillaume Godet-Bar"]
|
25
|
-
gemspec.files = FileList["{
|
25
|
+
gemspec.files = FileList["{schemas,autotest}/**/*", "lib/ipxact.rb", "lib/ipxact/*", "lib/ipxact/parser/*", "lib/ipxact/pathfinder/graph_pathfinder.rb", ".autotest", ".gitignore", "Rakefile", "VERSION"]
|
26
|
+
gemspec.test_files = FileList["spec/**/*"]
|
26
27
|
gemspec.add_dependency 'nokogiri'
|
28
|
+
gemspec.post_install_message = <<-POST_INSTALL_MESSAGE
|
29
|
+
|
30
|
+
("-._UPGRADING_.-")
|
31
|
+
|
32
|
+
Thank you for installing IP-Xact Ruby - #{File.read("VERSION").strip}.
|
33
|
+
Please make sure you have a look at http://tima-sls.imag.fr/www/research/ipxact/upgrading/
|
34
|
+
for upgrade info!
|
35
|
+
|
36
|
+
|
37
|
+
POST_INSTALL_MESSAGE
|
38
|
+
|
27
39
|
end
|
28
40
|
rescue LoadError
|
29
41
|
puts "Jeweler not available. Install it with: gem install jeweler"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.14.0
|
data/lib/ipxact.rb
CHANGED
@@ -191,5 +191,4 @@ require File.join File.dirname(__FILE__), 'ipxact/parser'
|
|
191
191
|
require File.join File.dirname(__FILE__), 'ipxact/platform'
|
192
192
|
require File.join File.dirname(__FILE__), 'ipxact/register'
|
193
193
|
require File.join File.dirname(__FILE__), 'ipxact/identifier'
|
194
|
-
require File.join File.dirname(__FILE__), 'ipxact/pathfinder/graph_pathfinder'
|
195
194
|
|
data/lib/ipxact/component.rb
CHANGED
@@ -72,93 +72,6 @@ class IPXACT::Component
|
|
72
72
|
!(self.cpus.nil? || self.cpus.empty?)
|
73
73
|
end
|
74
74
|
|
75
|
-
# Calculates an optimal path in the subcomponent graph between
|
76
|
-
# +subcomponent_start+ and +subcomponent_end+. This computation takes into
|
77
|
-
# account hierarchical subcomponents, and identifies optimal sub-paths in
|
78
|
-
# these elements as well, using hierconnections. This method is in fact the
|
79
|
-
# facade for the {IPXACT::GraphPathFinder} class. It handles the creation of
|
80
|
-
# the connection Hash, and translates the result in a IPXACT-specific format.
|
81
|
-
#
|
82
|
-
# @param [String] subcomponent_start The name of the component instance that
|
83
|
-
# should be the source of the data path.
|
84
|
-
# @param [String] subcomponent_end The name of the component instance that
|
85
|
-
# should be the target of the data path.
|
86
|
-
#
|
87
|
-
# @return [Array<Array<Hash>>] an Array of Arrays of Hashes that summarizes
|
88
|
-
# the component instances and the ports on the data path. Note that this
|
89
|
-
# data path may be used for calculating the target component's base
|
90
|
-
# address. The Arrays of Hashes are composed of 2 elements, the first
|
91
|
-
# element being the source of a connection step and the second element
|
92
|
-
# being the target of the connection step. Each element is a Hash, built as
|
93
|
-
# follows:
|
94
|
-
# +:component_instance+ the String name of the component instance that is
|
95
|
-
# traversed by the data path;
|
96
|
-
# +:port_name+ the String name of the port of the component instance that
|
97
|
-
# is being traversed.
|
98
|
-
# @raise several exceptions. Please refer to {IPXACT::GraphPathFinder} class
|
99
|
-
# for more details.
|
100
|
-
#
|
101
|
-
def resolve_data_path(subcomponent_start, subcomponent_end)
|
102
|
-
nodes, connections = rec_prepare_pathfinder_connections([], [])
|
103
|
-
|
104
|
-
pathfinder_connections = connections.collect do |connection|
|
105
|
-
{
|
106
|
-
:link => [nodes.index(connection[0][:component_instance]),
|
107
|
-
nodes.index(connection[1][:component_instance])],
|
108
|
-
:ports => [connection[0][:port_name], connection[1][:port_name]]
|
109
|
-
}
|
110
|
-
end
|
111
|
-
|
112
|
-
pathfinder_interconnect = {:nodes => nodes, :connections => pathfinder_connections}
|
113
|
-
pathfinder = IPXACT::GraphPathFinder.new(pathfinder_interconnect)
|
114
|
-
finder_result = pathfinder.resolve(subcomponent_start, subcomponent_end)
|
115
|
-
|
116
|
-
formatted_result = finder_result.collect do |res|
|
117
|
-
pathfinder_interconnect[:connections][res]
|
118
|
-
end.collect do |connection|
|
119
|
-
[
|
120
|
-
{
|
121
|
-
:component_instance => pathfinder_interconnect[:nodes][connection[:link][0]],
|
122
|
-
:port_name => connection[:ports][0]
|
123
|
-
},
|
124
|
-
{
|
125
|
-
:component_instance => pathfinder_interconnect[:nodes][connection[:link][1]],
|
126
|
-
:port_name => connection[:ports][1]
|
127
|
-
}
|
128
|
-
]
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
# Computes a the base address of the last component instance mentionned in
|
133
|
-
# the +data_path+. The latter should be calculated using the
|
134
|
-
# {#resolve_data_path} method. Additionally, this method takes into account
|
135
|
-
# all subcomponents from the +data_path+, and basically adds up mirrored slave
|
136
|
-
# ports' remap addresses.
|
137
|
-
#
|
138
|
-
# @param [Arrray] data_path the data path from which the base address should be
|
139
|
-
# calculated. Please refer to the documentation of
|
140
|
-
# {#resolve_data_path} for more details on the structure of
|
141
|
-
# this argument.
|
142
|
-
# @param [Integer] initial_value the value that should be added to the base
|
143
|
-
# address computed by the method.
|
144
|
-
#
|
145
|
-
# Returns the base address of the target component, as an Integer.
|
146
|
-
#
|
147
|
-
def resolve_base_address(data_path, initial_value = 0)
|
148
|
-
base_address = initial_value
|
149
|
-
data_path.each do |connection|
|
150
|
-
connection.each do |connection_step|
|
151
|
-
subcomponent = rec_get_subcomponent(connection_step[:component_instance])
|
152
|
-
port = subcomponent.ports \
|
153
|
-
.select{|port| port[:name] == connection_step[:port_name]} \
|
154
|
-
.first
|
155
|
-
if port[:type] == :mirrored_slave && !port[:port_data].nil?
|
156
|
-
base_address += port[:port_data][:remap][:address].to_i(16)
|
157
|
-
end
|
158
|
-
end
|
159
|
-
end
|
160
|
-
base_address
|
161
|
-
end
|
162
75
|
|
163
76
|
# Get the component's register map, if any.
|
164
77
|
#
|
@@ -227,50 +140,5 @@ class IPXACT::Component
|
|
227
140
|
current_list
|
228
141
|
end
|
229
142
|
|
230
|
-
# Prepares the connection structure for the {IPXACT::GraphPathFinder} class.
|
231
|
-
# Traverses the hierarchy of subcomponents in order to create a flattened
|
232
|
-
# representation of the subcomponents graph. In particular, the method
|
233
|
-
# considers hierconnections, and replaces the wrapper's interface port with
|
234
|
-
# the subcomponent's port that it is attached to.
|
235
|
-
#
|
236
|
-
# @return [Array<Array,Array<Hash>>] an Array of 2 elements, composed of a
|
237
|
-
# list of nodes and a list of connections. Please refer to the
|
238
|
-
# {IPXACT::GraphPathFinder#initialize} method for more details on
|
239
|
-
# the structure of these elements (both Hashes).
|
240
|
-
#
|
241
|
-
def rec_prepare_pathfinder_connections(current_nodes, current_interconnections)
|
242
|
-
if subcomponents.empty?
|
243
|
-
[current_nodes << self.instance_name, current_interconnections]
|
244
|
-
else
|
245
|
-
subcomponents.each do |sub_name, subcomponent|
|
246
|
-
formatted_interconnections = interconnections.values.collect do |interconnect|
|
247
|
-
[reformat_connector(interconnect[0]), reformat_connector(interconnect[1])]
|
248
|
-
end
|
249
|
-
current_nodes, current_interconnections = \
|
250
|
-
subcomponent.rec_prepare_pathfinder_connections(current_nodes, current_interconnections + formatted_interconnections)
|
251
|
-
end
|
252
|
-
[current_nodes, current_interconnections]
|
253
|
-
end
|
254
|
-
end
|
255
|
-
|
256
|
-
# Executes the actual replacement of an hierarchical component's outside port
|
257
|
-
# with the attached subcomponent port.
|
258
|
-
#
|
259
|
-
# @return [Hash] the flattened connector, i.e., a Hash built as follows:
|
260
|
-
# +:component_instance+ the String name of the component instance that is
|
261
|
-
# traversed by the data path;
|
262
|
-
# +:port_name+ the String name of the port of the component
|
263
|
-
# instance that is being traversed.
|
264
|
-
#
|
265
|
-
def reformat_connector(connector)
|
266
|
-
instance = subcomponents[connector[:component_instance]]
|
267
|
-
if instance.subcomponents.empty?
|
268
|
-
new_connector = connector
|
269
|
-
else
|
270
|
-
port = connector[:port_name]
|
271
|
-
new_connector = instance.hierconnections[port]
|
272
|
-
end
|
273
|
-
new_connector
|
274
|
-
end
|
275
143
|
|
276
144
|
end
|
@@ -17,60 +17,6 @@
|
|
17
17
|
require File.join File.dirname(__FILE__), 'general_spec'
|
18
18
|
|
19
19
|
describe "The data calculation functions of our IPXACT tool" do
|
20
|
-
it "should be able to find valid data paths when building a driver" do
|
21
|
-
expected_data_path = [
|
22
|
-
[
|
23
|
-
{
|
24
|
-
:component_instance => 'i_proc',
|
25
|
-
:port_name => "AHB_Master",
|
26
|
-
},
|
27
|
-
{
|
28
|
-
:component_instance => 'i_ahb',
|
29
|
-
:port_name => 'AHB_MirroredMaster0'
|
30
|
-
}
|
31
|
-
],
|
32
|
-
[
|
33
|
-
{
|
34
|
-
:component_instance => 'i_ahb',
|
35
|
-
:port_name => 'AHB_MirroredSlave1'
|
36
|
-
},
|
37
|
-
{
|
38
|
-
:component_instance => 'i_h2p',
|
39
|
-
:port_name => 'AHB_Slave'
|
40
|
-
}
|
41
|
-
],
|
42
|
-
[
|
43
|
-
{
|
44
|
-
:component_instance => 'i_h2p',
|
45
|
-
:port_name => 'APB_Master'
|
46
|
-
},
|
47
|
-
{
|
48
|
-
:component_instance => 'i_apb',
|
49
|
-
:port_name => 'APB_MirroredMaster'
|
50
|
-
}
|
51
|
-
],
|
52
|
-
[
|
53
|
-
{
|
54
|
-
:component_instance => 'i_apb',
|
55
|
-
:port_name => 'APB_MirroredSlave7'
|
56
|
-
},
|
57
|
-
{
|
58
|
-
:component_instance => 'i_dma',
|
59
|
-
:port_name => 'APB_Slave'
|
60
|
-
}
|
61
|
-
]
|
62
|
-
]
|
63
|
-
|
64
|
-
components = IPXACT::load_components(PLATFORM_PATH)
|
65
|
-
designs = IPXACT::load_designs(PLATFORM_PATH)
|
66
|
-
platform = IPXACT::Parser::PlatformData.parse_platform(["Leon2Platform", "1.1"], components, designs)
|
67
|
-
|
68
|
-
data_path = nil
|
69
|
-
lambda {
|
70
|
-
data_path = platform.resolve_data_path('i_proc', 'i_dma')
|
71
|
-
}.should_not raise_exception
|
72
|
-
data_path.should eql(expected_data_path)
|
73
|
-
end
|
74
20
|
|
75
21
|
it "should be able to assign instance variables to mirrored slave addresses and ranges" do
|
76
22
|
expected_values = {
|
@@ -108,43 +54,4 @@ describe "The data calculation functions of our IPXACT tool" do
|
|
108
54
|
end
|
109
55
|
end
|
110
56
|
|
111
|
-
it "should be able to determine the dma component's base address from the interconnect path" do
|
112
|
-
# DMA remap address : 0x30000000 + 0x7000 = 0x30007000
|
113
|
-
components = IPXACT::load_components(PLATFORM_PATH)
|
114
|
-
designs = IPXACT::load_designs(PLATFORM_PATH)
|
115
|
-
platform = IPXACT::Parser::PlatformData.parse_platform(["Leon2Platform", "1.1"], components, designs)
|
116
|
-
data_path = platform.resolve_data_path('i_proc', 'i_dma')
|
117
|
-
|
118
|
-
base_address = platform.resolve_base_address(data_path)
|
119
|
-
base_address.should == 0x30007000 # AHB remap + APB remap (as defined in the apbSubsystem design file)
|
120
|
-
end
|
121
|
-
|
122
|
-
|
123
|
-
it "should be able to determine the cgu component's base address from the interconnect path" do
|
124
|
-
components = IPXACT::load_components(PLATFORM_PATH)
|
125
|
-
designs = IPXACT::load_designs(PLATFORM_PATH)
|
126
|
-
platform = IPXACT::Parser::PlatformData.parse_platform(["Leon2Platform", "1.2"], components, designs)
|
127
|
-
data_path = platform.resolve_data_path('i_proc', 'i_cgu')
|
128
|
-
|
129
|
-
base_address = platform.resolve_base_address(data_path)
|
130
|
-
base_address.should == 0x30004000
|
131
|
-
end
|
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
|
-
|
150
57
|
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 14
|
8
|
+
- 0
|
9
|
+
version: 0.14.0
|
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: 2011-
|
17
|
+
date: 2011-03-14 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -53,7 +53,6 @@ files:
|
|
53
53
|
- lib/ipxact/parser/component_data_parser.rb
|
54
54
|
- lib/ipxact/parser/identifier_parser.rb
|
55
55
|
- lib/ipxact/parser/platform_data_parser.rb
|
56
|
-
- lib/ipxact/pathfinder/graph_pathfinder.rb
|
57
56
|
- lib/ipxact/platform.rb
|
58
57
|
- lib/ipxact/register.rb
|
59
58
|
- schemas/abstractionDefinition.xsd
|
@@ -78,6 +77,8 @@ files:
|
|
78
77
|
- schemas/signalDrivers.xsd
|
79
78
|
- schemas/simpleTypes.xsd
|
80
79
|
- schemas/subInstances.xsd
|
80
|
+
- README.html
|
81
|
+
- README.mdown
|
81
82
|
- spec/integration/bus_data_extraction_spec.rb
|
82
83
|
- spec/integration/data_calculation_spec.rb
|
83
84
|
- spec/integration/data_construction_spec.rb
|
@@ -178,18 +179,18 @@ files:
|
|
178
179
|
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/user_specific_Leon2_uart.cc
|
179
180
|
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/uart_tac.xml
|
180
181
|
- spec/unit/component_spec.rb
|
181
|
-
- spec/unit/graph_pathfinder_spec.rb
|
182
182
|
- spec/unit/identifier_spec.rb
|
183
183
|
- spec/unit/interconnect_spec.rb
|
184
184
|
- spec/unit/ipxact_spec.rb
|
185
185
|
- spec/unit/platform_spec.rb
|
186
|
-
- README.html
|
187
|
-
- README.mdown
|
188
186
|
has_rdoc: true
|
189
187
|
homepage: http://tima-sls.imag.fr/www/research/ipxact/
|
190
188
|
licenses: []
|
191
189
|
|
192
|
-
post_install_message:
|
190
|
+
post_install_message: "\n (\"-._UPGRADING_.-\")\n\n\
|
191
|
+
Thank you for installing IP-Xact Ruby - 0.14.0.\n\
|
192
|
+
Please make sure you have a look at http://tima-sls.imag.fr/www/research/ipxact/upgrading/\n\
|
193
|
+
for upgrade info!\n\n \n"
|
193
194
|
rdoc_options: []
|
194
195
|
|
195
196
|
require_paths:
|
@@ -222,8 +223,102 @@ test_files:
|
|
222
223
|
- spec/integration/data_calculation_spec.rb
|
223
224
|
- spec/integration/data_construction_spec.rb
|
224
225
|
- spec/integration/general_spec.rb
|
226
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_initiator_port.h
|
227
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_initiator_port.tpp
|
228
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_initiator_port_base.h
|
229
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_router.h
|
230
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_router.tpp
|
231
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_slave_base.h
|
232
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_slave_base.tpp
|
233
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_target_port.h
|
234
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_target_port_base.h
|
235
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_tlm_if.h
|
236
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/PV/user_types.h
|
237
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/Leon2Platform/Leon2Platform.xml
|
238
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/Leon2Platform/design_Leon2Platform.xml
|
239
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/Leon2Platform/tlmsrc/Leon2Platform.h
|
240
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/apbSubSystem/apbSubSystem.xml
|
241
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/apbSubSystem/design_apbSubSystem.xml
|
242
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/apbSubSystem/tlmsrc/apbSubSystem.h
|
243
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/Leon2Platform/Leon2Platform.xml
|
244
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/Leon2Platform/design_Leon2Platform.xml
|
245
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/Leon2Platform/tlmsrc/Leon2Platform.h
|
246
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/apbSubSystem.xml
|
247
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/designConfig_apbSubSystem.xml
|
248
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/design_apbSubSystem.xml
|
249
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/tlmsrc/apbSubSystem.h
|
250
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/Leon2Platform/Leon2Platform.xml
|
251
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/Leon2Platform/design_Leon2Platform.xml
|
252
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/Leon2Platform/tlmsrc/Leon2Platform.h
|
253
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/apbSubSystem.xml
|
254
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/designConfig_apbSubSystem.xml
|
255
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/design_apbSubSystem.xml
|
256
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/tlmsrc/apbSubSystem.h
|
257
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/ahbbus/1.4/ahbbus22.xml
|
258
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/ahbbus/1.4/tlmsrc/ahbbus.h
|
259
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/ahbram/1.4/ahbram.xml
|
260
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/ahbram/1.4/tlmsrc/ahbram.cc
|
261
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/ahbram/1.4/tlmsrc/ahbram.h
|
262
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/apbbus/1.4/apbbus8.xml
|
263
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/apbbus/1.4/tlmsrc/apbbus.h
|
264
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/apbmst/1.4/apbmst.xml
|
265
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/apbmst/1.4/tlmsrc/apbmst.h
|
266
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/apbram.xml
|
267
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.cc
|
268
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.h
|
269
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.v
|
270
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.vhd
|
271
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.4/cgu.xml
|
272
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.4/tlmsrc/cgu.cc
|
273
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.4/tlmsrc/cgu.h
|
274
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.5/cgu.xml
|
275
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.5/tlmsrc/cgu.cc
|
276
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.5/tlmsrc/cgu.h
|
277
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/dma/1.4/dma.xml
|
278
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/dma/1.4/tlmsrc/dma.cc
|
279
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/dma/1.4/tlmsrc/dma.h
|
280
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/irqctrl/1.4/irqctrl.xml
|
281
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/irqctrl/1.4/tlmsrc/irqctrl.cc
|
282
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/irqctrl/1.4/tlmsrc/irqctrl.h
|
283
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/processor/1.4/processor.xml
|
284
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/processor/1.4/tlmsrc/processor.cc
|
285
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/processor/1.4/tlmsrc/processor.h
|
286
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/pv2apb/1.0/pv2apb.xml
|
287
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/pv2apb/1.0/tlmsrc/pv2apb.cc
|
288
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/pv2apb/1.0/tlmsrc/pv2apb.h
|
289
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/pv2tac/1.0/pv2tac.xml
|
290
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/pv2tac/1.0/tlmsrc/pv2tac.cc
|
291
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/pv2tac/1.0/tlmsrc/pv2tac.h
|
292
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/rgu/1.4/rgu.xml
|
293
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/rgu/1.4/tlmsrc/rgu.cc
|
294
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/rgu/1.4/tlmsrc/rgu.h
|
295
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/scmlAdaptor/1.0/scmlAdaptor.xml
|
296
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/scmlAdaptor/1.0/tlmsrc/scmladaptor.cc
|
297
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/scmlAdaptor/1.0/tlmsrc/scmladaptor.h
|
298
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/serial_device/1.0/serial_device.xml
|
299
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/serial_device/1.0/tlmsrc/serial_device.h
|
300
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/timers/1.4/timers.xml
|
301
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/timers/1.4/tlmsrc/timers.cc
|
302
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/timers/1.4/tlmsrc/timers.h
|
303
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart.h
|
304
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart_fifo.h
|
305
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart_memory_map.h
|
306
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart_types.h
|
307
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart.cc
|
308
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart_interrupt_handler.cc
|
309
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart_register_bank.cc
|
310
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart_serial_tx_rx.cc
|
311
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/uart_scml.xml
|
312
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/Leon2_uart.h
|
313
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/def_Leon2_uart.h
|
314
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/tlm_field.h
|
315
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/tlm_register.h
|
316
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/tlmreg_Leon2_uart.h
|
317
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/Leon2_uart.cc
|
318
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/tlmreg_Leon2_uart.cc
|
319
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/user_specific_Leon2_uart.cc
|
320
|
+
- spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/uart_tac.xml
|
225
321
|
- spec/unit/component_spec.rb
|
226
|
-
- spec/unit/graph_pathfinder_spec.rb
|
227
322
|
- spec/unit/identifier_spec.rb
|
228
323
|
- spec/unit/interconnect_spec.rb
|
229
324
|
- spec/unit/ipxact_spec.rb
|
@@ -1,191 +0,0 @@
|
|
1
|
-
# Copyright (C) 2010 TIMA Laboratory
|
2
|
-
#
|
3
|
-
# This program is free software: you can redistribute it and/or modify
|
4
|
-
# it under the terms of the GNU General Public License as published by
|
5
|
-
# the Free Software Foundation, either version 3 of the License, or
|
6
|
-
# (at your option) any later version.
|
7
|
-
#
|
8
|
-
# This program is distributed in the hope that it will be useful,
|
9
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU General Public License for more details.
|
12
|
-
#
|
13
|
-
# You should have received a copy of the GNU General Public License
|
14
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
-
#
|
16
|
-
|
17
|
-
# {IPXACT::GraphPathFinder} instances are used by {IPXACT::Component} instances
|
18
|
-
# for handling Branch-And-Bound type data path searches within a given IPXACT
|
19
|
-
# architecture. The {IPXACT::Component} is responsible for translating the IPXACT
|
20
|
-
# architecture into a list of connections and transition weights, which may
|
21
|
-
# then be queried for optimal paths between two nodes from the connection
|
22
|
-
# graph. As such, even though the path finder is pretty generic, it should not
|
23
|
-
# be used directly for IPXACT-related work.
|
24
|
-
#
|
25
|
-
# @example
|
26
|
-
# @pathfinder = IPXACT::GraphPathFinder.new({
|
27
|
-
# :nodes => ['component_a', 'component_b', 'component_c']
|
28
|
-
# :connections =>
|
29
|
-
# [
|
30
|
-
# {:link => [0,1]},
|
31
|
-
# {:link => [1,2], :cost => 2},
|
32
|
-
# {:link => [2,0]}
|
33
|
-
# ]
|
34
|
-
# })
|
35
|
-
# @data_path = @pathfinder.resolve('component_a', 'component_b')
|
36
|
-
#
|
37
|
-
# @author Guillaume Godet-Bar
|
38
|
-
#
|
39
|
-
class IPXACT::GraphPathFinder
|
40
|
-
|
41
|
-
# The initializer is essentially used for passing a structured connection
|
42
|
-
# Hash.
|
43
|
-
#
|
44
|
-
# @param [Hash] hash the connection Hash, which should be structured as follows:
|
45
|
-
#
|
46
|
-
# :nodes - An Array of node names (String).
|
47
|
-
#
|
48
|
-
# :connections - An Array of connection elements, which are defined as
|
49
|
-
# :link - A 2-element Array, which describes an oriented
|
50
|
-
# connection between two nodes. The nodes are
|
51
|
-
# expressed using their index in the :nodes
|
52
|
-
# Array.
|
53
|
-
# :cost - A positive Integer expressing the cost of
|
54
|
-
# the transition (in the sense of a
|
55
|
-
# Branch-And-Bound algorithm) (optional,
|
56
|
-
# default: 1).
|
57
|
-
#
|
58
|
-
def initialize(hash)
|
59
|
-
@hash = hash
|
60
|
-
end
|
61
|
-
|
62
|
-
# Searches an optimal path between the start and _end elements, which
|
63
|
-
# should be defined in the Hash structured used for instanciating the
|
64
|
-
# {IPXACT::GraphPathFinder} instance. Optimal should be understood as "the
|
65
|
-
# cheapest path given the cost of each connection". Additionally, validates
|
66
|
-
# the latter Hash structure before executing the search algorithm.
|
67
|
-
#
|
68
|
-
# @param [String] start a String that corresponds to an element that was
|
69
|
-
# registered when the pathfinder was created. The latter will be used
|
70
|
-
# as the start node by the pathfinder algorithm.
|
71
|
-
# @param [String] _end a String that corresponds to an element that was
|
72
|
-
# registered when the pathfinder was created. The latter will be used
|
73
|
-
# as the target node by the pathfinder algorithm.
|
74
|
-
#
|
75
|
-
# @return [Array<Integer>] an Array of Integers corresponding to connection
|
76
|
-
# indices for the optimal data path between the +start+ and +_end+
|
77
|
-
# elements, or an empty Array if the +start+ and +_end+ elements are
|
78
|
-
# identical.
|
79
|
-
#
|
80
|
-
# @raise an exception if the Hash structure for the connections is empty.
|
81
|
-
# @raise an exception unless all the node names are unique.
|
82
|
-
# @raise an exception if the start or end element does not exist.
|
83
|
-
# @raise an exception if no optimal data path could be found.
|
84
|
-
#
|
85
|
-
def resolve(start, _end)
|
86
|
-
raise "Empty connection table!" if @hash.empty?
|
87
|
-
return [] if start == _end
|
88
|
-
raise "Duplicate connection node found!" if @hash[:nodes].uniq.size != @hash[:nodes].size
|
89
|
-
raise "The source or target node does not exist!" unless @hash[:nodes].include?(start) && @hash[:nodes].include?(_end)
|
90
|
-
|
91
|
-
@interconnect_table = (0..@hash[:nodes].size - 1).collect do |i|
|
92
|
-
(0..@hash[:nodes].size - 1).collect do |j|
|
93
|
-
result_hash = {
|
94
|
-
:connection =>
|
95
|
-
@hash[:connections].any?{|connection| connection[:link] == [j,i]},
|
96
|
-
:total => Float::INFINITY,
|
97
|
-
:previous => nil
|
98
|
-
}
|
99
|
-
if @hash[:connections].any?{|connection| connection[:link] == [j,i]}
|
100
|
-
result = @hash[:connections].select{|connection| connection[:link] == [j,i]}.first[:cost] || 1
|
101
|
-
result_hash.merge!({:cost => result})
|
102
|
-
end
|
103
|
-
|
104
|
-
result_hash
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
start_index = @hash[:nodes].index(start)
|
109
|
-
end_index = @hash[:nodes].index(_end)
|
110
|
-
@interconnect_table[start_index][start_index][:total] = 0
|
111
|
-
|
112
|
-
|
113
|
-
rec_resolve([start_index, start_index], end_index, 0)
|
114
|
-
|
115
|
-
last_writer_index = nil
|
116
|
-
@interconnect_table[end_index].each_with_index do |el, i|
|
117
|
-
last_writer_index = i if el[:total] < Float::INFINITY
|
118
|
-
end
|
119
|
-
raise "Destination could not be reached!" if last_writer_index.nil?
|
120
|
-
|
121
|
-
|
122
|
-
dump_trajectory(end_index).reverse
|
123
|
-
|
124
|
-
end
|
125
|
-
|
126
|
-
private
|
127
|
-
|
128
|
-
# Recursive function for the pathfinder search algorithm.
|
129
|
-
#
|
130
|
-
# @param [Array] current the current node that is being traversed by the
|
131
|
-
# algorithm.
|
132
|
-
# @param [Integer] _end the index of the target node.
|
133
|
-
# @param [Integer] current_total current Integer cost of the trajectory that
|
134
|
-
# is being explored by this branch of the algorithm.
|
135
|
-
#
|
136
|
-
def rec_resolve(current, _end, current_total)
|
137
|
-
current_writer_index = current[0]
|
138
|
-
(0..@interconnect_table.size - 1).each do |i|
|
139
|
-
if @interconnect_table[i][current_writer_index][:connection]
|
140
|
-
new_total = current_total + (@interconnect_table[i][current_writer_index][:cost] || 1)
|
141
|
-
|
142
|
-
if @interconnect_table[i][current_writer_index][:total] > new_total
|
143
|
-
@interconnect_table[i][current_writer_index] = {:total => new_total, :connection => true, :previous => current.reverse}
|
144
|
-
|
145
|
-
unless @interconnect_table[_end].any?{|el| el[:total] < new_total}
|
146
|
-
rec_resolve([i, current_writer_index], _end, new_total)
|
147
|
-
end
|
148
|
-
end
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
# Scans the interconnect table, starting with the end_index, and traces a
|
154
|
-
# trajectory back to its source, using the traceback references in each cell
|
155
|
-
# from the interconnect table. The source cell is considered as the cell for
|
156
|
-
# which there is no traceback reference.
|
157
|
-
#
|
158
|
-
# @param [Integer] end_index an Integer that corresponds to the last
|
159
|
-
# element (from the original Hash structure) for which there
|
160
|
-
# should be a trajectory calculated by the search algorithm.
|
161
|
-
#
|
162
|
-
# @return [Array<Integer>] the connection indices from the original Hash
|
163
|
-
# structure.
|
164
|
-
#
|
165
|
-
def dump_trajectory(end_index)
|
166
|
-
result = []
|
167
|
-
|
168
|
-
# Get the path with the cheapest result
|
169
|
-
min_element = @interconnect_table[end_index].min{|a,b| a[:total] <=> b[:total]}
|
170
|
-
min_index = @interconnect_table[end_index].index(min_element)
|
171
|
-
|
172
|
-
previous = [min_index, end_index]
|
173
|
-
begin
|
174
|
-
connection_index = @hash[:connections].index(@hash[:connections].detect{|el| el[:link] == previous})
|
175
|
-
result << connection_index unless connection_index.nil?
|
176
|
-
previous = @interconnect_table[previous[1]][previous[0]][:previous]
|
177
|
-
end while not previous.nil?
|
178
|
-
|
179
|
-
result
|
180
|
-
end
|
181
|
-
|
182
|
-
# Commodity method for printing the interconnect table during the execution of the search algorigthm.
|
183
|
-
#
|
184
|
-
def dump_table
|
185
|
-
@interconnect_table.inject('') do |row_acc, row|
|
186
|
-
row_acc + "\n" + row.inject('') do |col_acc, col|
|
187
|
-
col_acc + (col[:total] == Float::INFINITY ? 'I' : col[:total].to_s) + " | "
|
188
|
-
end
|
189
|
-
end
|
190
|
-
end
|
191
|
-
end
|
@@ -1,128 +0,0 @@
|
|
1
|
-
# Copyright (C) 2010 TIMA Laboratory
|
2
|
-
#
|
3
|
-
# This program is free software: you can redistribute it and/or modify
|
4
|
-
# it under the terms of the GNU General Public License as published by
|
5
|
-
# the Free Software Foundation, either version 3 of the License, or
|
6
|
-
# (at your option) any later version.
|
7
|
-
#
|
8
|
-
# This program is distributed in the hope that it will be useful,
|
9
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU General Public License for more details.
|
12
|
-
#
|
13
|
-
# You should have received a copy of the GNU General Public License
|
14
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
-
#
|
16
|
-
|
17
|
-
require File.join File.dirname(__FILE__), '../../lib/ipxact'
|
18
|
-
|
19
|
-
|
20
|
-
describe IPXACT::GraphPathFinder do
|
21
|
-
|
22
|
-
before(:each) do
|
23
|
-
@simple_graph = {
|
24
|
-
:nodes => ['component_a', 'component_b', 'component_c',
|
25
|
-
'component_d'],
|
26
|
-
:connections =>
|
27
|
-
[
|
28
|
-
{:link => [0,1], :via => 'connect_1'},
|
29
|
-
{:link => [1,2], :via => 'connect_2'},
|
30
|
-
{:link => [2,0], :via => 'connect_3.1'},
|
31
|
-
{:link => [2,3], :via => 'connect_3.2'}
|
32
|
-
]
|
33
|
-
}
|
34
|
-
|
35
|
-
@complete_graph = {
|
36
|
-
:nodes => ['i_proc', 'i_ahb', 'i_dma', 'i_sub', 'i_mem',
|
37
|
-
'i_cgu', 'i_rgu'],
|
38
|
-
:connections =>
|
39
|
-
[
|
40
|
-
{:link => [0,1], :via => 'connect_1'},
|
41
|
-
{:link => [2,1], :via => 'connect_2'},
|
42
|
-
{:link => [1,4], :via => 'connect_3'},
|
43
|
-
{:link => [1,3], :via => 'connect_4'},
|
44
|
-
{:link => [3,0], :via => 'connect_5'},
|
45
|
-
{:link => [3,5], :via => 'connect_6'},
|
46
|
-
{:link => [3,6], :via => 'connect_7'},
|
47
|
-
{:link => [3,2], :via => 'connect_8'}
|
48
|
-
]
|
49
|
-
}
|
50
|
-
|
51
|
-
@cheapest_path_graph = {
|
52
|
-
:nodes => ['component_a', 'component_b', 'component_c',
|
53
|
-
'component_d'],
|
54
|
-
:connections =>
|
55
|
-
[
|
56
|
-
{:link => [0,1], :via => 'connect_1'},
|
57
|
-
{:link => [1,2], :cost => 8, :via => 'connect_expensive'},
|
58
|
-
{:link => [2,3], :via => 'connect_2'},
|
59
|
-
{:link => [1,3], :cost => 9, :via => 'connect_cheaper'}
|
60
|
-
]
|
61
|
-
}
|
62
|
-
end
|
63
|
-
|
64
|
-
context "incorrect graph/arguments" do
|
65
|
-
it "should return an exception when the graph is empty" do
|
66
|
-
finder = IPXACT::GraphPathFinder.new({})
|
67
|
-
lambda {
|
68
|
-
finder.resolve('component_a', 'component_b')
|
69
|
-
}.should raise_exception
|
70
|
-
end
|
71
|
-
|
72
|
-
it "should return an exception if any component is not unique" do
|
73
|
-
@simple_graph[:nodes][1] = 'component_a'
|
74
|
-
finder = IPXACT::GraphPathFinder.new @simple_graph
|
75
|
-
lambda {
|
76
|
-
finder.resolve('component_a', 'component_c')
|
77
|
-
}.should raise_exception
|
78
|
-
end
|
79
|
-
|
80
|
-
it "should return an exception if the source or target component does not exist" do
|
81
|
-
finder = IPXACT::GraphPathFinder.new @simple_graph
|
82
|
-
lambda {
|
83
|
-
finder.resolve('component_a', 'component_z')
|
84
|
-
}.should raise_exception
|
85
|
-
lambda {
|
86
|
-
finder.resolve('component_z', 'component_a')
|
87
|
-
}.should raise_exception
|
88
|
-
end
|
89
|
-
|
90
|
-
end
|
91
|
-
|
92
|
-
context "graph pathfinding" do
|
93
|
-
it "should return an empty array if the source equals the destination" do
|
94
|
-
finder = IPXACT::GraphPathFinder.new @simple_graph
|
95
|
-
finder.resolve('component_a', 'component_a').should eql([])
|
96
|
-
end
|
97
|
-
|
98
|
-
it "should return an array with a single element if the source is right next to the destination" do
|
99
|
-
finder = IPXACT::GraphPathFinder.new(@simple_graph)
|
100
|
-
finder.resolve('component_a', 'component_b').should eql([0])
|
101
|
-
finder.resolve('component_c', 'component_a').should eql([2])
|
102
|
-
end
|
103
|
-
|
104
|
-
it "should raise an exception if the destination cannot be reached" do
|
105
|
-
finder = IPXACT::GraphPathFinder.new(@simple_graph)
|
106
|
-
lambda {
|
107
|
-
finder.resolve('component_d', 'component_a')
|
108
|
-
}.should raise_exception
|
109
|
-
end
|
110
|
-
|
111
|
-
it "should return a correct path from a simple graph" do
|
112
|
-
finder = IPXACT::GraphPathFinder.new(@simple_graph)
|
113
|
-
finder.resolve('component_a', 'component_d').should eql([0,1,3])
|
114
|
-
end
|
115
|
-
|
116
|
-
it "should be able to favor a cheaper path" do
|
117
|
-
finder = IPXACT::GraphPathFinder.new(@cheapest_path_graph)
|
118
|
-
finder.resolve('component_a', 'component_d').should eql([0,3])
|
119
|
-
end
|
120
|
-
|
121
|
-
it "should return a correct path from a realistic connection graph" do
|
122
|
-
finder = IPXACT::GraphPathFinder.new(@complete_graph)
|
123
|
-
finder.resolve('i_proc', 'i_dma').should eql([0,3,7])
|
124
|
-
finder.resolve('i_dma', 'i_proc').should eql([1,3,4])
|
125
|
-
end
|
126
|
-
|
127
|
-
end
|
128
|
-
end
|