aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.mk16
-rw-r--r--icebox/icebox.py7
-rw-r--r--icepack/icepack.cc14
3 files changed, 33 insertions, 4 deletions
diff --git a/config.mk b/config.mk
index 364f8bc..d6daca6 100644
--- a/config.mk
+++ b/config.mk
@@ -1,11 +1,19 @@
+PREFIX ?= /usr/local
+
CXX ?= clang++
CC ?= clang
-LDLIBS = -lm -lstdc++
-CFLAGS += -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include
-CXXFLAGS += -MD -O0 -ggdb -Wall -std=c++11 -I/usr/local/include
PKG_CONFIG ?= pkg-config
+
+C_STD ?= c99
+CXX_STD ?= c++11
+OPT_LEVEL ?= 0
+WARN_LEVEL ?= all
+
+LDLIBS = -lm -lstdc++
+CFLAGS += -MD -O$(OPT_LEVEL) -ggdb -W$(WARN_LEVEL) -std=$(C_STD) -I$(PREFIX)/include
+CXXFLAGS += -MD -O$(OPT_LEVEL) -ggdb -W$(WARN_LEVEL) -std=$(CXX_STD) -I$(PREFIX)/include
+
DESTDIR ?=
-PREFIX ?= /usr/local
CHIPDB_SUBDIR ?= icebox
ifeq ($(MXE),1)
diff --git a/icebox/icebox.py b/icebox/icebox.py
index 982d088..41e8f12 100644
--- a/icebox/icebox.py
+++ b/icebox/icebox.py
@@ -26,6 +26,7 @@ class iceconfig:
self.max_x = 0
self.max_y = 0
self.device = ""
+ self.warmboot = True
self.logic_tiles = dict()
self.io_tiles = dict()
self.ramb_tiles = dict()
@@ -668,6 +669,10 @@ class iceconfig:
assert line[1] in ["1k", "5k", "8k", "384"]
self.device = line[1]
continue
+ if line[0] == ".warmboot":
+ assert line[1] in ["disabled", "enabled"]
+ self.warmboot = line[1] == "enabled"
+ continue
if line[0] == ".sym":
self.symbols.setdefault(int(line[1]), set()).add(line[2])
continue
@@ -680,6 +685,8 @@ class iceconfig:
def write_file(self, filename):
with open(filename, "w") as f:
print(".device %s" % self.device, file=f)
+ if not self.warmboot:
+ print(".warmboot disabled", file=f)
for y in range(self.max_y+1):
for x in range(self.max_x+1):
if self.tile_pos(x, y) is not None:
diff --git a/icepack/icepack.cc b/icepack/icepack.cc
index 4374452..2eac9c6 100644
--- a/icepack/icepack.cc
+++ b/icepack/icepack.cc
@@ -649,6 +649,18 @@ void FpgaConfig::read_ascii(std::istream &ifs)
continue;
}
+ if (command == ".warmboot")
+ {
+ is >> this->warmboot;
+
+ if (this->warmboot != "disabled" &&
+ this->warmboot != "enabled")
+ error("Unknown warmboot setting '%s'.\n",
+ this->warmboot.c_str());
+
+ continue;
+ }
+
if (command == ".io_tile" || command == ".logic_tile" || command == ".ramb_tile" || command == ".ramt_tile")
{
if (!got_device)
@@ -764,6 +776,8 @@ void FpgaConfig::write_ascii(std::ostream &ofs) const
}
ofs << stringf("\n.device %s\n", this->device.c_str());
+ if (this->warmboot != "enabled")
+ ofs << stringf(".warmboot %s\n", this->warmboot.c_str());
typedef std::tuple<int, int, int> tile_bit_t;
std::set<tile_bit_t> tile_bits;