diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/debian/changelog arachne-pnr-0.1+20160813git52e69ed/debian/changelog --- arachne-pnr-0.1+20151224git1a4fdf9/debian/changelog 2016-03-03 23:22:56.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/debian/changelog 2016-09-23 04:59:03.000000000 +0000 @@ -1,3 +1,15 @@ +arachne-pnr (0.1+20160813git52e69ed-1) unstable; urgency=low + + * New upstream version + * debian/man/arachne-pnr.txt: Describe new command line switch + * debian/patches/0006-Fixed-spelling.patch: Fixed minor spelling error + * debian/control: + - New standards 3.9.8 - no changes + - Fixed spelling error in description + * Patches now being generated by gbp pq + + -- Ruben Undheim Fri, 23 Sep 2016 06:59:03 +0200 + arachne-pnr (0.1+20151224git1a4fdf9-1) unstable; urgency=medium * New upstream version diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/debian/control arachne-pnr-0.1+20160813git52e69ed/debian/control --- arachne-pnr-0.1+20151224git1a4fdf9/debian/control 2016-03-03 23:19:44.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/debian/control 2016-09-23 04:59:03.000000000 +0000 @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 9), fpga-icestorm-chipdb, txt2man -Standards-Version: 3.9.7 +Standards-Version: 3.9.8 Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/arachne-pnr.git Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/arachne-pnr.git Homepage: https://github.com/cseed/arachne-pnr @@ -20,7 +20,7 @@ format, as output by the Yosys synthesis suite for example. It currently targets the Lattice Semiconductor iCE40 family of FPGAs. Its output is a textual bitstream representation for assembly by the IceStorm icepack command. - The output of icepack is a binary bitstream which can be uploaded to a harware + The output of icepack is a binary bitstream which can be uploaded to a hardware device. . This package contains the binary versions of the chipdb files needed by @@ -39,7 +39,7 @@ format, as output by the Yosys synthesis suite for example. It currently targets the Lattice Semiconductor iCE40 family of FPGAs. Its output is a textual bitstream representation for assembly by the IceStorm icepack command. - The output of icepack is a binary bitstream which can be uploaded to a harware + The output of icepack is a binary bitstream which can be uploaded to a hardware device. . Together, Yosys, arachne-pnr and IceStorm provide an fully open-source diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/debian/man/arachne-pnr.txt arachne-pnr-0.1+20160813git52e69ed/debian/man/arachne-pnr.txt --- arachne-pnr-0.1+20151224git1a4fdf9/debian/man/arachne-pnr.txt 2016-03-03 23:19:44.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/debian/man/arachne-pnr.txt 2016-09-23 04:58:30.000000000 +0000 @@ -11,7 +11,7 @@ format, as output by the Yosys synthesis suite for example. It currently targets the Lattice Semiconductor iCE40 family of FPGAs. Its output is a textual bitstream representation for assembly by the IceStorm icepack command. - The output of icepack is a binary bitstream which can be uploaded to a harware + The output of icepack is a binary bitstream which can be uploaded to a hardware device. @@ -49,6 +49,9 @@ -r Randomize seed. + -m , --max-passes Maximum number of routing passes. + Default: 200 + -s , --seed Set seed for random generator to . Default: 1 diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/0006-Fixed-spelling.patch arachne-pnr-0.1+20160813git52e69ed/debian/patches/0006-Fixed-spelling.patch --- arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/0006-Fixed-spelling.patch 1970-01-01 00:00:00.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/debian/patches/0006-Fixed-spelling.patch 2016-09-23 04:55:14.000000000 +0000 @@ -0,0 +1,21 @@ +From: Ruben Undheim +Date: Fri, 23 Sep 2016 06:55:06 +0200 +Subject: Fixed spelling + +--- + README.md | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/README.md b/README.md +index 4b9eff7..b12c8ef 100644 +--- a/README.md ++++ b/README.md +@@ -20,7 +20,7 @@ example. It currently targets the Lattice Semiconductor + output is a textual bitstream representation for assembly by the + [IceStorm](http://www.clifford.at/icestorm/) [2] `icepack` command. + The output of `icepack` is a binary bitstream which can be uploaded to +-a harware device. ++a hardware device. + + Together, Yosys, arachne-pnr and IceStorm provide an fully open-source + Verilog-to-bistream tool chain for iCE40 1K and 8K FPGA development. diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/01_path_to_icebox.patch arachne-pnr-0.1+20160813git52e69ed/debian/patches/01_path_to_icebox.patch --- arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/01_path_to_icebox.patch 2016-03-03 23:19:44.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/debian/patches/01_path_to_icebox.patch 2016-09-23 04:55:14.000000000 +0000 @@ -1,9 +1,17 @@ -Description: This makes sure that the chipdb files from icestorm are found when +From: Ruben Undheim +Date: Mon, 19 Sep 2016 08:03:15 +0200 +Subject: This makes sure that the chipdb files from icestorm are found when building the package -Author: Ruben Undheim ---- arachne-pnr-0~20150927gitefdb026.orig/Makefile -+++ arachne-pnr-0~20150927gitefdb026/Makefile -@@ -13,7 +13,7 @@ CXXFLAGS = -I$(SRC) -std=c++11 -MD $(OPT + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 17ba257..68e214f 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,7 +14,7 @@ CXXFLAGS = -I$(SRC) -std=c++11 -MD $(OPTDEBUGFLAGS) -Wall -Wshadow -Wsign-compar LIBS = -lm DESTDIR = /usr/local diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/02_dont_run_tests.patch arachne-pnr-0.1+20160813git52e69ed/debian/patches/02_dont_run_tests.patch --- arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/02_dont_run_tests.patch 2016-03-03 23:19:44.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/debian/patches/02_dont_run_tests.patch 2016-09-23 04:55:14.000000000 +0000 @@ -1,12 +1,17 @@ -Description: The tests depend on fully installed new version of yosys. Skip - them during build -Author: Ruben Undheim +From: Ruben Undheim +Date: Mon, 19 Sep 2016 08:03:15 +0200 +Subject: The tests depend on fully installed new version of yosys. Skip them + during build -Index: arachne-pnr/Makefile -=================================================================== ---- arachne-pnr.orig/Makefile 2016-03-03 23:58:39.613952332 +0100 -+++ arachne-pnr/Makefile 2016-03-03 23:59:12.297086096 +0100 -@@ -56,19 +56,19 @@ +--- + Makefile | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/Makefile b/Makefile +index 68e214f..87e6d72 100644 +--- a/Makefile ++++ b/Makefile +@@ -57,19 +57,19 @@ simpletest: all tests/test_bv tests/test_us @echo # assumes icestorm, yosys installed diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/03_fix_install_dir.patch arachne-pnr-0.1+20160813git52e69ed/debian/patches/03_fix_install_dir.patch --- arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/03_fix_install_dir.patch 2016-03-03 23:19:44.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/debian/patches/03_fix_install_dir.patch 2016-09-23 04:55:14.000000000 +0000 @@ -1,11 +1,16 @@ -Description: Upstream doesn't use DESTDIR correctly. Fix -Author: Ruben Undheim +From: Ruben Undheim +Date: Mon, 19 Sep 2016 08:03:15 +0200 +Subject: Upstream doesn't use DESTDIR correctly. Fix -Index: arachne-pnr/Makefile -=================================================================== ---- arachne-pnr.orig/Makefile 2016-03-03 23:59:28.392656511 +0100 -+++ arachne-pnr/Makefile 2016-03-03 23:59:28.388656618 +0100 -@@ -87,16 +87,16 @@ +--- + Makefile | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Makefile b/Makefile +index 87e6d72..a086a67 100644 +--- a/Makefile ++++ b/Makefile +@@ -104,16 +104,16 @@ mxebin: .PHONY: install install: all diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/04_cxxflags.patch arachne-pnr-0.1+20160813git52e69ed/debian/patches/04_cxxflags.patch --- arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/04_cxxflags.patch 2016-03-03 23:19:44.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/debian/patches/04_cxxflags.patch 2016-09-23 04:55:14.000000000 +0000 @@ -1,10 +1,16 @@ -Description: Needed to make sure that CXXFLAGS are propagated from the - environment -Author: Ruben Undheim +From: Ruben Undheim +Date: Mon, 19 Sep 2016 08:03:15 +0200 +Subject: Needed to make sure that CXXFLAGS are propagated from the environment ---- arachne-pnr-0~20150927gitefdb026.orig/Makefile -+++ arachne-pnr-0~20150927gitefdb026/Makefile -@@ -9,7 +9,7 @@ OPTDEBUGFLAGS = -O2 # -DNDEBUG +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index a086a67..5532b86 100644 +--- a/Makefile ++++ b/Makefile +@@ -10,7 +10,7 @@ OPTDEBUGFLAGS = -O2 SRC = src # clang only: -Wglobal-constructors diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/05_prevent_dependency_on_git.patch arachne-pnr-0.1+20160813git52e69ed/debian/patches/05_prevent_dependency_on_git.patch --- arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/05_prevent_dependency_on_git.patch 2016-03-03 23:22:01.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/debian/patches/05_prevent_dependency_on_git.patch 2016-09-23 04:55:14.000000000 +0000 @@ -1,10 +1,17 @@ -Description: Set VER and GIT_REV explicitly so that the build does not - need to be done in a git repository. -Author: Ruben Undheim +From: Ruben Undheim +Date: Mon, 19 Sep 2016 08:03:15 +0200 +Subject: Set VER and GIT_REV explicitly so that the build does not need to be + done in a git repository. ---- arachne-pnr-0.1+20151224git1a4fdf9.orig/Makefile -+++ arachne-pnr-0.1+20151224git1a4fdf9/Makefile -@@ -18,8 +18,8 @@ ICEBOX = /usr/share/fpga-icestorm/chipdb +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 5532b86..f2e4163 100644 +--- a/Makefile ++++ b/Makefile +@@ -19,8 +19,8 @@ ICEBOX = /usr/share/fpga-icestorm/chipdb .PHONY: all all: bin/arachne-pnr share/arachne-pnr/chipdb-1k.bin share/arachne-pnr/chipdb-8k.bin diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/series arachne-pnr-0.1+20160813git52e69ed/debian/patches/series --- arachne-pnr-0.1+20151224git1a4fdf9/debian/patches/series 2016-03-03 23:21:26.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/debian/patches/series 2016-09-23 04:55:14.000000000 +0000 @@ -3,3 +3,4 @@ 03_fix_install_dir.patch 04_cxxflags.patch 05_prevent_dependency_on_git.patch +0006-Fixed-spelling.patch diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/.gitignore arachne-pnr-0.1+20160813git52e69ed/.gitignore --- arachne-pnr-0.1+20151224git1a4fdf9/.gitignore 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/.gitignore 2016-09-18 10:02:29.000000000 +0000 @@ -2,6 +2,7 @@ *~ *.o /bin/arachne-pnr +/bin/arachne-pnr.exe /tests/test_bv /tests/test_us /diff diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/Makefile arachne-pnr-0.1+20160813git52e69ed/Makefile --- arachne-pnr-0.1+20151224git1a4fdf9/Makefile 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/Makefile 2016-09-18 10:02:29.000000000 +0000 @@ -5,7 +5,8 @@ # build optimized without -DNDEBUG # OPTDEBUGFLAGS = -O0 -fno-inline -g -OPTDEBUGFLAGS = -O2 # -DNDEBUG +# OPTDEBUGFLAGS = -O3 -DNDEBUG +OPTDEBUGFLAGS = -O2 SRC = src # clang only: -Wglobal-constructors @@ -85,6 +86,22 @@ -include src/*.d +.PHONY: mxebin +mxebin: + $(MAKE) clean + rm -rf arachne-pnr-win32 + rm -f arachne-pnr-win32.zip + mkdir -p arachne-pnr-win32 + $(MAKE) share/arachne-pnr/chipdb-1k.bin share/arachne-pnr/chipdb-8k.bin + mv share/arachne-pnr/chipdb-1k.bin arachne-pnr-win32/ + mv share/arachne-pnr/chipdb-8k.bin arachne-pnr-win32/ + $(MAKE) clean + $(MAKE) CC=/usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-gcc CXX=/usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-g++ bin/arachne-pnr + mv bin/arachne-pnr arachne-pnr-win32/arachne-pnr.exe + zip -r arachne-pnr-win32.zip arachne-pnr-win32/ + rm -rf arachne-pnr-win32 + $(MAKE) clean + .PHONY: install install: all mkdir -p $(DESTDIR)/bin diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/arachne-pnr.cc arachne-pnr-0.1+20160813git52e69ed/src/arachne-pnr.cc --- arachne-pnr-0.1+20151224git1a4fdf9/src/arachne-pnr.cc 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/arachne-pnr.cc 2016-09-18 10:02:29.000000000 +0000 @@ -67,7 +67,11 @@ << "\n" << " -c , --chipdb \n" << " Read chip database from .\n" +#ifdef _WIN32 + << " Default: +/chipdb-.bin\n" +#else << " Default: +/share/arachne-pnr/chipdb-.bin\n" +#endif << "\n" << " --write-binary-chipdb \n" << " Write binary chipdb to .\n" @@ -96,6 +100,10 @@ << " -r\n" << " Randomize seed.\n" << "\n" + << " -m , --max-passes \n" + << " Maximum number of routing passes.\n" + << " Default: 200\n" + << "\n" << " -s , --seed \n" << " Set seed for random generator to .\n" << " Default: 1\n" @@ -136,6 +144,7 @@ *place_blif = nullptr, *output_file = nullptr, *seed_str = nullptr, + *max_passes_str = nullptr, *binary_chipdb = nullptr; for (int i = 1; i < argc; ++i) @@ -243,6 +252,15 @@ ++i; seed_str = argv[i]; } + else if (!strcmp(argv[i], "-m") + || !strcmp(argv[i], "--max-passes")) + { + if (i + 1 >= argc) + fatal(fmt(argv[i] << ": expected argument")); + + ++i; + max_passes_str = argv[i]; + } else if (!strcmp(argv[i], "-o") || !strcmp(argv[i], "--output-file")) { @@ -318,6 +336,28 @@ } else seed = 1; + + int max_passes = 0; + if (max_passes_str) + { + std::string max_passes_s = max_passes_str; + + if (max_passes_s.empty()) + fatal("invalid empty max-passes value"); + + for (char ch : max_passes_s) + { + if (ch >= '0' + && ch <= '9') + max_passes = max_passes * 10 + (unsigned)(ch - '0'); + else + fatal(fmt("invalid character `" + << ch + << "' in unsigned integer literal in max-passes value")); + } + } + else + max_passes = 200; if (randomize_seed) { @@ -338,9 +378,15 @@ if (chipdb_file) chipdb_file_s = chipdb_file; else +#ifdef _WIN32 + chipdb_file_s = (std::string("+/chipdb-") + + device + + ".bin"); +#else chipdb_file_s = (std::string("+/share/arachne-pnr/chipdb-") + device + ".bin"); +#endif *logs << "read_chipdb " << chipdb_file_s << "...\n"; const ChipDB *chipdb = read_chipdb(chipdb_file_s); @@ -349,7 +395,7 @@ *logs << "write_binary_chipdb " << binary_chipdb << "\n"; std::string expanded = expand_filename(binary_chipdb); - std::ofstream ofs(expanded); + std::ofstream ofs(expanded, std::ofstream::out | std::ofstream::binary); if (ofs.fail()) fatal(fmt("write_binary_chidpb: failed to open `" << expanded << "': " << strerror(errno))); @@ -559,7 +605,7 @@ // d->dump(); *logs << "route...\n"; - route(ds); + route(ds, max_passes); #ifndef NDEBUG d->check(); #endif diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/bstream.hh arachne-pnr-0.1+20160813git52e69ed/src/bstream.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/bstream.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/bstream.hh 2016-09-18 10:02:29.000000000 +0000 @@ -1,3 +1,18 @@ +/* Copyright (C) 2015 Cotton Seed + + This file is part of arachne-pnr. Arachne-pnr is free software; + you can redistribute it and/or modify it under the terms of the GNU + General Public License version 2 as published by the Free Software + Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + #ifndef PNR_BSTREAM_HH #define PNR_BSTREAM_HH @@ -134,6 +149,11 @@ return bwrite_unsigned_integral_type(obs, x); } +inline obstream &operator<<(obstream &obs, unsigned long long x) +{ + return bwrite_unsigned_integral_type(obs, x); +} + inline obstream &operator<<(obstream &obs, const std::string &s) { obs << s.size(); @@ -293,6 +313,11 @@ return bread_unsigned_integral_type(ibs, x); } +inline ibstream &operator>>(ibstream &ibs, unsigned long long &x) +{ + return bread_unsigned_integral_type(ibs, x); +} + inline ibstream &operator>>(ibstream &ibs, std::string &s) { size_t n; diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/carry.hh arachne-pnr-0.1+20160813git52e69ed/src/carry.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/carry.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/carry.hh 2016-09-18 10:02:29.000000000 +0000 @@ -18,6 +18,8 @@ #include +class Instance; + class CarryChains { public: diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/chipdb.cc arachne-pnr-0.1+20160813git52e69ed/src/chipdb.cc --- arachne-pnr-0.1+20151224git1a4fdf9/src/chipdb.cc 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/chipdb.cc 2016-09-18 10:02:29.000000000 +0000 @@ -733,6 +733,9 @@ extend(chipdb->cell_mfvs, c, mfvs); return; } + + if (words.size() > 0 && words[0] == "LOCKED") + continue; if (words.size() != 4) fatal("invalid .extra_cell entry"); @@ -985,7 +988,7 @@ read_chipdb(const std::string &filename) { std::string expanded = expand_filename(filename); - std::ifstream ifs(expanded); + std::ifstream ifs(expanded, std::ifstream::in | std::ifstream::binary); if (ifs.fail()) fatal(fmt("read_chipdb: failed to open `" << expanded << "': " << strerror(errno))); diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/chipdb.hh arachne-pnr-0.1+20160813git52e69ed/src/chipdb.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/chipdb.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/chipdb.hh 2016-09-18 10:02:29.000000000 +0000 @@ -17,7 +17,6 @@ #define PNR_CHIPDB_HH #include "location.hh" -#include "util.hh" #include "hashmap.hh" #include "bstream.hh" #include "vector.hh" @@ -127,8 +126,8 @@ {} }; -extern obstream &operator<<(obstream &obs, const Switch &sw); -extern ibstream &operator>>(ibstream &ibs, Switch &sw); +obstream &operator<<(obstream &obs, const Switch &sw); +ibstream &operator>>(ibstream &ibs, Switch &sw); enum class TileType : int { EMPTY, IO, LOGIC, RAMB, RAMT, @@ -138,7 +137,7 @@ LOGIC, IO, GB, RAM, WARMBOOT, PLL, }; -extern std::string cell_type_name(CellType ct); +std::string cell_type_name(CellType ct); inline obstream &operator<<(obstream &obs, TileType t) { @@ -188,7 +187,7 @@ } -extern std::string tile_type_name(TileType t); +std::string tile_type_name(TileType t); class Package { @@ -321,6 +320,6 @@ void bread(ibstream &ibs); }; -extern ChipDB *read_chipdb(const std::string &filename); +ChipDB *read_chipdb(const std::string &filename); #endif diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/configuration.hh arachne-pnr-0.1+20160813git52e69ed/src/configuration.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/configuration.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/configuration.hh 2016-09-18 10:02:29.000000000 +0000 @@ -16,10 +16,9 @@ #ifndef PNR_CONFIGURATION_HH #define PNR_CONFIGURATION_HH -#include "util.hh" +#include "chipdb.hh" #include -class ChipDB; class Design; class Instance; class Net; diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/constant.hh arachne-pnr-0.1+20160813git52e69ed/src/constant.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/constant.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/constant.hh 2016-09-18 10:02:29.000000000 +0000 @@ -19,6 +19,6 @@ class Design; class ChipDB; -extern void realize_constants(const ChipDB *chipdb, Design *d); +void realize_constants(const ChipDB *chipdb, Design *d); #endif diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/designstate.cc arachne-pnr-0.1+20160813git52e69ed/src/designstate.cc --- arachne-pnr-0.1+20151224git1a4fdf9/src/designstate.cc 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/designstate.cc 2016-09-18 10:02:29.000000000 +0000 @@ -1,3 +1,17 @@ +/* Copyright (C) 2015 Cotton Seed + + This file is part of arachne-pnr. Arachne-pnr is free software; + you can redistribute it and/or modify it under the terms of the GNU + General Public License version 2 as published by the Free Software + Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #include "designstate.hh" diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/designstate.hh arachne-pnr-0.1+20160813git52e69ed/src/designstate.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/designstate.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/designstate.hh 2016-09-18 10:02:29.000000000 +0000 @@ -1,3 +1,20 @@ +/* Copyright (C) 2015 Cotton Seed + + This file is part of arachne-pnr. Arachne-pnr is free software; + you can redistribute it and/or modify it under the terms of the GNU + General Public License version 2 as published by the Free Software + Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef PNR_DESIGNSTATE_HH +#define PNR_DESIGNSTATE_HH #include "netlist.hh" #include "chipdb.hh" @@ -27,3 +44,5 @@ bool is_dual_pll(Instance *inst) const; std::vector pll_out_io_cells(Instance *inst, int cell) const; }; + +#endif diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/global.cc arachne-pnr-0.1+20160813git52e69ed/src/global.cc --- arachne-pnr-0.1+20151224git1a4fdf9/src/global.cc 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/global.cc 2016-09-18 10:02:29.000000000 +0000 @@ -176,8 +176,6 @@ const auto &p2 = chipdb->cell_mfvs.at(cell).at(p_name); int pass_cell = chipdb->loc_cell(Location(p2.first, 0)); - *logs << "pass_cell = " << pass_cell << "\n"; - extend(ds.placement, pass_inst, pass_cell); } diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/global.hh arachne-pnr-0.1+20160813git52e69ed/src/global.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/global.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/global.hh 2016-09-18 10:02:29.000000000 +0000 @@ -18,8 +18,6 @@ class DesignState; -#include "util.hh" - static const uint8_t gc_clk = 0xff; static const uint8_t gc_cen = 0xaa; // 1357 static const uint8_t gc_rclke = 0x8a; // 137, 5 missing @@ -29,7 +27,7 @@ static const uint8_t gc_wclke = gc_cen; static const uint8_t gc_we = gc_sr; -extern const char *global_class_name(uint8_t gc); +const char *global_class_name(uint8_t gc); extern std::vector global_classes; diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/hashmap.hh arachne-pnr-0.1+20160813git52e69ed/src/hashmap.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/hashmap.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/hashmap.hh 2016-09-18 10:02:29.000000000 +0000 @@ -1,3 +1,17 @@ +/* Copyright (C) 2015 Cotton Seed + + This file is part of arachne-pnr. Arachne-pnr is free software; + you can redistribute it and/or modify it under the terms of the GNU + General Public License version 2 as published by the Free Software + Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifndef PNR_HASHMAP_HH #define PNR_HASHMAP_HH diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/hashset.hh arachne-pnr-0.1+20160813git52e69ed/src/hashset.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/hashset.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/hashset.hh 2016-09-18 10:02:29.000000000 +0000 @@ -1,3 +1,18 @@ +/* Copyright (C) 2015 Cotton Seed + + This file is part of arachne-pnr. Arachne-pnr is free software; + you can redistribute it and/or modify it under the terms of the GNU + General Public License version 2 as published by the Free Software + Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + #ifndef PNR_HASHSET_HH #define PNR_HASHSET_HH diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/io.hh arachne-pnr-0.1+20160813git52e69ed/src/io.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/io.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/io.hh 2016-09-18 10:02:29.000000000 +0000 @@ -18,6 +18,6 @@ class Design; -extern void instantiate_io(Design *d); +void instantiate_io(Design *d); #endif diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/location.hh arachne-pnr-0.1+20160813git52e69ed/src/location.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/location.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/location.hh 2016-09-18 10:02:29.000000000 +0000 @@ -16,7 +16,6 @@ #ifndef PNR_LOCATION_HH #define PNR_LOCATION_HH -#include "util.hh" #include "bstream.hh" #include diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/netlist.hh arachne-pnr-0.1+20160813git52e69ed/src/netlist.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/netlist.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/netlist.hh 2016-09-18 10:02:29.000000000 +0000 @@ -16,7 +16,6 @@ #ifndef PNR_NETLIST_HH #define PNR_NETLIST_HH -#include "util.hh" #include "bitvector.hh" #include "line_parser.hh" #include "vector.hh" @@ -83,7 +82,7 @@ IN, OUT, INOUT, }; -extern Direction opposite_direction(Direction d); +Direction opposite_direction(Direction d); enum class Value { diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/pack.cc arachne-pnr-0.1+20160813git52e69ed/src/pack.cc --- arachne-pnr-0.1+20151224git1a4fdf9/src/pack.cc 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/pack.cc 2016-09-18 10:02:29.000000000 +0000 @@ -334,7 +334,9 @@ { Port *ci = c->find_port("CI"); Net *ci_conn = ci->connection(); - + + /* FIXME if two connections (CO -> CI), could return a LUT that + matches I1/I2 */ if (!ci_conn || ci_conn->is_constant() || ci_conn->connections().size() != 3) @@ -494,23 +496,41 @@ } } + c->remove(); + delete c; + if (!next_c && out_conn) { assert(chain.size() < max_chain_length); - Instance *lc2_inst = top->add_instance(models.lc); - Port *p = chain.back()->find_port("COUT"); assert(p && p->connection() == out_conn); - carry_pass_through_lc(lc2_inst, p); + + Instance *lc2_inst = nullptr; + + // COUT might drive a LC I3 + if (out_conn->connections().size() == 2) + { + Port *consumer = p->connection_other_port(); + if (consumer->name() == "I3" + && isa(consumer->node())) + { + Instance *inst = cast(consumer->node()); + if (models.is_lc(inst)) + lc2_inst = inst; + } + } + + if (!lc2_inst) + { + lc2_inst = top->add_instance(models.lc); + carry_pass_through_lc(lc2_inst, p); + } chain.push_back(lc2_inst); } - c->remove(); - delete c; - c = next_c; } diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/pack.hh arachne-pnr-0.1+20160813git52e69ed/src/pack.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/pack.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/pack.hh 2016-09-18 10:02:29.000000000 +0000 @@ -18,6 +18,6 @@ class DesignState; -extern void pack(DesignState &ds); +void pack(DesignState &ds); #endif diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/pcf.cc arachne-pnr-0.1+20160813git52e69ed/src/pcf.cc --- arachne-pnr-0.1+20151224git1a4fdf9/src/pcf.cc 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/pcf.cc 2016-09-18 10:02:29.000000000 +0000 @@ -219,14 +219,31 @@ Instance *inst_other = cell_gate[cell_other]; if (inst_other) { + int x = chipdb->tile_x(t), + y = chipdb->tile_y(t); + if (inst->get_param("NEG_TRIGGER").get_bit(0) != inst_other->get_param("NEG_TRIGGER").get_bit(0)) - { - int x = chipdb->tile_x(t), - y = chipdb->tile_y(t); - fatal(fmt("pcf error: incompatible NEG_TRIGGER parameters in PIO at (" - << x << ", " << y << ")")); - } + fatal(fmt("pcf error: incompatible NEG_TRIGGER parameters in PIO at (" + << x << ", " << y << ")")); + + Net *cen = inst->find_port("CLOCK_ENABLE")->connection(), + *cen_other = inst_other->find_port("CLOCK_ENABLE")->connection(); + if (cen && cen_other && cen != cen_other) + fatal(fmt("pcf error: multiple CLOCK_ENABLE drivers in PIO at (" + << x << ", " << y << ")")); + + Net *inclk = inst->find_port("INPUT_CLK")->connection(), + *inclk_other = inst_other->find_port("INPUT_CLK")->connection(); + if (inclk && inclk_other && inclk != inclk_other) + fatal(fmt("pcf error: multiple INPUT_CLK drivers in PIO at (" + << x << ", " << y << ")")); + + Net *outclk = inst->find_port("OUTPUT_CLK")->connection(), + *outclk_other = inst_other->find_port("OUTPUT_CLK")->connection(); + if (outclk && outclk_other && outclk != outclk_other) + fatal(fmt("pcf error: multiple OUTPUT_CLK drivers in PIO at (" + << x << ", " << y << ")")); } } diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/pcf.hh arachne-pnr-0.1+20160813git52e69ed/src/pcf.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/pcf.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/pcf.hh 2016-09-18 10:02:29.000000000 +0000 @@ -19,7 +19,6 @@ #include #include -class Design; class DesignState; class Constraints diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/place.cc arachne-pnr-0.1+20160813git52e69ed/src/place.cc --- arachne-pnr-0.1+20151224git1a4fdf9/src/place.cc 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/place.cc 2016-09-18 10:02:29.000000000 +0000 @@ -384,10 +384,12 @@ bool Placer::inst_drives_global(Instance *inst, int c, int glb) { +#ifndef NDEBUG Location loc = chipdb->cell_location[c]; int t = loc.tile(); int x = chipdb->tile_x(t), y = chipdb->tile_y(t); +#endif if (models.is_gb_io(inst) && inst->find_port("GLOBAL_BUFFER_OUTPUT")->connected()) { @@ -585,6 +587,21 @@ if (inst0->get_param("NEG_TRIGGER").get_bit(0) != inst1->get_param("NEG_TRIGGER").get_bit(0)) return false; + + Net *cen0 = inst0->find_port("CLOCK_ENABLE")->connection(), + *cen1 = inst1->find_port("CLOCK_ENABLE")->connection(); + if (cen0 && cen1 && cen0 != cen1) + return false; + + Net *inclk0 = inst0->find_port("INPUT_CLK")->connection(), + *inclk1 = inst1->find_port("INPUT_CLK")->connection(); + if (inclk0 && inclk1 && inclk0 != inclk1) + return false; + + Net *outclk0 = inst0->find_port("OUTPUT_CLK")->connection(), + *outclk1 = inst1->find_port("OUTPUT_CLK")->connection(); + if (outclk0 && outclk1 && outclk0 != outclk1) + return false; } Location loc2(t, 2); @@ -1234,9 +1251,6 @@ Instance *inst = gates[g]; int cell = gate_cell[g]; - if (g == 5) - *logs << "cell = " << cell << "\n"; - const Location &loc = chipdb->cell_location[cell]; if (models.is_warmboot(inst)) { @@ -1404,6 +1418,9 @@ } } assert(found); + + // avoid "variable ‘found’ set but not used" in NDEBUG builds + if (found) { } const CBit &cbit_pt0 = func_cbits.at(fmt("IOB_" << io_loc.pos() << ".PINTYPE_0"))[0], &cbit_pt1 = func_cbits.at(fmt("IOB_" << io_loc.pos() << ".PINTYPE_1"))[0]; @@ -1618,7 +1635,7 @@ // set IoCtrl configuration bits { const auto &func_cbits = chipdb->tile_nonrouting_cbits.at(TileType::IO); - const CBit &lvds = func_cbits.at("IoCtrl.LVDS")[0]; + const CBit &lvds_cbit = func_cbits.at("IoCtrl.LVDS")[0]; std::map loc_pll; int pll_idx = cell_type_idx(CellType::PLL); @@ -1633,11 +1650,37 @@ extend(loc_pll, b_loc, cell); } + std::set ieren_partner_image; + for (const auto &p : package.pin_loc) + { + bool is_lvds = false; + const Location &loc = p.second; + int pll_cell = lookup_or_default(loc_pll, loc, 0); + + if (!pll_cell) + { + int cell = chipdb->loc_cell(loc); + int g = cell_gate[cell]; + if (g) + { + Instance *inst = gates[g]; + is_lvds = inst->get_param("IO_STANDARD").as_string() == "SB_LVDS_INPUT"; + } + } + + if (is_lvds) + { + Location partner_loc(loc.tile(), !loc.pos()); + extend(ieren_partner_image, partner_loc); + } + } + for (const auto &p : package.pin_loc) { // unused io bool enable_input = false; bool pullup = true; // default pullup + bool is_lvds = false; const Location &loc = p.second; int pll_cell = lookup_or_default(loc_pll, loc, 0); @@ -1661,15 +1704,29 @@ && inst->find_port("GLOBAL_BUFFER_OUTPUT")->connected())) enable_input = true; pullup = inst->get_param("PULLUP").get_bit(0); - conf.set_cbit(CBit(loc.tile(), - lvds.row, - lvds.col), - inst->get_param("IO_STANDARD").as_string() == "SB_LVDS_INPUT"); + is_lvds = inst->get_param("IO_STANDARD").as_string() == "SB_LVDS_INPUT"; + conf.set_cbit(CBit(loc.tile(), lvds_cbit.row, lvds_cbit.col), is_lvds); } } + + if (contains(ieren_partner_image, loc)) + continue; + if (is_lvds) + { + enable_input = false; + pullup = false; + } + const Location &ieren_loc = chipdb->ieren.at(loc); configure_io(ieren_loc, enable_input, pullup); + + if (is_lvds) + { + Location partner_loc(loc.tile(), !loc.pos()); + const Location &partner_ieren_loc = chipdb->ieren.at(partner_loc); + configure_io(partner_ieren_loc, enable_input, pullup); + } } std::set ieren_image; @@ -1725,11 +1782,15 @@ *logs << " initial wire length = " << wire_length() << "\n"; int n_no_progress = 0; + double avg_wire_length = wire_length(); - for (;;) + for (int iter=1;; iter++) { n_move = n_accept = 0; improved = false; + + if (iter % 50 == 0) + *logs << " at iteration #" << iter << ": temp = " << temp << ", wire length = " << wire_length() << "\n"; for (int m = 0; m < 15; ++m) { @@ -1784,28 +1845,37 @@ int M = std::max(chipdb->width, chipdb->height); - + double upper = 0.6, lower = 0.4; - if (Raccept >= 0.8) - temp *= 0.5; - else if (Raccept > upper) - { - if (diameter < M) - ++diameter; - else - temp *= 0.9; - } - else if (Raccept > lower) - temp *= 0.95; + if (wire_length() < 0.95 * avg_wire_length) + avg_wire_length = 0.8*avg_wire_length + 0.2*wire_length(); else { - // Raccept < 0.3 - if (diameter > 1) - --diameter; + if (Raccept >= 0.8) + { + temp *= 0.7; + } + else if (Raccept > upper) + { + if (diameter < M) + ++diameter; + else + temp *= 0.9; + } + else if (Raccept > lower) + { + temp *= 0.95; + } else - temp *= 0.8; + { + // Raccept < 0.3 + if (diameter > 1) + --diameter; + else + temp *= 0.8; + } } } diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/place.hh arachne-pnr-0.1+20160813git52e69ed/src/place.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/place.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/place.hh 2016-09-18 10:02:29.000000000 +0000 @@ -16,19 +16,9 @@ #ifndef PNR_PLACE_HH #define PNR_PLACE_HH -#include "util.hh" -#include - -class Design; -class Instance; -class Configuration; -class ChipDB; -class Package; -class Constraints; -class CarryChains; -class IdLess; +class random_generator; class DesignState; -extern void place(random_generator &rg, DesignState &ds); +void place(random_generator &rg, DesignState &ds); #endif diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/priorityq.hh arachne-pnr-0.1+20160813git52e69ed/src/priorityq.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/priorityq.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/priorityq.hh 2016-09-18 10:02:29.000000000 +0000 @@ -1,3 +1,20 @@ +/* Copyright (C) 2015 Cotton Seed + + This file is part of arachne-pnr. Arachne-pnr is free software; + you can redistribute it and/or modify it under the terms of the GNU + General Public License version 2 as published by the Free Software + Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef PNR_PRIORITYQQ_HH +#define PNR_PRIORITYQQ_HH #include #include @@ -41,3 +58,5 @@ return v[0]; } }; + +#endif diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/route.cc arachne-pnr-0.1+20160813git52e69ed/src/route.cc --- arachne-pnr-0.1+20151224git1a4fdf9/src/route.cc 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/route.cc 2016-09-18 10:02:29.000000000 +0000 @@ -78,7 +78,7 @@ std::vector> net_targets; std::vector net_net; - static const int max_passes = 50; + int max_passes; int passes; int n_shared; @@ -112,7 +112,7 @@ #endif public: - Router(DesignState &ds); + Router(DesignState &ds, int max_passes_v); void route(); }; @@ -279,7 +279,7 @@ } #endif -Router::Router(DesignState &ds) +Router::Router(DesignState &ds, int max_passes_v) : chipdb(ds.chipdb), d(ds.d), models(ds.models), @@ -295,6 +295,7 @@ cnet_ymin(chipdb->n_nets), cnet_ymax(chipdb->n_nets), n_nets(0), + max_passes(max_passes_v), n_shared(0), demand(chipdb->n_nets, 0), historical_demand(chipdb->n_nets, 0), @@ -765,6 +766,33 @@ } #if 0 + if (n_shared < 5) + { + std::map> net_route_reverse; + + for (int i = 0; i < n_nets; ++i) + for (const auto &p : net_route[i]) + if (demand[p.second] > 1) + net_route_reverse[p.second].insert(i); + + for (int i = 0; i < chipdb->n_nets; ++i) + if (demand[i] > 1) + { + if (chipdb->net_tile_name.empty()) + *logs << " shared net #" << i << " (demand = " << demand[i] << ").\n"; + else + { + auto &net_tile_name = chipdb->net_tile_name.at(i); + int tile_x = chipdb->tile_x(net_tile_name.first), tile_y = chipdb->tile_y(net_tile_name.first); + *logs << " shared net #" << i << " (demand = " << demand[i] << ") in tile " << tile_x << "," << tile_y << ": " << net_tile_name.second << "\n"; + } + for (auto j : net_route_reverse.at(i)) + *logs << " used by wire " << net_net[j]->name() << "\n"; + } + } +#endif + +#if 0 for (int i = 0; i < n_nets; ++i) { for (const auto &p : net_route[i]) @@ -872,9 +900,9 @@ } void -route(DesignState &ds) +route(DesignState &ds, int max_passes) { - Router router(ds); + Router router(ds, max_passes); clock_t start = clock(); router.route(); diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/route.hh arachne-pnr-0.1+20160813git52e69ed/src/route.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/route.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/route.hh 2016-09-18 10:02:29.000000000 +0000 @@ -16,16 +16,8 @@ #ifndef PNR_ROUTE_HH #define PNR_ROUTE_HH -#include "location.hh" -#include "util.hh" +class DesignState; -#include - -class Design; -class Instance; -class ChipDB; -class Configuration; - -extern void route(DesignState &ds); +void route(DesignState &ds, int max_passes); #endif diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/ullmanset.hh arachne-pnr-0.1+20160813git52e69ed/src/ullmanset.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/ullmanset.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/ullmanset.hh 2016-09-18 10:02:29.000000000 +0000 @@ -13,6 +13,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#ifndef PNR_ULLMANSET_HH +#define PNR_ULLMANSET_HH + #include "vector.hh" #include @@ -94,3 +97,5 @@ using UllmanSet = BasedUllmanSet<0>; using UllmanSet1 = BasedUllmanSet<1>; + +#endif diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/util.cc arachne-pnr-0.1+20160813git52e69ed/src/util.cc --- arachne-pnr-0.1+20151224git1a4fdf9/src/util.cc 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/util.cc 2016-09-18 10:02:29.000000000 +0000 @@ -13,6 +13,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#if !defined(_WIN32) && !defined (_GNU_SOURCE) +#define _GNU_SOURCE +#endif + #include "util.hh" #include @@ -112,7 +116,7 @@ } /* taken from Yosys, yosys/kernel/yosys.cc */ -#if defined(__linux__) +#if defined(__linux__) || defined(__CYGWIN__) std::string proc_self_dirname() { char path[PATH_MAX]; @@ -167,10 +171,16 @@ expand_filename(const std::string &file) { if (file[0] == '+') +#ifdef _WIN32 + return (proc_self_dirname() + + std::string(file.begin() + 2, + file.end())); +#else return (proc_self_dirname() + ".." + std::string(file.begin() + 1, file.end())); +#endif else return file; } diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/util.hh arachne-pnr-0.1+20160813git52e69ed/src/util.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/util.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/util.hh 2016-09-18 10:02:29.000000000 +0000 @@ -151,8 +151,8 @@ #define fmt(x) (static_cast(std::ostringstream() << x).str()) -extern void fatal(const std::string &msg); -extern void warning(const std::string &msg); +void fatal(const std::string &msg); +void warning(const std::string &msg); template void extend(S &s, const T &x) @@ -190,7 +190,7 @@ return std::move(keys); } -extern std::string unescape(const std::string &s); +std::string unescape(const std::string &s); template inline const V & lookup(const std::map &M, const K &key) @@ -246,7 +246,7 @@ return r.first == suffix.rend(); } -extern std::string proc_self_dirname(); +std::string proc_self_dirname(); inline char hexdigit(int i, char a = 'a') @@ -295,7 +295,7 @@ } -extern std::string expand_filename(const std::string &file); +std::string expand_filename(const std::string &file); template void pop(std::vector &v, int i) diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/src/vector.hh arachne-pnr-0.1+20160813git52e69ed/src/vector.hh --- arachne-pnr-0.1+20151224git1a4fdf9/src/vector.hh 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/src/vector.hh 2016-09-18 10:02:29.000000000 +0000 @@ -1,3 +1,17 @@ +/* Copyright (C) 2015 Cotton Seed + + This file is part of arachne-pnr. Arachne-pnr is free software; + you can redistribute it and/or modify it under the terms of the GNU + General Public License version 2 as published by the Free Software + Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #ifndef PNR_BASEDVECTOR_HH #define PNR_BASEDVECTOR_HH diff -Nru arachne-pnr-0.1+20151224git1a4fdf9/.travis.yml arachne-pnr-0.1+20160813git52e69ed/.travis.yml --- arachne-pnr-0.1+20151224git1a4fdf9/.travis.yml 2015-12-25 04:02:23.000000000 +0000 +++ arachne-pnr-0.1+20160813git52e69ed/.travis.yml 2016-09-18 10:02:29.000000000 +0000 @@ -39,7 +39,7 @@ - (cd iverilog && autoconf && ./configure --prefix=$HOME/extras && make && make install) - export PATH=$PATH:$HOME/extras/bin - git clone https://github.com/cliffordwolf/icestorm.git - - (cd icestorm && make && make DESTDIR=$HOME/extras install) + - (cd icestorm && make && make PREFIX=$HOME/extras install) - git clone https://github.com/cliffordwolf/yosys.git - (cd yosys && make && make test && make PREFIX=$HOME/extras install) compiler: