ipxact-ruby 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +15 -0
- data/.gitignore +2 -0
- data/README.html +89 -0
- data/README.mdown +91 -0
- data/Rakefile +31 -0
- data/VERSION +1 -0
- data/autotest/discover.rb +17 -0
- data/lib/ipxact.rb +263 -0
- data/lib/ipxact/component.rb +235 -0
- data/lib/ipxact/parser.rb +27 -0
- data/lib/ipxact/parser/bus_data_parser.rb +229 -0
- data/lib/ipxact/parser/component_data_parser.rb +309 -0
- data/lib/ipxact/parser/platform_data_parser.rb +63 -0
- data/lib/ipxact/pathfinder/graph_pathfinder.rb +191 -0
- data/lib/ipxact/platform.rb +43 -0
- data/schemas/abstractionDefinition.xsd +332 -0
- data/schemas/abstractor.xsd +156 -0
- data/schemas/autoConfigure.xsd +226 -0
- data/schemas/busDefinition.xsd +99 -0
- data/schemas/busInterface.xsd +640 -0
- data/schemas/commonStructures.xsd +189 -0
- data/schemas/component.xsd +253 -0
- data/schemas/configurable.xsd +82 -0
- data/schemas/constraints.xsd +283 -0
- data/schemas/design.xsd +105 -0
- data/schemas/designConfig.xsd +144 -0
- data/schemas/file.xsd +560 -0
- data/schemas/fileType.xsd +86 -0
- data/schemas/generator.xsd +240 -0
- data/schemas/identifier.xsd +93 -0
- data/schemas/index.xsd +67 -0
- data/schemas/memoryMap.xsd +1007 -0
- data/schemas/model.xsd +291 -0
- data/schemas/port.xsd +441 -0
- data/schemas/signalDrivers.xsd +220 -0
- data/schemas/simpleTypes.xsd +90 -0
- data/schemas/subInstances.xsd +256 -0
- data/spec/integration/bus_data_extraction_spec.rb +105 -0
- data/spec/integration/data_calculation_spec.rb +133 -0
- data/spec/integration/data_construction_spec.rb +52 -0
- data/spec/integration/general_spec.rb +121 -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/component_spec.rb +98 -0
- data/spec/unit/graph_pathfinder_spec.rb +128 -0
- data/spec/unit/interconnect_spec.rb +177 -0
- data/spec/unit/ipxact_spec.rb +69 -0
- data/spec/unit/platform_spec.rb +34 -0
- metadata +225 -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,98 @@
|
|
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
|
+
describe IPXACT::Component do
|
20
|
+
|
21
|
+
it "should create new components without subcomponents, interconnections or ports" do
|
22
|
+
component = IPXACT::Component.new("instance_name", "component_name", "component_vendor", "0.0")
|
23
|
+
component.should have(0).subcomponents
|
24
|
+
component.should have(0).interconnections
|
25
|
+
component.should have(0).ports
|
26
|
+
component[:name].should == "component_name"
|
27
|
+
component[:vendor].should == "component_vendor"
|
28
|
+
component[:version].should == "0.0"
|
29
|
+
component[:instance_name].should == "instance_name"
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should be able to get the register map of a given dma device" do
|
33
|
+
components = IPXACT::load_components(PLATFORM_PATH)
|
34
|
+
designs = IPXACT::load_designs(PLATFORM_PATH)
|
35
|
+
platform = IPXACT::Parser::PlatformData.parse_platform(["Leon2Platform", "1.1"], components, designs)
|
36
|
+
|
37
|
+
dma_component = platform.components['i_dma']
|
38
|
+
|
39
|
+
registers = dma_component.register_map
|
40
|
+
registers.should include(
|
41
|
+
{
|
42
|
+
:name => 'sourceAddress',
|
43
|
+
:offset => '0x0',
|
44
|
+
:size => '32',
|
45
|
+
:access => 'read-write'
|
46
|
+
}
|
47
|
+
)
|
48
|
+
registers.should include(
|
49
|
+
{
|
50
|
+
:name => 'destinationAddress',
|
51
|
+
:offset => '0x4',
|
52
|
+
:size => '32',
|
53
|
+
:access => 'read-write'
|
54
|
+
}
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should be able to get the register map of a given cgu device" do
|
59
|
+
components = IPXACT::load_components(PLATFORM_PATH)
|
60
|
+
designs = IPXACT::load_designs(PLATFORM_PATH)
|
61
|
+
platform = IPXACT::Parser::PlatformData.parse_platform(["Leon2Platform", "1.2"], components, designs)
|
62
|
+
|
63
|
+
cgu_component = platform.components['i_cgu']
|
64
|
+
cgu_component.should_not be_nil
|
65
|
+
|
66
|
+
registers = cgu_component.register_map
|
67
|
+
registers.should include(
|
68
|
+
{
|
69
|
+
:name => 'clock0Divide',
|
70
|
+
:offset => '0x0',
|
71
|
+
:size => '32',
|
72
|
+
:access => 'read-write'
|
73
|
+
}
|
74
|
+
)
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should raise an exception if the component has no register map" do
|
79
|
+
components = IPXACT::load_components(PLATFORM_PATH)
|
80
|
+
designs = IPXACT::load_designs(PLATFORM_PATH)
|
81
|
+
platform = IPXACT::Parser::PlatformData.parse_platform(["Leon2Platform", "1.1"], components, designs)
|
82
|
+
|
83
|
+
ahb_component = platform.components['i_ahb']
|
84
|
+
lambda {
|
85
|
+
ahb_component.register_map
|
86
|
+
}.should raise_exception
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should enable the description of a valid devfs suffix for the dma" do
|
90
|
+
components = IPXACT::load_components(PLATFORM_PATH)
|
91
|
+
designs = IPXACT::load_designs(PLATFORM_PATH)
|
92
|
+
platform = IPXACT::Parser::PlatformData.parse_platform(["Leon2Platform", "1.1"], components, designs)
|
93
|
+
|
94
|
+
dma = platform.components['i_dma']
|
95
|
+
(dma[:name] + '/' + dma[:vendor] + '/x/y').should == 'dma/spiritconsortium.org/x/y'
|
96
|
+
|
97
|
+
end
|
98
|
+
end
|