Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/blinky/blinky.pcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Pin constraints for blinky on Aegis
# Format: set_io <signal> <bel_name>
# IO BELs are named X<x>/Y<y>/IO<z> on the grid edges
set_io clk X0/Y1/IO0
set_io reset X0/Y2/IO0
set_io led X0/Y3/IO0
9 changes: 7 additions & 2 deletions examples/blinky/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ stdenvNoCC.mkDerivation {

src = lib.fileset.toSource {
root = ./.;
fileset = ./blinky.v;
fileset = lib.fileset.unions [
./blinky.v
./blinky.pcf
./place_io.py
];
};

nativeBuildInputs = [
Expand All @@ -45,8 +49,9 @@ stdenvNoCC.mkDerivation {
yosys -c synth.tcl > yosys.log 2>&1 || { cat yosys.log; exit 1; }

echo "=== Place and route ==="
nextpnr-aegis-${deviceName} \
PCF_FILE=blinky.pcf nextpnr-aegis-${deviceName} \
--json blinky_pnr.json \
--pre-place place_io.py \
--write blinky_routed.json \
> nextpnr.log 2>&1 || { cat nextpnr.log; echo "nextpnr finished (may have warnings)"; }

Expand Down
19 changes: 19 additions & 0 deletions examples/blinky/place_io.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Apply PCF-style IO constraints for Aegis
# Reads blinky.pcf and constrains IO cells to specific BELs

import os

pcf_file = os.environ.get("PCF_FILE", "blinky.pcf")

with open(pcf_file) as f:
for line in f:
line = line.strip()
if not line or line.startswith("#"):
continue
parts = line.split()
if len(parts) == 3 and parts[0] == "set_io":
signal, bel = parts[1], parts[2]
for cname, cell in ctx.cells:
if cname == signal:
cell.setAttr("BEL", bel)
break
12 changes: 12 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@

treefmt.programs = {
black.enable = true;
clang-format.enable = true;
dart-format.enable = true;
jsonfmt.enable = true;
nixfmt.enable = true;
Expand All @@ -73,6 +74,17 @@
flakever = flakeverConfig;
aegis-ip-tools = pkgs.callPackage ./pkgs/aegis-ip-tools { };
aegis-pack = pkgs.callPackage ./pkgs/aegis-pack { inherit craneLib; };
nextpnr-aegis = pkgs.nextpnr.overrideAttrs (old: {
pname = "nextpnr-aegis";
postPatch = (old.postPatch or "") + ''
# Add Aegis viaduct uarch
mkdir -p generic/viaduct/aegis
cp ${./nextpnr-aegis/aegis.cc} generic/viaduct/aegis/aegis.cc

# Register in CMakeLists.txt
sed -i '/viaduct\/example\/example.cc/a\ viaduct/aegis/aegis.cc' generic/CMakeLists.txt
'';
});
gf180mcu-pdk = pkgs.callPackage ./pkgs/gf180mcu-pdk { };
sky130-pdk = pkgs.callPackage ./pkgs/sky130-pdk { };
};
Expand Down
18 changes: 0 additions & 18 deletions ip/bin/aegis_genip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,23 +202,6 @@ Future<void> main(List<String> arguments) async {
File('$outputDir/${fpga.name}_bram.rules').writeAsStringSync(bramRules);
}

final chipdbEmitter = ChipdbEmitter(
deviceName: fpga.name,
width: width,
height: height,
tracks: tracks,
serdesCount: serdesCount,
clockTileCount: clockTiles,
bramColumnInterval: bramInterval,
dspColumnInterval: dspInterval,
);
File(
'$outputDir/${fpga.name}-chipdb.py',
).writeAsStringSync(chipdbEmitter.generate());
File(
'$outputDir/${fpga.name}-packer.py',
).writeAsStringSync(chipdbEmitter.generatePacker());

final openroadEmitter = OpenroadTclEmitter(
moduleName: 'AegisFPGA',
width: width,
Expand All @@ -240,7 +223,6 @@ Future<void> main(List<String> arguments) async {
print(' $outputDir/${fpga.name}_cells.v');
print(' $outputDir/${fpga.name}_techmap.v');
print(' $outputDir/${fpga.name}-synth-aegis.tcl');
print(' $outputDir/${fpga.name}-chipdb.py');
print(' $outputDir/${fpga.name}-openroad.tcl');
} on FormatException catch (e) {
print(e.message);
Expand Down
1 change: 0 additions & 1 deletion ip/lib/aegis_ip.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export 'src/components.dart';
export 'src/config.dart';
export 'src/nextpnr.dart';
export 'src/openroad.dart';
export 'src/pdk.dart';
export 'src/sim.dart';
Expand Down
1 change: 0 additions & 1 deletion ip/lib/src/nextpnr.dart

This file was deleted.

Loading
Loading