Skip to content

Commit f9a1a39

Browse files
committed
Integration with the new compiler reference point.
Signed-off-by: fruffy <[email protected]>
1 parent 0a1b5eb commit f9a1a39

File tree

5 files changed

+8
-15
lines changed

5 files changed

+8
-15
lines changed

.github/workflows/ci-test-ubuntu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Run tests
6161
run: |
6262
# FIXME: Move these into a separate test suite.
63-
ENABLE_BF_ASM=TRUE make -C build tna_counter install
63+
make -C build tna_counter install
6464
export SDE=`pwd`
6565
export SDE_INSTALL="`pwd`/install"
6666

cmake/P4Build.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function(P4_BUILD_TARGET t arch target p4program)
8080
separate_arguments(COMPUTED_P4PPFLAGS UNIX_COMMAND ${P4PPFLAGS})
8181
# compile the p4 program
8282
add_custom_command(OUTPUT ${output_files}
83-
COMMAND ${P4C} --std ${P4_LANG} --target ${target} --arch ${arch} --enable-bf-asm ${rt_commands} -o ${CMAKE_CURRENT_BINARY_DIR}/${t}/${target} ${COMPUTED_P4PPFLAGS} ${COMPUTED_P4FLAGS} ${P4FLAGS_INTERNAL} -g ${p4program}
83+
COMMAND ${P4C} --std ${P4_LANG} --target ${target} --arch ${arch} ${rt_commands} -o ${CMAKE_CURRENT_BINARY_DIR}/${t}/${target} ${COMPUTED_P4PPFLAGS} ${COMPUTED_P4FLAGS} ${P4FLAGS_INTERNAL} -g ${p4program}
8484
COMMAND ${P4C-GEN-BFRT-CONF} --name ${t} --device ${chiptype} --testdir ./${t}/${target}
8585
--installdir share/${target}pd/${t} --pipe `${P4C-MANIFEST-CONFIG} --pipe ./${t}/${target}/manifest.json`
8686
DEPENDS ${p4program} bf-p4c
@@ -159,7 +159,7 @@ function(P4_BUILD_PD_TARGET t arch target p4program)
159159
separate_arguments(COMPUTED_PDFLAGS UNIX_COMMAND ${PDFLAGS})
160160
# compile the p4 program
161161
add_custom_command(OUTPUT ${t}/${target}/manifest.json
162-
COMMAND ${P4C} --std ${P4_LANG} --target ${target} --arch ${arch} --enable-bf-asm --no-bf-rt-schema -o ${CMAKE_CURRENT_BINARY_DIR}/${t}/${target} ${COMPUTED_P4PPFLAGS} ${COMPUTED_P4FLAGS} ${P4FLAGS_INTERNAL} -g ${p4program}
162+
COMMAND ${P4C} --std ${P4_LANG} --target ${target} --arch ${arch} --no-bf-rt-schema -o ${CMAKE_CURRENT_BINARY_DIR}/${t}/${target} ${COMPUTED_P4PPFLAGS} ${COMPUTED_P4FLAGS} ${P4FLAGS_INTERNAL} -g ${p4program}
163163
DEPENDS ${p4program} bf-p4c
164164
)
165165

p4studio/utils/processes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def try_execute(command: Union[str, Sequence[str]], working_dir: Optional[PathLi
6262
while process.poll() is None:
6363
while True:
6464
stdout = process.stdout
65-
line = stdout.readline().decode().rstrip() if stdout else ""
65+
line = stdout.readline().decode('latin-1').rstrip() if stdout else ""
6666
if line:
6767
compact_log().log(line)
6868
else:

pkgsrc/p4-compilers/CMakeLists.txt

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# First, check whether the repository needs to be initialized.
2-
32
# Check if the submodule directory exists.
4-
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/p4c/CMakeLists.txt")
3+
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/p4c/CMakeLists.txt")
54
message(STATUS "Initializing P4C submodule...")
65
execute_process(
76
COMMAND git submodule update --init --recursive
8-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
7+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
98
RESULT_VARIABLE GIT_SUBMODULE_RESULT
109
)
1110

@@ -17,10 +16,6 @@ else()
1716
endif()
1817

1918

20-
set(CMAKE_CXX_STANDARD 17)
21-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
22-
set(CMAKE_CXX_EXTENSIONS ON)
23-
set(ENABLE_BF_ASM TRUE)
2419
add_definitions("-DBAREFOOT_INTERNAL=1")
2520
add_definitions("-DHAVE_JBAY=1")
2621
set (P4C_USE_PREINSTALLED_ABSEIL ON CACHE BOOL "")
@@ -42,12 +37,10 @@ set (ENABLE_P4FMT OFF CACHE BOOL "")
4237
set (ENABLE_P4TEST OFF CACHE BOOL "")
4338
set (ENABLE_P4C_GRAPHS OFF CACHE BOOL "")
4439
# set (ENABLE_LTO ON CACHE BOOL "")
45-
# Enable Unity builds for the compiler and bf-asm to speed up compilation.
40+
# Enable Unity builds for the compiler to speed up compilation.
4641
set(CMAKE_UNITY_BUILD_PREV ${CMAKE_UNITY_BUILD})
4742
set(CMAKE_UNITY_BUILD ON)
4843
add_subdirectory(p4c)
49-
50-
add_subdirectory(bf-asm)
5144
set(CMAKE_UNITY_BUILD ${CMAKE_UNITY_BUILD_PREV})
5245

5346

pkgsrc/p4-compilers/p4c

Submodule p4c updated 1019 files

0 commit comments

Comments
 (0)