Skip to content

Commit

Permalink
Do not throw errors when compiling. Properly depend on p4ctoolkit.
Browse files Browse the repository at this point in the history
Signed-off-by: fruffy <fruffy@nyu.edu>
  • Loading branch information
fruffy committed Feb 7, 2025
1 parent 050cf7c commit a870fbf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 32 deletions.
5 changes: 4 additions & 1 deletion backends/tofino/bf-asm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ endif()
# string(REPLACE "-Wno-overloaded-virtual" "" vector_c_flags ${BFASM_CXX_FLAGS})
# set_source_files_properties(vector.c PROPERTIES COMPILE_FLAGS ${vector_c_flags})
add_executable (bfas ${BFAS_SOURCES})
target_compile_options(bfas PRIVATE -std=gnu++17) # Enable extensions for bfas.
# Enable extensions for bfas. FIXME: Do we need this?
target_compile_options(bfas PRIVATE -std=gnu++17)
# Disable errors for warnings. FIXME: Get rid of this.
target_compile_options(bfas PUBLIC "-Wno-error")
target_link_libraries (bfas ${BFASM_LIBS} ${BFASM_LIB_DEPS})
add_dependencies(bfas bfasm_yaml)

Expand Down
17 changes: 3 additions & 14 deletions backends/tofino/bf-asm/jbay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ add_custom_command(OUTPUT ${GEN_JBAY_HDRS} ${GEN_JBAY_SRCS}
DEPENDS template_objects.yaml chip.schema ${WALLE_SOURCES}
COMMENT "Generating cpp code for jbay from jbay/chip.schema")

set_source_files_properties(
${GEN_JBAY_SRCS} ${GEN_JBAY_HDRS}
PROPERTIES GENERATED TRUE)
set_source_files_properties(${GEN_JBAY_SRCS} ${GEN_JBAY_HDRS} PROPERTIES GENERATED TRUE)

set (BFAS_JBAY_SRCS
jbay/gateway.cpp
Expand All @@ -52,14 +50,5 @@ set (BFAS_JBAY_SRCS
PARENT_SCOPE
)

set (BFAS_JBAY_HEADERS
jbay/counter.h
jbay/gateway.h
jbay/input_xbar.h
jbay/meter.h
jbay/stateful.h
PARENT_SCOPE
)

include_directories (${BFASM_BINARY_DIR}/gen/jbay)
add_library (regs_jbay ${GEN_JBAY_SRCS} ${GEN_JBAY_HDRS})
add_library (regs_jbay ${GEN_JBAY_SRCS})
target_link_libraries (regs_jbay p4ctoolkit)
20 changes: 3 additions & 17 deletions backends/tofino/bf-asm/tofino/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ foreach(f IN LISTS GEN_TOFINO)
list (APPEND GEN_TOFINO_HDRS ${BFASM_BINARY_DIR}/gen/tofino/${f}.h)
endforeach()

set_source_files_properties(
${GEN_TOFINO_SRCS} ${GEN_TOFINO_HDRS}
PROPERTIES GENERATED TRUE)
set_source_files_properties(${GEN_TOFINO_SRCS} ${GEN_TOFINO_HDRS} PROPERTIES GENERATED TRUE)

add_custom_command(OUTPUT ${GEN_TOFINO_HDRS} ${GEN_TOFINO_SRCS}
COMMAND ${BFASM_WALLE} --schema chip.schema --generate-cpp template_objects.yaml -o ${BFASM_BINARY_DIR}/gen/tofino
Expand All @@ -55,18 +53,6 @@ set (BFAS_TOFINO_SRCS
PARENT_SCOPE
)

set (BFAS_TOFINO_HEADERS
tofino/action_table.h
tofino/counter.h
tofino/exact_match.h
tofino/gateway.h
tofino/input_xbar.h
tofino/meter.h
tofino/phv.h
tofino/stateful.h
tofino/ternary_match.h
PARENT_SCOPE
)

include_directories (${BFASM_BINARY_DIR}/gen/tofino)
add_library (regs_tofino ${GEN_TOFINO_SRCS} ${GEN_TOFINO_HDRS})
add_library (regs_tofino ${GEN_TOFINO_SRCS})
target_link_libraries (regs_tofino p4ctoolkit)

0 comments on commit a870fbf

Please sign in to comment.