Commit Graph

51 Commits

Author SHA1 Message Date
Tomasz Michalak bb400b4f1e Add licensing header to C++ source and header files
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
Signed-off-by: Tim 'mithro' Ansell <tansell@google.com>
2020-05-26 07:33:12 -07:00
Karol Gugala 3acd1e99fc bitstream_writer: update 7 series tests
Signed-off-by: Karol Gugala <kgugala@antmicro.com>
2019-12-12 20:48:43 +01:00
Karol Gugala 9d08578a60 bitstream_writer: fix 7 series and US+ headers
Signed-off-by: Karol Gugala <kgugala@antmicro.com>
2019-12-12 18:47:48 +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 3f574743cf Add initial support for UltraScale devices
Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
2019-10-21 13:00:50 +02: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
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
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 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
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 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
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 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 5a664c04ec lib: xc7series: shorten ConfigurationFrameAddress to FrameAddress
Frame addresses are only used in the context of configuration frames.
Remove the prefix to reduce typing that does not improve clarity.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-04 15:33:15 -08:00
Rick Altherr 6ba411294e lib: xc7series: verify bitstream variants parse to same configurations
Normal, debug, and per-frame CRC bitstreams differ in the commands used
to write the frame data but should generate equivalent configurations.
Note that this currently fails as something is wrong with normal
bitstream parsing.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-04 15:11:00 -08:00
Rick Altherr 0d2c33bf0f lib: xc7series: ostream operator for ConfigurationFrameAddress
Writes a decoded version of the address to the stream.  Handy for logging.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-04 15:00:08 -08:00
Rick Altherr bd3fa58584 lib: xc7series: class to hold a configuration
Currently is able to parse IDCODE and frames from a sequence of
ConfigurationPackets.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr d251aa0ed7 lib: xc7series: wrapper for part-specific information
Currently just the pieces required to successfully identify and decode
a bitstream into configuration frames.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr 4f6046d177 lib: xc7series: wrapper for ranges of config frame addresses
Includes conversion to/from YAML.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr 92509c5043 lib: xc7series: Fix frame address YAML decoding
Need to manually translate row_half from human-readable form in YAML
(top/bottom) to true/false.  Requesting a Node as a uint8_t returns the
first char in the YAML field rather than parsing the field as an
integer.  Just used unsigned ints and let the constructor force them to
smaller types.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr 6a2fb25013 lib: xc7series: YAML conversion tests for ConfigurationFrameAddress
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr 7e2cdc0947 lib: xc7series: block_type YAML conversion tests
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr 195323e0c8 lib: xc7series: enable conversion to/from YAML for frame addresses
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr 7345f2630a lib: xc7series: Handle the curious case of Type 0 packets
Type 0 shouldn't exist but bitstreams generated with
BITSTREAM.GENERAL.DEBUGBITSTREAM=YES seem to use them as padding.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr 9cbd9bac28 lib: replace binary literals with hex literals
binary literals are a C++14 feature.  Use hex literals instead to
keep C++11 compatibility.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr 4a80475db9 lib: xc7series: record header type in configuration packets
Type 2 packets are used for when the amount of data required exceeds the
word count field in a Type 1 header.  ConfigurationPacket mostly hides
this detail from the user but occasionally it is handy for debugging.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr fd3a5d8bab lib: xc7series: ostream overload for BlockType
Makes debugging a bit easier.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr 47e02d4cfd lib: xc7series: move register details to reusable enum
Both ConfigurationPacket and Configuration need to reference registers.
Use a common scoped enum to reduce change of errors.  Leverage stream
operator to simplify outputing register names.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00