P4C
The P4 Compiler
Loading...
Searching...
No Matches
PHV::v2::GreedyAllocator Class Reference
Inheritance diagram for PHV::v2::GreedyAllocator:
[legend]

Public Member Functions

 GreedyAllocator (const PhvKit &kit, PhvInfo &phv, int pipe_id)
 
bool allocate (std::list< SuperCluster * > clusters, AllocatorMetrics &alloc_metrics)
 
- Public Member Functions inherited from PHV::v2::AllocatorBase
 AllocatorBase (const PhvKit &kit)
 
PHV::Transaction alloc_deparser_zero_cluster (const ScoreContext &ctx, const PHV::Allocation &alloc, const PHV::SuperCluster *sc, PhvInfo &phv) const
 
AllocResult alloc_strided_super_clusters (const ScoreContext &ctx, const Allocation &alloc, const SuperCluster *sc, const ContainerGroupsBySize &groups, AllocatorMetrics &alloc_metrics, const int max_n_slicings=64) const
 
AllocResult try_sliced_super_cluster (const ScoreContext &ctx, const Allocation &alloc, const SuperCluster *sc, const ContainerGroupsBySize &groups, AllocatorMetrics &alloc_metrics) const
 ALLOCATION functions common to trivial and greedy allocation.
 

Friends

std::ostream & operator<< (std::ostream &out, const AllocResultWithSlicingDetails &rst)
 

Additional Inherited Members

- Protected Types inherited from PHV::v2::AllocatorBase
using DfsAllocCb = std::function<bool(const Transaction &)>
 internal type of callback.
 
- Protected Member Functions inherited from PHV::v2::AllocatorBase
AllocResult alloc_stride (const ScoreContext &ctx, const Allocation &alloc, const std::vector< FieldSlice > &stride, const ContainerGroupsBySize &groups, AllocatorMetrics &alloc_metrics) const
 
const AllocErrorcheck_container_scope_constraints (const Allocation &alloc, const std::vector< AllocSlice > &candidates, const Container &c) const
 
std::set< PHV::Sizecompute_valid_container_sizes (const SuperCluster *sc) const
 
const AllocErroris_container_bytes_ok (const Allocation &alloc, const std::vector< AllocSlice > &candidates, const Container &c) const
 
const AllocErroris_container_gress_ok (const Allocation &alloc, const AllocSlice &sl, const Container &c) const
 
const AllocErroris_container_solitary_ok (const Allocation &alloc, const AllocSlice &candidate, const Container &c) const
 
const AllocErroris_container_type_ok (const AllocSlice &sl, const Container &c) const
 CONSTRAINT CHECKING Functions common to trivial and greedy allocation.
 
const AllocErroris_container_write_mode_ok (const Allocation &alloc, const AllocSlice &sl, const Container &c) const
 
std::vector< const SuperCluster::SliceList * > * make_alloc_order (const ScoreContext &ctx, const SuperCluster *sc, const PHV::Size width) const
 
Transaction make_speculated_alloc (const ScoreContext &ctx, const Allocation &alloc, const SuperCluster *sc, const std::vector< AllocSlice > &candidates, const Container &candidates_cont) const
 
std::vector< int > make_start_positions (const ScoreContext &ctx, const SuperCluster::SliceList *sl, const PHV::Size width) const
 
std::optional< Transactiontry_hints (const ScoreContext &ctx, const Allocation &alloc, const ContainerGroup &group, const ActionSourceCoPackMap &action_hints_map, ordered_set< PHV::FieldSlice > &allocated, ScAllocAlignment &hint_enforced_alignments, AllocatorMetrics &alloc_metrics) const
 
SomeContScopeAllocResult try_slices_adapter (const ScoreContext &ctx, const Allocation &alloc, const FieldSliceAllocStartMap &fs_starts, const ContainerGroup &group, std::optional< Container > c, AllocatorMetrics &alloc_metrics) const
 
ContScopeAllocResult try_slices_to_container (const ScoreContext &ctx, const Allocation &alloc, const FieldSliceAllocStartMap &fs_starts, const Container &c, AllocatorMetrics &alloc_metrics, const bool skip_mau_checks=false) const
 
SomeContScopeAllocResult try_slices_to_container_group (const ScoreContext &ctx, const Allocation &alloc, const FieldSliceAllocStartMap &fs_starts, const ContainerGroup &group, AllocatorMetrics &alloc_metrics) const
 
AllocResult try_super_cluster_to_container_group (const ScoreContext &ctx, const Allocation &alloc, const SuperCluster *sc, const ContainerGroup &group, AllocatorMetrics &alloc_metrics) const
 
AllocResult try_wide_arith_slices_to_container_group (const ScoreContext &ctx, const Allocation &alloc, const ScAllocAlignment &alignment, const SuperCluster::SliceList *lo, const SuperCluster::SliceList *hi, const ContainerGroup &group, AllocatorMetrics &alloc_metrics) const
 
const AllocErrorverify_can_pack (const ScoreContext &ctx, const Allocation &alloc, const SuperCluster *sc, const std::vector< AllocSlice > &candidates, const Container &c, ActionSourceCoPackMap &co_pack_hints) const
 
- Protected Attributes inherited from PHV::v2::AllocatorBase
const PhvKitkit_i
 

Member Function Documentation

◆ allocate()

bool PHV::v2::GreedyAllocator::allocate ( std::list< SuperCluster * > clusters,
AllocatorMetrics & alloc_metrics )
Returns
false if allocation failed. allocate all clusters to phv_i. This function will directly print out errors when allocation failed.