summaryrefslogtreecommitdiffstats
path: root/fpga/xilinx/programmer/bit2svf/bitinfo-0.3/bitinfo.c
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-01 21:07:55 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-01 21:07:55 -0500
commitd1b70f80180fe4b5ac6078e2be9678fc36d74c5c (patch)
tree2e46de7a644f89e36842247af6826ff00a0d3fa4 /fpga/xilinx/programmer/bit2svf/bitinfo-0.3/bitinfo.c
parentae161b4a6a978922747cf09e8c04479340825852 (diff)
downloadulab-d1b70f80180fe4b5ac6078e2be9678fc36d74c5c.tar.gz
ulab-d1b70f80180fe4b5ac6078e2be9678fc36d74c5c.zip
Add initial files for direct FPGA programming
Diffstat (limited to 'fpga/xilinx/programmer/bit2svf/bitinfo-0.3/bitinfo.c')
-rw-r--r--fpga/xilinx/programmer/bit2svf/bitinfo-0.3/bitinfo.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/fpga/xilinx/programmer/bit2svf/bitinfo-0.3/bitinfo.c b/fpga/xilinx/programmer/bit2svf/bitinfo-0.3/bitinfo.c
new file mode 100644
index 0000000..1fc1c84
--- /dev/null
+++ b/fpga/xilinx/programmer/bit2svf/bitinfo-0.3/bitinfo.c
@@ -0,0 +1,57 @@
+/* bitinfo.c
+ *
+ * Main function to parse Xilinx bit file header, version 0.2.
+ *
+ * Copyright 2001, 2002 by David Sullins
+ *
+ * This file is part of Bitinfo.
+ *
+ * Bitinfo is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation, version 2 of the License.
+ *
+ * Bitinfo 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
+ * Bitinfo; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * You may contact the author at djs@naspa.net.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "bitfile.h"
+
+/* read a bit file from stdin */
+int main(void)
+{
+ int t;
+ struct bithead bh;
+
+ initbh(&bh);
+
+ /* read header */
+ t = readhead(&bh, stdin);
+ if (t)
+ {
+ printf("Invalid bit file header.\n");
+ exit(1);
+ }
+
+ /* output header info */
+ printf("\n");
+ printf("Bit file created on %s at %s.\n", bh.date, bh.time);
+ printf("Created from file %s for Xilinx part %s.\n", bh.filename,
+ bh.part);
+ printf("Bitstream length is %d bytes.\n", bh.length);
+ printf("\n");
+
+ freebh(&bh);
+
+ return 0;
+}