OpenCores
URL https://opencores.org/ocsvn/neo430/neo430/trunk

Subversion Repositories neo430

[/] [neo430/] [trunk/] [neo430/] [sw/] [lib/] [neo430/] [include/] [neo430_wishbone.h] - Blame information for rev 198

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 198 zero_gravi
// #################################################################################################
2
// #  < neo430_wishbone.h - Internal Wishbone interface control functions >                        #
3
// # ********************************************************************************************* #
4
// # Use the normal Wishbone functions for BLOCKING access (until ACK is asserted).                #
5
// # Use non-blocking functions (*_start, wishbone_busy, wishbone_get_data*) to prevent dead locks #
6
// # when accessing invalid addresses and to do things in parallel when using the Wishbone bus.    #
7
// # ********************************************************************************************* #
8
// # BSD 3-Clause License                                                                          #
9
// #                                                                                               #
10
// # Copyright (c) 2020, Stephan Nolting. All rights reserved.                                     #
11
// #                                                                                               #
12
// # Redistribution and use in source and binary forms, with or without modification, are          #
13
// # permitted provided that the following conditions are met:                                     #
14
// #                                                                                               #
15
// # 1. Redistributions of source code must retain the above copyright notice, this list of        #
16
// #    conditions and the following disclaimer.                                                   #
17
// #                                                                                               #
18
// # 2. Redistributions in binary form must reproduce the above copyright notice, this list of     #
19
// #    conditions and the following disclaimer in the documentation and/or other materials        #
20
// #    provided with the distribution.                                                            #
21
// #                                                                                               #
22
// # 3. Neither the name of the copyright holder nor the names of its contributors may be used to  #
23
// #    endorse or promote products derived from this software without specific prior written      #
24
// #    permission.                                                                                #
25
// #                                                                                               #
26
// # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS   #
27
// # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF               #
28
// # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE    #
29
// # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,     #
30
// # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE #
31
// # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED    #
32
// # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING     #
33
// # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED  #
34
// # OF THE POSSIBILITY OF SUCH DAMAGE.                                                            #
35
// # ********************************************************************************************* #
36
// # The NEO430 Processor - https://github.com/stnolting/neo430                                    #
37
// #################################################################################################
38
 
39
#ifndef neo430_wishbone_h
40
#define neo430_wishbone_h
41
 
42
// prototypes blocking functions for 32-bit data bus width
43
uint32_t neo430_wishbone32_read32(uint32_t a);
44
void neo430_wishbone32_write32(uint32_t a, uint32_t d);
45
 
46
uint16_t neo430_wishbone32_read16(uint32_t a); // This function performs a data alignment based on the address!
47
void neo430_wishbone32_write16(uint32_t a, uint16_t d); // This function performs a data alignment based on the address!
48
 
49
uint8_t neo430_wishbone32_read8(uint32_t a); // This function performs a data alignment based on the address!
50
void neo430_wishbone32_write8(uint32_t a, uint8_t d); // This function performs a data alignment based on the address!
51
 
52
// prototypes non-blocking functions for 32-bit data bus width
53
void neo430_wishbone32_read32_start(uint32_t a);
54
void neo430_wishbone32_write32_start(uint32_t a, uint32_t d);
55
 
56
void neo430_wishbone32_read16_start(uint32_t a);
57
void neo430_wishbone32_write16_start(uint32_t a, uint16_t d); // This function performs a data alignment based on the address!
58
 
59
void neo430_wishbone32_read8_start(uint32_t a);
60
void neo430_wishbone32_write8_start(uint32_t a, uint8_t d); // This function performs a data alignment based on the address!
61
 
62
uint32_t neo430_wishbone32_get_data32(void);
63
uint16_t neo430_wishbone32_get_data16(uint32_t a); // This function performs a data alignment based on the address!
64
uint8_t neo430_wishbone32_get_data8(uint32_t a); // This function performs a data alignment based on the address!
65
 
66
// -------------
67
 
68
// prototypes blocking functions for 32-bit data bus width using NO ADDRESS ALIGNMENT
69
uint32_t neo430_wishbone32_read(uint32_t a);
70
void neo430_wishbone32_write(uint32_t a, uint32_t d);
71
 
72
// prototypes non-blocking functions for 32-bit data bus width using NO ADDRESS ALIGNMENT
73
void neo430_wishbone32_read_start(uint32_t a);
74
void neo430_wishbone32_write_start(uint32_t a, uint32_t d);
75
uint32_t neo430_wishbone32_get_data(void);
76
 
77
// -------------
78
 
79
// prototypes blocking functions for 16-bit data bus width using NO ADDRESS ALIGNMENT
80
uint16_t neo430_wishbone16_read(uint32_t a);
81
void neo430_wishbone16_write(uint32_t a, uint16_t d);
82
 
83
// prototypes non-blocking functions for 16-bit data bus width using NO ADDRESS ALIGNMENT
84
void neo430_wishbone16_read_start(uint32_t a);
85
void neo430_wishbone16_write_start(uint32_t a, uint16_t d);
86
uint16_t neo430_wishbone16_get_data(void);
87
 
88
// -------------
89
 
90
// prototypes blocking functions for 8-bit data bus width using NO ADDRESS ALIGNMENT
91
uint8_t neo430_wishbone8_read(uint32_t a);
92
void neo430_wishbone8_write(uint32_t a, uint8_t d);
93
 
94
// prototypes non-blocking functions for 8-bit data bus width using NO ADDRESS ALIGNMENT
95
void neo430_wishbone8_read_start(uint32_t a);
96
void neo430_wishbone8_write_start(uint32_t a, uint8_t d);
97
uint8_t neo430_wishbone8_get_data8(void);
98
 
99
// -------------
100
 
101
// general status funtion prototypes
102
uint16_t neo430_wishbone_busy(void);
103
void neo430_wishbone_terminate(void);
104
 
105
#endif // neo430_wishbone_h

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.