diff --git a/.gitignore b/.gitignore index c5b22dc..16aeaf3 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,8 @@ floorplan.o control.o autotest autotest.o -bits.o +bit_regs.o +bit_frames.o fp2bit fp2bit.o bit2fp diff --git a/Makefile b/Makefile index f7d9b91..4eeff4f 100644 --- a/Makefile +++ b/Makefile @@ -28,17 +28,19 @@ new_fp: new_fp.o $(MODEL_OBJ) floorplan.o helper.o control.o new_fp.o: new_fp.c floorplan.h model.h helper.h control.h -fp2bit: fp2bit.o $(MODEL_OBJ) floorplan.o control.o bits.o helper.o +fp2bit: fp2bit.o $(MODEL_OBJ) floorplan.o control.o bit_regs.o bit_frames.o helper.o -fp2bit.o: fp2bit.c model.h floorplan.h bits.h helper.h +fp2bit.o: fp2bit.c model.h floorplan.h bit.h helper.h -bit2fp: bit2fp.o $(MODEL_OBJ) floorplan.o control.o bits.o helper.o +bit2fp: bit2fp.o $(MODEL_OBJ) floorplan.o control.o bit_regs.o bit_frames.o helper.o -bit2fp.o: bit2fp.c model.h floorplan.h bits.h helper.h +bit2fp.o: bit2fp.c model.h floorplan.h bit.h helper.h floorplan.o: floorplan.c floorplan.h model.h control.h -bits.o: bits.c bits.h model.h +bit_regs.o: bit_regs.c bit.h model.h + +bit_frames.o: bit_frames.c bit.h model.h control.o: control.c control.h model.h @@ -127,6 +129,7 @@ clean: autotest autotest.o control.o floorplan.o \ fp2bit fp2bit.o \ bit2fp bit2fp.o \ + bit_regs.o bit_frames.o \ pair2net pair2net.o \ xc6slx9_empty.fp xc6slx9.svg \ xc6slx9_empty.tiles xc6slx9_empty.devs xc6slx9_empty.conns \ diff --git a/bits.h b/bit.h similarity index 97% rename from bits.h rename to bit.h index 12f72bf..04b49bd 100644 --- a/bits.h +++ b/bit.h @@ -108,7 +108,6 @@ struct fpga_config }; int read_bitfile(struct fpga_config* cfg, FILE* f); -int extract_model(struct fpga_model* model, uint8_t* bits, int bits_len); #define DUMP_HEADER_STR 0x0001 #define DUMP_REGS 0x0002 @@ -118,3 +117,6 @@ int dump_config(struct fpga_config* cfg, int flags); void free_config(struct fpga_config* cfg); int write_bitfile(FILE* f, struct fpga_model* model); + +int extract_model(struct fpga_model* model, uint8_t* bits, int bits_len); +int write_model(uint8_t* bits, int bits_len, struct fpga_model* model); diff --git a/bit2fp.c b/bit2fp.c index 48d62a7..30d557e 100644 --- a/bit2fp.c +++ b/bit2fp.c @@ -7,7 +7,7 @@ #include "model.h" #include "floorplan.h" -#include "bits.h" +#include "bit.h" int main(int argc, char** argv) { diff --git a/bit_frames.c b/bit_frames.c new file mode 100644 index 0000000..b667eeb --- /dev/null +++ b/bit_frames.c @@ -0,0 +1,19 @@ +// +// 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 "model.h" +#include "bit.h" + +int extract_model(struct fpga_model* model, uint8_t* bits, int bits_len) +{ + return 0; +} + +int write_model(uint8_t* bits, int bits_len, struct fpga_model* model) +{ + return 0; +} diff --git a/bits.c b/bit_regs.c similarity index 99% rename from bits.c rename to bit_regs.c index 810abd6..e2a23a2 100644 --- a/bits.c +++ b/bit_regs.c @@ -6,7 +6,7 @@ // #include "model.h" -#include "bits.h" +#include "bit.h" static int parse_header(struct fpga_config* config, uint8_t* d, int len, int inpos, int* outdelta); @@ -97,11 +97,6 @@ fail: return rc; } -int extract_model(struct fpga_model* model, uint8_t* bits, int bits_len) -{ - return 0; -} - static void dump_header(struct fpga_config* cfg) { int i; @@ -1681,11 +1676,6 @@ fail: return rc; } -static int write_model(uint8_t* bits, int bits_len, struct fpga_model* model) -{ - return 0; -} - static int write_bits(FILE* f, struct fpga_model* model) { uint8_t* bits; diff --git a/fp2bit.c b/fp2bit.c index 5db8c9c..9e32a0d 100644 --- a/fp2bit.c +++ b/fp2bit.c @@ -7,7 +7,7 @@ #include "model.h" #include "floorplan.h" -#include "bits.h" +#include "bit.h" int main(int argc, char** argv) {