Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
fruffy committed Feb 7, 2025
1 parent 8f58781 commit f9aa7c9
Show file tree
Hide file tree
Showing 56 changed files with 1,295 additions and 747 deletions.
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/action_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

#include <config.h>

#include "backends/tofino/bf-asm/stage.h"
#include "lib/hex.h"
#include "misc.h"
#include "backends/tofino/bf-asm/stage.h"

static MeterBus_t MeterBus;

Expand Down
6 changes: 3 additions & 3 deletions backends/tofino/bf-asm/action_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
*/

#include "action_bus.h"
#include "lib/algorithm.h"
#include "input_xbar.h"
#include "instruction.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "input_xbar.h"
#include "instruction.h"
#include "lib/algorithm.h"

// template specialization declarations
#include "tofino/action_table.h"
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/asm-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <set>
#include <sstream>

#include "backends/tofino/bf-asm/map.h"
#include "backends/tofino/bf-asm/json.h"
#include "backends/tofino/bf-asm/map.h"
#include "bfas.h"
#include "lib/bitops.h"
#include "lib/bitvec.h"
Expand Down
8 changes: 4 additions & 4 deletions backends/tofino/bf-asm/atcam_match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
*/

#include "action_bus.h"
#include "lib/algorithm.h"
#include "lib/hex.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "input_xbar.h"
#include "instruction.h"
#include "lib/algorithm.h"
#include "lib/hex.h"
#include "misc.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"

void AlgTcamMatchTable::setup(VECTOR(pair_t) & data) {
common_init_setup(data, false, P4Table::MatchEntry);
Expand Down
6 changes: 3 additions & 3 deletions backends/tofino/bf-asm/attached_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
#include <unordered_map>

#include "action_bus.h"
#include "lib/algorithm.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "input_xbar.h"
#include "instruction.h"
#include "lib/algorithm.h"
#include "misc.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"

void AttachedTable::pass1() {
if (default_action.empty()) default_action = get_default_action();
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/bfas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
#include <string>
#include <vector>

#include "backends/tofino/bf-asm/target.h"
#include "backends/tofino/bf-p4c/git_sha_version.h" // for BF_P4C_GIT_SHA
#include "backends/tofino/bf-p4c/version.h"
#include "constants.h"
#include "lib/indent.h"
#include "misc.h"
#include "parser-tofino-jbay.h"
#include "sections.h"
#include "backends/tofino/bf-asm/target.h"
#include "top_level.h"

#define MAJOR_VERSION 1
Expand Down
6 changes: 3 additions & 3 deletions backends/tofino/bf-asm/counter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include "lib/algorithm.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "data_switchbox.h"
#include "input_xbar.h"
#include "lib/algorithm.h"
#include "misc.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"

// target specific template specializations
#include "tofino/counter.h"
Expand Down
4 changes: 2 additions & 2 deletions backends/tofino/bf-asm/deparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

#include <config.h>

#include "backends/tofino/bf-asm/target.h"
#include "constants.h"
#include "lib/range.h"
#include "misc.h"
#include "parser-tofino-jbay.h"
#include "phv.h"
#include "lib/range.h"
#include "backends/tofino/bf-asm/target.h"
#include "top_level.h"
#include "ubits.h"

Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/deparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

#include <boost/optional.hpp>

#include "lib/bitops.h"
#include "constants.h"
#include "lib/bitops.h"
#include "lib/ordered_set.h"
#include "phv.h"
#include "sections.h"
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/dynhash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include <iostream>
#include <string>

#include "bfas.h"
#include "backends/tofino/bf-asm/json.h"
#include "bfas.h"
#include "sections.h"

class DynHash : public Section {
Expand Down
8 changes: 4 additions & 4 deletions backends/tofino/bf-asm/exact_match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
#include "tofino/exact_match.h"

#include "action_bus.h"
#include "lib/algorithm.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "hashexpr.h"
#include "lib/hex.h"
#include "input_xbar.h"
#include "instruction.h"
#include "lib/algorithm.h"
#include "lib/hex.h"
#include "misc.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"

void ExactMatchTable::setup(VECTOR(pair_t) & data) {
common_init_setup(data, false, P4Table::MatchEntry);
Expand Down
4 changes: 2 additions & 2 deletions backends/tofino/bf-asm/flexible_headers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include "backends/tofino/bf-asm/sections.h"

#include <string>

#include "backends/tofino/bf-asm/sections.h"

namespace BFASM {

// Singleton class representing the assembler flexible_headers
Expand Down
8 changes: 4 additions & 4 deletions backends/tofino/bf-asm/gateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include "lib/algorithm.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "hashexpr.h"
#include "lib/hex.h"
#include "input_xbar.h"
#include "instruction.h"
#include "lib/algorithm.h"
#include "lib/hex.h"
#include "misc.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"

// template specialization declarations
#include "jbay/gateway.h"
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/gtest/gateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include "backends/tofino/bf-asm/stage.h"
#include "bfas.h"
#include "gtest/gtest.h"
#include "backends/tofino/bf-asm/stage.h"

namespace {

Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/gtest/hashexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include "hashexpr.h"

#include "backends/tofino/bf-asm/stage.h"
#include "bfas.h"
#include "gtest/gtest.h"
#include "backends/tofino/bf-asm/stage.h"

namespace {

Expand Down
4 changes: 2 additions & 2 deletions backends/tofino/bf-asm/hash_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#include <string_view>

#include "action_bus.h"
#include "input_xbar.h"
#include "misc.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "input_xbar.h"
#include "misc.h"

// target specific instantiatitions

Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/hash_dist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#include <config.h>

#include "lib/range.h"
#include "backends/tofino/bf-asm/stage.h"
#include "lib/range.h"

static void set_output_bit(unsigned &xbar_use, value_t &v) {
if (CHECKTYPE(v, tSTR)) {
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/hashdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include <fstream>
#include <iostream>

#include "backends/tofino/bf-asm/json.h"
#include "gen/tofino/disas.regs.mau_addrmap.h"
#include "lib/hex.h"
#include "backends/tofino/bf-asm/json.h"

static Tofino::regs_mau_addrmap regs;

Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/hashexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include "hashexpr.h"

#include "input_xbar.h"
#include "lib/bitops.h"
#include "lib/bitvec.h"
#include "input_xbar.h"

static bitvec crc(bitvec poly, bitvec val) {
int poly_size = poly.max().index() + 1;
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/idletime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include "misc.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "misc.h"

void IdletimeTable::setup(VECTOR(pair_t) & data) {
setup_layout(layout, data);
Expand Down
6 changes: 3 additions & 3 deletions backends/tofino/bf-asm/input_xbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

#include <fstream>

#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "hashexpr.h"
#include "lib/log.h"
#include "lib/range.h"
#include "misc.h"
#include "power_ctl.h"
#include "lib/range.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"

// template specialization declarations
#include "backends/tofino/bf-asm/jbay/input_xbar.h"
Expand Down
4 changes: 2 additions & 2 deletions backends/tofino/bf-asm/instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#include <config.h>

#include "action_bus.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "depositfield.h"
#include "phv.h"
#include "power_ctl.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"

namespace {
constexpr int RotationBits = 16;
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/jbay/gateway.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#ifndef BACKENDS_TOFINO_BF_ASM_JBAY_GATEWAY_H_
#define BACKENDS_TOFINO_BF_ASM_JBAY_GATEWAY_H_

#include "backends/tofino/bf-asm/tofino/gateway.h"
#include "backends/tofino/bf-asm/tables.h"
#include "backends/tofino/bf-asm/tofino/gateway.h"

#if HAVE_JBAY
template <>
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/json_diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include <iomanip>
#include <set>

#include "fdstream.h"
#include "backends/tofino/bf-asm/json.h"
#include "fdstream.h"
#include "lib/ordered_map.h"

static bool show_deletion = true;
Expand Down
6 changes: 3 additions & 3 deletions backends/tofino/bf-asm/match_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
#include <unordered_map>

#include "action_bus.h"
#include "lib/algorithm.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "input_xbar.h"
#include "instruction.h"
#include "lib/algorithm.h"
#include "misc.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"

Table::Format *MatchTable::get_format() const {
if (!format && gateway) return gateway->get_format();
Expand Down
4 changes: 2 additions & 2 deletions backends/tofino/bf-asm/meter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"
#include "data_switchbox.h"
#include "input_xbar.h"
#include "misc.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/tables.h"

// target specific template specializations
#include "tofino/meter.h"
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <sstream>
#include <string>

#include "bfas.h"
#include "backends/tofino/bf-asm/target.h"
#include "bfas.h"

int remove_name_tail_range(std::string &name, int *size) {
auto tail = name.rfind('.');
Expand Down
10 changes: 5 additions & 5 deletions backends/tofino/bf-asm/parser-tofino-jbay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

#include <config.h>

#include "lib/algorithm.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/target.h"
#include "constants.h"
#include "misc.h"
#include "lib/algorithm.h"
#include "lib/ordered_set.h"
#include "phv.h"
#include "lib/range.h"
#include "backends/tofino/bf-asm/stage.h"
#include "backends/tofino/bf-asm/target.h"
#include "misc.h"
#include "phv.h"
#include "top_level.h"
#include "vector.h"

Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/parser-tofino-jbay.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#include <set>
#include <vector>

#include "backends/tofino/bf-asm/target.h"
#include "lib/bitvec.h"
#include "parser.h"
#include "phv.h"
#include "sections.h"
#include "backends/tofino/bf-asm/target.h"
#include "ubits.h"

enum {
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-asm/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

#include "asm-types.h"
#include "backends/tofino/bf-asm/json.h"
#include "sections.h"
#include "backends/tofino/bf-asm/target.h"
#include "sections.h"
#include "vector.h"

/**
Expand Down
Loading

0 comments on commit f9aa7c9

Please sign in to comment.