Commit Graph

76 Commits

Author SHA1 Message Date
Keith Rothman c4a62fb315 Run make format.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
2018-09-27 08:53:39 -07:00
Keith Rothman 85e14f81a1 Generate tile types, site types, tilegrid, tileconn for entire part.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
2018-09-26 22:37:33 -07:00
John McMaster cfea717280 make format: update to latest yapf
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-09-17 18:45:47 -07:00
Tim 'mithro' Ansell e5346c308e python: Run latest yapf.
Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
2018-06-22 15:18:43 -07:00
Clifford Wolf 5b74b282c2 Merge branch 'master' of github.com:SymbiFlow/prjxray into tilegrid-ng 2018-02-14 13:38:39 +01:00
Clifford Wolf 0f67fcf1d2 Make tilegrid["tiles"] the tilegrid top-level object
Signed-off-by: Clifford Wolf <clifford@clifford.at>
2018-02-06 20:12:50 +01:00
Rick Altherr 3d33f101bc xc7patch: Generate Xilinx BIT header in output bitstream
Xilinx tools generate and expect an additional header to be added to the
bitstream.  This header is the only difference between .bit and .bin
files and is not required by the part in any way.  OpenOCD only supports
reading .bit files so the easiest path to a using FOSS tools from FASM
down is to generate a .bit header in xc7patch's output. To distinguish
xc7patch-generated files from Xilinx-generated files, the source file
field includes a Generator tag indicating that the bitstream was produced by
xc7patch.  Vivado uses the same technique to record the Vivado version
in a Version tag.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-02-01 14:34:31 -08:00
Rick Altherr b7d01aa9f6 xc7patch: generate init and final sequences in output bitstream
Bitstreams generated by xc7patch can now be directly loaded into parts
via Vivado's Hardware Manager (bitstream must have .bin suffix) or by
flashing into a boot FLASH.

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
Rick Altherr f5099113e6 xc7patch: remove disabled debug code
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-02-01 12:40:49 -08:00
Rick Altherr 61b6a9dfe7 xc7patch: use ECC calculation from lib
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-02-01 12:39:56 -08:00
John McMaster a7092468f9 simpleroute: pickle to improve performance
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-30 18:15:19 -08:00
John McMaster 8da9f4f572 roi_harness: fix formatting
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-30 14:45:29 -08:00
John McMaster 2a3eebdd9d fasm2frame: dont print nested exception
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-30 14:39:09 -08:00
John McMaster 9849e537a5 simpleroute: better stack overflow message, dont remember previous route
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-30 14:36:02 -08:00
John McMaster 8148cd0d71 simpleroute: enable library function use
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-30 11:26:07 -08:00
John McMaster 9185e152cc fasm2frame: misc cleanup
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-23 18:30:38 -08:00
John McMaster 23813e3065 fasm2frame: optional value on simple elements
Remove INT prefixes not in segdb
Better test cases

Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-23 15:27:58 -08:00
John McMaster e892576560 fasm: slice site name as 0/1 instead of global coordinate. Test cleanup
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-22 17:49:51 -08:00
Rick Altherr 86db6b6724 Tool to patch a 7-series bitstream
Applies a .frm file (lines of frame address: frame words) to a bitstream
and writes the result as a new bitstream.  Note that the new bitstream
will not include the initialization and finalization sequences required
for programming.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-22 14:15:31 -08:00
Rick Altherr c894e1f123 tools: support CLBLL_L in segprint2fasm and fasm2frame
Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-22 14:15:27 -08:00
Clifford Wolf b0b7ec0c06 Run "make format"
Signed-off-by: Clifford Wolf <clifford@clifford.at>
2018-01-22 19:46:45 +01:00
Clifford Wolf 98d2cd0945 Improve simpleroute debug output
Signed-off-by: Clifford Wolf <clifford@clifford.at>
2018-01-20 20:52:11 +01:00
Clifford Wolf b98a4abf1e Add simpleroute.py tool for routing signals through ROI
Signed-off-by: Clifford Wolf <clifford@clifford.at>
2018-01-20 18:15:56 +01:00
John McMaster 7ae7b0c16c roi_harness: misc fixes
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-18 20:14:33 -08:00
John McMaster 8c2e8ad1ea segprint2fasm: test suite
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-18 13:06:24 -08:00
John McMaster 58e84a20d2 segprint2fasm: baseline utility
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-18 13:05:36 -08:00
John McMaster 764ff74100 fasm2frame: stdin/stdout files by default
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-18 13:05:30 -08:00
John McMaster e995034158 fasm2frame FPGA assembler tool. Remove minitest rel path
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
2018-01-18 10:58:19 -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 a4858be23a lib: accessor to get contents of a memory-mapped file as bytes
MemoryMappedFile's data() method returns a void* as it has no idea what
type the contents are.  Viewing it as bytes is a very common operation
so add a convience method that wraps the pointer in a Span<uint8_t>.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
2018-01-04 11:17:59 -08:00
Rick Altherr 28c447c6b2 tools: Rewrite bitread using libprjxray
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 6a17a92d83 tools: rewrite gen_part_base_yaml using xc7series::Part
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 5eb7e15ad3 tools: Tool to generate part YAML from a debug bitstream
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 27aa3d7892 bittool: command for retrieving device IDCODE from a bitstream
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 a53589956e Revert "segmatch: add options to exclude tags and bits from a database"
Does not work as intended.  Removing to avoid confusion.

This reverts commit caeba1b49af17bdceb35803b2c3bc55ef0e3cf62.

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 76210b02c5 Revert "segmath: fixup inverted logic for --exclude_known"
Does not work as intended.  Remove to avoid confusion.
This reverts commit 80d8d6d8d3bc5e7ad5c72c9998777b5e0590ec30.

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 86f22183f8 bittool: Specify action via a positional arg instead of a flag
Action is a required option with no reasonable default.  Making it a
flag just requires the user to type extra for no benefit.

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 d799da0ad5 bittool: command to dump all frame addresses used in a bitstream
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 cfbfb477e6 frame_address_decoder: Autodetect input address base (oct, dec, hex)
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 bd9338da4a Tool to decode xc7series 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 0a005ab5a1 lib: move Xilinx 7series classes into a separate namespace
Class names were getting unwieldy.  Use a namespace to group all the
7series classes and allow for shorter class 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
Rick Altherr 216698560d tools: bitstream inspection tool built on libprjxray
Initial version support dumping configuration packets from a bitstream.

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
Clifford Wolf 339fd235bc Update tools to correctly handle ECC mask (ECC is only 13 LSB bits in word 50)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Clifford Wolf 0efe772467 Fixed bitread FLAGS_o handling
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
2017-12-20 22:46:39 +01:00
Rick Altherr a0f08cf3a2 segmath: fixup inverted logic for --exclude_known
Skip tags and bits if they are _found_ in the excluded sets.

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 744ed997a9 segmatch: add options to exclude tags and bits from a database
--exclude_known will omit any tags and bits that are already saved in
the database specified with --database_path.

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