ipxact-tools 0.2.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/config/detector.yml +63 -0
- data/lib/ipxact_tools.rb +287 -0
- data/lib/ipxact_tools/graph_pathfinder.rb +191 -0
- data/lib/ipxact_tools/interrupt_line_detector.rb +98 -0
- data/spec/integration/integration_spec.rb +254 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_initiator_port.h +135 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_initiator_port.tpp +247 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_initiator_port_base.h +189 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_router.h +205 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_router.tpp +278 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_slave_base.h +115 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_slave_base.tpp +126 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_target_port.h +168 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_target_port_base.h +133 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_tlm_if.h +280 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/user_types.h +38 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/Leon2Platform/Leon2Platform.xml +77 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/Leon2Platform/design_Leon2Platform.xml +156 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/Leon2Platform/tlmsrc/Leon2Platform.h +149 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/apbSubSystem/apbSubSystem.xml +406 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/apbSubSystem/design_apbSubSystem.xml +135 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/apbSubSystem/tlmsrc/apbSubSystem.h +133 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/Leon2Platform/Leon2Platform.xml +77 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/Leon2Platform/design_Leon2Platform.xml +157 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/Leon2Platform/tlmsrc/Leon2Platform.h +150 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/apbSubSystem.xml +422 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/designConfig_apbSubSystem.xml +79 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/design_apbSubSystem.xml +184 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/tlmsrc/apbSubSystem.h +164 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/Leon2Platform/Leon2Platform.xml +105 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/Leon2Platform/design_Leon2Platform.xml +157 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/Leon2Platform/tlmsrc/Leon2Platform.h +152 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/apbSubSystem.xml +429 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/designConfig_apbSubSystem.xml +64 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/design_apbSubSystem.xml +150 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/tlmsrc/apbSubSystem.h +167 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/ahbbus/1.4/ahbbus22.xml +236 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/ahbbus/1.4/tlmsrc/ahbbus.h +52 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/ahbram/1.4/ahbram.xml +184 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/ahbram/1.4/tlmsrc/ahbram.cc +93 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/ahbram/1.4/tlmsrc/ahbram.h +77 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/apbbus/1.4/apbbus8.xml +544 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/apbbus/1.4/tlmsrc/apbbus.h +55 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/apbmst/1.4/apbmst.xml +209 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/apbmst/1.4/tlmsrc/apbmst.h +53 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/apbram.xml +395 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.cc +89 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.h +69 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.v +82 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.vhd +132 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.4/cgu.xml +686 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.4/tlmsrc/cgu.cc +121 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.4/tlmsrc/cgu.h +81 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.5/cgu.xml +707 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.5/tlmsrc/cgu.cc +121 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.5/tlmsrc/cgu.h +81 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/dma/1.4/dma.xml +272 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/dma/1.4/tlmsrc/dma.cc +230 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/dma/1.4/tlmsrc/dma.h +116 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/irqctrl/1.4/irqctrl.xml +530 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/irqctrl/1.4/tlmsrc/irqctrl.cc +211 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/irqctrl/1.4/tlmsrc/irqctrl.h +108 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/processor/1.4/processor.xml +423 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/processor/1.4/tlmsrc/processor.cc +331 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/processor/1.4/tlmsrc/processor.h +121 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2apb/1.0/pv2apb.xml +240 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2apb/1.0/tlmsrc/pv2apb.cc +153 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2apb/1.0/tlmsrc/pv2apb.h +77 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2tac/1.0/pv2tac.xml +154 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2tac/1.0/tlmsrc/pv2tac.cc +114 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2tac/1.0/tlmsrc/pv2tac.h +67 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/rgu/1.4/rgu.xml +766 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/rgu/1.4/tlmsrc/rgu.cc +126 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/rgu/1.4/tlmsrc/rgu.h +105 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/scmlAdaptor/1.0/scmlAdaptor.xml +154 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/scmlAdaptor/1.0/tlmsrc/scmladaptor.cc +100 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/scmlAdaptor/1.0/tlmsrc/scmladaptor.h +62 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/serial_device/1.0/serial_device.xml +151 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/serial_device/1.0/tlmsrc/serial_device.h +85 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/timers/1.4/timers.xml +460 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/timers/1.4/tlmsrc/timers.cc +201 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/timers/1.4/tlmsrc/timers.h +102 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart.h +152 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart_fifo.h +113 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart_memory_map.h +96 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart_types.h +60 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart.cc +125 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart_interrupt_handler.cc +136 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart_register_bank.cc +129 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart_serial_tx_rx.cc +145 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/uart_scml.xml +372 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/Leon2_uart.h +216 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/def_Leon2_uart.h +34 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/tlm_field.h +72 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/tlm_register.h +129 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/tlmreg_Leon2_uart.h +133 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/Leon2_uart.cc +316 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/tlmreg_Leon2_uart.cc +197 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/user_specific_Leon2_uart.cc +146 -0
- data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/uart_tac.xml +222 -0
- data/spec/unit/graph_pathfinder_spec.rb +128 -0
- metadata +272 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Revision: $Revision: 1506 $
|
|
3
|
+
// Date: $Date: 2009-04-26 01:51:56 -0500 (Sun, 26 Apr 2009) $
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2005, 2006, 2007, 2008, 2009 The SPIRIT Consortium.
|
|
6
|
+
//
|
|
7
|
+
// This work forms part of a deliverable of The SPIRIT Consortium.
|
|
8
|
+
//
|
|
9
|
+
// Use of these materials are governed by the legal terms and conditions
|
|
10
|
+
// outlined in the disclaimer available from www.spiritconsortium.org.
|
|
11
|
+
//
|
|
12
|
+
// This source file is provided on an AS IS basis. The SPIRIT
|
|
13
|
+
// Consortium disclaims any warranty express or implied including
|
|
14
|
+
// any warranty of merchantability and fitness for use for a
|
|
15
|
+
// particular purpose.
|
|
16
|
+
//
|
|
17
|
+
// The user of the source file shall indemnify and hold The SPIRIT
|
|
18
|
+
// Consortium and its members harmless from any damages or liability.
|
|
19
|
+
// Users are requested to provide feedback to The SPIRIT Consortium
|
|
20
|
+
// using either mailto:feedback@lists.spiritconsortium.org or the forms at
|
|
21
|
+
// http://www.spiritconsortium.org/about/contact_us/
|
|
22
|
+
//
|
|
23
|
+
// This file may be copied, and distributed, with or without
|
|
24
|
+
// modifications; this notice must be included on any copy.
|
|
25
|
+
|
|
26
|
+
/* -----------------------------------------------------------------------
|
|
27
|
+
* Includes
|
|
28
|
+
* ----------------------------------------------------------------------- */
|
|
29
|
+
|
|
30
|
+
#include "systemc.h" /* SystemC include file */
|
|
31
|
+
#include "Leon2_uart.h"
|
|
32
|
+
|
|
33
|
+
#include "def_Leon2_uart.h"
|
|
34
|
+
|
|
35
|
+
namespace Leon2 {
|
|
36
|
+
|
|
37
|
+
/* -----------------------------------------------------------------------
|
|
38
|
+
* define the method and thread sensitivity and the end of the constructor
|
|
39
|
+
* ----------------------------------------------------------------------- */
|
|
40
|
+
|
|
41
|
+
void uart::method_and_thread_sensitivity()
|
|
42
|
+
{
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/***************************************************************************
|
|
47
|
+
* \brief Slave read_block Interface
|
|
48
|
+
**************************************************************************/
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
prt_tlm_tac::tac_status uart::read_block(const tlm_uint32_t & address_tlmske,
|
|
52
|
+
tlm_uint32_t * block_data_tlmske,
|
|
53
|
+
const unsigned int number,
|
|
54
|
+
prt_tlm_tac::tac_error_reason& error_reason,
|
|
55
|
+
unsigned int * block_byte_enable,
|
|
56
|
+
const unsigned int block_byte_enable_period,
|
|
57
|
+
const prt_tlm_tac::tac_mode mode,
|
|
58
|
+
const unsigned int target_port_id
|
|
59
|
+
) {
|
|
60
|
+
prt_tlm_tac::tac_status status_tlmske;
|
|
61
|
+
|
|
62
|
+
switch(target_port_id)
|
|
63
|
+
{
|
|
64
|
+
|
|
65
|
+
case Leon2_uart_ambaAPB_ID:
|
|
66
|
+
DEBUG_REPORT(3,"\ttarget_port_id = Leon2_uart_ambaAPB_ID\n");
|
|
67
|
+
break;
|
|
68
|
+
|
|
69
|
+
default:
|
|
70
|
+
status_tlmske.set_error();
|
|
71
|
+
error_reason.set_reason("Error, no businterface at that ID ");
|
|
72
|
+
string msg_tlmske = "Error, can not write at address ";
|
|
73
|
+
ERROR_REPORT(2,"\t%s: %s 0x%X T:%9.9f\n",
|
|
74
|
+
name(),msg_tlmske.c_str(),(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/***************************************************************************
|
|
80
|
+
* \brief Slave write_block Interface
|
|
81
|
+
**************************************************************************/
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
prt_tlm_tac::tac_status uart::write_block(const tlm_uint32_t& address_tlmske,
|
|
85
|
+
const tlm_uint32_t * block_data_tlmske,
|
|
86
|
+
const unsigned int number,
|
|
87
|
+
prt_tlm_tac::tac_error_reason& error_reason,
|
|
88
|
+
unsigned int * block_byte_enable,
|
|
89
|
+
const unsigned int block_byte_enable_period,
|
|
90
|
+
const prt_tlm_tac::tac_mode mode,
|
|
91
|
+
const unsigned int target_port_id
|
|
92
|
+
) {
|
|
93
|
+
prt_tlm_tac::tac_status status_tlmske;
|
|
94
|
+
|
|
95
|
+
switch(target_port_id)
|
|
96
|
+
{
|
|
97
|
+
|
|
98
|
+
case Leon2_uart_ambaAPB_ID:
|
|
99
|
+
DEBUG_REPORT(3,"\ttarget_port_id = Leon2_uart_ambaAPB_ID\n");
|
|
100
|
+
break;
|
|
101
|
+
|
|
102
|
+
default:
|
|
103
|
+
status_tlmske.set_error();
|
|
104
|
+
error_reason.set_reason("Error, no businterface at that ID ");
|
|
105
|
+
string msg_tlmske = "Error, can not write at address ";
|
|
106
|
+
ERROR_REPORT(2,"\t%s: %s 0x%X T:%9.9f\n",
|
|
107
|
+
name(),msg_tlmske.c_str(),(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/***************************************************************************
|
|
113
|
+
* \brief Slave set_target_info Interface
|
|
114
|
+
**************************************************************************/
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
prt_tlm_tac::tac_status uart::set_target_info(const tlm_uint32_t& address_tlmske,
|
|
118
|
+
const prt_tlm_tac::tac_metadata& metadata,
|
|
119
|
+
prt_tlm_tac::tac_error_reason& error_reason,
|
|
120
|
+
const unsigned int target_port_id
|
|
121
|
+
) {
|
|
122
|
+
prt_tlm_tac::tac_status status_tlmske;
|
|
123
|
+
|
|
124
|
+
switch(target_port_id)
|
|
125
|
+
{
|
|
126
|
+
|
|
127
|
+
case Leon2_uart_ambaAPB_ID:
|
|
128
|
+
error_reason.set_reason("set info for port ID : Leon2_uart_ambaAPB_ID using metadata not supported");
|
|
129
|
+
ERROR_REPORT(2,"\t%s: %s T:%9.9f\n",
|
|
130
|
+
name(),error_reason.get_reason().c_str(),
|
|
131
|
+
(float)(sc_time_stamp().to_seconds()));
|
|
132
|
+
status_tlmske.set_error();
|
|
133
|
+
break;
|
|
134
|
+
|
|
135
|
+
default:
|
|
136
|
+
status_tlmske.set_error();
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
DEBUG_REPORT(3,"\t%s: set_target_info at 0x%X T:%9.9f\n",
|
|
141
|
+
name(),(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
142
|
+
|
|
143
|
+
return(status_tlmske);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
} // end namespace Leon2
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!--
|
|
3
|
+
//
|
|
4
|
+
// Revision: $Revision: 1506 $
|
|
5
|
+
// Date: $Date: 2009-04-26 01:51:56 -0500 (Sun, 26 Apr 2009) $
|
|
6
|
+
//
|
|
7
|
+
// Copyright (c) 2005, 2006, 2007, 2008, 2009 The SPIRIT Consortium.
|
|
8
|
+
//
|
|
9
|
+
// This work forms part of a deliverable of The SPIRIT Consortium.
|
|
10
|
+
//
|
|
11
|
+
// Use of these materials are governed by the legal terms and conditions
|
|
12
|
+
// outlined in the disclaimer available from www.spiritconsortium.org.
|
|
13
|
+
//
|
|
14
|
+
// This source file is provided on an AS IS basis. The SPIRIT
|
|
15
|
+
// Consortium disclaims any warranty express or implied including
|
|
16
|
+
// any warranty of merchantability and fitness for use for a
|
|
17
|
+
// particular purpose.
|
|
18
|
+
//
|
|
19
|
+
// The user of the source file shall indemnify and hold The SPIRIT
|
|
20
|
+
// Consortium and its members harmless from any damages or liability.
|
|
21
|
+
// Users are requested to provide feedback to The SPIRIT Consortium
|
|
22
|
+
// using either mailto:feedback@lists.spiritconsortium.org or the forms at
|
|
23
|
+
// http://www.spiritconsortium.org/about/contact_us/
|
|
24
|
+
//
|
|
25
|
+
// This file may be copied, and distributed, with or without
|
|
26
|
+
// modifications; but this notice must be included on any copy.
|
|
27
|
+
-->
|
|
28
|
+
<spirit:component xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.5 http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.5/index.xsd">
|
|
29
|
+
<spirit:vendor>spiritconsortium.org</spirit:vendor>
|
|
30
|
+
<spirit:library>Leon2TLM</spirit:library>
|
|
31
|
+
<spirit:name>uart_tac</spirit:name>
|
|
32
|
+
<spirit:version>1.0</spirit:version>
|
|
33
|
+
<spirit:busInterfaces>
|
|
34
|
+
<spirit:busInterface>
|
|
35
|
+
<spirit:name>ambaAPB</spirit:name>
|
|
36
|
+
<spirit:busType spirit:library="AMBA2" spirit:name="APB" spirit:vendor="amba.com" spirit:version="r2p0_4"/>
|
|
37
|
+
<spirit:abstractionType spirit:library="SPG" spirit:name="tlm_tac" spirit:vendor="st.com" spirit:version="2.0"/>
|
|
38
|
+
<spirit:slave>
|
|
39
|
+
<spirit:memoryMapRef spirit:memoryMapRef="ambaAPB"/>
|
|
40
|
+
</spirit:slave>
|
|
41
|
+
<spirit:portMaps>
|
|
42
|
+
<spirit:portMap>
|
|
43
|
+
<spirit:logicalPort>
|
|
44
|
+
<spirit:name>tac_if</spirit:name>
|
|
45
|
+
</spirit:logicalPort>
|
|
46
|
+
<spirit:physicalPort>
|
|
47
|
+
<spirit:name>ambaAPB</spirit:name>
|
|
48
|
+
</spirit:physicalPort>
|
|
49
|
+
</spirit:portMap>
|
|
50
|
+
</spirit:portMaps>
|
|
51
|
+
</spirit:busInterface>
|
|
52
|
+
</spirit:busInterfaces>
|
|
53
|
+
<spirit:memoryMaps>
|
|
54
|
+
<spirit:memoryMap>
|
|
55
|
+
<spirit:name>ambaAPB</spirit:name>
|
|
56
|
+
<spirit:addressBlock>
|
|
57
|
+
<spirit:name>ambaAPB</spirit:name>
|
|
58
|
+
<spirit:baseAddress>0</spirit:baseAddress>
|
|
59
|
+
<spirit:range>24</spirit:range>
|
|
60
|
+
<spirit:width>32</spirit:width>
|
|
61
|
+
<spirit:usage>register</spirit:usage>
|
|
62
|
+
<spirit:register>
|
|
63
|
+
<spirit:name>data</spirit:name>
|
|
64
|
+
<spirit:description>Data read/write register</spirit:description>
|
|
65
|
+
<spirit:addressOffset>0x0</spirit:addressOffset>
|
|
66
|
+
<spirit:size>32</spirit:size>
|
|
67
|
+
<spirit:access>read-write</spirit:access>
|
|
68
|
+
<spirit:reset>
|
|
69
|
+
<spirit:value>0x0</spirit:value>
|
|
70
|
+
</spirit:reset>
|
|
71
|
+
</spirit:register>
|
|
72
|
+
<spirit:register>
|
|
73
|
+
<spirit:name>status</spirit:name>
|
|
74
|
+
<spirit:description>Status register</spirit:description>
|
|
75
|
+
<spirit:addressOffset>0x4</spirit:addressOffset>
|
|
76
|
+
<spirit:size>32</spirit:size>
|
|
77
|
+
<spirit:access>read-only</spirit:access>
|
|
78
|
+
<spirit:reset>
|
|
79
|
+
<spirit:value>0x6</spirit:value>
|
|
80
|
+
</spirit:reset>
|
|
81
|
+
</spirit:register>
|
|
82
|
+
<spirit:register>
|
|
83
|
+
<spirit:name>control</spirit:name>
|
|
84
|
+
<spirit:description>Control register</spirit:description>
|
|
85
|
+
<spirit:addressOffset>0x8</spirit:addressOffset>
|
|
86
|
+
<spirit:size>32</spirit:size>
|
|
87
|
+
<spirit:access>read-write</spirit:access>
|
|
88
|
+
<spirit:reset>
|
|
89
|
+
<spirit:value>0x0</spirit:value>
|
|
90
|
+
</spirit:reset>
|
|
91
|
+
</spirit:register>
|
|
92
|
+
<spirit:register>
|
|
93
|
+
<spirit:name>scalarReload</spirit:name>
|
|
94
|
+
<spirit:description>Scalar reload register</spirit:description>
|
|
95
|
+
<spirit:addressOffset>0xC</spirit:addressOffset>
|
|
96
|
+
<spirit:size>32</spirit:size>
|
|
97
|
+
<spirit:access>read-write</spirit:access>
|
|
98
|
+
<spirit:reset>
|
|
99
|
+
<spirit:value>0x0</spirit:value>
|
|
100
|
+
</spirit:reset>
|
|
101
|
+
</spirit:register>
|
|
102
|
+
</spirit:addressBlock>
|
|
103
|
+
</spirit:memoryMap>
|
|
104
|
+
</spirit:memoryMaps>
|
|
105
|
+
<spirit:model>
|
|
106
|
+
<spirit:views>
|
|
107
|
+
<spirit:view>
|
|
108
|
+
<spirit:name>PV</spirit:name>
|
|
109
|
+
<spirit:envIdentifier>systemCSource::</spirit:envIdentifier>
|
|
110
|
+
<spirit:language>systemCSource</spirit:language>
|
|
111
|
+
<spirit:modelName>Leon2::uart</spirit:modelName>
|
|
112
|
+
<spirit:fileSetRef>
|
|
113
|
+
<spirit:localName>fs-scSource</spirit:localName>
|
|
114
|
+
</spirit:fileSetRef>
|
|
115
|
+
</spirit:view>
|
|
116
|
+
</spirit:views>
|
|
117
|
+
<spirit:ports>
|
|
118
|
+
<spirit:port>
|
|
119
|
+
<spirit:name>ambaAPB</spirit:name>
|
|
120
|
+
<spirit:transactional>
|
|
121
|
+
<spirit:transTypeDef>
|
|
122
|
+
<spirit:typeName>prt_tlm_tac::tac_target_port</spirit:typeName>
|
|
123
|
+
<spirit:typeDefinition>tac_target_port.h</spirit:typeDefinition>
|
|
124
|
+
</spirit:transTypeDef>
|
|
125
|
+
<spirit:service>
|
|
126
|
+
<spirit:initiative>provides</spirit:initiative>
|
|
127
|
+
<spirit:serviceTypeDefs>
|
|
128
|
+
<spirit:serviceTypeDef>
|
|
129
|
+
<spirit:typeName spirit:implicit="true">TAC</spirit:typeName>
|
|
130
|
+
<spirit:parameters>
|
|
131
|
+
<spirit:parameter>
|
|
132
|
+
<spirit:name>BFM_ADDRESS_TYPE</spirit:name>
|
|
133
|
+
<spirit:value spirit:resolve="immediate">tlm_uint32_t</spirit:value>
|
|
134
|
+
</spirit:parameter>
|
|
135
|
+
<spirit:parameter>
|
|
136
|
+
<spirit:name>BFM_DATA_TYPE</spirit:name>
|
|
137
|
+
<spirit:value spirit:resolve="immediate">tlm_uint32_t</spirit:value>
|
|
138
|
+
</spirit:parameter>
|
|
139
|
+
</spirit:parameters>
|
|
140
|
+
</spirit:serviceTypeDef>
|
|
141
|
+
</spirit:serviceTypeDefs>
|
|
142
|
+
</spirit:service>
|
|
143
|
+
</spirit:transactional>
|
|
144
|
+
<spirit:access>
|
|
145
|
+
<spirit:portAccessType>ref</spirit:portAccessType>
|
|
146
|
+
<spirit:portAccessHandle>ambaAPB</spirit:portAccessHandle>
|
|
147
|
+
</spirit:access>
|
|
148
|
+
</spirit:port>
|
|
149
|
+
</spirit:ports>
|
|
150
|
+
<spirit:modelParameters>
|
|
151
|
+
<spirit:modelParameter spirit:dataType="sc_module_name" spirit:usageType="nontyped">
|
|
152
|
+
<spirit:name>module_name</spirit:name>
|
|
153
|
+
<spirit:value spirit:id="moduleName_id" spirit:resolve="generated" spirit:configGroups="requiredConfig" spirit:format="string" spirit:prompt="module name"/>
|
|
154
|
+
</spirit:modelParameter>
|
|
155
|
+
<spirit:modelParameter spirit:dataType="bool" spirit:usageType="nontyped">
|
|
156
|
+
<spirit:name>resetOnInitialize</spirit:name>
|
|
157
|
+
<spirit:value spirit:id="resetOnInitialize_id" spirit:resolve="user" spirit:configGroups="requiredConfig" spirit:format="bool" spirit:prompt="whether reset() should be invoked at startup time">true</spirit:value>
|
|
158
|
+
</spirit:modelParameter>
|
|
159
|
+
<spirit:modelParameter spirit:dataType="unsigned int" spirit:usageType="nontyped">
|
|
160
|
+
<spirit:name>debug_level</spirit:name>
|
|
161
|
+
<spirit:value spirit:id="debug_level_id" spirit:resolve="user" spirit:configGroups="requiredConfig" spirit:format="long" spirit:prompt="debug level">0</spirit:value>
|
|
162
|
+
</spirit:modelParameter>
|
|
163
|
+
<spirit:modelParameter spirit:dataType="tlm_endianness endianness" spirit:usageType="nontyped">
|
|
164
|
+
<spirit:name>endianness</spirit:name>
|
|
165
|
+
<spirit:value spirit:id="endianness_id" spirit:resolve="user" spirit:choiceRef="endianness" spirit:configGroups="requiredConfig" spirit:prompt="use specific endianness">TLM_BIG_ENDIAN</spirit:value>
|
|
166
|
+
</spirit:modelParameter>
|
|
167
|
+
</spirit:modelParameters>
|
|
168
|
+
</spirit:model>
|
|
169
|
+
<spirit:choices>
|
|
170
|
+
<spirit:choice>
|
|
171
|
+
<spirit:name>endianness</spirit:name>
|
|
172
|
+
<spirit:enumeration spirit:text="TLM_BIG_ENDIAN">TLM_BIG_ENDIAN</spirit:enumeration>
|
|
173
|
+
<spirit:enumeration spirit:text="TLM_LITTLE_ENDIAN">TLM_LITTLE_ENDIAN</spirit:enumeration>
|
|
174
|
+
<spirit:enumeration spirit:text="TLM_HOST_ENDIAN">TLM_HOST_ENDIAN</spirit:enumeration>
|
|
175
|
+
</spirit:choice>
|
|
176
|
+
</spirit:choices>
|
|
177
|
+
<spirit:fileSets>
|
|
178
|
+
<spirit:fileSet>
|
|
179
|
+
<spirit:name>fs-scSource</spirit:name>
|
|
180
|
+
<spirit:file>
|
|
181
|
+
<spirit:name>./tlmsrc/src/Leon2_uart.cpp</spirit:name>
|
|
182
|
+
<spirit:fileType>systemCSource</spirit:fileType>
|
|
183
|
+
<spirit:dependency>./include</spirit:dependency>
|
|
184
|
+
</spirit:file>
|
|
185
|
+
<spirit:file>
|
|
186
|
+
<spirit:name>./tlmsrc/src/tlmreg_Leon2_uart.cpp</spirit:name>
|
|
187
|
+
<spirit:fileType>systemCSource</spirit:fileType>
|
|
188
|
+
<spirit:dependency>./include</spirit:dependency>
|
|
189
|
+
</spirit:file>
|
|
190
|
+
<spirit:file>
|
|
191
|
+
<spirit:name>./tlmsrc/src/user_specific_Leon2_uart.cpp</spirit:name>
|
|
192
|
+
<spirit:fileType>systemCSource</spirit:fileType>
|
|
193
|
+
<spirit:dependency>./include</spirit:dependency>
|
|
194
|
+
</spirit:file>
|
|
195
|
+
<spirit:file>
|
|
196
|
+
<spirit:name>./tlmsrc/include/Leon2_uart.h</spirit:name>
|
|
197
|
+
<spirit:fileType>systemCSource</spirit:fileType>
|
|
198
|
+
<spirit:isIncludeFile spirit:externalDeclarations="true">true</spirit:isIncludeFile>
|
|
199
|
+
</spirit:file>
|
|
200
|
+
<spirit:file>
|
|
201
|
+
<spirit:name>./tlmsrc/include/def_Leon2_uart.h</spirit:name>
|
|
202
|
+
<spirit:fileType>systemCSource</spirit:fileType>
|
|
203
|
+
<spirit:isIncludeFile>true</spirit:isIncludeFile>
|
|
204
|
+
</spirit:file>
|
|
205
|
+
<spirit:file>
|
|
206
|
+
<spirit:name>./tlmsrc/include/tlmreg_Leon2_uart.h</spirit:name>
|
|
207
|
+
<spirit:fileType>systemCSource</spirit:fileType>
|
|
208
|
+
<spirit:isIncludeFile>true</spirit:isIncludeFile>
|
|
209
|
+
</spirit:file>
|
|
210
|
+
<spirit:file>
|
|
211
|
+
<spirit:name>./tlmsrc/include/tlm_field.h</spirit:name>
|
|
212
|
+
<spirit:fileType>systemCSource</spirit:fileType>
|
|
213
|
+
<spirit:isIncludeFile>true</spirit:isIncludeFile>
|
|
214
|
+
</spirit:file>
|
|
215
|
+
<spirit:file>
|
|
216
|
+
<spirit:name>./tlmsrc/include/tlm_register.h</spirit:name>
|
|
217
|
+
<spirit:fileType>systemCSource</spirit:fileType>
|
|
218
|
+
<spirit:isIncludeFile>true</spirit:isIncludeFile>
|
|
219
|
+
</spirit:file>
|
|
220
|
+
</spirit:fileSet>
|
|
221
|
+
</spirit:fileSets>
|
|
222
|
+
</spirit:component>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Copyright (C) 2010, 2011 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_tools'
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
describe IPXACT::Tools::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::Tools::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::Tools::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::Tools::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::Tools::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::Tools::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::Tools::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::Tools::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::Tools::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::Tools::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
|