Skip to content

Commit 0ca6994

Browse files
committed
libs: capnp: add interchange parsing
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 1488aae commit 0ca6994

File tree

5 files changed

+40
-10
lines changed

5 files changed

+40
-10
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "libs/EXTERNAL/capnproto"]
22
path = libs/EXTERNAL/capnproto
3-
url = https://github.com/capnproto/capnproto
3+
url = https://github.com/capnproto/capnproto.git

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ option(VTR_ENABLE_CAPNPROTO "Enable capnproto binary serialization support in VP
4040
#Allow the user to enable/disable VPR analytic placement
4141
#VPR option --enable_analytic_placer is also required for Analytic Placement
4242
option(VPR_ANALYTIC_PLACE "Enable analytic placement in VPR." ON)
43+
option(VPR_ENABLE_INTERCHANGE "Enable FPGA interchange." ON)
4344

4445
option(WITH_BLIFEXPLORER "Enable build with blifexplorer" OFF)
4546

@@ -365,7 +366,6 @@ if (VPR_USE_EZGL STREQUAL "auto")
365366
endif()
366367
endif()
367368

368-
369369
#Add the various sub-projects
370370
if(${WITH_ABC})
371371
add_subdirectory(abc)

libs/EXTERNAL/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ add_subdirectory(libsdcparse)
88
add_subdirectory(libblifparse)
99
add_subdirectory(libtatum)
1010

11-
#VPR_USE_EZGL is initialized in the root CMakeLists.
11+
#VPR_USE_EZGL is initialized in the root CMakeLists.
1212
#compile libezgl only if the user asks for or has its dependencies installed.
1313
if(VPR_USE_EZGL STREQUAL "on")
1414
add_subdirectory(libezgl)

libs/libarchfpga/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,23 @@ list(REMOVE_ITEM LIB_SOURCES ${EXEC_SOURCES})
1212

1313
#Create the library
1414
add_library(libarchfpga STATIC
15-
${LIB_HEADERS}
16-
${LIB_SOURCES})
15+
${LIB_HEADERS}
16+
${LIB_SOURCES}
17+
)
18+
1719
target_include_directories(libarchfpga PUBLIC ${LIB_INCLUDE_DIRS})
20+
1821
set_target_properties(libarchfpga PROPERTIES PREFIX "") #Avoid extra 'lib' prefix
1922

2023
#Specify link-time dependancies
2124
target_link_libraries(libarchfpga
2225
libvtrutil
2326
libpugixml
24-
libpugiutil)
27+
libpugiutil
28+
libvtrcapnproto
29+
)
30+
31+
target_compile_definitions(libarchfpga PUBLIC ${INTERCHANGE_SCHEMA_HEADERS})
2532

2633
#Create the test executable
2734
add_executable(read_arch ${EXEC_SOURCES})

libs/libvtrcapnproto/CMakeLists.txt

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
include(GNUInstallDirs)
2-
31
if(NOT MSCV)
42
# These flags generate noisy but non-bug warnings when using lib kj,
53
# supress them.
@@ -25,15 +23,40 @@ set(CAPNP_DEFS
2523
gen/rr_graph_uxsdcxx.capnp
2624
map_lookahead.capnp
2725
extended_map_lookahead.capnp
28-
)
26+
)
27+
2928
capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS
3029
${CAPNP_DEFS}
30+
)
31+
32+
if (VPR_ENABLE_INTERCHANGE)
33+
set(IC_DIR ${CMAKE_SOURCE_DIR}/libs/EXTERNAL/libinterchange/interchange)
34+
set(CAPNPC_SRC_PREFIX ${IC_DIR})
35+
set(IC_PROTOS
36+
LogicalNetlist.capnp
37+
PhysicalNetlist.capnp
38+
DeviceResources.capnp
39+
References.capnp
3140
)
41+
set(IC_SRCS)
42+
set(IC_HDRS)
43+
foreach(PROTO ${IC_PROTOS})
44+
capnp_generate_cpp(
45+
IC_SRC
46+
IC_HDR
47+
${IC_DIR}/${PROTO}
48+
)
49+
list(APPEND IC_SRCS ${IC_SRC})
50+
list(APPEND IC_HDRS ${IC_HDR})
51+
endforeach()
52+
53+
endif()
3254

3355
install(FILES ${CAPNP_DEFS} DESTINATION ${CMAKE_INSTALL_DATADIR}/vtr)
3456

3557
add_library(libvtrcapnproto STATIC
3658
${CAPNP_SRCS}
59+
${IC_SRCS}
3760
mmap_file.h
3861
mmap_file.cpp
3962
serdes_utils.h
@@ -47,4 +70,4 @@ target_include_directories(libvtrcapnproto PUBLIC
4770
target_link_libraries(libvtrcapnproto
4871
libvtrutil
4972
CapnProto::capnp
50-
)
73+
)

0 commit comments

Comments
 (0)