summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rwxr-xr-xpin2qsf.pl12
2 files changed, 18 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 3e00c5c..52ff829 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,13 @@
-FILES := $(patsubst %.pins,%.csf,$(wildcard *.pins))
+FILES := $(patsubst %.pins,%.csf,$(wildcard *.pins)) \
+ $(patsubst %.pins,%.qsf,$(wildcard *.pins))
all : $(FILES)
%.csf: %.pins pin2csf.pl
perl pin2csf.pl < $< > $@ || rm -f $@
+%.qsf: %.pins pin2qsf.pl
+ perl pin2qsf.pl < $< > $@ || rm -f $@
+
clean:
- rm -f *.csf
+ rm -f *.csf *.qsf
diff --git a/pin2qsf.pl b/pin2qsf.pl
new file mode 100755
index 0000000..7ffbc4c
--- /dev/null
+++ b/pin2qsf.pl
@@ -0,0 +1,12 @@
+#!/usr/bin/perl
+
+while ( defined($line = <STDIN>) ) {
+ chomp $line;
+ $line =~ s/^\#.*$//; # Remove comments
+
+ if ( $line =~ /^\s*(\S+)\s+(\S+)/ ) {
+ $pin = $1;
+ $signal = $2;
+ print "set_location_assignment PIN_\U${pin}\E -to \Q${signal}\E\n";
+ }
+}