diff --git a/.gitignore b/.gitignore index df2433f..d8df4bd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ draw_svg_tiles draw_svg_tiles.o helper.o model.o +new_floorplan +new_floorplan.o diff --git a/Makefile b/Makefile index d78dc15..54e4d74 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ CFLAGS = -Wall -g LDLIBS = -lxml2 -all: bit2txt draw_svg_tiles xc6slx9.svg +all: bit2txt draw_svg_tiles new_floorplan xc6slx9.svg xc6slx9.svg: draw_svg_tiles ./draw_svg_tiles | xmllint --pretty 1 - > $@ @@ -25,7 +25,10 @@ model.o: model.c model.h draw_svg_tiles: draw_svg_tiles.o model.o +new_floorplan: new_floorplan.o model.o + clean: rm -f bit2txt bit2txt.o \ draw_svg_tiles draw_svg_tiles.o \ + new_floorplan new_floorplan.o \ helper.o model.o diff --git a/draw_svg_tiles.c b/draw_svg_tiles.c index 61fd723..379fecd 100644 --- a/draw_svg_tiles.c +++ b/draw_svg_tiles.c @@ -19,8 +19,6 @@ #include "model.h" -void print_svg_tiles(struct fpga_model* model); - int main(int argc, char** argv) { static const xmlChar* empty_svg = (const xmlChar*) diff --git a/new_floorplan.c b/new_floorplan.c new file mode 100644 index 0000000..118d1a6 --- /dev/null +++ b/new_floorplan.c @@ -0,0 +1,37 @@ +// +// Author: Wolfgang Spraul +// +// This is free and unencumbered software released into the public domain. +// For details see the UNLICENSE file at the root of the source tree. +// + +#include +#include +#include +#include +#include +#include + +#include "model.h" + +int main(int argc, char** argv) +{ + struct fpga_model* model = 0; + int x, y; + + model = fpga_build_model(XC6SLX9_ROWS, XC6SLX9_COLUMNS, + XC6SLX9_LEFT_WIRING, XC6SLX9_RIGHT_WIRING); + if (!model) goto fail; + + printf("fpga_floorplan_format 1\n"); + for (y = 0; y < model->tile_y_range; y++) { + for (x = 0; x < model->tile_x_range; x++) { + printf("x%i y%i %s\n", x, y, + fpga_tiletype_str(model->tiles[y*model->tile_x_range + x].type)); + } + } + return EXIT_SUCCESS; + +fail: + return EXIT_FAILURE; +}