ipxact-ruby 0.11.1
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/.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
data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/tlmreg_Leon2_uart.h
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
#ifndef _LEON2_UART_TLM_REGISTERS_H_
|
|
27
|
+
#define _LEON2_UART_TLM_REGISTERS_H_
|
|
28
|
+
|
|
29
|
+
/* -----------------------------------------------------------------------
|
|
30
|
+
* Includes
|
|
31
|
+
* ----------------------------------------------------------------------- */
|
|
32
|
+
|
|
33
|
+
#include "tlm_field.h"
|
|
34
|
+
#include "tlm_register.h"
|
|
35
|
+
|
|
36
|
+
#include "tlm_host_def.h"
|
|
37
|
+
|
|
38
|
+
namespace Leon2 {
|
|
39
|
+
|
|
40
|
+
class uart_data_tlm_register : public tlm_register_32
|
|
41
|
+
{
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
tlm_field<tlm_uint32_t,32> field; // Data read/write register
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
uart_data_tlm_register();
|
|
48
|
+
|
|
49
|
+
/* Destructor */
|
|
50
|
+
~uart_data_tlm_register(){};
|
|
51
|
+
|
|
52
|
+
void write(tlm_uint32_t value);
|
|
53
|
+
|
|
54
|
+
void poke(tlm_uint32_t value);
|
|
55
|
+
|
|
56
|
+
tlm_uint32_t read();
|
|
57
|
+
|
|
58
|
+
tlm_uint32_t peek();
|
|
59
|
+
|
|
60
|
+
void reset();
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
class uart_status_tlm_register : public tlm_register_32
|
|
64
|
+
{
|
|
65
|
+
|
|
66
|
+
public:
|
|
67
|
+
tlm_field<tlm_uint32_t,32> field; // Status register
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
uart_status_tlm_register();
|
|
71
|
+
|
|
72
|
+
/* Destructor */
|
|
73
|
+
~uart_status_tlm_register(){};
|
|
74
|
+
|
|
75
|
+
void write(tlm_uint32_t value);
|
|
76
|
+
|
|
77
|
+
void poke(tlm_uint32_t value);
|
|
78
|
+
|
|
79
|
+
tlm_uint32_t read();
|
|
80
|
+
|
|
81
|
+
tlm_uint32_t peek();
|
|
82
|
+
|
|
83
|
+
void reset();
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
class uart_control_tlm_register : public tlm_register_32
|
|
87
|
+
{
|
|
88
|
+
|
|
89
|
+
public:
|
|
90
|
+
tlm_field<tlm_uint32_t,32> field; // Control register
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
uart_control_tlm_register();
|
|
94
|
+
|
|
95
|
+
/* Destructor */
|
|
96
|
+
~uart_control_tlm_register(){};
|
|
97
|
+
|
|
98
|
+
void write(tlm_uint32_t value);
|
|
99
|
+
|
|
100
|
+
void poke(tlm_uint32_t value);
|
|
101
|
+
|
|
102
|
+
tlm_uint32_t read();
|
|
103
|
+
|
|
104
|
+
tlm_uint32_t peek();
|
|
105
|
+
|
|
106
|
+
void reset();
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
class uart_scalarReload_tlm_register : public tlm_register_32
|
|
110
|
+
{
|
|
111
|
+
|
|
112
|
+
public:
|
|
113
|
+
tlm_field<tlm_uint32_t,32> field; // Scalar reload register
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
uart_scalarReload_tlm_register();
|
|
117
|
+
|
|
118
|
+
/* Destructor */
|
|
119
|
+
~uart_scalarReload_tlm_register(){};
|
|
120
|
+
|
|
121
|
+
void write(tlm_uint32_t value);
|
|
122
|
+
|
|
123
|
+
void poke(tlm_uint32_t value);
|
|
124
|
+
|
|
125
|
+
tlm_uint32_t read();
|
|
126
|
+
|
|
127
|
+
tlm_uint32_t peek();
|
|
128
|
+
|
|
129
|
+
void reset();
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
} // end namespace Leon2
|
|
133
|
+
#endif /* _Leon2_uart_TLM_REGISTERS_H_ */
|
|
@@ -0,0 +1,316 @@
|
|
|
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 "def_Leon2_uart.h"
|
|
31
|
+
|
|
32
|
+
#include "Leon2_uart.h"
|
|
33
|
+
|
|
34
|
+
/* -----------------------------------------------------------------------
|
|
35
|
+
* Defines
|
|
36
|
+
* ----------------------------------------------------------------------- */
|
|
37
|
+
|
|
38
|
+
using std::exception;
|
|
39
|
+
|
|
40
|
+
using namespace std;
|
|
41
|
+
|
|
42
|
+
using prt_tlm_tac::be_byte;
|
|
43
|
+
|
|
44
|
+
/* -----------------------------------------------------------------------
|
|
45
|
+
* Global Variables
|
|
46
|
+
* ----------------------------------------------------------------------- */
|
|
47
|
+
|
|
48
|
+
// sc_object kind string property
|
|
49
|
+
|
|
50
|
+
const char* const Leon2::uart::kind_string = "Leon2_uart";
|
|
51
|
+
|
|
52
|
+
/* -----------------------------------------------------------------------
|
|
53
|
+
* Public functions
|
|
54
|
+
* ----------------------------------------------------------------------- */
|
|
55
|
+
|
|
56
|
+
namespace Leon2 {
|
|
57
|
+
|
|
58
|
+
/***************************************************************************
|
|
59
|
+
* \brief Reset
|
|
60
|
+
**************************************************************************/
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
void uart::reset()
|
|
64
|
+
{
|
|
65
|
+
DEBUG_REPORT(3,"\tLeon2::uart: Init registers\n");
|
|
66
|
+
data.reset();
|
|
67
|
+
status.reset();
|
|
68
|
+
control.reset();
|
|
69
|
+
scalarReload.reset();
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/***************************************************************************
|
|
74
|
+
* \brief Constructor
|
|
75
|
+
**************************************************************************/
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
uart::uart(sc_module_name tlms_module_name,
|
|
79
|
+
bool resetOnInitialize,
|
|
80
|
+
unsigned int debugLevel,
|
|
81
|
+
tlm_endianness endianness) :
|
|
82
|
+
sc_module(tlms_module_name),
|
|
83
|
+
prt_tlm_tac::tac_slave_base<tlm_uint32_t,tlm_uint32_t>(name()),
|
|
84
|
+
// tac ports
|
|
85
|
+
ambaAPB("ambaAPB")
|
|
86
|
+
{
|
|
87
|
+
resetOnInitialize_c = resetOnInitialize;
|
|
88
|
+
debugLevel_c = debugLevel;
|
|
89
|
+
endianness_c = endianness;
|
|
90
|
+
|
|
91
|
+
// Bind slave ports to the slave
|
|
92
|
+
ambaAPB(*this);
|
|
93
|
+
ambaAPB.set_port_id(Leon2_uart_ambaAPB_ID);
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
/* -----------------------------------------------------------------------
|
|
97
|
+
* Leon2_uart Internal SC_METHODS and SC_THREADS (sensitivity)
|
|
98
|
+
* ----------------------------------------------------------------------- */
|
|
99
|
+
|
|
100
|
+
method_and_thread_sensitivity();
|
|
101
|
+
|
|
102
|
+
// Call the Reset to initialyze the registers
|
|
103
|
+
reset();
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/***************************************************************************
|
|
108
|
+
* \brief Destructor for Leon2_uart . Does nothing
|
|
109
|
+
**************************************************************************/
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
uart::~uart()
|
|
113
|
+
{
|
|
114
|
+
GENERAL_REPORT("\t%s: Destructor called \n",name());
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/***************************************************************************
|
|
118
|
+
* \brief Slave Read Interface
|
|
119
|
+
* \return none
|
|
120
|
+
**************************************************************************/
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
prt_tlm_tac::tac_status uart::read(const tlm_uint32_t& address_tlmske,
|
|
124
|
+
tlm_uint32_t& data_tlmske,
|
|
125
|
+
prt_tlm_tac::tac_error_reason& error_reason,
|
|
126
|
+
const unsigned int byte_enable,
|
|
127
|
+
const prt_tlm_tac::tac_mode mode,
|
|
128
|
+
const unsigned int target_port_id
|
|
129
|
+
) {
|
|
130
|
+
prt_tlm_tac::tac_status status_tlmske;
|
|
131
|
+
|
|
132
|
+
bool sd_enabled = 0;
|
|
133
|
+
|
|
134
|
+
switch(target_port_id)
|
|
135
|
+
{
|
|
136
|
+
|
|
137
|
+
case Leon2_uart_ambaAPB_ID:
|
|
138
|
+
DEBUG_REPORT(3,"\ttarget_port_id = Leon2_uart_ambaAPB_ID\n");
|
|
139
|
+
sd_enabled = 0;
|
|
140
|
+
|
|
141
|
+
switch(address_tlmske)
|
|
142
|
+
{
|
|
143
|
+
case (data_offset):
|
|
144
|
+
if (sd_enabled == 0) {
|
|
145
|
+
data_tlmske = data.read();
|
|
146
|
+
}
|
|
147
|
+
status_tlmske.set_ok();
|
|
148
|
+
status_tlmske.set_synchro();
|
|
149
|
+
|
|
150
|
+
break;
|
|
151
|
+
|
|
152
|
+
case (status_offset):
|
|
153
|
+
if (sd_enabled == 0) {
|
|
154
|
+
data_tlmske = status.read();
|
|
155
|
+
}
|
|
156
|
+
status_tlmske.set_ok();
|
|
157
|
+
status_tlmske.set_synchro();
|
|
158
|
+
|
|
159
|
+
break;
|
|
160
|
+
|
|
161
|
+
case (control_offset):
|
|
162
|
+
if (sd_enabled == 0) {
|
|
163
|
+
data_tlmske = control.read();
|
|
164
|
+
}
|
|
165
|
+
status_tlmske.set_ok();
|
|
166
|
+
status_tlmske.set_synchro();
|
|
167
|
+
|
|
168
|
+
break;
|
|
169
|
+
|
|
170
|
+
case (scalarReload_offset):
|
|
171
|
+
if (sd_enabled == 0) {
|
|
172
|
+
data_tlmske = scalarReload.read();
|
|
173
|
+
}
|
|
174
|
+
status_tlmske.set_ok();
|
|
175
|
+
status_tlmske.set_synchro();
|
|
176
|
+
|
|
177
|
+
break;
|
|
178
|
+
|
|
179
|
+
default:
|
|
180
|
+
status_tlmske.set_error();
|
|
181
|
+
error_reason.set_reason("Error, can not read at address ");
|
|
182
|
+
string msg_tlmske = "Error, can not read at address ";
|
|
183
|
+
ERROR_REPORT(2,"\t%s: %s 0x%X T:%9.9f\n",
|
|
184
|
+
name(),msg_tlmske.c_str(),(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
|
|
189
|
+
default:
|
|
190
|
+
status_tlmske.set_error();
|
|
191
|
+
error_reason.set_reason("Error, bus ID unknown ");
|
|
192
|
+
string msg_tlmske = "Error, bus ID unknown ";
|
|
193
|
+
ERROR_REPORT(2,"\t%s: %s 0x%X T:%9.9f\n",
|
|
194
|
+
name(),msg_tlmske.c_str(),(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
DEBUG_REPORT(3,"\t%s: Read 0x%X at 0x%X T:%9.9f\n",
|
|
199
|
+
name(),(unsigned int)data_tlmske,(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
200
|
+
|
|
201
|
+
return(status_tlmske);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/***************************************************************************
|
|
205
|
+
* \brief Slave Write Interface
|
|
206
|
+
**************************************************************************/
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
prt_tlm_tac::tac_status uart::write(const tlm_uint32_t& address_tlmske,
|
|
210
|
+
const tlm_uint32_t& data_tlmske,
|
|
211
|
+
prt_tlm_tac::tac_error_reason& error_reason,
|
|
212
|
+
const unsigned int byte_enable,
|
|
213
|
+
const prt_tlm_tac::tac_mode mode,
|
|
214
|
+
const unsigned int target_port_id
|
|
215
|
+
) {
|
|
216
|
+
prt_tlm_tac::tac_status status_tlmske;
|
|
217
|
+
bool sd_enabled = 0;
|
|
218
|
+
|
|
219
|
+
switch(target_port_id)
|
|
220
|
+
{
|
|
221
|
+
|
|
222
|
+
case Leon2_uart_ambaAPB_ID:
|
|
223
|
+
DEBUG_REPORT(3,"\ttarget_port_id = Leon2_uart_ambaAPB_ID\n");
|
|
224
|
+
sd_enabled = 0;
|
|
225
|
+
|
|
226
|
+
switch(address_tlmske)
|
|
227
|
+
{
|
|
228
|
+
case (data_offset):
|
|
229
|
+
if (sd_enabled == 0) {
|
|
230
|
+
data.write(data_tlmske);
|
|
231
|
+
}
|
|
232
|
+
status_tlmske.set_ok();
|
|
233
|
+
status_tlmske.set_synchro();
|
|
234
|
+
break;
|
|
235
|
+
|
|
236
|
+
case (control_offset):
|
|
237
|
+
if (sd_enabled == 0) {
|
|
238
|
+
control.write(data_tlmske);
|
|
239
|
+
}
|
|
240
|
+
status_tlmske.set_ok();
|
|
241
|
+
status_tlmske.set_synchro();
|
|
242
|
+
break;
|
|
243
|
+
|
|
244
|
+
case (scalarReload_offset):
|
|
245
|
+
if (sd_enabled == 0) {
|
|
246
|
+
scalarReload.write(data_tlmske);
|
|
247
|
+
}
|
|
248
|
+
status_tlmske.set_ok();
|
|
249
|
+
status_tlmske.set_synchro();
|
|
250
|
+
break;
|
|
251
|
+
|
|
252
|
+
default:
|
|
253
|
+
status_tlmske.set_error();
|
|
254
|
+
error_reason.set_reason("Error, can not write at address ");
|
|
255
|
+
string msg_tlmske = "Error, can not write at address ";
|
|
256
|
+
ERROR_REPORT(2,"\t%s: %s 0x%X T:%9.9f\n",
|
|
257
|
+
name(),msg_tlmske.c_str(),(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
break;
|
|
261
|
+
default:
|
|
262
|
+
status_tlmske.set_error();
|
|
263
|
+
error_reason.set_reason("Error, bus ID unknown ");
|
|
264
|
+
string msg_tlmske = "Error, bus ID unknown ";
|
|
265
|
+
ERROR_REPORT(2,"\t%s: %s 0x%X T:%9.9f\n",
|
|
266
|
+
name(),msg_tlmske.c_str(),(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
DEBUG_REPORT(3,"\t%s: Write 0x%X at 0x%X T:%9.9f\n",
|
|
271
|
+
name(),(unsigned int)data_tlmske,(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
272
|
+
|
|
273
|
+
return(status_tlmske);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/***************************************************************************
|
|
277
|
+
* \brief Slave get_target_info Interface
|
|
278
|
+
**************************************************************************/
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
prt_tlm_tac::tac_status uart::get_target_info(const tlm_uint32_t& address_tlmske,
|
|
282
|
+
prt_tlm_tac::tac_metadata& metadata,
|
|
283
|
+
prt_tlm_tac::tac_error_reason& error_reason,
|
|
284
|
+
const unsigned int target_port_id
|
|
285
|
+
) {
|
|
286
|
+
prt_tlm_tac::tac_status status_tlmske;
|
|
287
|
+
|
|
288
|
+
stringstream info;
|
|
289
|
+
|
|
290
|
+
switch(target_port_id)
|
|
291
|
+
{
|
|
292
|
+
|
|
293
|
+
case Leon2_uart_ambaAPB_ID:
|
|
294
|
+
status_tlmske.set_ok();
|
|
295
|
+
info << metadata.get_key_string(prt_tlm_tac::tac_metadata::NAME) << name();
|
|
296
|
+
info << metadata.get_key_string(prt_tlm_tac::tac_metadata::SLAVE_BASE_PTR) << hex << showbase << (prt_tlm_tac::tac_slave_base<tlm_uint32_t,tlm_uint32_t> *)(this);
|
|
297
|
+
info << metadata.get_key_string(prt_tlm_tac::tac_metadata::TARGET_PORT_ID) << dec << target_port_id;
|
|
298
|
+
info << metadata.get_key_string(prt_tlm_tac::tac_metadata::ENDIANNESS) << ((endianness_c == TLM_BIG_ENDIAN) ? "big ": "little");
|
|
299
|
+
metadata.set_metadata(info.str());
|
|
300
|
+
break;
|
|
301
|
+
default:
|
|
302
|
+
status_tlmske.set_error();
|
|
303
|
+
error_reason.set_reason("Error, bus ID unknown ");
|
|
304
|
+
string msg_tlmske = "Error, bus ID unknown ";
|
|
305
|
+
ERROR_REPORT(2,"\t%s: %s 0x%X T:%9.9f\n",
|
|
306
|
+
name(),msg_tlmske.c_str(),(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
DEBUG_REPORT(3,"\t%s: get_target_info at 0x%X T:%9.9f\n",
|
|
311
|
+
name(),(unsigned int)address_tlmske,(float)(sc_time_stamp().to_seconds()));
|
|
312
|
+
|
|
313
|
+
return(status_tlmske);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
} // end of namespace Leon2
|
data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/tlmreg_Leon2_uart.cc
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
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 "tlmreg_Leon2_uart.h"
|
|
31
|
+
|
|
32
|
+
namespace Leon2 {
|
|
33
|
+
|
|
34
|
+
uart_data_tlm_register::uart_data_tlm_register() :
|
|
35
|
+
field()
|
|
36
|
+
{}
|
|
37
|
+
|
|
38
|
+
void uart_data_tlm_register::write(tlm_uint32_t value)
|
|
39
|
+
{
|
|
40
|
+
field.write(value >> 0);
|
|
41
|
+
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
void uart_data_tlm_register::poke(tlm_uint32_t value)
|
|
46
|
+
{
|
|
47
|
+
field.write(value >> 0);
|
|
48
|
+
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
tlm_uint32_t uart_data_tlm_register::peek()
|
|
53
|
+
{
|
|
54
|
+
tlm_uint32_t value = 0;
|
|
55
|
+
value |= field.read() << 0;
|
|
56
|
+
|
|
57
|
+
return(value);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
tlm_uint32_t uart_data_tlm_register::read()
|
|
61
|
+
{
|
|
62
|
+
tlm_uint32_t value = 0;
|
|
63
|
+
value |= field.read() << 0;
|
|
64
|
+
|
|
65
|
+
return(value);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
void uart_data_tlm_register::reset()
|
|
69
|
+
{
|
|
70
|
+
field.write(0x0);
|
|
71
|
+
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
uart_status_tlm_register::uart_status_tlm_register() :
|
|
76
|
+
field()
|
|
77
|
+
{}
|
|
78
|
+
|
|
79
|
+
void uart_status_tlm_register::write(tlm_uint32_t value)
|
|
80
|
+
{
|
|
81
|
+
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
void uart_status_tlm_register::poke(tlm_uint32_t value)
|
|
86
|
+
{
|
|
87
|
+
field.write(value >> 0);
|
|
88
|
+
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
tlm_uint32_t uart_status_tlm_register::peek()
|
|
93
|
+
{
|
|
94
|
+
tlm_uint32_t value = 0;
|
|
95
|
+
value |= field.read() << 0;
|
|
96
|
+
|
|
97
|
+
return(value);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
tlm_uint32_t uart_status_tlm_register::read()
|
|
101
|
+
{
|
|
102
|
+
tlm_uint32_t value = 0;
|
|
103
|
+
value |= field.read() << 0;
|
|
104
|
+
|
|
105
|
+
return(value);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
void uart_status_tlm_register::reset()
|
|
109
|
+
{
|
|
110
|
+
field.write(0x6);
|
|
111
|
+
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
uart_control_tlm_register::uart_control_tlm_register() :
|
|
116
|
+
field()
|
|
117
|
+
{}
|
|
118
|
+
|
|
119
|
+
void uart_control_tlm_register::write(tlm_uint32_t value)
|
|
120
|
+
{
|
|
121
|
+
field.write(value >> 0);
|
|
122
|
+
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
void uart_control_tlm_register::poke(tlm_uint32_t value)
|
|
127
|
+
{
|
|
128
|
+
field.write(value >> 0);
|
|
129
|
+
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
tlm_uint32_t uart_control_tlm_register::peek()
|
|
134
|
+
{
|
|
135
|
+
tlm_uint32_t value = 0;
|
|
136
|
+
value |= field.read() << 0;
|
|
137
|
+
|
|
138
|
+
return(value);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
tlm_uint32_t uart_control_tlm_register::read()
|
|
142
|
+
{
|
|
143
|
+
tlm_uint32_t value = 0;
|
|
144
|
+
value |= field.read() << 0;
|
|
145
|
+
|
|
146
|
+
return(value);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
void uart_control_tlm_register::reset()
|
|
150
|
+
{
|
|
151
|
+
field.write(0x0);
|
|
152
|
+
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
uart_scalarReload_tlm_register::uart_scalarReload_tlm_register() :
|
|
157
|
+
field()
|
|
158
|
+
{}
|
|
159
|
+
|
|
160
|
+
void uart_scalarReload_tlm_register::write(tlm_uint32_t value)
|
|
161
|
+
{
|
|
162
|
+
field.write(value >> 0);
|
|
163
|
+
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
void uart_scalarReload_tlm_register::poke(tlm_uint32_t value)
|
|
168
|
+
{
|
|
169
|
+
field.write(value >> 0);
|
|
170
|
+
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
tlm_uint32_t uart_scalarReload_tlm_register::peek()
|
|
175
|
+
{
|
|
176
|
+
tlm_uint32_t value = 0;
|
|
177
|
+
value |= field.read() << 0;
|
|
178
|
+
|
|
179
|
+
return(value);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
tlm_uint32_t uart_scalarReload_tlm_register::read()
|
|
183
|
+
{
|
|
184
|
+
tlm_uint32_t value = 0;
|
|
185
|
+
value |= field.read() << 0;
|
|
186
|
+
|
|
187
|
+
return(value);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
void uart_scalarReload_tlm_register::reset()
|
|
191
|
+
{
|
|
192
|
+
field.write(0x0);
|
|
193
|
+
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
} // end namespace Leon2
|