Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

experiment pr 2 #5

Open
wants to merge 68 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
2119abb
Add licenses and top level scripts
hanw Oct 16, 2024
248455e
Add files in top level directory
hanw Oct 16, 2024
8d3dd34
Add files under backends/tofino/bf-p4c/arch for handling tna/t2na/v1m…
hanw Oct 16, 2024
721ffb9
Add files under backends/tofino/bf-p4c/arch/psa for handling psa to t…
hanw Oct 16, 2024
2b3e7b5
Add files under backends/tofino/bf-p4c/arch/tna
hanw Oct 16, 2024
aec728f
Add files under backends/tofino/bf-p4c/common
hanw Oct 16, 2024
73ef4e1
Add files under backends/tofino/bf-p4c/pragma
hanw Oct 16, 2024
157c455
Add files under backends/tofino/bf-p4c/control-plane for bfrt support
hanw Oct 16, 2024
dcc09d5
Add files under backends/tofino/bf-p4c/driver for compiler driver
hanw Oct 16, 2024
21c50c6
Add files under backends/tofino/bf-p4c/ir for tofino-specific IR
hanw Oct 16, 2024
f6f58d7
Add files under backends/tofino/bf-p4c/lib
hanw Oct 16, 2024
2be44e7
Add files under backends/tofino/bf-p4c/logging
hanw Oct 16, 2024
b1bb812
Add files under backends/tofino/bf-p4c/mau
hanw Oct 16, 2024
027ab7f
Add files under backends/tofino/bf-p4c/p4include
hanw Oct 16, 2024
6905255
Add files under backends/tofino/bf-p4c/parde
hanw Oct 16, 2024
4a1091f
Add files under backends/tofino/bf-p4c/parde/clot
hanw Oct 16, 2024
39b19c5
Add files under backends/tofino/bf-p4c/parde/lowered, common and mirror
hanw Oct 16, 2024
8c66de6
Add files under backends/tofino/bf-p4c/parde/phv (part 1)
hanw Oct 16, 2024
540a031
Add files under backends/tofino/bf-p4c/parde/phv/analysis (part 2)
hanw Oct 16, 2024
03ed2e6
Add files under backends/tofino/bf-p4c/parde/phv/pragma (part 3)
hanw Oct 16, 2024
23d3297
Add files under backends/tofino/bf-p4c/parde/phv/* (part 4)
hanw Oct 16, 2024
1fa1bf2
Add files under backends/tofino/bf-p4c/parde/phv/v2 (part 5)
hanw Oct 16, 2024
034be76
Add files under backends/tofino/bf-p4c/test/gtest
hanw Oct 16, 2024
ea0908c
Add files under backends/tofino/bf-utils for dynamic_hash library
hanw Oct 16, 2024
3b14211
Add files under backends/tofino/compiler-interfaces
hanw Oct 16, 2024
f5e2abd
Add files under backends/tofino/scripts for misc scripts
hanw Oct 16, 2024
b1d16d1
Changes to other backend to fix compilation error
hanw Oct 16, 2024
25909fb
Changes to top level CMakeLists.txt to add tofino backend
hanw Oct 16, 2024
e4d20fd
more compilation fixes
Oct 18, 2024
0a01904
misc ci fixes
hanw Oct 18, 2024
32dd294
clang-format fix on bf-p4c/arch
Oct 19, 2024
548da17
clang-format fix for common and top
Oct 19, 2024
da7b39c
clang-format for bf-p4c/logging
Oct 19, 2024
38ae020
clang-format for midend
Oct 19, 2024
f87b2eb
clang-format for parde
Oct 19, 2024
7403dbd
clang-format fix for mau
Oct 19, 2024
458144c
clang-format fix for phv
Oct 19, 2024
fa2c64e
fix warnings
Oct 19, 2024
bc0bebf
clang-format for arch,common,controlplane
Oct 19, 2024
d925435
clang-format ir and lib
Oct 19, 2024
4ca5cb9
clang-format for gtest and others
Oct 19, 2024
b6c07cd
clang-format
Oct 19, 2024
95e2cab
clang-format gtest
Oct 19, 2024
136d8c3
clang-format
Oct 19, 2024
dc0034f
clang-format
Oct 19, 2024
da9b10d
clang-format
Oct 19, 2024
f982b66
clang-format
Oct 19, 2024
efe1d9b
clang-format
Oct 19, 2024
73c302b
clang-format ignore a few files that cannot be fixed
Oct 19, 2024
c9c3341
black format fix
hanw Oct 18, 2024
de52f77
switch ENABLE_TOFINO to OFF by default
hanw Oct 18, 2024
5e269a3
fix psaprogramstructure
hanw Oct 18, 2024
35360e4
fix isort errors
hanw Oct 18, 2024
aeb0827
fix ci-build.sh
Oct 18, 2024
419146b
add pyinstaller to requirement.txt
Oct 18, 2024
3b62b66
fix ifdefs
hanw Oct 18, 2024
53ae7f9
more cpplint fixes
Oct 19, 2024
69faf7f
clang-format fix
Oct 19, 2024
d22a759
compilation fix
Oct 19, 2024
15e9f59
small fix
Oct 19, 2024
51d5ece
try 22.04 as non-unity build
Oct 19, 2024
2c53a4a
try 20.04 build
Oct 19, 2024
0fa46ee
link ${P4C_LIB_DEPS} to bf_gtest_support target
Oct 19, 2024
b079042
link ${P4C_LIB_DEPS} to tofinobackend target
Oct 19, 2024
96dbd39
add FindZ3.cmake for bf-p4c
Oct 19, 2024
c87533d
remove duplicated bmv2/psa.p4 and dpdk/psa.p4
Oct 19, 2024
b8f96b6
fix p4c drivers
Oct 20, 2024
5c48803
adjust driver tests
hanw Oct 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/workflows/ci-test-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
CTEST_PARALLEL_LEVEL: 4
IMAGE_TYPE: test
BUILD_GENERATOR: Ninja
ENABLE_TOFINO: ON
CMAKE_UNITY_BUILD: OFF
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -61,6 +63,7 @@ jobs:
ENABLE_GTESTS: ${{ matrix.gtest }}
CMAKE_UNITY_BUILD: ${{ matrix.unity }}
BUILD_GENERATOR: Ninja
ENABLE_TOFINO: ON
steps:
- uses: actions/checkout@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ docs/doxygen/p4c-doxygen-warn.log

# Local Documentation build theme files
docs/doxygen/awesome_css/

# thirdparty
backends/tofino/third_party/
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ OPTION (ENABLE_BMV2 "Build the BMV2 backend (required for the full test suite)"
OPTION (ENABLE_EBPF "Build the EBPF backend (required for the full test suite)" ON)
OPTION (ENABLE_UBPF "Build the uBPF backend (required for the full test suite)" ON)
OPTION (ENABLE_DPDK "Build the DPDK backend (required for the full test suite)" ON)
OPTION (ENABLE_TOFINO "Build the TOFINO backend (required for the full test suite)" OFF)
OPTION (ENABLE_P4TC "Build the P4TC backend" ON)
OPTION (ENABLE_P4FMT "Build the P4FMT backend" ON)
OPTION (ENABLE_P4TEST "Build the P4Test backend (required for the full test suite)" ON)
Expand Down Expand Up @@ -374,6 +375,7 @@ include_directories (
${P4C_SOURCE_DIR}
${P4C_BINARY_DIR}
${P4C_SOURCE_DIR}/extensions
${P4C_SOURCE_DIR}/backends/tofino ## FIXME
)
add_definitions (-DCONFIG_PREFIX="${CMAKE_INSTALL_PREFIX}")
add_definitions (-DCONFIG_PKGDATADIR="${CMAKE_INSTALL_PREFIX}/${P4C_ARTIFACTS_OUTPUT_DIRECTORY}")
Expand Down Expand Up @@ -487,6 +489,9 @@ endif ()
if (ENABLE_UBPF)
add_subdirectory (backends/ubpf)
endif ()
if (ENABLE_TOFINO)
add_subdirectory (backends/tofino)
endif ()
if (ENABLE_GTESTS)
add_subdirectory (test)
endif ()
Expand Down
1 change: 1 addition & 0 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ filter=-runtime/references
filter=-readability/todo
filter=-readability/function
filter=-readability/casting
filter=-readability/fn_size
linelength=100
# Do not use 'p4c' as the cpp header guard prefix.
root=.
Expand Down
8 changes: 6 additions & 2 deletions backends/common/psaProgramStructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ limitations under the License.

namespace P4 {

enum gress_t { INGRESS, EGRESS };
enum psa_gress_t {
INGRESS,
EGRESS,
};

enum block_t {
PARSER,
PIPELINE,
Expand All @@ -32,7 +36,7 @@ enum block_t {
class PsaProgramStructure : public PortableProgramStructure {
public:
/// Architecture related information.
ordered_map<const IR::Node *, std::pair<gress_t, block_t>> block_type;
ordered_map<const IR::Node *, std::pair<psa_gress_t, block_t>> block_type;

public:
PsaProgramStructure(P4::ReferenceMap *refMap, P4::TypeMap *typeMap)
Expand Down
Loading
Loading