Skip to content

Commit

Permalink
Fix p4c driver issues
Browse files Browse the repository at this point in the history
- remove duplicated bmv2/psa.p4 and dpdk/psa.p4
- remove calling bfas in p4c-driver
- disable a few driver tests

Co-authored-by: Glen Gibb <[email protected]>
Co-authored-by: Prathima Kotikalapudi <[email protected]>
Co-authored-by: Han Wang <[email protected]>
  • Loading branch information
4 people committed Oct 21, 2024
1 parent 6cc5cf2 commit cba46af
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 3,274 deletions.
13 changes: 6 additions & 7 deletions backends/tofino/bf-p4c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -926,9 +926,7 @@ set (p4include_HEADERS
p4include/tofino2_base.p4
p4include/tofino2_arch.p4
p4include/t2na.p4
p4include/psa.p4
p4include/bmv2/psa.p4
p4include/dpdk/psa.p4
p4include/tofino/psa.p4
)


Expand Down Expand Up @@ -1495,10 +1493,11 @@ if (ENABLE_GTESTS)
set (GTEST_LDADD ${GTEST_LDADD}
"bf_gtest_support;tofinobackend;${LIBDYNHASH_LIBRARY};bfn_p4runtime" PARENT_SCOPE)

add_test(NAME test_p4c_driver
COMMAND ${BFN_P4C_SOURCE_DIR}/scripts/test_p4c_driver.py -j 4 --print-on-failure --compiler ${P4C_BINARY_DIR}/bf-p4c
WORKING_DIRECTORY ${P4C_BINARY_DIR})
set_tests_properties(test_p4c_driver PROPERTIES LABELS lint)
# TODO: re-enable this test once p4-test is added to the build system
# add_test(NAME test_p4c_driver
# COMMAND ${BFN_P4C_SOURCE_DIR}/scripts/test_p4c_driver.py -j 4 --print-on-failure --compiler ${P4C_BINARY_DIR}/bf-p4c
# WORKING_DIRECTORY ${P4C_BINARY_DIR})
# set_tests_properties(test_p4c_driver PROPERTIES LABELS lint)

endif(ENABLE_GTESTS)

Expand Down
10 changes: 5 additions & 5 deletions backends/tofino/bf-p4c/driver/barefoot.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ def checkEnv():


# Search the environment for assets
if os.environ['P4C_BUILD_TYPE'] == "DEVELOPER":
bfas = find_file('bf-asm', 'bfas')
else:
bfas = find_file(os.environ['P4C_BIN_DIR'], 'bfas')
# if os.environ['P4C_BUILD_TYPE'] == "DEVELOPER":
# bfas = find_file('bf-asm', 'bfas')
# else:
# bfas = find_file(os.environ['P4C_BIN_DIR'], 'bfas')

bfrt_schema = find_file(os.environ['P4C_BIN_DIR'], 'bfrt_schema.py')
p4c_gen_conf = find_file(os.environ['P4C_BIN_DIR'], 'p4c-gen-conf')
Expand Down Expand Up @@ -108,7 +108,7 @@ def __init__(self, target, arch, argParser):
self.add_command('preclean-runtime', 'rm')
self.add_command('preprocessor', 'cc')
self.add_command('compiler', os.path.join(os.environ['P4C_BIN_DIR'], 'p4c-barefoot'))
self.add_command('assembler', bfas)
# self.add_command('assembler', bfas)
self.add_command('bf-rt-verifier', bfrt_schema)
self.add_command('p4c-gen-conf', p4c_gen_conf)
self.add_command('cleaner', 'rm')
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-p4c/driver/p4c.tofino.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TofinoBackend(bfn.BarefootBackend):
# command options
self.config_preprocessor("__TARGET_TOFINO__=1")
self.config_compiler("__TARGET_TOFINO__=1")
self.config_assembler("tofino")
# self.config_assembler("tofino")

# Tofino Native Architecture
tna_target = TofinoBackend('tofino', 'tna', argParser)
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-p4c/driver/p4c.tofino2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Tofino2Backend(bfn.BarefootBackend):
self.config_preprocessor("__TOFINO2_VARIANT__={}".format(Tofino2Variants[target]))
self.config_compiler("__TARGET_TOFINO__=2")
self.config_compiler("__TOFINO2_VARIANT__={}".format(Tofino2Variants[target]))
self.config_assembler(target)
# self.config_assembler(target)

for t in Tofino2Variants.keys():
config.target.append(Tofino2Backend(t, 't2na', argParser))
Expand Down
30 changes: 0 additions & 30 deletions backends/tofino/bf-p4c/driver/p4c.tofino3.cfg

This file was deleted.

31 changes: 0 additions & 31 deletions backends/tofino/bf-p4c/driver/p4c.tofino5.cfg

This file was deleted.

Loading

0 comments on commit cba46af

Please sign in to comment.