-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: gatecat <[email protected]>
- Loading branch information
Showing
28 changed files
with
3,176 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
function get_dependencies { | ||
: | ||
} | ||
|
||
function build_nextpnr { | ||
mkdir build | ||
pushd build | ||
cmake .. -DARCH=himbaechel | ||
make nextpnr-himbaechel bbasm -j`nproc` | ||
# We'd ideally use pypy3 for speed (as works locally), but the version | ||
# our CI Ubuntu provides doesn't like some of the typing stuff | ||
python3 ../himbaechel/uarch/example/example_arch_gen.py ./example.bba | ||
./bba/bbasm --l ./example.bba ./example.bin | ||
popd | ||
} | ||
|
||
function run_tests { | ||
: | ||
} | ||
|
||
function run_archcheck { | ||
pushd build | ||
./nextpnr-himbaechel --uarch example --chipdb ./example.bin --test | ||
popd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Himbächel - a series of bigger arches | ||
|
||
[Viaduct](./viaduct.md) enables custom architectures to be easily prototyped using a C++ API to build in-memory databases; with most of the flexibility of nextpnr's validity checking capabilities to hand. This is the recommended way to get started quickly with FPGAs up to about 20k logic elements, where no other particularly unusal requirements exist. | ||
|
||
However, building the routing graph in-memory at every startup and storing it flat doesn't scale at all well with larger FPGAs (say, 100k LEs or bigger). | ||
So, we take advantage of nextpnr's support for complex, non-flat routing graph structures and define a deduplication approach that's designed to work better even for very large fabrics - the database size is unlikely to exceed about 100MB even for million-LUT scale devices, compared to multiple gigabytes for a flat database. | ||
|
||
Python scripting is defined that allows the user to describe a semi-flattened routing graph and build the deduplicated database binary _at compile time_. Pips - routing switches - are described per tile type rather than flat; however, the connectivity between tiles ("nodes") are described flat and automatically deduplicated during database build. | ||
|
||
## Getting Started | ||
|
||
Most of what's written in the [viaduct docs](./viaduct.md) also applies to bootstrapping a Himbächel arch - this also provides a migration path for an existing Viaduct architecture. Just replace `viaduct` with `himbaechel` and `ViaductAPI` with `HimbaechelAPI` - the set of validity checking and custom flow "hooks" that you have access to is designed to be otherwise as close as possible. | ||
|
||
However, the key difference is that you will need to generate a "binary blob" chip database. `himbaechel_dbgen/bba.py` provides a framework for this. The typical steps for using this API would be as follows: | ||
- Create a `Chip` instance | ||
- For each unique "tile type" in the design (e.g. logic, BRAM, IO - in some cases multiple variants of these may be multiple tile types): | ||
- Create it using `Chip.create_tile_type` | ||
- Add local wires (connectivity between tiles is dealt with later) using `TileType.create_wire` | ||
- Add bels (like LUTs and FFs) using `TileType.create_bel`, and pins to those bels using `TileType.add_bel_pin` | ||
- Add pips using `TileType.create_pip` | ||
- For each grid location, use `Chip.set_tile_type` to set its tile type. Every location must have a tile type set, even if it's just an empty "NULL" tile | ||
- Whenever wires span multiple tiles (i.e. all wires with a length greater than zero), combine the per-tile local wires into a single node using `Chip.add_node` for each case. | ||
- Write out the `.bba` file using `Chip.write_bba` | ||
- Compile it into a binary that nextpnr can load using `./bba/bbasm --l my_chipdb.bba my_chipdb.bin` | ||
|
||
An example Python generator to copy from is located in `uarch/example/example_arch_gen.py`. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* nextpnr -- Next Generation Place and Route | ||
* | ||
* Copyright (C) 2018 Miodrag Milanovic <[email protected]> | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
* | ||
*/ | ||
|
||
#include "mainwindow.h" | ||
|
||
#include <QMessageBox> | ||
#include <cstdlib> | ||
|
||
static void initMainResource() { Q_INIT_RESOURCE(nextpnr); } | ||
|
||
NEXTPNR_NAMESPACE_BEGIN | ||
|
||
MainWindow::MainWindow(std::unique_ptr<Context> context, CommandHandler *handler, QWidget *parent) | ||
: BaseMainWindow(std::move(context), handler, parent) | ||
{ | ||
initMainResource(); | ||
} | ||
|
||
MainWindow::~MainWindow() {} | ||
|
||
void MainWindow::newContext(Context *ctx) | ||
{ | ||
std::string title = "nextpnr-himbächel - " + ctx->getChipName(); | ||
setWindowTitle(title.c_str()); | ||
} | ||
|
||
void MainWindow::createMenu() {} | ||
|
||
void MainWindow::new_proj() | ||
{ | ||
QMessageBox::critical(0, "Error", | ||
"Creating a new project not supported in himbächel mode, please re-start from command line."); | ||
std::exit(1); | ||
} | ||
|
||
NEXTPNR_NAMESPACE_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* nextpnr -- Next Generation Place and Route | ||
* | ||
* Copyright (C) 2018 Miodrag Milanovic <[email protected]> | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
* | ||
*/ | ||
|
||
#ifndef MAINWINDOW_H | ||
#define MAINWINDOW_H | ||
|
||
#include "../basewindow.h" | ||
|
||
NEXTPNR_NAMESPACE_BEGIN | ||
|
||
class MainWindow : public BaseMainWindow | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit MainWindow(std::unique_ptr<Context> context, CommandHandler *handler, QWidget *parent = 0); | ||
virtual ~MainWindow(); | ||
|
||
public: | ||
void createMenu(); | ||
|
||
protected Q_SLOTS: | ||
void new_proj() override; | ||
void newContext(Context *ctx); | ||
}; | ||
|
||
NEXTPNR_NAMESPACE_END | ||
|
||
#endif // MAINWINDOW_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<RCC> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__ |
Oops, something went wrong.