Verilog to Routing - VPR
Public Member Functions | Private Attributes
VprContext Class Reference

This object encapsulates VPR's state. More...

#include <vpr_context.h>

Inheritance diagram for VprContext:
Inheritance graph
[legend]
Collaboration diagram for VprContext:
Collaboration graph
[legend]

Public Member Functions

const AtomContextatom () const
 
AtomContextmutable_atom ()
 
const DeviceContextdevice () const
 
DeviceContextmutable_device ()
 
const TimingContexttiming () const
 
TimingContextmutable_timing ()
 
const PowerContextpower () const
 
PowerContextmutable_power ()
 
const ClusteringContextclustering () const
 
ClusteringContextmutable_clustering ()
 
const PlacementContextplacement () const
 
PlacementContextmutable_placement ()
 
const RoutingContextrouting () const
 
RoutingContextmutable_routing ()
 
- Public Member Functions inherited from Context
 Context ()=default
 
 Context (Context &)=delete
 
Contextoperator= (Context &)=delete
 
virtual ~Context ()=default
 

Private Attributes

DeviceContext device_
 
AtomContext atom_
 
TimingContext timing_
 
PowerContext power_
 
ClusteringContext clustering_
 
PlacementContext placement_
 
RoutingContext routing_
 

Detailed Description

This object encapsulates VPR's state.

There is typically a single instance which is accessed via the global variable g_vpr_ctx (see globals.h/.cpp).

It is divided up into separate sub-contexts of logically related data structures.

Each sub-context can be accessed via member functions which return a reference to the sub-context:

Typical usage in VPR would be to call the appropriate accessor to get a reference to the context of interest, and then operate on it.

For example if we were performing an action which required access to the current placement, we would do:

void my_analysis_algorithm() {
//Get read-only access to the placement
auto& place_ctx = g_vpr_ctx.placement();
//Do something that depends on (but does not change)
//the current placement...
}

If we needed to modify the placement (e.g. we were implementing another placement algorithm) we would do:

void my_placement_algorithm() {
//Get read-write access to the placement
auto& place_ctx = g_vpr_ctx.mutable_placement();
//Do something that modifies the placement
//...
}
Note
The returned contexts are not copyable, so they must be taken by reference.

Member Function Documentation

◆ atom()

const AtomContext& VprContext::atom ( ) const
inline

◆ clustering()

const ClusteringContext& VprContext::clustering ( ) const
inline

◆ device()

const DeviceContext& VprContext::device ( ) const
inline

◆ mutable_atom()

AtomContext& VprContext::mutable_atom ( )
inline

◆ mutable_clustering()

ClusteringContext& VprContext::mutable_clustering ( )
inline

◆ mutable_device()

DeviceContext& VprContext::mutable_device ( )
inline

◆ mutable_placement()

PlacementContext& VprContext::mutable_placement ( )
inline

◆ mutable_power()

PowerContext& VprContext::mutable_power ( )
inline

◆ mutable_routing()

RoutingContext& VprContext::mutable_routing ( )
inline

◆ mutable_timing()

TimingContext& VprContext::mutable_timing ( )
inline

◆ placement()

const PlacementContext& VprContext::placement ( ) const
inline

◆ power()

const PowerContext& VprContext::power ( ) const
inline

◆ routing()

const RoutingContext& VprContext::routing ( ) const
inline

◆ timing()

const TimingContext& VprContext::timing ( ) const
inline

Field Documentation

◆ atom_

AtomContext VprContext::atom_
private

◆ clustering_

ClusteringContext VprContext::clustering_
private

◆ device_

DeviceContext VprContext::device_
private

◆ placement_

PlacementContext VprContext::placement_
private

◆ power_

PowerContext VprContext::power_
private

◆ routing_

RoutingContext VprContext::routing_
private

◆ timing_

TimingContext VprContext::timing_
private

The documentation for this class was generated from the following file: