ipxact-ruby 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. data/.autotest +15 -0
  2. data/.gitignore +2 -0
  3. data/README.html +89 -0
  4. data/README.mdown +91 -0
  5. data/Rakefile +31 -0
  6. data/VERSION +1 -0
  7. data/autotest/discover.rb +17 -0
  8. data/lib/ipxact.rb +263 -0
  9. data/lib/ipxact/component.rb +235 -0
  10. data/lib/ipxact/parser.rb +27 -0
  11. data/lib/ipxact/parser/bus_data_parser.rb +229 -0
  12. data/lib/ipxact/parser/component_data_parser.rb +309 -0
  13. data/lib/ipxact/parser/platform_data_parser.rb +63 -0
  14. data/lib/ipxact/pathfinder/graph_pathfinder.rb +191 -0
  15. data/lib/ipxact/platform.rb +43 -0
  16. data/schemas/abstractionDefinition.xsd +332 -0
  17. data/schemas/abstractor.xsd +156 -0
  18. data/schemas/autoConfigure.xsd +226 -0
  19. data/schemas/busDefinition.xsd +99 -0
  20. data/schemas/busInterface.xsd +640 -0
  21. data/schemas/commonStructures.xsd +189 -0
  22. data/schemas/component.xsd +253 -0
  23. data/schemas/configurable.xsd +82 -0
  24. data/schemas/constraints.xsd +283 -0
  25. data/schemas/design.xsd +105 -0
  26. data/schemas/designConfig.xsd +144 -0
  27. data/schemas/file.xsd +560 -0
  28. data/schemas/fileType.xsd +86 -0
  29. data/schemas/generator.xsd +240 -0
  30. data/schemas/identifier.xsd +93 -0
  31. data/schemas/index.xsd +67 -0
  32. data/schemas/memoryMap.xsd +1007 -0
  33. data/schemas/model.xsd +291 -0
  34. data/schemas/port.xsd +441 -0
  35. data/schemas/signalDrivers.xsd +220 -0
  36. data/schemas/simpleTypes.xsd +90 -0
  37. data/schemas/subInstances.xsd +256 -0
  38. data/spec/integration/bus_data_extraction_spec.rb +105 -0
  39. data/spec/integration/data_calculation_spec.rb +133 -0
  40. data/spec/integration/data_construction_spec.rb +52 -0
  41. data/spec/integration/general_spec.rb +121 -0
  42. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_initiator_port.h +135 -0
  43. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_initiator_port.tpp +247 -0
  44. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_initiator_port_base.h +189 -0
  45. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_router.h +205 -0
  46. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_router.tpp +278 -0
  47. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_slave_base.h +115 -0
  48. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_slave_base.tpp +126 -0
  49. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_target_port.h +168 -0
  50. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_target_port_base.h +133 -0
  51. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/pv_tlm_if.h +280 -0
  52. data/spec/test_data/spiritconsortium.org/Leon2TLM/PV/user_types.h +38 -0
  53. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/Leon2Platform/Leon2Platform.xml +77 -0
  54. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/Leon2Platform/design_Leon2Platform.xml +156 -0
  55. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/Leon2Platform/tlmsrc/Leon2Platform.h +149 -0
  56. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/apbSubSystem/apbSubSystem.xml +406 -0
  57. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/apbSubSystem/design_apbSubSystem.xml +135 -0
  58. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM1/apbSubSystem/tlmsrc/apbSubSystem.h +133 -0
  59. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/Leon2Platform/Leon2Platform.xml +77 -0
  60. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/Leon2Platform/design_Leon2Platform.xml +157 -0
  61. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/Leon2Platform/tlmsrc/Leon2Platform.h +150 -0
  62. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/apbSubSystem.xml +422 -0
  63. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/designConfig_apbSubSystem.xml +79 -0
  64. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/design_apbSubSystem.xml +184 -0
  65. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM2/apbSubSystem/tlmsrc/apbSubSystem.h +164 -0
  66. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/Leon2Platform/Leon2Platform.xml +105 -0
  67. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/Leon2Platform/design_Leon2Platform.xml +157 -0
  68. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/Leon2Platform/tlmsrc/Leon2Platform.h +152 -0
  69. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/apbSubSystem.xml +429 -0
  70. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/designConfig_apbSubSystem.xml +64 -0
  71. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/design_apbSubSystem.xml +150 -0
  72. data/spec/test_data/spiritconsortium.org/Leon2TLM/SystemTLM3/apbSubSystem/tlmsrc/apbSubSystem.h +167 -0
  73. data/spec/test_data/spiritconsortium.org/Leon2TLM/ahbbus/1.4/ahbbus22.xml +236 -0
  74. data/spec/test_data/spiritconsortium.org/Leon2TLM/ahbbus/1.4/tlmsrc/ahbbus.h +52 -0
  75. data/spec/test_data/spiritconsortium.org/Leon2TLM/ahbram/1.4/ahbram.xml +184 -0
  76. data/spec/test_data/spiritconsortium.org/Leon2TLM/ahbram/1.4/tlmsrc/ahbram.cc +93 -0
  77. data/spec/test_data/spiritconsortium.org/Leon2TLM/ahbram/1.4/tlmsrc/ahbram.h +77 -0
  78. data/spec/test_data/spiritconsortium.org/Leon2TLM/apbbus/1.4/apbbus8.xml +544 -0
  79. data/spec/test_data/spiritconsortium.org/Leon2TLM/apbbus/1.4/tlmsrc/apbbus.h +55 -0
  80. data/spec/test_data/spiritconsortium.org/Leon2TLM/apbmst/1.4/apbmst.xml +209 -0
  81. data/spec/test_data/spiritconsortium.org/Leon2TLM/apbmst/1.4/tlmsrc/apbmst.h +53 -0
  82. data/spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/apbram.xml +395 -0
  83. data/spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.cc +89 -0
  84. data/spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.h +69 -0
  85. data/spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.v +82 -0
  86. data/spec/test_data/spiritconsortium.org/Leon2TLM/apbram/1.0/hdlsrc/apbram.vhd +132 -0
  87. data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.4/cgu.xml +686 -0
  88. data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.4/tlmsrc/cgu.cc +121 -0
  89. data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.4/tlmsrc/cgu.h +81 -0
  90. data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.5/cgu.xml +707 -0
  91. data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.5/tlmsrc/cgu.cc +121 -0
  92. data/spec/test_data/spiritconsortium.org/Leon2TLM/cgu/1.5/tlmsrc/cgu.h +81 -0
  93. data/spec/test_data/spiritconsortium.org/Leon2TLM/dma/1.4/dma.xml +272 -0
  94. data/spec/test_data/spiritconsortium.org/Leon2TLM/dma/1.4/tlmsrc/dma.cc +230 -0
  95. data/spec/test_data/spiritconsortium.org/Leon2TLM/dma/1.4/tlmsrc/dma.h +116 -0
  96. data/spec/test_data/spiritconsortium.org/Leon2TLM/irqctrl/1.4/irqctrl.xml +530 -0
  97. data/spec/test_data/spiritconsortium.org/Leon2TLM/irqctrl/1.4/tlmsrc/irqctrl.cc +211 -0
  98. data/spec/test_data/spiritconsortium.org/Leon2TLM/irqctrl/1.4/tlmsrc/irqctrl.h +108 -0
  99. data/spec/test_data/spiritconsortium.org/Leon2TLM/processor/1.4/processor.xml +423 -0
  100. data/spec/test_data/spiritconsortium.org/Leon2TLM/processor/1.4/tlmsrc/processor.cc +331 -0
  101. data/spec/test_data/spiritconsortium.org/Leon2TLM/processor/1.4/tlmsrc/processor.h +121 -0
  102. data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2apb/1.0/pv2apb.xml +240 -0
  103. data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2apb/1.0/tlmsrc/pv2apb.cc +153 -0
  104. data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2apb/1.0/tlmsrc/pv2apb.h +77 -0
  105. data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2tac/1.0/pv2tac.xml +154 -0
  106. data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2tac/1.0/tlmsrc/pv2tac.cc +114 -0
  107. data/spec/test_data/spiritconsortium.org/Leon2TLM/pv2tac/1.0/tlmsrc/pv2tac.h +67 -0
  108. data/spec/test_data/spiritconsortium.org/Leon2TLM/rgu/1.4/rgu.xml +766 -0
  109. data/spec/test_data/spiritconsortium.org/Leon2TLM/rgu/1.4/tlmsrc/rgu.cc +126 -0
  110. data/spec/test_data/spiritconsortium.org/Leon2TLM/rgu/1.4/tlmsrc/rgu.h +105 -0
  111. data/spec/test_data/spiritconsortium.org/Leon2TLM/scmlAdaptor/1.0/scmlAdaptor.xml +154 -0
  112. data/spec/test_data/spiritconsortium.org/Leon2TLM/scmlAdaptor/1.0/tlmsrc/scmladaptor.cc +100 -0
  113. data/spec/test_data/spiritconsortium.org/Leon2TLM/scmlAdaptor/1.0/tlmsrc/scmladaptor.h +62 -0
  114. data/spec/test_data/spiritconsortium.org/Leon2TLM/serial_device/1.0/serial_device.xml +151 -0
  115. data/spec/test_data/spiritconsortium.org/Leon2TLM/serial_device/1.0/tlmsrc/serial_device.h +85 -0
  116. data/spec/test_data/spiritconsortium.org/Leon2TLM/timers/1.4/timers.xml +460 -0
  117. data/spec/test_data/spiritconsortium.org/Leon2TLM/timers/1.4/tlmsrc/timers.cc +201 -0
  118. data/spec/test_data/spiritconsortium.org/Leon2TLM/timers/1.4/tlmsrc/timers.h +102 -0
  119. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart.h +152 -0
  120. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart_fifo.h +113 -0
  121. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart_memory_map.h +96 -0
  122. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/inc/uart_types.h +60 -0
  123. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart.cc +125 -0
  124. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart_interrupt_handler.cc +136 -0
  125. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart_register_bank.cc +129 -0
  126. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/tlmsrc/src/uart_serial_tx_rx.cc +145 -0
  127. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_scml/1.0/uart_scml.xml +372 -0
  128. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/Leon2_uart.h +216 -0
  129. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/def_Leon2_uart.h +34 -0
  130. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/tlm_field.h +72 -0
  131. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/tlm_register.h +129 -0
  132. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/include/tlmreg_Leon2_uart.h +133 -0
  133. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/Leon2_uart.cc +316 -0
  134. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/tlmreg_Leon2_uart.cc +197 -0
  135. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/tlmsrc/src/user_specific_Leon2_uart.cc +146 -0
  136. data/spec/test_data/spiritconsortium.org/Leon2TLM/uart_tac/1.0/uart_tac.xml +222 -0
  137. data/spec/unit/component_spec.rb +98 -0
  138. data/spec/unit/graph_pathfinder_spec.rb +128 -0
  139. data/spec/unit/interconnect_spec.rb +177 -0
  140. data/spec/unit/ipxact_spec.rb +69 -0
  141. data/spec/unit/platform_spec.rb +34 -0
  142. metadata +225 -0
@@ -0,0 +1,216 @@
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_H_
27
+ #define _LEON2_UART_H_
28
+
29
+ /* -----------------------------------------------------------------------
30
+ * Includes
31
+ * ----------------------------------------------------------------------- */
32
+
33
+ #include <vector>
34
+ #include <exception>
35
+ #include <iostream>
36
+ #include <iomanip>
37
+ #include <string>
38
+
39
+ #include "systemc.h" /* SystemC include file */
40
+ #include "tlmreg_Leon2_uart.h" /* Register Class declaration */
41
+
42
+ #include "tlm_event.h" /* tlm randomize timing file */
43
+ #include "tlm_host_def.h"
44
+ /* tlm datatype and address typedef */
45
+
46
+ #include "tlm_module.h"
47
+ #include "tlm_transaction_counter.h"
48
+
49
+ #include "tac_slave_base.h" /* the tac files */
50
+
51
+ #include "tac_target_port.h"
52
+
53
+ /* -----------------------------------------------------------------------
54
+ * Defines
55
+ * ----------------------------------------------------------------------- */
56
+ using prt_tlm_tac::BYTE_LANE_0;
57
+ using prt_tlm_tac::BYTE_LANE_1;
58
+ using prt_tlm_tac::BYTE_LANE_2;
59
+ using prt_tlm_tac::BYTE_LANE_3;
60
+ using prt_tlm_tac::BYTE_LANE_4;
61
+ using prt_tlm_tac::BYTE_LANE_5;
62
+ using prt_tlm_tac::BYTE_LANE_6;
63
+ using prt_tlm_tac::BYTE_LANE_7;
64
+
65
+ using namespace std;
66
+
67
+
68
+ namespace Leon2 {
69
+
70
+ class uart :
71
+ public sc_module,
72
+ // derivation of the protocol IF
73
+ public prt_tlm_tac::tac_slave_base<tlm_uint32_t,tlm_uint32_t>
74
+ {
75
+
76
+ bool m_mau_byte; // memory minimum allocation unit mode (0 = word, 1 = byte)
77
+
78
+ /* -----------------------------------------------------------------------
79
+ * Internal variables private, public and internal events
80
+ * ----------------------------------------------------------------------- */
81
+
82
+ private:
83
+
84
+ /* -----------------------------------------------------------------------
85
+ * Register Map
86
+ * ----------------------------------------------------------------------- */
87
+ uart_data_tlm_register data; // Data read/write register
88
+ uart_status_tlm_register status; // Status register
89
+ uart_control_tlm_register control; // Control register
90
+ uart_scalarReload_tlm_register scalarReload; // Scalar reload register
91
+
92
+ public:
93
+
94
+ /* -----------------------------------------------------------------------
95
+ * BusInterFace/port Definitions
96
+ * ----------------------------------------------------------------------- */
97
+
98
+ // target Interface - Leon2_uart
99
+ prt_tlm_tac::tac_target_port<tlm_uint32_t,tlm_uint32_t> ambaAPB;
100
+
101
+ // Initiator Interface - Leon2_uart
102
+
103
+ /* -----------------------------------------------------------------------
104
+ * Variables taking the values of the constructor parameters
105
+ * ----------------------------------------------------------------------- */
106
+ bool resetOnInitialize_c;
107
+ unsigned int debugLevel_c;
108
+
109
+ // Model endianness
110
+ tlm_endianness endianness_c;
111
+
112
+ // internal usage for array of registers
113
+ int index;
114
+ tlm_uint32_t data_ambaAPB_tske;
115
+
116
+ /* -----------------------------------------------------------------------
117
+ * OverLoaded Virtual Functions
118
+ * ----------------------------------------------------------------------- */
119
+ // Generic register Reset
120
+ void reset(void);
121
+
122
+ void printstatus();
123
+
124
+ // Read access
125
+ virtual prt_tlm_tac::tac_status read(const tlm_uint32_t& address, tlm_uint32_t& data,
126
+ prt_tlm_tac::tac_error_reason& error_reason,
127
+ const unsigned int byte_enable = prt_tlm_tac::NO_BE,
128
+ const prt_tlm_tac::tac_mode mode = prt_tlm_tac::DEFAULT,
129
+ const unsigned int target_port_id = 0
130
+ );
131
+
132
+ //----------------------------
133
+ // Write access
134
+ virtual prt_tlm_tac::tac_status write(const tlm_uint32_t& address, const tlm_uint32_t& data,
135
+ prt_tlm_tac::tac_error_reason& error_reason,
136
+ const unsigned int byte_enable = prt_tlm_tac::NO_BE,
137
+ const prt_tlm_tac::tac_mode mode = prt_tlm_tac::DEFAULT,
138
+ const unsigned int target_port_id = 0
139
+ );
140
+
141
+ //----------------------------
142
+ // Read access block
143
+ virtual prt_tlm_tac::tac_status read_block(const tlm_uint32_t& address, tlm_uint32_t * block_data,
144
+ const unsigned int number,
145
+ prt_tlm_tac::tac_error_reason& error_reason,
146
+ unsigned int * block_byte_enable = NULL,
147
+ const unsigned int block_byte_enable_period = 1,
148
+ const prt_tlm_tac::tac_mode mode = prt_tlm_tac::DEFAULT,
149
+ const unsigned int target_port_id = 0
150
+ );
151
+
152
+ //----------------------------
153
+ // Write access block
154
+ virtual prt_tlm_tac::tac_status write_block(const tlm_uint32_t& address, const tlm_uint32_t * block_data,
155
+ const unsigned int number,
156
+ prt_tlm_tac::tac_error_reason& error_reason,
157
+ unsigned int * block_byte_enable = NULL,
158
+ const unsigned int block_byte_enable_period = 1,
159
+ const prt_tlm_tac::tac_mode mode = prt_tlm_tac::DEFAULT,
160
+ const unsigned int target_port_id = 0
161
+ );
162
+
163
+ //---------------------------------------
164
+ // Get info about target
165
+ virtual prt_tlm_tac::tac_status get_target_info(const tlm_uint32_t& address,
166
+ prt_tlm_tac::tac_metadata& metadata,
167
+ prt_tlm_tac::tac_error_reason& error_reason,
168
+ const unsigned int target_port_id = 0
169
+ );
170
+
171
+ //---------------------------------------
172
+ // Set info about target
173
+ virtual prt_tlm_tac::tac_status set_target_info(const tlm_uint32_t& address,
174
+ const prt_tlm_tac::tac_metadata& metadata,
175
+ prt_tlm_tac::tac_error_reason& error_reason,
176
+ const unsigned int target_port_id = 0
177
+ );
178
+
179
+
180
+ /* -----------------------------------------------------------------------
181
+ * sc_object kind infos
182
+ * ----------------------------------------------------------------------- */
183
+
184
+ static const char* const kind_string;
185
+
186
+ virtual const char* kind() const
187
+ {
188
+ return kind_string;
189
+ }
190
+
191
+ /* -----------------------------------------------------------------------
192
+ * Leon2_uart Internal SC_METHODS and SC_THREADS ( Functions )
193
+ * ----------------------------------------------------------------------- */
194
+
195
+ void method_and_thread_sensitivity();
196
+
197
+
198
+ /* -----------------------------------------------------------------------
199
+ * Constructor for Leon2_uart.
200
+ * ----------------------------------------------------------------------- */
201
+
202
+ SC_HAS_PROCESS(uart);
203
+ uart(sc_module_name module_name,
204
+ bool resetOnInitialize = true, // whether reset() should be invoked at startup time
205
+ unsigned int debugLevel = 0, // level of debugging
206
+ tlm_endianness endianness = TLM_BIG_ENDIAN // endianness of the IP
207
+ );
208
+
209
+ /* -----------------------------------------------------------------------
210
+ * Destructor for Leon2_uart
211
+ * ----------------------------------------------------------------------- */
212
+
213
+ ~uart();
214
+ };
215
+ } // end namespace Leon2
216
+ #endif /* _LEON2_UART_H_ */
@@ -0,0 +1,34 @@
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
+ // define of the Businterface ID
27
+ #define Leon2_uart_ambaAPB_ID 0
28
+
29
+
30
+ // define of the registers ID (offset for the register + baseaddress of the addressblock)
31
+ #define data_offset 0x0 + 0x0 // Data read/write register
32
+ #define status_offset 0x4 + 0x0 // Status register
33
+ #define control_offset 0x8 + 0x0 // Control register
34
+ #define scalarReload_offset 0xC + 0x0 // Scalar reload register
@@ -0,0 +1,72 @@
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 _tlm_field_H_
27
+ #define _tlm_field_H_
28
+
29
+ //----------------------------------------------------------------------------
30
+ /// CLASS : tlm_field
31
+ //----------------------------------------------------------------------------
32
+
33
+ template<typename DATATYPE, int width>
34
+ class tlm_field
35
+ {
36
+ private:
37
+ DATATYPE m_value;
38
+ DATATYPE m_mask;
39
+
40
+ public:
41
+
42
+ /* Build a new tlm_field item.*/
43
+ tlm_field() {
44
+ m_mask = 0;
45
+ for(int bit = 0; bit < width; bit++)
46
+ {
47
+ m_mask |= (1U << bit);
48
+ }
49
+ }
50
+ /* Destructor */
51
+ ~tlm_field(){};
52
+
53
+
54
+ void write(DATATYPE value) {
55
+ m_value = m_mask & value;
56
+ };
57
+
58
+ const tlm_field& operator=(DATATYPE value) {
59
+ write(value);
60
+ return( *this );
61
+ }
62
+
63
+ DATATYPE read() {
64
+ return(m_value);
65
+ };
66
+ };
67
+
68
+ #endif //_tlm_field_H_
69
+
70
+
71
+
72
+
@@ -0,0 +1,129 @@
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 _TLM_REGISTER_H_
27
+ #define _TLM_REGISTER_H_
28
+
29
+ /*------------------------------------------------------------------------------
30
+ * Includes
31
+ *----------------------------------------------------------------------------*/
32
+
33
+ #include "tlm_field.h"
34
+ #include "tlm_host_def.h"
35
+ #include "systemc.h" /* SystemC include file */
36
+
37
+
38
+ //----------------------------------------------------------------------------
39
+ /// CLASS : tlm_register_<size>
40
+ //----------------------------------------------------------------------------
41
+
42
+
43
+ /* tlm_uint8_t */
44
+ class tlm_register_8 {
45
+ public:
46
+
47
+ tlm_register_8(){};
48
+
49
+ /* Destructor */
50
+ virtual ~tlm_register_8(){};
51
+
52
+ virtual void write(tlm_uint8_t value){};
53
+
54
+ const tlm_register_8& operator=(const tlm_uint8_t value) {
55
+ write(value);
56
+ return( *this );
57
+ }
58
+
59
+ virtual tlm_uint8_t read(){ return 0; };
60
+
61
+ virtual void reset(){};
62
+ };
63
+
64
+ /* tlm_uint16_t */
65
+ class tlm_register_16 {
66
+ public:
67
+
68
+ tlm_register_16(){};
69
+
70
+ /* Destructor */
71
+ virtual ~tlm_register_16(){};
72
+
73
+ virtual void write(tlm_uint16_t value){};
74
+
75
+ const tlm_register_16& operator=(const tlm_uint16_t value) {
76
+ write(value);
77
+ return( *this );
78
+ }
79
+
80
+ virtual tlm_uint16_t read(){ return 0; };
81
+
82
+ virtual void reset(){};
83
+ };
84
+
85
+
86
+ /* tlm_uint32_t */
87
+ class tlm_register_32 {
88
+ public:
89
+
90
+ tlm_register_32(){};
91
+
92
+ /* Destructor */
93
+ virtual ~tlm_register_32(){};
94
+
95
+ virtual void write(tlm_uint32_t value){};
96
+
97
+ const tlm_register_32& operator=(const tlm_uint32_t value) {
98
+ write(value);
99
+ return( *this );
100
+ }
101
+
102
+ virtual tlm_uint32_t read(){ return 0; };
103
+
104
+ virtual void reset(){};
105
+ };
106
+
107
+
108
+ /* tlm_uint64_t */
109
+ class tlm_register_64 {
110
+ public:
111
+
112
+ tlm_register_64(){};
113
+
114
+ /* Destructor */
115
+ virtual ~tlm_register_64(){};
116
+
117
+ virtual void write(tlm_uint64_t value){};
118
+
119
+ const tlm_register_64& operator=(const tlm_uint64_t value) {
120
+ write(value);
121
+ return( *this );
122
+ }
123
+
124
+ virtual tlm_uint64_t read(){ return 0; };
125
+
126
+ virtual void reset(){};
127
+ };
128
+
129
+ #endif /* _TLM_REGISTER_H_ */