|
| 1 | + |
| 2 | + |
| 3 | +#include "read_fpga_interchange_arch.h" |
| 4 | +#include "vtr_error.h" |
| 5 | + |
| 6 | +#ifdef VTR_ENABLE_CAPNPROTO |
| 7 | + |
1 | 8 | #include <algorithm> |
2 | 9 | #include <kj/std/iostream.h> |
3 | 10 | #include <limits> |
|
21 | 28 | #include "arch_util.h" |
22 | 29 | #include "arch_types.h" |
23 | 30 |
|
24 | | -#include "read_fpga_interchange_arch.h" |
25 | 31 |
|
26 | 32 | /* |
27 | 33 | * FPGA Interchange Device frontend |
@@ -2497,11 +2503,14 @@ struct ArchReader { |
2497 | 2503 | } |
2498 | 2504 | }; |
2499 | 2505 |
|
| 2506 | +#endif // VTR_ENABLE_CAPNPROTO |
| 2507 | + |
2500 | 2508 | void FPGAInterchangeReadArch(const char* FPGAInterchangeDeviceFile, |
2501 | 2509 | const bool /*timing_enabled*/, |
2502 | 2510 | t_arch* arch, |
2503 | 2511 | std::vector<t_physical_tile_type>& PhysicalTileTypes, |
2504 | 2512 | std::vector<t_logical_block_type>& LogicalBlockTypes) { |
| 2513 | +#ifdef VTR_ENABLE_CAPNPROTO |
2505 | 2514 | // Decompress GZipped capnproto device file |
2506 | 2515 | gzFile file = gzopen(FPGAInterchangeDeviceFile, "r"); |
2507 | 2516 | VTR_ASSERT(file != Z_NULL); |
@@ -2542,4 +2551,12 @@ void FPGAInterchangeReadArch(const char* FPGAInterchangeDeviceFile, |
2542 | 2551 |
|
2543 | 2552 | ArchReader reader(arch, device_reader, FPGAInterchangeDeviceFile, PhysicalTileTypes, LogicalBlockTypes); |
2544 | 2553 | reader.read_arch(); |
| 2554 | +#else // VTR_ENABLE_CAPNPROTO |
| 2555 | + // If CAPNPROTO is disabled, throw an error. |
| 2556 | + (void)FPGAInterchangeDeviceFile; |
| 2557 | + (void)arch; |
| 2558 | + (void)PhysicalTileTypes; |
| 2559 | + (void)LogicalBlockTypes; |
| 2560 | + throw vtr::VtrError("Unable to read FPGA interchange if CAPNPROTO is not enabled", __FILE__, __LINE__); |
| 2561 | +#endif // VTR_ENABLE_CAPNPROTO |
2545 | 2562 | } |
0 commit comments