ttl-fpga/sw/kousaten/src/main.c

40 lines
775 B
C
Raw Normal View History

2019-06-16 17:11:20 +02:00
#include <stdio.h>
2019-06-16 21:27:42 +02:00
#include "fpga_cell.h"
#include "fpga_fdef_loader.h"
#include "fpga_global.h"
2019-06-18 20:15:35 +02:00
#include "fpga.h"
#define E_FDEF 1
#define E_BITSTREAM 2
2019-06-16 17:11:20 +02:00
2019-06-16 21:27:42 +02:00
int development_test_main(int argc, char *argv[])
2019-06-16 17:11:20 +02:00
{
2019-06-16 21:27:42 +02:00
struct fpga_cell *entry_cell;
2019-06-18 20:15:35 +02:00
entry_cell = fpga_fdef_loader_load("fdef/4x4.fdef");
2019-06-16 21:27:42 +02:00
if (!entry_cell) {
2019-06-18 20:15:35 +02:00
report(LL_CRITICAL, "Error loading FDEF.");
return E_FDEF;
2019-06-16 21:27:42 +02:00
}
2019-06-18 20:15:35 +02:00
// if (entry_cell->type != FPGA_CELL_PROG) {
// report(LL_CRITICAL, "Entry cell must be of type P.");
// return E_FDEF;
// }
2019-06-16 21:27:42 +02:00
report(LL_INFO, "FDEF loaded.");
2019-06-19 18:25:21 +02:00
if (!fpga_isp_chain_new(entry_cell)) {
2019-06-18 20:15:35 +02:00
report(LL_CRITICAL, "Critical error during bitstream generation.");
return E_BITSTREAM;
}
2019-06-16 17:11:20 +02:00
return 0;
}
2019-06-16 21:27:42 +02:00
int main(int argc, char *argv[])
{
return development_test_main(argc, argv);
}