Commit Graph

81 Commits

Author SHA1 Message Date
Jake Mercer 57d8a3a6bd SEGBITS FILE READER - Handle Whitespace
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>
2019-10-22 19:35:24 +01:00
Jake Mercer bf11f43390 FORMAT - Run `make format`
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>
2019-10-22 19:35:24 +01:00
Tomasz Michalak 58c26369de bitstream_tools: Add unit tests for Spartan6
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-22 09:20:04 +02:00
Tomasz Michalak b35bf3fe11 bitstream_tools: Add support for Spartan6
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-22 09:20:04 +02:00
Tomasz Michalak 170169b01c Refactor Configuration::createType2ConfigurationPacketData template method
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-21 13:00:50 +02:00
Tomasz Michalak d91b0a5006 Refactor Configuration::InitWithPackets template method
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-21 13:00:50 +02:00
Tomasz Michalak 7bc54d0c56 Refactor BitstreamReader::InitWithBytes template method
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-21 13:00:50 +02:00
Tomasz Michalak 3f574743cf Add initial support for UltraScale devices
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-21 13:00:50 +02:00
litghost 2a3f6aecfe
Merge pull request #1103 from antmicro/ultrascaleplus_support
Bitstream Tools: Add UltraScalePlus support
2019-10-15 10:33:32 -07:00
Tomasz Michalak d328a2f576 Add initial support for UltraScalePlus devices
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-15 13:45:14 +02:00
Keith Rothman 1830202f7d Fixes to enable compilation under clang-7.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
2019-10-14 21:33:23 -07:00
Tomasz Michalak 2f630efada bitstream_tools: Move bitstream writer template methods to header file
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-11 14:14:28 +02:00
Tomasz Michalak 464a09a424 bitstream_tools: Move frames template methods to header file
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-11 14:14:28 +02:00
Tomasz Michalak 9e0178230f bitstream_tools: Move ECC related functions to ECC header
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-11 14:14:28 +02:00
Tomasz Michalak 630cebd0fb Remove unused class
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-09 08:45:04 +02:00
Tomasz Michalak b356ed2761 Change location of Series7 tests and adapt to new API
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-09 08:45:04 +02:00
Tomasz Michalak 35b7130116 Replace API for Series7
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-09 08:45:04 +02:00
Keith Rothman c5a9cb4646 Correct class vs struct usage.
yaml-lib defines convert as
template<T>
struct convert

Not as a class.

Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
2019-06-10 16:22:43 -07:00
litghost b588c5eaaf
Merge pull request #770 from antmicro/bitread_bug
xc7series: fix condition detecting 2 empty frames between rows
2019-04-11 10:03:01 -07:00
Tomasz Michalak cbc58c9ad1 xc7series: add unit test for addMissingFrames
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-04-10 15:00:41 +02:00
Tomasz Michalak 1f6ba5d734 xc7series: fix bug with missing empty frames
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-04-10 15:00:41 +02:00
Tomasz Michalak 71ca8257bc xc7series: add unit test for checking padding frames in configuration
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-04-10 14:42:34 +02:00
Tomasz Michalak 710658ebf8 libprjxray: move definition of icap_ecc to source file
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-04-10 14:42:34 +02:00
Tomasz Michalak 091c12438a xc7series: fix condition for padding frames detection
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-04-10 14:42:34 +02:00
Tomasz Michalak 71f8d7d255 xc7frames2bit: add comments to new utility functions
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-03-19 17:09:59 +01:00
Tomasz Michalak 2aa3c30976 xc7frames2bit: implement tool for xilinx 7-series bitstream generation from frames
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-03-19 09:13:29 +01:00
Tim 'mithro' Ansell aa35026d4f `make format` all files.
Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
2018-12-13 18:43:23 -08:00
John McMaster 66f2816146 make format deltas
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-12-10 17:20:44 -08:00
Michael Gielda 9e8aa9f755
lib: xilinx: catch exceptions by reference
Signed-off-by: Michael Gielda <mgielda@antmicro.com>
2018-10-18 02:28:21 +02:00
Christian Fibich 2e20e2e32f Workaround for g++ and glibc that define `minor` in `<sys/types.h>`.
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=19239

https://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>
2018-06-22 11:18:13 +02:00
Rick Altherr 0fc3ba0400 lib: xc7series: implement builder pattern for generating COR0 values
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-02-01 14:34:31 -08:00
Rick Altherr a4fb9ff7d8 lib: xc7series: define known CMD register values
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-02-01 14:34:31 -08:00
Rick Altherr 80004a3737 lib: xc7series: config packet subclass for NOPs
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-02-01 14:34:31 -08:00
Rick Altherr ab1e60c037 lib: xc7series: add undocumented register used in init sequence
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-02-01 14:34:31 -08:00
Rick Altherr 2a1154ec16 lib: xc7series: config packet subclass that owns the payload
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-02-01 14:34:31 -08:00
Rick Altherr 43b70caf03 xc7series: Dynamically allocate config packets when writing bitstreams
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>
2018-02-01 14:34:31 -08:00
Herbert Poetzl 9c4971162e Make loop condition more readable
Signed-off-by: Herbert Poetzl <herbert@13thfloor.at>
2018-01-31 18:48:01 -08:00
Herbert Poetzl b69ed5cc7e Code cleanup and additional comments
Signed-off-by: Herbert Poetzl <herbert@13thfloor.at>
2018-01-31 18:48:01 -08:00
Herbert Poetzl 86f49cc9da Added ICAP CRC and ECC calculations and tests
Signed-off-by: Herbert Poetzl <herbert@13thfloor.at>
2018-01-31 18:48:01 -08:00
Rick Altherr 87d9538af9 Return zero-fill packets when reading bitstreams
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>
2018-01-22 14:15:30 -08:00
Rick Altherr b0604362e0 lib: xc7series: const all the Span<>s
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>
2018-01-22 14:15:13 -08:00
John McMaster dab52e90ba
Merge branch 'master' into bit_write 2018-01-17 15:07:04 -08:00
John McMaster fe49ac6cee bitstream writer utility class
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-17 15:06:12 -08:00
Rick Altherr 012494552d lib: xc7series: generate packets from a Configuration
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>
2018-01-17 11:20:06 -08:00
Rick Altherr 5749352937 lib: xc7series: convience constructor for Configuration
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>
2018-01-16 16:11:08 -08:00
Rick Altherr 2da520bea3 Remove unused ConfigurationFrameRange
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-10 14:28:30 -08:00
Rick Altherr 2b34fbb35d xc7series: refactor Part()
ConfigurationFrameAddress row-half and row fields translate directly to
the clock region structure used in 7-series parts.  Break these concepts
out into separate classes and encode them as such in Part YAML.

Columns within a row are more complicated. Column indices are relative
to a BlockType. Think of each BlockType as a data bus that terminates at
some particular tile type (e.g. CLB_IO_CLK maps to INT_{L,R} tiles).
Column indices act as addresses of endpoints on the associated BlockType
bus.  As the bus is 1 frame (101 words, 404 bytes) wide, each endpoint
feeds frames into multiple tiles simultaneously.

Minor addresses are frame addresses within a BlockType bus endpoint.
These can refer to frames either stored within the endpoint tiles
or in tiles chained behind them.

Note that a given tile can be connected on multiple BlockType buses.
For example, block RAMs appear to be attached both by being chained
behind an INT_{L,R} on the CLB_IO_CLK bus as well as being a direct
endpoint on the BLOCK_RAM bus.  Due to this, tiles conceptually belong
to the row rather than a single column.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-10 14:28:23 -08:00
Rick Altherr 53d7f1f80b lib: xc7series: shorten accessor names
_address suffix on accessors is unnecessary and somewhat inaccurate.
The returned values are indices rather than frame addresses.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-10 14:28:17 -08:00
Rick Altherr 50d2521b33 Apply clang-format to all C++ files
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-08 17:14:27 -08:00
Rick Altherr 1232caf648 lib: combine 7series tests into a single target
Reduces repitition in CMakeLists.txt.  Individiual tests can be selected
via gtest flags.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-05 14:01:44 -08:00