added new stub util new_floorplan
This commit is contained in:
parent
d1e8d5f557
commit
40cb5e88a0
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,3 +4,5 @@ draw_svg_tiles
|
|||
draw_svg_tiles.o
|
||||
helper.o
|
||||
model.o
|
||||
new_floorplan
|
||||
new_floorplan.o
|
||||
|
|
5
Makefile
5
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
|
||||
|
|
|
@ -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*)
|
||||
|
|
37
new_floorplan.c
Normal file
37
new_floorplan.c
Normal file
|
@ -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 <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user