From 5cea17ea883f90a59cca4bb929424e5bfc3bf915 Mon Sep 17 00:00:00 2001 From: Roland Lutz Date: Sun, 27 Aug 2017 21:57:44 +0200 Subject: icebox: Make `check' a phony target --- icebox/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'icebox') diff --git a/icebox/Makefile b/icebox/Makefile index 778e2ce..a6bd23b 100644 --- a/icebox/Makefile +++ b/icebox/Makefile @@ -64,4 +64,4 @@ uninstall: rm -f $(DESTDIR)$(PREFIX)/share/icebox/chipdb-8k.txt -rmdir $(DESTDIR)$(PREFIX)/share/icebox -.PHONY: all clean install uninstall +.PHONY: all check clean install uninstall -- cgit v1.2.3 From 7e4689d3f50b0a8322ec74879202377ef1159d57 Mon Sep 17 00:00:00 2001 From: Roland Lutz Date: Sun, 27 Aug 2017 22:14:38 +0200 Subject: icebox: Give useful error messages for .hlc parsing errors --- icebox/icebox_hlc2asc.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'icebox') diff --git a/icebox/icebox_hlc2asc.py b/icebox/icebox_hlc2asc.py index 54d6722..71211e0 100755 --- a/icebox/icebox_hlc2asc.py +++ b/icebox/icebox_hlc2asc.py @@ -971,20 +971,26 @@ class IOBlock: def main1(path): f = open(path, 'r') stack = [Main()] - for line in f: + for i, line in enumerate(f): fields = line.split('#')[0].split() - if not fields: - pass # empty line - elif fields == ['}']: - stack.pop() - if not stack: - raise ParseError - elif fields[-1] == '{': - stack.append(stack[-1].new_block(fields[:-1])) - else: - stack[-1].read(fields) + try: + if not fields: + pass # empty line + elif fields == ['}']: + stack.pop() + if not stack: + raise ParseError + elif fields[-1] == '{': + stack.append(stack[-1].new_block(fields[:-1])) + else: + stack[-1].read(fields) + except ParseError: + sys.stderr.write("Parse error in line %d:\n" % (i + 1)) + sys.stderr.write(line) + sys.exit(1) if len(stack) != 1: - raise ParseError + sys.stderr.write("Parse error: unexpected end of file") + sys.exit(1) f.close() stack[0].writeout() -- cgit v1.2.3 From 5ac8f1a6876c061a9169c19e297ce391c89f70d5 Mon Sep 17 00:00:00 2001 From: Roland Lutz Date: Sun, 27 Aug 2017 22:20:42 +0200 Subject: icebox: Fix parsing of PLL directive --- icebox/icebox_hlc2asc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'icebox') diff --git a/icebox/icebox_hlc2asc.py b/icebox/icebox_hlc2asc.py index 71211e0..e200a0d 100755 --- a/icebox/icebox_hlc2asc.py +++ b/icebox/icebox_hlc2asc.py @@ -879,7 +879,10 @@ class IOTile(Tile): self.blocks = [None, None] def read(self, fields): - super().read(fields) + if len(fields) == 2 and fields[0] == 'PLL': + self.apply_directive(*fields) # TODO + else: + super().read(fields) def new_block(self, fields): if fields == ['io_0'] and self.blocks[0] is None: -- cgit v1.2.3 From bb2bc7a00cc7117b5e84bf2004cd092c021695f3 Mon Sep 17 00:00:00 2001 From: Roland Lutz Date: Sun, 27 Aug 2017 22:25:50 +0200 Subject: icebox: Fix parsing of IO block special wires --- icebox/icebox_hlc2asc.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'icebox') diff --git a/icebox/icebox_hlc2asc.py b/icebox/icebox_hlc2asc.py index e200a0d..f0c1c63 100755 --- a/icebox/icebox_hlc2asc.py +++ b/icebox/icebox_hlc2asc.py @@ -955,13 +955,13 @@ class IOBlock: prefix = 'io_%d/' % self.index if fields[0] in ('D_IN_0', 'D_IN_1'): self.tile.read([prefix + fields[0]] + fields[1:]) - elif fields[-1] in ('CLOCK_ENABLE', + elif fields[-1] in ('cen', 'D_OUT_0', 'D_OUT_1', - 'INPUT_CLK', - 'LATCH_INPUT_VALUE', - 'OUTPUT_CLK', - 'OUTPUT_ENABLE'): + 'inclk', + #'LATCH_INPUT_VALUE', + 'outclk', + 'OUT_ENB'): self.tile.read(fields[:-1] + [prefix + fields[-1]]) else: raise ParseError -- cgit v1.2.3