Skip to content

Commit

Permalink
Merge pull request #1029 from slaclab/pre-release
Browse files Browse the repository at this point in the history
Release Candidate v6.4.3
  • Loading branch information
slacrherbst authored Dec 5, 2024
2 parents 0cd3112 + ac39d68 commit 65f90cd
Show file tree
Hide file tree
Showing 55 changed files with 287 additions and 127 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if ( NOT NO_PYTHON )

# Hint for boost on anaconda
if (DEFINED ENV{CONDA_PREFIX})
set(Boost_ROOT $ENV{CONDA_PREFIX})
set(BOOST_ROOT $ENV{CONDA_PREFIX})
endif()

# libboost_python3.7 style libraries
Expand Down Expand Up @@ -336,6 +336,8 @@ configure_file(${PROJECT_SOURCE_DIR}/templates/setup_rogue.csh.in
${PROJECT_BINARY_DIR}/setup_rogue.csh @ONLY)
configure_file(${PROJECT_SOURCE_DIR}/templates/setup_rogue.sh.in
${PROJECT_BINARY_DIR}/setup_rogue.sh @ONLY)
configure_file(${PROJECT_SOURCE_DIR}/templates/setup_rogue.fish.in
${PROJECT_BINARY_DIR}/setup_rogue.fish @ONLY)

# Create the python install script
configure_file(${PROJECT_SOURCE_DIR}/templates/setup.py.in
Expand All @@ -357,7 +359,7 @@ install(FILES ${PROJECT_BINARY_DIR}/RogueConfig.cmake DESTINATION ${CMAKE_INSTAL

# Copy setup files for local or custom
if ((${ROGUE_INSTALL} STREQUAL "custom") OR (${ROGUE_INSTALL} STREQUAL "local"))
install(FILES ${PROJECT_BINARY_DIR}/setup_rogue.sh ${PROJECT_BINARY_DIR}/setup_rogue.csh DESTINATION ${ROGUE_DIR})
install(FILES ${PROJECT_BINARY_DIR}/setup_rogue.sh ${PROJECT_BINARY_DIR}/setup_rogue.csh ${PROJECT_BINARY_DIR}/setup_rogue.fish DESTINATION ${ROGUE_DIR})
endif()

# Install header files for non local installs
Expand Down
17 changes: 9 additions & 8 deletions include/rogue/hardware/drivers/DmaDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,18 @@ struct DmaRegisterData {

// Conditional inclusion for non-kernel environments
#ifndef DMA_IN_KERNEL
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/signal.h>
#include <sys/socket.h>
#include <unistd.h>

#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <cstring>

/**
* dmaWrite - Writes data to a DMA channel.
* @fd: File descriptor for the DMA device.
Expand All @@ -167,7 +168,7 @@ static inline ssize_t dmaWrite(int32_t fd, const void* buf, size_t size, uint32_
w.flags = flags;
w.size = size;
w.is32 = (sizeof(void*) == 4);
w.data = (uint64_t)buf;
w.data = (uint64_t)buf; // NOLINT

return (write(fd, &w, sizeof(struct DmaWriteData)));
}
Expand Down Expand Up @@ -237,7 +238,7 @@ static inline ssize_t dmaWriteVector(int32_t fd,
w.flags = (x == 0) ? begFlags : ((x == (iovlen - 1)) ? endFlags : midFlags);
w.size = iov[x].iov_len;
w.is32 = (sizeof(void*) == 4);
w.data = (uint64_t)iov[x].iov_base;
w.data = (uint64_t)iov[x].iov_base; // NOLINT

do {
res = write(fd, &w, sizeof(struct DmaWriteData));
Expand Down Expand Up @@ -288,7 +289,7 @@ static inline ssize_t dmaWriteIndexVector(int32_t fd,
w.flags = (x == 0) ? begFlags : ((x == (iovlen - 1)) ? endFlags : midFlags);
w.size = iov[x].iov_len;
w.is32 = (sizeof(void*) == 4);
w.index = (uint32_t)(((uint64_t)iov[x].iov_base) & 0xFFFFFFFF);
w.index = (uint32_t)(((uint64_t)iov[x].iov_base) & 0xFFFFFFFF); // NOLINT

do {
res = write(fd, &w, sizeof(struct DmaWriteData));
Expand Down Expand Up @@ -324,7 +325,7 @@ static inline ssize_t dmaRead(int32_t fd, void* buf, size_t maxSize, uint32_t* f
memset(&r, 0, sizeof(struct DmaReadData));
r.size = maxSize;
r.is32 = (sizeof(void*) == 4);
r.data = (uint64_t)buf;
r.data = (uint64_t)buf; // NOLINT

ret = read(fd, &r, sizeof(struct DmaReadData));

Expand Down
22 changes: 20 additions & 2 deletions include/rogue/interfaces/stream/Frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "rogue/EnableSharedFromThis.h"

#ifndef NO_PYTHON
#include <numpy/ndarrayobject.h>

#include <boost/python.hpp>
#endif

Expand Down Expand Up @@ -335,6 +337,22 @@ class Frame : public rogue::EnableSharedFromThis<rogue::interfaces::stream::Fram
*/
void readPy(boost::python::object p, uint32_t offset);

//! Python Frame data read function
/** Read data from Frame into a python bytearray which is allocated and returned
*
* Exposed as getBa() to Python
* @param offset First location of Frame data to copy to byte array
* @param count Number of bytes to read
*/
boost::python::object getBytearrayPy(uint32_t offset, uint32_t count);

//! Python Frame data read function
/** Read data from Frame into a python bytearray which is allocated and returned as a memoryview
*
* Exposed as getMemoryview() to Python
*/
boost::python::object getMemoryviewPy();

//! Python Frame data write function
/** Write data into from Frame from passed Python byte array.
*
Expand All @@ -351,10 +369,10 @@ class Frame : public rogue::EnableSharedFromThis<rogue::interfaces::stream::Fram
* @return The read data as a 1-D numpy byte array
*
* @param[in] offset The byte offset into the frame to write to
* @param[in] size The number of bytes to write
* @param[in] count The number of bytes to write
*
*/
boost::python::object getNumpy(uint32_t offset, uint32_t size);
boost::python::object getNumpy(uint32_t offset, uint32_t count, boost::python::object dtype);

//! Python Frame data write using a numpy array as the source
/*
Expand Down
2 changes: 1 addition & 1 deletion include/rogue/interfaces/stream/Master.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include "rogue/Directives.h"

#include <stdint.h>
#include <stdio.h>

#include <cstdio>
#include <memory>
#include <mutex>
#include <string>
Expand Down
6 changes: 3 additions & 3 deletions include/rogue/protocols/xilinx/JtagDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

#include "rogue/Directives.h"

#include <errno.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

#include <cerrno>
#include <cstdio>
#include <cstring>
#include <exception>
#include <memory>
#include <stdexcept>
Expand Down
1 change: 1 addition & 0 deletions src/package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "rogue/Directives.h"

#include <boost/python.hpp>
#include <cstdio>

#include "rogue/Version.h"
#include "rogue/module.h"
Expand Down
3 changes: 3 additions & 0 deletions src/rogue/GeneralError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

#include <stdarg.h>

#include <cstdio>
#include <string>

#ifndef NO_PYTHON
#include <boost/python.hpp>
namespace bp = boost::python;
Expand Down
7 changes: 5 additions & 2 deletions src/rogue/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@

#include <inttypes.h>
#include <stdarg.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>

#include <cstdio>
#include <cstring>
#include <memory>
#include <string>
#include <vector>

#if defined(__linux__)
#include <sys/syscall.h>
Expand Down Expand Up @@ -156,7 +159,7 @@ void rogue::Logging::logThreadId() {
#elif defined(__APPLE__) && defined(__MACH__)
uint64_t tid64;
pthread_threadid_np(NULL, &tid64);
tid = (uint32_t)tid64;
tid = static_cast<uint32_t>(tid64);
#else
tid = 0;
#endif
Expand Down
1 change: 1 addition & 0 deletions src/rogue/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <inttypes.h>
#include <unistd.h>

#include <cstdio>
#include <sstream>
#include <string>

Expand Down
2 changes: 1 addition & 1 deletion src/rogue/hardware/MemMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

#include <fcntl.h>
#include <inttypes.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

#include <cstdio>
#include <cstring>
#include <memory>
#include <thread>
Expand Down
3 changes: 2 additions & 1 deletion src/rogue/hardware/axi/AxiMemMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@

#include <fcntl.h>
#include <inttypes.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

#include <cstdio>
#include <cstring>
#include <memory>
#include <string>
#include <thread>

#include "rogue/GeneralError.h"
Expand Down
5 changes: 4 additions & 1 deletion src/rogue/hardware/axi/AxiStreamDma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
#include "rogue/hardware/axi/AxiStreamDma.h"

#include <inttypes.h>
#include <stdlib.h>

#include <cstdio>
#include <cstdlib>
#include <map>
#include <memory>
#include <string>

#include "rogue/GeneralError.h"
#include "rogue/GilRelease.h"
Expand Down
1 change: 1 addition & 0 deletions src/rogue/interfaces/ZmqClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <inttypes.h>
#include <zmq.h>

#include <cstdio>
#include <memory>
#include <string>

Expand Down
1 change: 1 addition & 0 deletions src/rogue/interfaces/api/Bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "rogue/interfaces/api/Bsp.h"

#include <boost/make_shared.hpp>
#include <memory>
#include <string>

#include "rogue/GeneralError.h"
Expand Down
Loading

0 comments on commit 65f90cd

Please sign in to comment.