Add `make format-trailing-ws`. This recipe finds all _files_ (not
links) known to Git and uses `sed` to remove trailing whitespace.
Signed-off-by: Jake Mercer <jake.mercer@civica.co.uk>
The previous commit caused the segbits file reader test to fail as
trailing whitespace was removed from the test_data. Updated the reader
to additionally handle a tag immediately followed by a newline.
Signed-off-by: Jake Mercer <jake.mercer@civica.co.uk>
Changes after running `make format`. Future commits which add
whitespace should be caught by CI at the PR stage.
Signed-off-by: Jake Mercer <jake.mercer@civica.co.uk>
Building prjxray using g++ 7.3.0 and glibc 2.27-3 produces the following warning that is treated as an error:
In file included from [...]/prjxray/lib/include/prjxray/xilinx/xc7series/configuration_column.h:8:0,
from [...]/prjxray/lib/include/prjxray/xilinx/xc7series/configuration_bus.h:10,
from [...]/prjxray/lib/xilinx/xc7series/configuration_bus.cc:1:
[...]/prjxray/lib/include/prjxray/xilinx/xc7series/frame_address.h:32:13: error: In the GNU C Library, "minor" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "minor", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"minor", you should undefine it after including <sys/types.h>. [-Werror]
uint8_t minor() const;
^~~~~~~~~~~
This is related to these two bugs:
https://sourceware.org/bugzilla/show_bug.cgi?format=multiple&id=19239https://bugzilla.redhat.com/show_bug.cgi?id=130601
This patch is a workaround that undefines `minor` if `_GNU_SOURCE` is defined.
Signed-off-by: Christian Fibich <fibich@technikum-wien.at>
ConfigurationPacket assumes that the payload data is owned by someone
else. For frame data, that is generally true. For initialization and
finalization sequences, those payloads need to be created and managed.
Instead, dynamically allocate packets which allows for using subclasses
of ConfigurationPacket that store the payload with the packet.
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Zero-fill packets are required in certain conditions to create valid
bitstreams. When reading a bitstream, make sure they are yielded and
printed.
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Span<T> can be converted to a Span<const T> but the reverse is not true.
Since most of the uses of spans do not allow modification of the data,
taking a Span<const T> is more versatile and importantly allows them to
be used in const methods.
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
ConfigurationPacketizer translates a Configuration's frame data to a
sequence of ConfigurationPackets that will write that configuration to
the configuration's Part.
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Configuration's original constructor expects Span<uint32_t>s as part of
the map to avoid copying the actual frame data. In tests or any other
place that needs to directly construct a Configuration, the caller will
already have a map with vector<uint32_t> to hold the actual frame data.
This new constructor just wraps those vectors in Spans.
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>