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
|
@@ -0,0 +1,126 @@
|
|
|
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; but this notice must be included on any copy.
|
|
25
|
+
|
|
26
|
+
/*------------------------------------------------------------------------------
|
|
27
|
+
* Simple TLM RGU
|
|
28
|
+
* Clock diviser PV example. Produces a clock vector of 8 bits.
|
|
29
|
+
* Each Clock output line has a 8 bits devide register.
|
|
30
|
+
* If register[i]=0 => No divide (reset state)
|
|
31
|
+
* If register[i]=1 => divide by 2
|
|
32
|
+
* If register[i]=2 => divide by 4
|
|
33
|
+
* If register[i]=3 => divide by 8 ...
|
|
34
|
+
*------------------------------------------------------------------------------*/
|
|
35
|
+
|
|
36
|
+
/*------------------------------------------------------------------------------
|
|
37
|
+
* Includes
|
|
38
|
+
*----------------------------------------------------------------------------*/
|
|
39
|
+
#include "rgu.h"
|
|
40
|
+
|
|
41
|
+
/*------------------------------------------------------------------------------
|
|
42
|
+
* Methods
|
|
43
|
+
*----------------------------------------------------------------------------*/
|
|
44
|
+
rgu::rgu( sc_module_name module_name) :
|
|
45
|
+
sc_module( module_name ) ,
|
|
46
|
+
pv_slave_base<ADDRESS_TYPE,DATA_TYPE>(name()),
|
|
47
|
+
apb_slave_port ("apb_slave_port"),
|
|
48
|
+
ipclk ("ipclk"),
|
|
49
|
+
rstin_an ("rstin_an")
|
|
50
|
+
{
|
|
51
|
+
apb_slave_port( *this );
|
|
52
|
+
SC_METHOD( gen_resets );
|
|
53
|
+
sensitive << ipclk;
|
|
54
|
+
init_registers();
|
|
55
|
+
init_memory();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
tlm::tlm_status rgu::write( const ADDRESS_TYPE &addr , const DATA_TYPE &data,
|
|
59
|
+
const unsigned int byte_enable,
|
|
60
|
+
const tlm::tlm_mode mode,
|
|
61
|
+
const unsigned int export_id )
|
|
62
|
+
{
|
|
63
|
+
tlm::tlm_status status;
|
|
64
|
+
if ((addr/4) < NUMRESETS + NUMEEPROM) {
|
|
65
|
+
memory[addr/4] = data;
|
|
66
|
+
}
|
|
67
|
+
status.set_ok();
|
|
68
|
+
return status;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
tlm::tlm_status rgu::read( const ADDRESS_TYPE &addr , DATA_TYPE &data,
|
|
72
|
+
const unsigned int byte_enable,
|
|
73
|
+
const tlm::tlm_mode mode,
|
|
74
|
+
const unsigned int export_id )
|
|
75
|
+
{
|
|
76
|
+
tlm::tlm_status status;
|
|
77
|
+
if ((addr/4) < NUMRESETS) { // read the registers
|
|
78
|
+
data = registers[addr/4];
|
|
79
|
+
} else if (addr < NUMRESETS + NUMEEPROM) {
|
|
80
|
+
data = memory[addr/4]; // read the memory registers
|
|
81
|
+
} else if (addr == 0xFFC) { // read the ID register
|
|
82
|
+
data = 0xD01;
|
|
83
|
+
} else {
|
|
84
|
+
data = 0x0;
|
|
85
|
+
}
|
|
86
|
+
status.set_ok();
|
|
87
|
+
return status;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
void rgu::gen_resets()
|
|
91
|
+
{
|
|
92
|
+
if (rstin_an==0) {
|
|
93
|
+
for (int i=0; i<NUMRESETS; i++) {
|
|
94
|
+
if (rstout_an[i].read())
|
|
95
|
+
rstout_an[i].write(0);
|
|
96
|
+
counter[i] = registers[i];
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
if (ipclk.read() == SC_LOGIC_1) {
|
|
100
|
+
for (int i=0; i<NUMRESETS; i++) {
|
|
101
|
+
if (counter[i] == 0) {
|
|
102
|
+
if (rstout_an[i].read() != 1) {
|
|
103
|
+
rstout_an[i].write(1);
|
|
104
|
+
cout << name() << ": Reset " << i << " deasserted at time " << sc_time_stamp() << endl;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
counter[i]--;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
void rgu::init_registers()
|
|
116
|
+
{
|
|
117
|
+
for (int i=0;i<NUMRESETS;i++) {
|
|
118
|
+
registers[i]=0x01 << i+1;
|
|
119
|
+
counter[i] = registers[i];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
void rgu::init_memory()
|
|
124
|
+
{
|
|
125
|
+
for (int i=0;i<NUMEEPROM;i++) memory[i]=0;
|
|
126
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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; but this notice must be included on any copy.
|
|
25
|
+
|
|
26
|
+
/*------------------------------------------------------------------------------
|
|
27
|
+
* Simple TLM RGU
|
|
28
|
+
* Reset delay generator PV example. Produces a reset vector of 8 bits.
|
|
29
|
+
* Each reset output line has a 8 bits delay register.
|
|
30
|
+
* reset(0) = read only delay at address 0x0
|
|
31
|
+
* reset(1) = read only delay at address 0x4
|
|
32
|
+
* reset(2) = read only delay at address 0x8
|
|
33
|
+
* reset(3) = read only delay at address 0xC
|
|
34
|
+
* reset(4) = read only delay at address 0x10
|
|
35
|
+
* reset(5) = read only delay at address 0x14
|
|
36
|
+
* reset(6) = read only delay at address 0x18
|
|
37
|
+
* reset(7) = read only delay at address 0x1C
|
|
38
|
+
* The delay value (stored in the above reset registers) is the number
|
|
39
|
+
* of clocks from when the reset input is deasserted till the
|
|
40
|
+
* reset output is deasserted. i.e.
|
|
41
|
+
* 0 = No Delay
|
|
42
|
+
* 1 = Delay by 1 clock
|
|
43
|
+
* 2 = Delay by 2 clocks
|
|
44
|
+
* 3 = Delay by 3 clocks ...
|
|
45
|
+
* The 8 other registers are used as non volatile storage inside the RGU
|
|
46
|
+
* memory[0] = read/write register at address 0x20
|
|
47
|
+
* memory[1] = read/write register at address 0x24
|
|
48
|
+
* memory[2] = read/write register at address 0x28
|
|
49
|
+
* ...
|
|
50
|
+
* memory[7] = read/write register at address 0x3C
|
|
51
|
+
* 4K byte addressSpace.
|
|
52
|
+
*------------------------------------------------------------------------------*/
|
|
53
|
+
|
|
54
|
+
#ifndef _RGU_H_
|
|
55
|
+
#define _RGU_H_
|
|
56
|
+
|
|
57
|
+
/*------------------------------------------------------------------------------
|
|
58
|
+
* Includes
|
|
59
|
+
*----------------------------------------------------------------------------*/
|
|
60
|
+
#include <systemc.h>
|
|
61
|
+
|
|
62
|
+
#include "user_types.h"
|
|
63
|
+
#include "pv_target_port.h"
|
|
64
|
+
#include "pv_slave_base.h"
|
|
65
|
+
|
|
66
|
+
#define NUMRESETS 8
|
|
67
|
+
#define NUMEEPROM 8
|
|
68
|
+
#define DELAYDEPTH 8
|
|
69
|
+
|
|
70
|
+
/*------------------------------------------------------------------------------
|
|
71
|
+
* RGU
|
|
72
|
+
*----------------------------------------------------------------------------*/
|
|
73
|
+
class rgu :
|
|
74
|
+
public sc_module,
|
|
75
|
+
public pv_slave_base< ADDRESS_TYPE , DATA_TYPE >
|
|
76
|
+
{
|
|
77
|
+
public:
|
|
78
|
+
rgu( sc_module_name module_name);
|
|
79
|
+
SC_HAS_PROCESS( rgu );
|
|
80
|
+
|
|
81
|
+
pv_target_port<ADDRESS_TYPE , DATA_TYPE> apb_slave_port;
|
|
82
|
+
sc_in<sc_logic> rstin_an;
|
|
83
|
+
sc_out<bool> rstout_an[NUMRESETS];
|
|
84
|
+
sc_in<sc_logic> ipclk;
|
|
85
|
+
|
|
86
|
+
tlm::tlm_status write( const ADDRESS_TYPE &addr , const DATA_TYPE &data,
|
|
87
|
+
const unsigned int byte_enable = tlm::NO_BE,
|
|
88
|
+
const tlm::tlm_mode mode = tlm::REGULAR,
|
|
89
|
+
const unsigned int export_id = 0 );
|
|
90
|
+
tlm::tlm_status read( const ADDRESS_TYPE &addr , DATA_TYPE &data,
|
|
91
|
+
const unsigned int byte_enable = tlm::NO_BE,
|
|
92
|
+
const tlm::tlm_mode mode = tlm::REGULAR,
|
|
93
|
+
const unsigned int export_id = 0 );
|
|
94
|
+
|
|
95
|
+
private:
|
|
96
|
+
sc_pvector<int> registers;
|
|
97
|
+
sc_pvector<int> counter;
|
|
98
|
+
sc_pvector<int> memory;
|
|
99
|
+
void init_registers();
|
|
100
|
+
void init_memory();
|
|
101
|
+
void gen_resets();
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
#endif /* _RGU_H_ */
|
|
@@ -0,0 +1,154 @@
|
|
|
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:abstractor 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>scmlAdaptor</spirit:name>
|
|
32
|
+
<spirit:version>1.0</spirit:version>
|
|
33
|
+
<spirit:abstractorMode>direct</spirit:abstractorMode>
|
|
34
|
+
<spirit:busType spirit:library="AMBA2" spirit:name="APB" spirit:vendor="amba.com" spirit:version="r2p0_4"/>
|
|
35
|
+
<spirit:abstractorInterfaces>
|
|
36
|
+
<spirit:abstractorInterface>
|
|
37
|
+
<spirit:name>APB_Slave</spirit:name>
|
|
38
|
+
<spirit:abstractionType spirit:library="abstractiondef.tlm" spirit:name="apb_pv" spirit:vendor="spiritconsortium.org" spirit:version="1.4"/>
|
|
39
|
+
<spirit:portMaps>
|
|
40
|
+
<spirit:portMap>
|
|
41
|
+
<spirit:logicalPort>
|
|
42
|
+
<spirit:name>PV_TRANS</spirit:name>
|
|
43
|
+
</spirit:logicalPort>
|
|
44
|
+
<spirit:physicalPort>
|
|
45
|
+
<spirit:name>apb_slave_port</spirit:name>
|
|
46
|
+
</spirit:physicalPort>
|
|
47
|
+
</spirit:portMap>
|
|
48
|
+
</spirit:portMaps>
|
|
49
|
+
</spirit:abstractorInterface>
|
|
50
|
+
<spirit:abstractorInterface>
|
|
51
|
+
<spirit:name>ambaAPB</spirit:name>
|
|
52
|
+
<spirit:abstractionType spirit:library="SCML" spirit:name="APB_PV" spirit:vendor="coware.com" spirit:version="1.1"/>
|
|
53
|
+
<spirit:portMaps>
|
|
54
|
+
<spirit:portMap>
|
|
55
|
+
<spirit:logicalPort>
|
|
56
|
+
<spirit:name>PV</spirit:name>
|
|
57
|
+
</spirit:logicalPort>
|
|
58
|
+
<spirit:physicalPort>
|
|
59
|
+
<spirit:name>scml_master_port</spirit:name>
|
|
60
|
+
</spirit:physicalPort>
|
|
61
|
+
</spirit:portMap>
|
|
62
|
+
</spirit:portMaps>
|
|
63
|
+
</spirit:abstractorInterface>
|
|
64
|
+
</spirit:abstractorInterfaces>
|
|
65
|
+
<spirit:model>
|
|
66
|
+
<spirit:views>
|
|
67
|
+
<spirit:view>
|
|
68
|
+
<spirit:name>PVPVT</spirit:name>
|
|
69
|
+
<spirit:envIdentifier>:*Simulation:</spirit:envIdentifier>
|
|
70
|
+
<spirit:language>systemc2.1</spirit:language>
|
|
71
|
+
<spirit:modelName>scmlAdaptor</spirit:modelName>
|
|
72
|
+
<spirit:fileSetRef>
|
|
73
|
+
<spirit:localName>scmlAdaptorFileSet</spirit:localName>
|
|
74
|
+
</spirit:fileSetRef>
|
|
75
|
+
</spirit:view>
|
|
76
|
+
</spirit:views>
|
|
77
|
+
<spirit:ports>
|
|
78
|
+
<spirit:port>
|
|
79
|
+
<spirit:name>apb_slave_port</spirit:name>
|
|
80
|
+
<spirit:transactional>
|
|
81
|
+
<spirit:transTypeDef>
|
|
82
|
+
<spirit:typeName>pv_target_port</spirit:typeName>
|
|
83
|
+
<spirit:typeDefinition>pv_target_port.h</spirit:typeDefinition>
|
|
84
|
+
</spirit:transTypeDef>
|
|
85
|
+
<spirit:service>
|
|
86
|
+
<spirit:initiative>provides</spirit:initiative>
|
|
87
|
+
<spirit:serviceTypeDefs>
|
|
88
|
+
<spirit:serviceTypeDef>
|
|
89
|
+
<spirit:typeName spirit:implicit="true">OSCI_TLM_PV</spirit:typeName>
|
|
90
|
+
<spirit:parameters>
|
|
91
|
+
<spirit:parameter>
|
|
92
|
+
<spirit:name>typedef1</spirit:name>
|
|
93
|
+
<spirit:value>ADDRESS_TYPE</spirit:value>
|
|
94
|
+
</spirit:parameter>
|
|
95
|
+
<spirit:parameter>
|
|
96
|
+
<spirit:name>typedef2</spirit:name>
|
|
97
|
+
<spirit:value>DATA_TYPE</spirit:value>
|
|
98
|
+
</spirit:parameter>
|
|
99
|
+
</spirit:parameters>
|
|
100
|
+
</spirit:serviceTypeDef>
|
|
101
|
+
</spirit:serviceTypeDefs>
|
|
102
|
+
</spirit:service>
|
|
103
|
+
</spirit:transactional>
|
|
104
|
+
</spirit:port>
|
|
105
|
+
<spirit:port>
|
|
106
|
+
<spirit:name>scml_master_port</spirit:name>
|
|
107
|
+
<spirit:transactional>
|
|
108
|
+
<spirit:transTypeDef>
|
|
109
|
+
<spirit:typeName>PVInitiator_port</spirit:typeName>
|
|
110
|
+
<spirit:typeDefinition>PV/PV.h</spirit:typeDefinition>
|
|
111
|
+
</spirit:transTypeDef>
|
|
112
|
+
<spirit:service>
|
|
113
|
+
<spirit:initiative>requires</spirit:initiative>
|
|
114
|
+
<spirit:serviceTypeDefs>
|
|
115
|
+
<spirit:serviceTypeDef>
|
|
116
|
+
<spirit:typeName spirit:implicit="true">SCML</spirit:typeName>
|
|
117
|
+
<spirit:parameters>
|
|
118
|
+
<spirit:parameter>
|
|
119
|
+
<spirit:name>DT</spirit:name>
|
|
120
|
+
<spirit:value spirit:resolve="immediate">DATA_TYPE</spirit:value>
|
|
121
|
+
</spirit:parameter>
|
|
122
|
+
<spirit:parameter>
|
|
123
|
+
<spirit:name>AT</spirit:name>
|
|
124
|
+
<spirit:value spirit:resolve="immediate">ADDRESS_TYPE</spirit:value>
|
|
125
|
+
</spirit:parameter>
|
|
126
|
+
</spirit:parameters>
|
|
127
|
+
</spirit:serviceTypeDef>
|
|
128
|
+
</spirit:serviceTypeDefs>
|
|
129
|
+
</spirit:service>
|
|
130
|
+
</spirit:transactional>
|
|
131
|
+
<spirit:access>
|
|
132
|
+
<spirit:portAccessType>ref</spirit:portAccessType>
|
|
133
|
+
<spirit:portAccessHandle>scml_master_port</spirit:portAccessHandle>
|
|
134
|
+
</spirit:access>
|
|
135
|
+
</spirit:port>
|
|
136
|
+
</spirit:ports>
|
|
137
|
+
</spirit:model>
|
|
138
|
+
<spirit:fileSets>
|
|
139
|
+
<spirit:fileSet>
|
|
140
|
+
<spirit:name>scmlAdaptorFileSet</spirit:name>
|
|
141
|
+
<spirit:file>
|
|
142
|
+
<spirit:name>./tlmsrc/inc/scmladaptor.h</spirit:name>
|
|
143
|
+
<spirit:fileType>systemCSource-2.1</spirit:fileType>
|
|
144
|
+
<spirit:isIncludeFile spirit:externalDeclarations="true">true</spirit:isIncludeFile>
|
|
145
|
+
<spirit:logicalName>uart_scml</spirit:logicalName>
|
|
146
|
+
</spirit:file>
|
|
147
|
+
<spirit:file>
|
|
148
|
+
<spirit:name>./tlmsrc/inc/scmladaptor.cc</spirit:name>
|
|
149
|
+
<spirit:fileType>systemCSource-2.1</spirit:fileType>
|
|
150
|
+
<spirit:logicalName>uart_scml</spirit:logicalName>
|
|
151
|
+
</spirit:file>
|
|
152
|
+
</spirit:fileSet>
|
|
153
|
+
</spirit:fileSets>
|
|
154
|
+
</spirit:abstractor>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
//
|
|
2
|
+
//Revision: $Revision: 1506 $
|
|
3
|
+
//Date: $Date: 2009-04-26 01:51:56 -0500 (Sun, 26 Apr 2009) $
|
|
4
|
+
//
|
|
5
|
+
//Copyright (c) 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; but this notice must be included on any copy.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
#include "scmladaptor.h"
|
|
28
|
+
|
|
29
|
+
scmlAdaptor::scmlAdaptor( sc_module_name module_name ) :
|
|
30
|
+
sc_module( module_name ),
|
|
31
|
+
pv_slave_base<ADDRESS_TYPE,DATA_TYPE>(name()),
|
|
32
|
+
apb_slave_port("apb_slave_port"),
|
|
33
|
+
scml_master_port("scml_master_port")
|
|
34
|
+
{
|
|
35
|
+
apb_slave_port( *this );
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
void scmlAdaptor::end_of_elaboration() {
|
|
39
|
+
cout << name() << " constructed." << endl;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
scmlAdaptor::~scmlAdaptor()
|
|
43
|
+
{
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
tlm::tlm_status scmlAdaptor::write( const ADDRESS_TYPE &addr , const DATA_TYPE &data,
|
|
47
|
+
const unsigned int byte_enable,
|
|
48
|
+
const tlm::tlm_mode mode,
|
|
49
|
+
const unsigned int export_id)
|
|
50
|
+
{
|
|
51
|
+
tlm::tlm_status status;
|
|
52
|
+
|
|
53
|
+
PVReq<DATA_TYPE, ADDRESS_TYPE> req;
|
|
54
|
+
PVResp<DATA_TYPE> resp;
|
|
55
|
+
|
|
56
|
+
DATA_TYPE tdata = data;
|
|
57
|
+
|
|
58
|
+
req.setAddress(addr);
|
|
59
|
+
req.setWriteDataSource(&tdata);
|
|
60
|
+
req.setOffset(0);
|
|
61
|
+
req.setBurstCount(1);
|
|
62
|
+
req.setDataSize(8*sizeof(DATA_TYPE));
|
|
63
|
+
req.setType(pvWrite);
|
|
64
|
+
|
|
65
|
+
resp = scml_master_port.transport(req);
|
|
66
|
+
|
|
67
|
+
if (resp.getResponse() == pvOk) {
|
|
68
|
+
status.set_ok();
|
|
69
|
+
} else {
|
|
70
|
+
status.set_error();
|
|
71
|
+
}
|
|
72
|
+
return status;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
tlm::tlm_status scmlAdaptor::read( const ADDRESS_TYPE &addr , DATA_TYPE &data,
|
|
76
|
+
const unsigned int byte_enable,
|
|
77
|
+
const tlm::tlm_mode mode,
|
|
78
|
+
const unsigned int export_id)
|
|
79
|
+
{
|
|
80
|
+
tlm::tlm_status status;
|
|
81
|
+
|
|
82
|
+
PVReq<DATA_TYPE, ADDRESS_TYPE> req;
|
|
83
|
+
PVResp<DATA_TYPE> resp;
|
|
84
|
+
|
|
85
|
+
req.setAddress(addr);
|
|
86
|
+
req.setReadDataDestination(&data);
|
|
87
|
+
req.setOffset(0);
|
|
88
|
+
req.setBurstCount(1);
|
|
89
|
+
req.setDataSize(8*sizeof(DATA_TYPE));
|
|
90
|
+
req.setType(pvRead);
|
|
91
|
+
|
|
92
|
+
resp = scml_master_port.transport(req);
|
|
93
|
+
|
|
94
|
+
if (resp.getResponse() == pvOk) {
|
|
95
|
+
status.set_ok();
|
|
96
|
+
} else {
|
|
97
|
+
status.set_error();
|
|
98
|
+
}
|
|
99
|
+
return status;
|
|
100
|
+
}
|