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>
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>
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>
_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>
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>
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>
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>
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>
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>
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>
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>
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>
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>