Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Candidate v6.4.3 #1029

Merged
merged 34 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1595980
Add default arguments and configurable array type to getNumpy
bengineerd Oct 15, 2024
1a7a455
Fix parameter name for consistency
bengineerd Oct 15, 2024
5aa304b
Temporarily turn of C++ linter
bengineerd Oct 15, 2024
25c5199
Update the way dtype is passed
bengineerd Oct 15, 2024
0835bee
Whitespace
bengineerd Oct 15, 2024
eaedb41
Add default offset arguments for readPy and writePy
bengineerd Oct 15, 2024
3832713
Add readBa method
bengineerd Oct 15, 2024
986489a
Better bytearray allocation
bengineerd Oct 15, 2024
86a87ed
Add getMemoryviewPy feature
bengineerd Oct 15, 2024
a2f3067
Add count parameter to getBytearrayPy
bengineerd Oct 16, 2024
51d1bcb
Merge remote-tracking branch 'origin/pre-release' into get-numpy
bengineerd Oct 16, 2024
387b65d
Add linter back to CI
bengineerd Oct 16, 2024
e46fed2
NOLINT for the C-based drivers
ruck314 Oct 16, 2024
8ee4172
resolving c++ linter
ruck314 Oct 16, 2024
89ca11c
resolving c++ linter
ruck314 Oct 16, 2024
b4b6fed
resolving c++ linter
ruck314 Oct 16, 2024
96d7224
resolving c++ linter
ruck314 Oct 16, 2024
d64c015
resolving c++ linter
ruck314 Oct 16, 2024
0ef1351
Replace C header includes with C++ includes, rerun clang-format
bengineerd Oct 16, 2024
6842425
Rerun clang-format with version 19.1.3
bengineerd Nov 4, 2024
6281e87
Merge branch 'linter-fix' into get-numpy
bengineerd Nov 4, 2024
bd5f1f2
Merge pull request #1028 from slaclab/linter-fix
bengineerd Nov 4, 2024
57446ce
Merge remote-tracking branch 'origin/pre-release' into get-numpy
bengineerd Nov 4, 2024
7f36922
Whitespace cleanup
bengineerd Nov 4, 2024
6b9827b
Fix casting style
bengineerd Nov 4, 2024
d6b2503
clang-format
bengineerd Nov 4, 2024
c87a109
Fix typo
bengineerd Nov 4, 2024
0ad66a5
Add setup_rogue.fish for fish shell
JJL772 Nov 26, 2024
be66f5b
Merge pull request #1030 from JJL772/pr-fish-env
ruck314 Dec 4, 2024
0c6c060
Merge branch 'pre-release' into get-numpy
ruck314 Dec 4, 2024
0eeada2
Fix boost find call"
slacrherbst Dec 4, 2024
2b49f24
Merge pull request #1031 from slaclab/cmake_boost
slacrherbst Dec 5, 2024
9908bb0
Merge branch 'pre-release' into get-numpy
slacrherbst Dec 5, 2024
ac39d68
Merge pull request #1027 from slaclab/get-numpy
slacrherbst Dec 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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