![]() |
P4C
The P4 Compiler
|
#include <target.h>
Classes | |
struct | Spec |
Specifies a target device and architecture by their names in lower case. More... | |
Public Member Functions | |
virtual const IR::Expression * | createTargetUninitialized (const IR::Type *type, bool forceTaint) const |
Static Public Member Functions | |
static bool | init (std::string deviceName, std::string archName) |
static bool | setArch (std::string archName) |
static bool | setDevice (std::string deviceName) |
Public Attributes | |
Spec | spec |
The device and architecture supported by this instance. | |
std::string | toolName |
The name of the tool supported by this instance. | |
Protected Member Functions | |
Target (std::string_view toolName, const std::string &deviceName, const std::string &archName) | |
Static Protected Member Functions | |
template<class TargetImpl> | |
static const TargetImpl & | get (std::string_view toolName) |
Encapsulates the details of a target device and architecture for a single tool. Implementations are singletons and must provide a default constructor. Instances are automatically registered into a central registry. The active target is set by calling @init. The suite of instances for all supported tools for the active target can be obtained by calling @get.
|
protected |
Creates and registers a new Target instance for the given @toolName, @deviceName, and @archName.
|
virtual |
forceTaint | is active, this function always returns a taint variable. Can be overridden by sub-targets. |
|
inlinestaticprotected |
|
static |
Initializes the global target device and architecture to @deviceName and @archName.
|
static |
Initializes the global target architecture to @archName without changing the device. If no device was previously selected, then the first device registered for the architecture is chosen.
|
static |
Initializes the global target device to @deviceName without changing the architecture. If no architecture was previously selected, then the first architecture registered for the device is chosen.