Skip to content

Commit

Permalink
Deploying to gh-pages from @ 39d9d44 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
AdarshRawat1 committed Aug 18, 2024
1 parent 2985de3 commit a212349
Show file tree
Hide file tree
Showing 33 changed files with 6,102 additions and 5,936 deletions.
3 changes: 3 additions & 0 deletions pr-preview/4850/doxygen_crawl.html
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@
<a href="unroll_loops_8h_source.html"/>
<a href="validate_properties_8h_source.html"/>
<a href="repository_structure.html"/>
<a href="frontend.html"/>
<a href="getting_started.html"/>
<a href="intermediate_representation_ir.html"/>
<a href="behavioral_model_backend.html"/>
Expand Down Expand Up @@ -3552,6 +3553,7 @@
<a href="functions_rela.html"/>
<a href="functions_rela.html"/>
<a href="functions_rela.html"/>
<a href="@ref midend"/>
<a href="annotated.html"/>
<a href="behavioral_model_backend.html"/>
<a href="changelog.html"/>
Expand Down Expand Up @@ -6256,6 +6258,7 @@
<a href="contribute.html"/>
<a href="dpdk_backend.html"/>
<a href="ebpf_backend.html"/>
<a href="frontend.html"/>
<a href="functions.html"/>
<a href="functions_b.html"/>
<a href="functions_c.html"/>
Expand Down
154 changes: 154 additions & 0 deletions pr-preview/4850/frontend.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<!-- HTML header for doxygen 1.12.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>P4 Compiler Documentation (P4C): Frontend</title>
<link rel="icon" href="p4-fav.svg" type="image/x-icon" />
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<!-- Add link to paragraphs -->
<script type="text/javascript" src="doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript">
DoxygenAwesomeParagraphLink.init()
</script>
<!-- Add copy button to code fragments -->
<script type="text/javascript" src="doxygen-awesome-fragment-copy-button.js"></script>
<script type="text/javascript">
DoxygenAwesomeFragmentCopyButton.init()
</script>
<!-- Add dark mode toggle -->
<script type="text/javascript" src="doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
<link href="cards.css" rel="stylesheet" type="text/css"/>
<link href="flow.css" rel="stylesheet" type="text/css"/>
<link href="p4c_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="p4-logo.png"/></td>
<td id="projectalign">
<div id="projectname">P4C
</div>
<div id="projectbrief">The P4 Compiler</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('frontend.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div><div class="header">
<div class="headertitle"><div class="title">Frontend</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The front-end of the P4 compiler is responsible for transforming the high-level P4 source code into an Intermediate Representation (IR) while ensuring that the code is valid and optimized. This stage is entirely architecture-independent and consists of several critical passes:</p>
<ul>
<li><b>Program Parsing:</b> Converts the P4 source code into an Abstract Syntax Tree (AST).</li>
<li><b>Validation:</b> Checks the program against P4 language rules and constraints to ensure it is valid.</li>
<li><b>Name Resolution:</b> Resolves all identifiers, such as variables and functions, to their declarations.</li>
<li><b>Type Checking/Inference:</b> Uses the Hindley-Milner type inference algorithm to ensure that all types are correctly assigned and compatible.</li>
<li><b>Making Semantics Explicit:</b> Ensures the program's semantics, such as the order of side effects, are clearly defined and explicit. </li>
</ul>
<h2><a class="anchor" id="optimization-tasks"></a>
Optimization Tasks</h2>
<p>The front-end also performs some optimization-related tasks, including:</p><ul>
<li><b>Inlining:</b> Replaces function calls with the function body to reduce overhead.</li>
<li><b>Compile-Time Evaluation and Specialization:</b> Evaluates expressions and specializes code at compile time for efficiency.</li>
<li><b>Conversion to P4 Source:</b> Converts the AST back to P4 source code if needed.</li>
<li><b>Deparser Inference (for P4_14 programs):</b> Automatically infers deparser logic for P4_14 programs.</li>
</ul>
<p>After completing these passes, the front-end generates the control-plane API, which is essential for the interaction between the control plane and the data plane. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.12.0-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
</ul>
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions pr-preview/4850/getting_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<a href="#known-issues">Known issues</a>
<ul>
<li class="level3">
<a href="#frontend">Frontend</a>
<a href="#frontend-1">Frontend</a>
<ul>
<li class="level4">
<a href="#p4_14-features-not-supported-in-p4_16">P4_14 features not supported in P4_16</a>
Expand Down Expand Up @@ -619,7 +619,7 @@ <h2><a class="anchor" id="known-issues"></a>
Known issues</h2>
<p>Issues with the compiler are tracked on <a href="https://github.com/p4lang/p4c/issues">GitHub</a>. Before opening a new issue, please check whether a similar issue is already opened. Opening issues and submitting a pull request with fixes for those issues is much appreciated.</p>
<p>In addition to the list of issues on Github, there are a number of currently unsupported features listed below:</p>
<h3><a class="anchor" id="frontend"></a>
<h3><a class="anchor" id="frontend-1"></a>
Frontend</h3>
<h4><a class="anchor" id="p4_14-features-not-supported-in-p4_16"></a>
P4_14 features not supported in P4_16</h4>
Expand Down
4 changes: 2 additions & 2 deletions pr-preview/4850/intermediate_representation_ir.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<a href="#overall-flow">Overall flow</a>
<ul>
<li class="level3">
<a href="#frontend-1">Frontend</a>
<a href="#frontend-2">Frontend</a>
</li>
<li class="level3">
<a href="#mid-end">Mid-end</a>
Expand Down Expand Up @@ -252,7 +252,7 @@ <h4><a class="anchor" id="controlflowvisitor"></a>
<h2><a class="anchor" id="overall-flow"></a>
Overall flow</h2>
<p>The compiler flow can be roughly split into frontend, middle-end, and backend. The frontend does largely non-target specific transforms designed to clean up the IR and get it into a canonical form. The middle make target-dependent IR transformations. The back end performs resource allocation decisions. As this backend step may fail due to constraint violations, it may need to backtrack through the middle-end to try a different configuration. We do not anticipate needing to backtrack through frontend passes. The split between Front/Middle/Back-end is largely arbitrary, and some passes may end up being moved between them if we later find it makes more sense to do so.</p>
<h3><a class="anchor" id="frontend-1"></a>
<h3><a class="anchor" id="frontend-2"></a>
Frontend</h3>
<p>The frontend parses the source code into IR that corresponds directly to the source code. It then runs a series of passes like type-checking (modifying nodes to indicate their inferred types), constant folding, dead code elimination, etc. The initial IR tree corresponds to the source code, and then various mostly target independent transformation are done. Complex scoping or structuring in the code is flattened here.</p>
<h3><a class="anchor" id="mid-end"></a>
Expand Down
2 changes: 2 additions & 0 deletions pr-preview/4850/menudata.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ var menudata={children:[
{text:"P4C Repository Organization",url:"repository_structure.html"},
{text:"Getting Started",url:"getting_started.html"},
{text:"P4C Intermediate Representation (IR)",url:"intermediate_representation_ir.html"},
{text:"Frontend",url:"frontend.html"},
{text:"Midend",url:"@ref midend"},
{text:"Backends",url:"usergroup0.html",children:[
{text:"Behavioral Model Backend",url:"behavioral_model_backend.html"},
{text:"DPDK Backend",url:"dpdk_backend.html"},
Expand Down
38 changes: 20 additions & 18 deletions pr-preview/4850/navtreedata.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ var NAVTREE =
[ "P4C Repository Organization", "repository_structure.html", null ],
[ "Getting Started", "getting_started.html", null ],
[ "P4C Intermediate Representation (IR)", "intermediate_representation_ir.html", null ],
[ "Frontend", "frontend.html", null ],
[ "Midend", "@ref midend", null ],
[ "Backends", "usergroup0.html", [
[ "Behavioral Model Backend", "behavioral_model_backend.html", null ],
[ "DPDK Backend", "dpdk_backend.html", null ],
Expand Down Expand Up @@ -72,29 +74,29 @@ var NAVTREE =

var NAVTREEINDEX =
[
"annotated.html",
"@ref midend",
"class_p4_1_1_b_m_v2_1_1_pna_enum_on32_bits.html",
"class_p4_1_1_control_plane_a_p_i_1_1_p4_info_maps.html#a906a59a9170c1ae6fcccab61f006cac7",
"class_p4_1_1_d_p_d_k_1_1_direction_to_reg_read.html#a13185144f9542dd94b567f316f0d088e",
"class_p4_1_1_do_convert_errors.html",
"class_p4_1_1_e_b_p_f_1_1_e_b_p_f_hash_p_s_a.html#a04c71d4e53f8536089d0b1079c57c9ac",
"class_p4_1_1_e_b_p_f_1_1_x_d_p_egress_deparser_p_s_a.html",
"class_p4_1_1_if_in_parser.html",
"class_p4_1_1_p4_tools_1_1_abstract_p4c_tool.html#abb583f3714214154261c44ee9ed33f3e",
"class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_bmv2_test_backend.html#add367b59dc9dc5a8473a12e271a01028",
"class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_token.html#a97ab9a18c1613a98438b5a554f6cacbe",
"class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_expr_stepper.html#a26eac5191fab531d8b02ed28201a99be",
"class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_shared_pna_program_info.html#aeb2ee22471989aa047f509c4d7c6d1a9",
"class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_test_framework.html#abc35f8e3e43c46a81b8111aee85b5577",
"class_p4_1_1_p4_tools_1_1_trace_events_1_1_packet.html",
"class_p4_1_1_d_p_d_k_1_1_direction_to_reg_read.html",
"class_p4_1_1_do_convert_enums.html#a9ca6f838994e2ffca8f28f2258e5383d",
"class_p4_1_1_e_b_p_f_1_1_e_b_p_f_hash_p_s_a.html",
"class_p4_1_1_e_b_p_f_1_1_test_target.html",
"class_p4_1_1_i_r_1_1_vector_base.html",
"class_p4_1_1_p4_tools_1_1_abstract_p4c_tool.html#a4da104312718d15bcce5bfef46590704",
"class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_bmv2_test_backend.html#aab9a6d3948d7b1b1be221c93c2cd925d",
"class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2_1_1_token.html#a8bfad2624a29edb0e63d9af19443bd7b",
"class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_expr_stepper.html#a0b8f7a79e07a6a7296c5f17e3e6de5d0",
"class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_pna_1_1_shared_pna_program_info.html#acca77f233f6f692f42cb5778bf72478f",
"class_p4_1_1_p4_tools_1_1_p4_testgen_1_1_test_framework.html#a5eaddadaca6cf2a08134bf5666dd93d0",
"class_p4_1_1_p4_tools_1_1_trace_events_1_1_method_call.html#ac479d5d9409f0ef7322f76121694e1e4",
"class_p4_1_1_pass_manager.html",
"class_p4_1_1_simplify_parsers.html",
"class_p4_1_1_test_1_1_z3_solver_satisfiability_checks.html#a120645e79bc3bdaf2adc5ecbfefe90cb",
"class_p4_1_1_test_1_1_z3_solver_satisfiability_checks.html",
"class_p4_1_1_validate_match_annotations.html",
"functions_o.html",
"namespace_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2.html#ad5a48f3d178f3dcac8ff95677434bc40",
"struct_p4_1_1_diagnostic_count_info.html#a9ef3639182cd95e75114d3f3fde77535",
"struct_p4_1_1_specialization_info.html"
"functions_m.html",
"namespace_p4_1_1_p4_tools_1_1_p4_testgen_1_1_bmv2.html#a9a3f2fa401025ddc8c913db307cb9934",
"struct_p4_1_1_diagnostic_count_info.html#a8f9e7a1f3f84ec8e9be2fee20edab056",
"struct_p4_1_1_r_t_t_i_1_1has__rtti.html"
];

var SYNCONMSG = 'click to disable panel synchronisation';
Expand Down
Loading

0 comments on commit a212349

Please sign in to comment.