summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2019-05-02 21:21:05 -0600
committerEvan Lojewski <github@meklort.com>2019-05-02 21:21:05 -0600
commit0e0e5e5b28c86da08c23a9ecb30bd08c4323d441 (patch)
tree96ada964bc1869d06dd7d5725df8da6a4c4594ae
parent86106d98887a390f3a0dd54edf167cb5da1c2436 (diff)
downloadbcm5719-ortega-0e0e5e5b28c86da08c23a9ecb30bd08c4323d441.tar.gz
bcm5719-ortega-0e0e5e5b28c86da08c23a9ecb30bd08c4323d441.zip
Add initial RX port register generation.
-rw-r--r--include/APE_RX_PORT.h175
-rw-r--r--include/APE_RX_PORT1.h113
-rw-r--r--include/APE_RX_PORT2.h113
-rw-r--r--include/APE_RX_PORT3.h113
-rw-r--r--include/APE_TX_PORT.h4
-rw-r--r--include/APE_TX_PORT1.h2
-rw-r--r--include/APE_TX_PORT2.h2
-rw-r--r--include/APE_TX_PORT3.h2
-rw-r--r--ipxact/APE.xml51
-rwxr-xr-xipxact/regen.sh2
-rw-r--r--simulator/APE_RX_PORT.cpp53
-rw-r--r--simulator/APE_RX_PORT1.cpp55
-rw-r--r--simulator/APE_RX_PORT1_sim.cpp99
-rw-r--r--simulator/APE_RX_PORT2.cpp55
-rw-r--r--simulator/APE_RX_PORT2_sim.cpp99
-rw-r--r--simulator/APE_RX_PORT3.cpp55
-rw-r--r--simulator/APE_RX_PORT3_sim.cpp99
-rw-r--r--simulator/APE_RX_PORT_sim.cpp92
-rw-r--r--simulator/HAL.cpp4
19 files changed, 1173 insertions, 15 deletions
diff --git a/include/APE_RX_PORT.h b/include/APE_RX_PORT.h
new file mode 100644
index 0000000..d0b2449
--- /dev/null
+++ b/include/APE_RX_PORT.h
@@ -0,0 +1,175 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT.h
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+/** @defgroup APE_RX_PORT_H APE_RX_PORT */
+/** @addtogroup APE_RX_PORT_H
+ * @{
+ */
+#ifndef APE_RX_PORT_H
+#define APE_RX_PORT_H
+
+#include <stdint.h>
+
+#ifdef CXX_SIMULATOR /* Compiling c++ simulator code - uses register wrappers */
+void init_APE_RX_PORT_sim(void* base);
+void init_APE_RX_PORT(void);
+
+#include <CXXRegister.h>
+typedef CXXRegister<uint8_t, 0, 8> APE_RX_PORT_H_uint8_t;
+typedef CXXRegister<uint16_t, 0, 16> APE_RX_PORT_H_uint16_t;
+typedef CXXRegister<uint32_t, 0, 32> APE_RX_PORT_H_uint32_t;
+#define APE_RX_PORT_H_uint8_t_bitfield(__pos__, __width__) CXXRegister<uint8_t, __pos__, __width__>
+#define APE_RX_PORT_H_uint16_t_bitfield(__pos__, __width__) CXXRegister<uint16_t, __pos__, __width__>
+#define APE_RX_PORT_H_uint32_t_bitfield(__pos__, __width__) CXXRegister<uint32_t, __pos__, __width__>
+#define register_container struct
+#define volatile
+#define BITFIELD_BEGIN(__type__, __name__) struct {
+#define BITFIELD_MEMBER(__type__, __name__, __offset__, __bits__) __type__##_bitfield(__offset__, __bits__) __name__;
+#define BITFIELD_END(__type__, __name__) } __name__;
+
+#else /* Firmware Data types */
+typedef uint8_t APE_RX_PORT_H_uint8_t;
+typedef uint16_t APE_RX_PORT_H_uint16_t;
+typedef uint32_t APE_RX_PORT_H_uint32_t;
+#define register_container union
+#define BITFIELD_BEGIN(__type__, __name__) struct {
+#define BITFIELD_MEMBER(__type__, __name__, __offset__, __bits__) __type__ __name__:__bits__;
+#define BITFIELD_END(__type__, __name__) } __name__;
+#endif /* !CXX_SIMULATOR */
+
+#define REG_RX_PORT_BASE ((volatile void*)0xa0000000) /* RX from network port, function 0 */
+#define REG_RX_PORT_SIZE (sizeof(RX_PORT_t))
+
+#define REG_RX_PORT_IN ((volatile APE_RX_PORT_H_uint32_t*)0xa0000000) /* This is the memory range into which frames are directed towards the APE by the hardware. */
+#define RX_PORT_IN_ALL_SHIFT 0u
+#define RX_PORT_IN_ALL_MASK 0xffffffffu
+#define GET_RX_PORT_IN_ALL(__reg__) (((__reg__) & 0xffffffff) >> 0u)
+#define SET_RX_PORT_IN_ALL(__val__) (((__val__) << 0u) & 0xffffffffu)
+#define RX_PORT_IN_ALL_CONTROL_WORD 0x0u
+#define RX_PORT_IN_ALL_ADDITIONAL_PAYLOAD_WORD 0x2u
+#define RX_PORT_IN_ALL_FIRST_PAYLOAD_WORD 0xcu
+#define RX_PORT_IN_ALL_BLOCK_WORDS 0x20u
+#define RX_PORT_IN_ALL_BLOCK_BYTES 0x80u
+
+
+/** @brief Register definition for @ref RX_PORT_t.In. */
+typedef register_container RegRX_PORTIn_t {
+ /** @brief 32bit direct register access. */
+ APE_RX_PORT_H_uint32_t r32;
+
+ BITFIELD_BEGIN(APE_RX_PORT_H_uint32_t, bits)
+#if defined(__LITTLE_ENDIAN__)
+ /** @brief All bits */
+ BITFIELD_MEMBER(APE_RX_PORT_H_uint32_t, all, 0, 32)
+#elif defined(__BIG_ENDIAN__)
+ /** @brief All bits */
+ BITFIELD_MEMBER(APE_RX_PORT_H_uint32_t, all, 0, 32)
+#else
+#error Unknown Endian
+#endif
+ BITFIELD_END(APE_RX_PORT_H_uint32_t, bits)
+#ifdef CXX_SIMULATOR
+ /** @brief Register name for use with the simulator. */
+ const char* getName(void) { return "In"; }
+
+ /** @brief Print register value. */
+ void print(void) { r32.print(); }
+
+ RegRX_PORTIn_t()
+ {
+ /** @brief constructor for @ref RX_PORT_t.In. */
+ r32.setName("In");
+ bits.all.setBaseRegister(&r32);
+ bits.all.setName("all");
+ }
+ RegRX_PORTIn_t& operator=(const RegRX_PORTIn_t& other)
+ {
+ r32 = other.r32;
+ return *this;
+ }
+#endif /* CXX_SIMULATOR */
+} RegRX_PORTIn_t;
+
+/** @brief Component definition for @ref RX_PORT. */
+typedef struct RX_PORT_t {
+ /** @brief This is the memory range into which frames are directed towards the APE by the hardware. */
+ RegRX_PORTIn_t In[4096];
+
+#ifdef CXX_SIMULATOR
+ RX_PORT_t()
+ {
+ for(int i = 0; i < 4096; i++)
+ {
+ In[i].r32.setComponentOffset(0x0 + (i * 4));
+ }
+ }
+ typedef uint32_t (*callback_t)(uint32_t, uint32_t, void*);
+ callback_t mIndexReadCallback;
+ void* mIndexReadCallbackArgs;
+
+ callback_t mIndexWriteCallback;
+ void* mIndexWriteCallbackArgs;
+
+ uint32_t read(int offset) { return mIndexReadCallback(0, offset, mIndexReadCallbackArgs); }
+ void write(int offset, uint32_t value) { (void)mIndexWriteCallback(value, offset, mIndexWriteCallbackArgs); }
+#endif /* CXX_SIMULATOR */
+} RX_PORT_t;
+
+/** @brief RX from network port, function 0 */
+extern volatile RX_PORT_t RX_PORT;
+
+
+
+#ifdef CXX_SIMULATOR /* Compiling c++ code - uses register wrappers */
+#undef volatile
+#endif /* CXX_SIMULATOR */
+
+#undef register_container
+#undef BITFIELD_BEGIN
+#undef BITFIELD_MEMBER
+#undef BITFIELD_END
+
+#endif /* !APE_RX_PORT_H */
+
+/** @} */
diff --git a/include/APE_RX_PORT1.h b/include/APE_RX_PORT1.h
new file mode 100644
index 0000000..15751c5
--- /dev/null
+++ b/include/APE_RX_PORT1.h
@@ -0,0 +1,113 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT1.h
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT1
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+/** @defgroup APE_RX_PORT1_H APE_RX_PORT1 */
+/** @addtogroup APE_RX_PORT1_H
+ * @{
+ */
+#ifndef APE_RX_PORT1_H
+#define APE_RX_PORT1_H
+
+#include <stdint.h>
+#include "APE_RX_PORT.h"
+
+#ifdef CXX_SIMULATOR /* Compiling c++ simulator code - uses register wrappers */
+void init_APE_RX_PORT1_sim(void* base);
+void init_APE_RX_PORT1(void);
+
+#include <CXXRegister.h>
+typedef CXXRegister<uint8_t, 0, 8> APE_RX_PORT1_H_uint8_t;
+typedef CXXRegister<uint16_t, 0, 16> APE_RX_PORT1_H_uint16_t;
+typedef CXXRegister<uint32_t, 0, 32> APE_RX_PORT1_H_uint32_t;
+#define APE_RX_PORT1_H_uint8_t_bitfield(__pos__, __width__) CXXRegister<uint8_t, __pos__, __width__>
+#define APE_RX_PORT1_H_uint16_t_bitfield(__pos__, __width__) CXXRegister<uint16_t, __pos__, __width__>
+#define APE_RX_PORT1_H_uint32_t_bitfield(__pos__, __width__) CXXRegister<uint32_t, __pos__, __width__>
+#define register_container struct
+#define volatile
+#define BITFIELD_BEGIN(__type__, __name__) struct {
+#define BITFIELD_MEMBER(__type__, __name__, __offset__, __bits__) __type__##_bitfield(__offset__, __bits__) __name__;
+#define BITFIELD_END(__type__, __name__) } __name__;
+
+#else /* Firmware Data types */
+typedef uint8_t APE_RX_PORT1_H_uint8_t;
+typedef uint16_t APE_RX_PORT1_H_uint16_t;
+typedef uint32_t APE_RX_PORT1_H_uint32_t;
+#define register_container union
+#define BITFIELD_BEGIN(__type__, __name__) struct {
+#define BITFIELD_MEMBER(__type__, __name__, __offset__, __bits__) __type__ __name__:__bits__;
+#define BITFIELD_END(__type__, __name__) } __name__;
+#endif /* !CXX_SIMULATOR */
+
+#define REG_RX_PORT1_BASE ((volatile void*)0xa0004000) /* RX from network port, function 1 */
+#define REG_RX_PORT1_SIZE (sizeof(RX_PORT_t))
+
+#define REG_RX_PORT1_IN ((volatile APE_RX_PORT1_H_uint32_t*)0xa0004000) /* This is the memory range into which frames are directed towards the APE by the hardware. */
+#define RX_PORT1_IN_ALL_SHIFT 0u
+#define RX_PORT1_IN_ALL_MASK 0xffffffffu
+#define GET_RX_PORT1_IN_ALL(__reg__) (((__reg__) & 0xffffffff) >> 0u)
+#define SET_RX_PORT1_IN_ALL(__val__) (((__val__) << 0u) & 0xffffffffu)
+#define RX_PORT1_IN_ALL_CONTROL_WORD 0x0u
+#define RX_PORT1_IN_ALL_ADDITIONAL_PAYLOAD_WORD 0x2u
+#define RX_PORT1_IN_ALL_FIRST_PAYLOAD_WORD 0xcu
+#define RX_PORT1_IN_ALL_BLOCK_WORDS 0x20u
+#define RX_PORT1_IN_ALL_BLOCK_BYTES 0x80u
+
+
+/** @brief RX from network port, function 1 */
+extern volatile RX_PORT_t RX_PORT1;
+
+
+
+#ifdef CXX_SIMULATOR /* Compiling c++ code - uses register wrappers */
+#undef volatile
+#endif /* CXX_SIMULATOR */
+
+#undef register_container
+#undef BITFIELD_BEGIN
+#undef BITFIELD_MEMBER
+#undef BITFIELD_END
+
+#endif /* !APE_RX_PORT1_H */
+
+/** @} */
diff --git a/include/APE_RX_PORT2.h b/include/APE_RX_PORT2.h
new file mode 100644
index 0000000..273f63a
--- /dev/null
+++ b/include/APE_RX_PORT2.h
@@ -0,0 +1,113 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT2.h
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT2
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+/** @defgroup APE_RX_PORT2_H APE_RX_PORT2 */
+/** @addtogroup APE_RX_PORT2_H
+ * @{
+ */
+#ifndef APE_RX_PORT2_H
+#define APE_RX_PORT2_H
+
+#include <stdint.h>
+#include "APE_RX_PORT.h"
+
+#ifdef CXX_SIMULATOR /* Compiling c++ simulator code - uses register wrappers */
+void init_APE_RX_PORT2_sim(void* base);
+void init_APE_RX_PORT2(void);
+
+#include <CXXRegister.h>
+typedef CXXRegister<uint8_t, 0, 8> APE_RX_PORT2_H_uint8_t;
+typedef CXXRegister<uint16_t, 0, 16> APE_RX_PORT2_H_uint16_t;
+typedef CXXRegister<uint32_t, 0, 32> APE_RX_PORT2_H_uint32_t;
+#define APE_RX_PORT2_H_uint8_t_bitfield(__pos__, __width__) CXXRegister<uint8_t, __pos__, __width__>
+#define APE_RX_PORT2_H_uint16_t_bitfield(__pos__, __width__) CXXRegister<uint16_t, __pos__, __width__>
+#define APE_RX_PORT2_H_uint32_t_bitfield(__pos__, __width__) CXXRegister<uint32_t, __pos__, __width__>
+#define register_container struct
+#define volatile
+#define BITFIELD_BEGIN(__type__, __name__) struct {
+#define BITFIELD_MEMBER(__type__, __name__, __offset__, __bits__) __type__##_bitfield(__offset__, __bits__) __name__;
+#define BITFIELD_END(__type__, __name__) } __name__;
+
+#else /* Firmware Data types */
+typedef uint8_t APE_RX_PORT2_H_uint8_t;
+typedef uint16_t APE_RX_PORT2_H_uint16_t;
+typedef uint32_t APE_RX_PORT2_H_uint32_t;
+#define register_container union
+#define BITFIELD_BEGIN(__type__, __name__) struct {
+#define BITFIELD_MEMBER(__type__, __name__, __offset__, __bits__) __type__ __name__:__bits__;
+#define BITFIELD_END(__type__, __name__) } __name__;
+#endif /* !CXX_SIMULATOR */
+
+#define REG_RX_PORT2_BASE ((volatile void*)0xa0008000) /* RX from network port, function 2 */
+#define REG_RX_PORT2_SIZE (sizeof(RX_PORT_t))
+
+#define REG_RX_PORT2_IN ((volatile APE_RX_PORT2_H_uint32_t*)0xa0008000) /* This is the memory range into which frames are directed towards the APE by the hardware. */
+#define RX_PORT2_IN_ALL_SHIFT 0u
+#define RX_PORT2_IN_ALL_MASK 0xffffffffu
+#define GET_RX_PORT2_IN_ALL(__reg__) (((__reg__) & 0xffffffff) >> 0u)
+#define SET_RX_PORT2_IN_ALL(__val__) (((__val__) << 0u) & 0xffffffffu)
+#define RX_PORT2_IN_ALL_CONTROL_WORD 0x0u
+#define RX_PORT2_IN_ALL_ADDITIONAL_PAYLOAD_WORD 0x2u
+#define RX_PORT2_IN_ALL_FIRST_PAYLOAD_WORD 0xcu
+#define RX_PORT2_IN_ALL_BLOCK_WORDS 0x20u
+#define RX_PORT2_IN_ALL_BLOCK_BYTES 0x80u
+
+
+/** @brief RX from network port, function 2 */
+extern volatile RX_PORT_t RX_PORT2;
+
+
+
+#ifdef CXX_SIMULATOR /* Compiling c++ code - uses register wrappers */
+#undef volatile
+#endif /* CXX_SIMULATOR */
+
+#undef register_container
+#undef BITFIELD_BEGIN
+#undef BITFIELD_MEMBER
+#undef BITFIELD_END
+
+#endif /* !APE_RX_PORT2_H */
+
+/** @} */
diff --git a/include/APE_RX_PORT3.h b/include/APE_RX_PORT3.h
new file mode 100644
index 0000000..7a87e79
--- /dev/null
+++ b/include/APE_RX_PORT3.h
@@ -0,0 +1,113 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT3.h
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT3
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+/** @defgroup APE_RX_PORT3_H APE_RX_PORT3 */
+/** @addtogroup APE_RX_PORT3_H
+ * @{
+ */
+#ifndef APE_RX_PORT3_H
+#define APE_RX_PORT3_H
+
+#include <stdint.h>
+#include "APE_RX_PORT.h"
+
+#ifdef CXX_SIMULATOR /* Compiling c++ simulator code - uses register wrappers */
+void init_APE_RX_PORT3_sim(void* base);
+void init_APE_RX_PORT3(void);
+
+#include <CXXRegister.h>
+typedef CXXRegister<uint8_t, 0, 8> APE_RX_PORT3_H_uint8_t;
+typedef CXXRegister<uint16_t, 0, 16> APE_RX_PORT3_H_uint16_t;
+typedef CXXRegister<uint32_t, 0, 32> APE_RX_PORT3_H_uint32_t;
+#define APE_RX_PORT3_H_uint8_t_bitfield(__pos__, __width__) CXXRegister<uint8_t, __pos__, __width__>
+#define APE_RX_PORT3_H_uint16_t_bitfield(__pos__, __width__) CXXRegister<uint16_t, __pos__, __width__>
+#define APE_RX_PORT3_H_uint32_t_bitfield(__pos__, __width__) CXXRegister<uint32_t, __pos__, __width__>
+#define register_container struct
+#define volatile
+#define BITFIELD_BEGIN(__type__, __name__) struct {
+#define BITFIELD_MEMBER(__type__, __name__, __offset__, __bits__) __type__##_bitfield(__offset__, __bits__) __name__;
+#define BITFIELD_END(__type__, __name__) } __name__;
+
+#else /* Firmware Data types */
+typedef uint8_t APE_RX_PORT3_H_uint8_t;
+typedef uint16_t APE_RX_PORT3_H_uint16_t;
+typedef uint32_t APE_RX_PORT3_H_uint32_t;
+#define register_container union
+#define BITFIELD_BEGIN(__type__, __name__) struct {
+#define BITFIELD_MEMBER(__type__, __name__, __offset__, __bits__) __type__ __name__:__bits__;
+#define BITFIELD_END(__type__, __name__) } __name__;
+#endif /* !CXX_SIMULATOR */
+
+#define REG_RX_PORT3_BASE ((volatile void*)0xa000c000) /* RX from network port, function 3 */
+#define REG_RX_PORT3_SIZE (sizeof(RX_PORT_t))
+
+#define REG_RX_PORT3_IN ((volatile APE_RX_PORT3_H_uint32_t*)0xa000c000) /* This is the memory range into which frames are directed towards the APE by the hardware. */
+#define RX_PORT3_IN_ALL_SHIFT 0u
+#define RX_PORT3_IN_ALL_MASK 0xffffffffu
+#define GET_RX_PORT3_IN_ALL(__reg__) (((__reg__) & 0xffffffff) >> 0u)
+#define SET_RX_PORT3_IN_ALL(__val__) (((__val__) << 0u) & 0xffffffffu)
+#define RX_PORT3_IN_ALL_CONTROL_WORD 0x0u
+#define RX_PORT3_IN_ALL_ADDITIONAL_PAYLOAD_WORD 0x2u
+#define RX_PORT3_IN_ALL_FIRST_PAYLOAD_WORD 0xcu
+#define RX_PORT3_IN_ALL_BLOCK_WORDS 0x20u
+#define RX_PORT3_IN_ALL_BLOCK_BYTES 0x80u
+
+
+/** @brief RX from network port, function 3 */
+extern volatile RX_PORT_t RX_PORT3;
+
+
+
+#ifdef CXX_SIMULATOR /* Compiling c++ code - uses register wrappers */
+#undef volatile
+#endif /* CXX_SIMULATOR */
+
+#undef register_container
+#undef BITFIELD_BEGIN
+#undef BITFIELD_MEMBER
+#undef BITFIELD_END
+
+#endif /* !APE_RX_PORT3_H */
+
+/** @} */
diff --git a/include/APE_TX_PORT.h b/include/APE_TX_PORT.h
index fc1726c..33a127d 100644
--- a/include/APE_TX_PORT.h
+++ b/include/APE_TX_PORT.h
@@ -81,7 +81,7 @@ typedef uint32_t APE_TX_PORT_H_uint32_t;
#define REG_TX_PORT_BASE ((volatile void*)0xa0020000) /* TX to network port, function 0 */
#define REG_TX_PORT_SIZE (sizeof(TX_PORT_t))
-#define REG_TX_PORT_OUT ((volatile APE_TX_PORT_H_uint32_t*)0xa0020000) /* This is the memory range into which frames are directed towards the network byte the APE firmware. */
+#define REG_TX_PORT_OUT ((volatile APE_TX_PORT_H_uint32_t*)0xa0020000) /* This is the memory range into which frames are directed towards the network by the APE firmware. */
#define TX_PORT_OUT_ALL_SHIFT 0u
#define TX_PORT_OUT_ALL_MASK 0xffffffffu
#define GET_TX_PORT_OUT_ALL(__reg__) (((__reg__) & 0xffffffff) >> 0u)
@@ -135,7 +135,7 @@ typedef register_container RegTX_PORTOut_t {
/** @brief Component definition for @ref TX_PORT. */
typedef struct TX_PORT_t {
- /** @brief This is the memory range into which frames are directed towards the network byte the APE firmware. */
+ /** @brief This is the memory range into which frames are directed towards the network by the APE firmware. */
RegTX_PORTOut_t Out[2048];
#ifdef CXX_SIMULATOR
diff --git a/include/APE_TX_PORT1.h b/include/APE_TX_PORT1.h
index 9ef3c51..aa8fedb 100644
--- a/include/APE_TX_PORT1.h
+++ b/include/APE_TX_PORT1.h
@@ -82,7 +82,7 @@ typedef uint32_t APE_TX_PORT1_H_uint32_t;
#define REG_TX_PORT1_BASE ((volatile void*)0xa0022000) /* TX to network port, function 1 */
#define REG_TX_PORT1_SIZE (sizeof(TX_PORT_t))
-#define REG_TX_PORT1_OUT ((volatile APE_TX_PORT1_H_uint32_t*)0xa0022000) /* This is the memory range into which frames are directed towards the network byte the APE firmware. */
+#define REG_TX_PORT1_OUT ((volatile APE_TX_PORT1_H_uint32_t*)0xa0022000) /* This is the memory range into which frames are directed towards the network by the APE firmware. */
#define TX_PORT1_OUT_ALL_SHIFT 0u
#define TX_PORT1_OUT_ALL_MASK 0xffffffffu
#define GET_TX_PORT1_OUT_ALL(__reg__) (((__reg__) & 0xffffffff) >> 0u)
diff --git a/include/APE_TX_PORT2.h b/include/APE_TX_PORT2.h
index 1f230d8..d37310c 100644
--- a/include/APE_TX_PORT2.h
+++ b/include/APE_TX_PORT2.h
@@ -82,7 +82,7 @@ typedef uint32_t APE_TX_PORT2_H_uint32_t;
#define REG_TX_PORT2_BASE ((volatile void*)0xa0024000) /* TX to network port, function 2 */
#define REG_TX_PORT2_SIZE (sizeof(TX_PORT_t))
-#define REG_TX_PORT2_OUT ((volatile APE_TX_PORT2_H_uint32_t*)0xa0024000) /* This is the memory range into which frames are directed towards the network byte the APE firmware. */
+#define REG_TX_PORT2_OUT ((volatile APE_TX_PORT2_H_uint32_t*)0xa0024000) /* This is the memory range into which frames are directed towards the network by the APE firmware. */
#define TX_PORT2_OUT_ALL_SHIFT 0u
#define TX_PORT2_OUT_ALL_MASK 0xffffffffu
#define GET_TX_PORT2_OUT_ALL(__reg__) (((__reg__) & 0xffffffff) >> 0u)
diff --git a/include/APE_TX_PORT3.h b/include/APE_TX_PORT3.h
index a61c422..3dd308f 100644
--- a/include/APE_TX_PORT3.h
+++ b/include/APE_TX_PORT3.h
@@ -82,7 +82,7 @@ typedef uint32_t APE_TX_PORT3_H_uint32_t;
#define REG_TX_PORT3_BASE ((volatile void*)0xa0026000) /* TX to network port, function 3 */
#define REG_TX_PORT3_SIZE (sizeof(TX_PORT_t))
-#define REG_TX_PORT3_OUT ((volatile APE_TX_PORT3_H_uint32_t*)0xa0026000) /* This is the memory range into which frames are directed towards the network byte the APE firmware. */
+#define REG_TX_PORT3_OUT ((volatile APE_TX_PORT3_H_uint32_t*)0xa0026000) /* This is the memory range into which frames are directed towards the network by the APE firmware. */
#define TX_PORT3_OUT_ALL_SHIFT 0u
#define TX_PORT3_OUT_ALL_MASK 0xffffffffu
#define GET_TX_PORT3_OUT_ALL(__reg__) (((__reg__) & 0xffffffff) >> 0u)
diff --git a/ipxact/APE.xml b/ipxact/APE.xml
index a3f1d90..1ce1997 100644
--- a/ipxact/APE.xml
+++ b/ipxact/APE.xml
@@ -66,11 +66,51 @@
<ipxact:addressBlock>
<ipxact:name>RX_PORT</ipxact:name>
<ipxact:description>RX from network port, function 0</ipxact:description>
+ <ipxact:typeIdentifier>RX_PORT</ipxact:typeIdentifier>
<ipxact:baseAddress>0xA0000000</ipxact:baseAddress>
<!-- LINK: addressBlockDefinitionGroup: see 6.9.3, Address blockdefinition group -->
<!-- LINK: memoryBlockData: see 6.9.4, memoryBlockData group -->
<ipxact:usage>register</ipxact:usage>
<ipxact:volatile>false</ipxact:volatile>
+ <ipxact:register>
+ <ipxact:name>in</ipxact:name>
+ <ipxact:description>This is the memory range into which frames are directed towards the APE by the hardware.</ipxact:description>
+ <ipxact:addressOffset>0x0</ipxact:addressOffset>
+ <ipxact:dim>0x1000</ipxact:dim>
+ <!-- LINK: registerDefinitionGroup: see 6.11.3, Register definition group -->
+ <ipxact:size>32</ipxact:size>
+ <ipxact:volatile>true</ipxact:volatile>
+ <ipxact:field>
+ <ipxact:name>all</ipxact:name>
+ <ipxact:description>All bits</ipxact:description>
+ <ipxact:bitOffset>0</ipxact:bitOffset>
+ <ipxact:bitWidth>32</ipxact:bitWidth>
+ <ipxact:enumeratedValues>
+ <!-- LINK: enumeratedValue: see 6.11.10, Enumeration values -->
+ <ipxact:enumeratedValue>
+ <ipxact:name>BLOCK_WORDS</ipxact:name>
+ <ipxact:value>32</ipxact:value>
+ </ipxact:enumeratedValue>
+ <ipxact:enumeratedValue>
+ <ipxact:name>BLOCK_BYTES</ipxact:name>
+ <ipxact:value>128</ipxact:value>
+ </ipxact:enumeratedValue>
+
+ <ipxact:enumeratedValue>
+ <ipxact:name>Control Word</ipxact:name>
+ <ipxact:value>0</ipxact:value>
+ </ipxact:enumeratedValue>
+ <ipxact:enumeratedValue>
+ <ipxact:name>First Payload Word</ipxact:name>
+ <ipxact:value>12</ipxact:value>
+ </ipxact:enumeratedValue>
+ <ipxact:enumeratedValue>
+ <ipxact:name>Additional Payload Word</ipxact:name>
+ <ipxact:value>2</ipxact:value>
+ </ipxact:enumeratedValue>
+ </ipxact:enumeratedValues>
+ </ipxact:field>
+ </ipxact:register>
</ipxact:addressBlock>
</ipxact:memoryMap>
@@ -87,15 +127,6 @@
<!-- LINK: memoryBlockData: see 6.9.4, memoryBlockData group -->
<ipxact:usage>register</ipxact:usage>
<ipxact:volatile>false</ipxact:volatile>
- <ipxact:register>
- <ipxact:name>queue</ipxact:name>
- <ipxact:description>This is the memory range into which frames received and directed towards the APE are placed by the hardware. The hardware will tell you where in this region the frame has been placed.</ipxact:description>
- <ipxact:addressOffset>0x0</ipxact:addressOffset>
- <ipxact:dim>0x1000</ipxact:dim>
- <!-- LINK: registerDefinitionGroup: see 6.11.3, Register definition group -->
- <ipxact:size>32</ipxact:size>
- <ipxact:volatile>true</ipxact:volatile>
- </ipxact:register>
</ipxact:addressBlock>
</ipxact:memoryMap>
@@ -146,7 +177,7 @@
<ipxact:volatile>false</ipxact:volatile>
<ipxact:register>
<ipxact:name>out</ipxact:name>
- <ipxact:description>This is the memory range into which frames are directed towards the network byte the APE firmware.</ipxact:description>
+ <ipxact:description>This is the memory range into which frames are directed towards the network by the APE firmware.</ipxact:description>
<ipxact:addressOffset>0x0</ipxact:addressOffset>
<ipxact:dim>0x800</ipxact:dim>
<!-- LINK: registerDefinitionGroup: see 6.11.3, Register definition group -->
diff --git a/ipxact/regen.sh b/ipxact/regen.sh
index 976be00..85b19c3 100755
--- a/ipxact/regen.sh
+++ b/ipxact/regen.sh
@@ -46,6 +46,7 @@ mv APE_SHM*.h ../include
mv APE_FILTERS*.h ../include
mv APE_DEVICE*.h ../include
mv APE_TX_PORT*.h ../include
+mv APE_RX_PORT*.h ../include
# ${IPXACT} -p ${PROJECT} NVIC.xml APE_full.xml APE.s
${IPXACT} -p ${PROJECT} APE_full.xml -t asym APE_sym.s
@@ -57,4 +58,5 @@ rm APE_SHM*.cpp
rm APE_NVM*.cpp
rm APE_DEVICE*.cpp
rm APE_TX_PORT*.cpp
+rm APE_RX_PORT*.cpp
mv *.cpp ../simulator/
diff --git a/simulator/APE_RX_PORT.cpp b/simulator/APE_RX_PORT.cpp
new file mode 100644
index 0000000..9de1523
--- /dev/null
+++ b/simulator/APE_RX_PORT.cpp
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT.cpp
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+#include <APE_RX_PORT.h>
+
+RX_PORT_t RX_PORT;
+
+void init_APE_RX_PORT(void)
+{
+ /** @brief Component Registers for @ref RX_PORT. */
+
+}
diff --git a/simulator/APE_RX_PORT1.cpp b/simulator/APE_RX_PORT1.cpp
new file mode 100644
index 0000000..b15e9bb
--- /dev/null
+++ b/simulator/APE_RX_PORT1.cpp
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT1.cpp
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT1
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+#include <APE_RX_PORT1.h>
+
+RX_PORT_t RX_PORT1;
+
+void init_APE_RX_PORT1(void)
+{
+ /** @brief Component Registers for @ref RX_PORT1. */
+ /** @brief Bitmap for @ref RX_PORT1_t.Queue. */
+
+
+}
diff --git a/simulator/APE_RX_PORT1_sim.cpp b/simulator/APE_RX_PORT1_sim.cpp
new file mode 100644
index 0000000..c6472b2
--- /dev/null
+++ b/simulator/APE_RX_PORT1_sim.cpp
@@ -0,0 +1,99 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT1_sim.cpp
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT1_sim
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+#include <stdint.h>
+#include <utility>
+#include <bcm5719_SHM.h>
+#include <APE_RX_PORT1.h>
+
+static uint32_t loader_read_mem(uint32_t val, uint32_t offset, void *args)
+{
+ uint32_t addr = (uint32_t)((uint64_t)args);
+ addr += offset;
+
+ SHM.LoaderArg0.r32 = addr;
+ SHM.LoaderCommand.bits.Command = SHM_LOADER_COMMAND_COMMAND_READ_MEM;
+
+ // Wait for command to be handled.
+ while(0 != SHM.LoaderCommand.bits.Command);
+
+ return (uint32_t)SHM.LoaderArg0.r32;
+}
+
+static uint32_t loader_write_mem(uint32_t val, uint32_t offset, void *args)
+{
+ uint32_t addr = (uint32_t)((uint64_t)args);
+ addr += offset;
+
+ SHM.LoaderArg0.r32 = addr;
+ SHM.LoaderArg1.r32 = val;
+ SHM.LoaderCommand.bits.Command = SHM_LOADER_COMMAND_COMMAND_WRITE_MEM;
+
+ // Wait for command to be handled.
+ while(0 != SHM.LoaderCommand.bits.Command);
+
+ return val;
+}
+
+void init_APE_RX_PORT1_sim(void *arg0)
+{
+ (void)arg0; // unused
+ void* base = (void*)0xa0004000;
+
+ RX_PORT1.mIndexReadCallback = loader_read_mem;
+ RX_PORT1.mIndexReadCallbackArgs = base;
+
+ RX_PORT1.mIndexWriteCallback = loader_write_mem;
+ RX_PORT1.mIndexWriteCallbackArgs = base;
+
+ /** @brief Component Registers for @ref RX_PORT1. */
+ /** @brief Bitmap for @ref RX_PORT1_t.Queue. */
+ for(int i = 0; i < 4096; i++)
+ {
+ RX_PORT1.Queue[i].r32.installReadCallback(loader_read_mem, (uint8_t *)base);
+ RX_PORT1.Queue[i].r32.installWriteCallback(loader_write_mem, (uint8_t *)base);
+ }
+
+
+}
diff --git a/simulator/APE_RX_PORT2.cpp b/simulator/APE_RX_PORT2.cpp
new file mode 100644
index 0000000..fc52c61
--- /dev/null
+++ b/simulator/APE_RX_PORT2.cpp
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT2.cpp
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT2
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+#include <APE_RX_PORT2.h>
+
+RX_PORT_t RX_PORT2;
+
+void init_APE_RX_PORT2(void)
+{
+ /** @brief Component Registers for @ref RX_PORT2. */
+ /** @brief Bitmap for @ref RX_PORT2_t.Queue. */
+
+
+}
diff --git a/simulator/APE_RX_PORT2_sim.cpp b/simulator/APE_RX_PORT2_sim.cpp
new file mode 100644
index 0000000..4bfee63
--- /dev/null
+++ b/simulator/APE_RX_PORT2_sim.cpp
@@ -0,0 +1,99 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT2_sim.cpp
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT2_sim
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+#include <stdint.h>
+#include <utility>
+#include <bcm5719_SHM.h>
+#include <APE_RX_PORT2.h>
+
+static uint32_t loader_read_mem(uint32_t val, uint32_t offset, void *args)
+{
+ uint32_t addr = (uint32_t)((uint64_t)args);
+ addr += offset;
+
+ SHM.LoaderArg0.r32 = addr;
+ SHM.LoaderCommand.bits.Command = SHM_LOADER_COMMAND_COMMAND_READ_MEM;
+
+ // Wait for command to be handled.
+ while(0 != SHM.LoaderCommand.bits.Command);
+
+ return (uint32_t)SHM.LoaderArg0.r32;
+}
+
+static uint32_t loader_write_mem(uint32_t val, uint32_t offset, void *args)
+{
+ uint32_t addr = (uint32_t)((uint64_t)args);
+ addr += offset;
+
+ SHM.LoaderArg0.r32 = addr;
+ SHM.LoaderArg1.r32 = val;
+ SHM.LoaderCommand.bits.Command = SHM_LOADER_COMMAND_COMMAND_WRITE_MEM;
+
+ // Wait for command to be handled.
+ while(0 != SHM.LoaderCommand.bits.Command);
+
+ return val;
+}
+
+void init_APE_RX_PORT2_sim(void *arg0)
+{
+ (void)arg0; // unused
+ void* base = (void*)0xa0008000;
+
+ RX_PORT2.mIndexReadCallback = loader_read_mem;
+ RX_PORT2.mIndexReadCallbackArgs = base;
+
+ RX_PORT2.mIndexWriteCallback = loader_write_mem;
+ RX_PORT2.mIndexWriteCallbackArgs = base;
+
+ /** @brief Component Registers for @ref RX_PORT2. */
+ /** @brief Bitmap for @ref RX_PORT2_t.Queue. */
+ for(int i = 0; i < 4096; i++)
+ {
+ RX_PORT2.Queue[i].r32.installReadCallback(loader_read_mem, (uint8_t *)base);
+ RX_PORT2.Queue[i].r32.installWriteCallback(loader_write_mem, (uint8_t *)base);
+ }
+
+
+}
diff --git a/simulator/APE_RX_PORT3.cpp b/simulator/APE_RX_PORT3.cpp
new file mode 100644
index 0000000..7003194
--- /dev/null
+++ b/simulator/APE_RX_PORT3.cpp
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT3.cpp
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT3
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+#include <APE_RX_PORT3.h>
+
+RX_PORT_t RX_PORT3;
+
+void init_APE_RX_PORT3(void)
+{
+ /** @brief Component Registers for @ref RX_PORT3. */
+ /** @brief Bitmap for @ref RX_PORT3_t.Queue. */
+
+
+}
diff --git a/simulator/APE_RX_PORT3_sim.cpp b/simulator/APE_RX_PORT3_sim.cpp
new file mode 100644
index 0000000..6ce0c7e
--- /dev/null
+++ b/simulator/APE_RX_PORT3_sim.cpp
@@ -0,0 +1,99 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT3_sim.cpp
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT3_sim
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+#include <stdint.h>
+#include <utility>
+#include <bcm5719_SHM.h>
+#include <APE_RX_PORT3.h>
+
+static uint32_t loader_read_mem(uint32_t val, uint32_t offset, void *args)
+{
+ uint32_t addr = (uint32_t)((uint64_t)args);
+ addr += offset;
+
+ SHM.LoaderArg0.r32 = addr;
+ SHM.LoaderCommand.bits.Command = SHM_LOADER_COMMAND_COMMAND_READ_MEM;
+
+ // Wait for command to be handled.
+ while(0 != SHM.LoaderCommand.bits.Command);
+
+ return (uint32_t)SHM.LoaderArg0.r32;
+}
+
+static uint32_t loader_write_mem(uint32_t val, uint32_t offset, void *args)
+{
+ uint32_t addr = (uint32_t)((uint64_t)args);
+ addr += offset;
+
+ SHM.LoaderArg0.r32 = addr;
+ SHM.LoaderArg1.r32 = val;
+ SHM.LoaderCommand.bits.Command = SHM_LOADER_COMMAND_COMMAND_WRITE_MEM;
+
+ // Wait for command to be handled.
+ while(0 != SHM.LoaderCommand.bits.Command);
+
+ return val;
+}
+
+void init_APE_RX_PORT3_sim(void *arg0)
+{
+ (void)arg0; // unused
+ void* base = (void*)0xa000c000;
+
+ RX_PORT3.mIndexReadCallback = loader_read_mem;
+ RX_PORT3.mIndexReadCallbackArgs = base;
+
+ RX_PORT3.mIndexWriteCallback = loader_write_mem;
+ RX_PORT3.mIndexWriteCallbackArgs = base;
+
+ /** @brief Component Registers for @ref RX_PORT3. */
+ /** @brief Bitmap for @ref RX_PORT3_t.Queue. */
+ for(int i = 0; i < 4096; i++)
+ {
+ RX_PORT3.Queue[i].r32.installReadCallback(loader_read_mem, (uint8_t *)base);
+ RX_PORT3.Queue[i].r32.installWriteCallback(loader_write_mem, (uint8_t *)base);
+ }
+
+
+}
diff --git a/simulator/APE_RX_PORT_sim.cpp b/simulator/APE_RX_PORT_sim.cpp
new file mode 100644
index 0000000..0691736
--- /dev/null
+++ b/simulator/APE_RX_PORT_sim.cpp
@@ -0,0 +1,92 @@
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @file APE_RX_PORT_sim.cpp
+///
+/// @project ape
+///
+/// @brief APE_RX_PORT_sim
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// @copyright Copyright (c) 2018, Evan Lojewski
+/// @cond
+///
+/// All rights reserved.
+///
+/// Redistribution and use in source and binary forms, with or without
+/// modification, are permitted provided that the following conditions are met:
+/// 1. Redistributions of source code must retain the above copyright notice,
+/// this list of conditions and the following disclaimer.
+/// 2. Redistributions in binary form must reproduce the above copyright notice,
+/// this list of conditions and the following disclaimer in the documentation
+/// and/or other materials provided with the distribution.
+/// 3. Neither the name of the <organization> nor the
+/// names of its contributors may be used to endorse or promote products
+/// derived from this software without specific prior written permission.
+///
+////////////////////////////////////////////////////////////////////////////////
+///
+/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+/// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+/// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+/// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+/// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+/// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+/// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+/// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+/// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+/// POSSIBILITY OF SUCH DAMAGE.
+/// @endcond
+////////////////////////////////////////////////////////////////////////////////
+
+#include <stdint.h>
+#include <utility>
+#include <bcm5719_SHM.h>
+#include <APE_RX_PORT.h>
+
+static uint32_t loader_read_mem(uint32_t val, uint32_t offset, void *args)
+{
+ uint32_t addr = (uint32_t)((uint64_t)args);
+ addr += offset;
+
+ SHM.LoaderArg0.r32 = addr;
+ SHM.LoaderCommand.bits.Command = SHM_LOADER_COMMAND_COMMAND_READ_MEM;
+
+ // Wait for command to be handled.
+ while(0 != SHM.LoaderCommand.bits.Command);
+
+ return (uint32_t)SHM.LoaderArg0.r32;
+}
+
+static uint32_t loader_write_mem(uint32_t val, uint32_t offset, void *args)
+{
+ uint32_t addr = (uint32_t)((uint64_t)args);
+ addr += offset;
+
+ SHM.LoaderArg0.r32 = addr;
+ SHM.LoaderArg1.r32 = val;
+ SHM.LoaderCommand.bits.Command = SHM_LOADER_COMMAND_COMMAND_WRITE_MEM;
+
+ // Wait for command to be handled.
+ while(0 != SHM.LoaderCommand.bits.Command);
+
+ return val;
+}
+
+void init_APE_RX_PORT_sim(void *arg0)
+{
+ (void)arg0; // unused
+ void* base = (void*)0xa0000000;
+
+ RX_PORT.mIndexReadCallback = loader_read_mem;
+ RX_PORT.mIndexReadCallbackArgs = base;
+
+ RX_PORT.mIndexWriteCallback = loader_write_mem;
+ RX_PORT.mIndexWriteCallbackArgs = base;
+
+ /** @brief Component Registers for @ref RX_PORT. */
+
+}
diff --git a/simulator/HAL.cpp b/simulator/HAL.cpp
index 46b0705..01f9032 100644
--- a/simulator/HAL.cpp
+++ b/simulator/HAL.cpp
@@ -13,6 +13,7 @@
#include <APE_NVIC.h>
#include <APE_FILTERS.h>
#include <APE_TX_PORT.h>
+#include <APE_RX_PORT.h>
#include <dirent.h>
#include <endian.h>
@@ -288,5 +289,8 @@ bool initHAL(const char *pci_path, int wanted_function)
init_APE_TX_PORT();
init_APE_TX_PORT_sim(NULL);
+ init_APE_RX_PORT();
+ init_APE_RX_PORT_sim(NULL);
+
return true;
}
OpenPOWER on IntegriCloud