CIRCT 23.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
esiaccel.codegen.ports.CppPortKind Class Reference
Collaboration diagram for esiaccel.codegen.ports.CppPortKind:
Collaboration graph
[legend]

Public Member Functions

str member_type (self, Optional[str] alias_prefix=None)
 
str indexed_elem_type (self, Optional[str] alias_prefix=None)
 
str scalar_find_code (self, str v, str appid_expr)
 
str indexed_find_code (self, str map_var, str appid_expr)
 

Public Attributes

 find_style
 
 indexed_find
 

Static Public Attributes

Optional service_type
 
str find_style
 
str indexed_find
 
str param_type
 
str param_suffix
 
Optional member_template
 
Optional member_ref [str]
 
Optional indexed_elem
 
Optional alias_kind [str]
 
bool connectable
 
list CPP_PORT_KINDS
 

Detailed Description

Per-port-kind constants for generating a module's typed port slots.

Holds everything that varies between port kinds in one record.
`member_template` (typed channel/func ports) and `member_ref` (service /
bundle ports) are mutually exclusive. `find_style` / `indexed_find` select
the `connect()` resolution snippet for scalar and indexed ports
respectively; `alias_kind` selects which `using` aliases to emit for the
typed template parameters.

Definition at line 37 of file ports.py.

Member Function Documentation

◆ indexed_elem_type()

str esiaccel.codegen.ports.CppPortKind.indexed_elem_type (   self,
Optional[str]   alias_prefix = None 
)
Return the storage type used inside an `IndexedPorts<T>` for this kind.

Typed ports use the same `TypedFunction<...>` / `TypedReadPort<...>` etc.
that `member_type` produces. MMIO regions, telemetry metrics, and plain
bundle ports are stored as raw pointers because `std::map<int, T&>` is
ill-formed.

Definition at line 81 of file ports.py.

References esiaccel.codegen.ports.CppPortKind.indexed_elem, and esiaccel.codegen.ports.CppPortKind.member_type().

◆ indexed_find_code()

str esiaccel.codegen.ports.CppPortKind.indexed_find_code (   self,
str  map_var,
str  appid_expr 
)
Render the per-index `try_emplace` body for an `IndexedPorts<T>` group.
Pure function of the kind (golden-tested alongside `scalar_find_code`).

Definition at line 118 of file ports.py.

◆ member_type()

str esiaccel.codegen.ports.CppPortKind.member_type (   self,
Optional[str]   alias_prefix = None 
)
Return the C++ member type string for this kind (no member name).

For typed ports (function/callback/to-host/from-host channels)
`alias_prefix` is required; the returned template parameters are written
using the alias names (`<prefix>Args`, `<prefix>Result`, `<prefix>Data`)
that should be emitted at module-class scope. For non-typed ports (MMIO
regions, telemetry metrics, plain bundles) `alias_prefix` is ignored and
the runtime reference/pointer type is returned directly.

Definition at line 61 of file ports.py.

References esiaccel.codegen.ports.CppPortKind.member_ref, and esiaccel.codegen.ports.CppPortKind.member_template.

Referenced by esiaccel.codegen.ports.CppPortKind.indexed_elem_type().

◆ scalar_find_code()

str esiaccel.codegen.ports.CppPortKind.scalar_find_code (   self,
str  v,
str  appid_expr 
)
Render the connect()-body snippet that resolves one scalar port into the
local `v`. Pure function of the kind so it can be golden-tested without a
live accelerator (see `test_port_find_code_golden`).

Definition at line 93 of file ports.py.

Member Data Documentation

◆ alias_kind

Optional esiaccel.codegen.ports.CppPortKind.alias_kind [str]
static

Definition at line 58 of file ports.py.

◆ connectable

bool esiaccel.codegen.ports.CppPortKind.connectable
static

Definition at line 59 of file ports.py.

◆ CPP_PORT_KINDS

list esiaccel.codegen.ports.CppPortKind.CPP_PORT_KINDS
static

Definition at line 149 of file ports.py.

◆ find_style [1/2]

str esiaccel.codegen.ports.CppPortKind.find_style
static

Definition at line 49 of file ports.py.

◆ find_style [2/2]

esiaccel.codegen.ports.CppPortKind.find_style

Definition at line 97 of file ports.py.

◆ indexed_elem

Optional esiaccel.codegen.ports.CppPortKind.indexed_elem
static
Initial value:
[
str]

Definition at line 56 of file ports.py.

Referenced by esiaccel.codegen.ports.CppPortKind.indexed_elem_type().

◆ indexed_find [1/2]

str esiaccel.codegen.ports.CppPortKind.indexed_find
static

Definition at line 50 of file ports.py.

◆ indexed_find [2/2]

esiaccel.codegen.ports.CppPortKind.indexed_find

Definition at line 121 of file ports.py.

◆ member_ref

Optional esiaccel.codegen.ports.CppPortKind.member_ref [str]
static

Definition at line 55 of file ports.py.

Referenced by esiaccel.codegen.ports.CppPortKind.member_type().

◆ member_template

Optional esiaccel.codegen.ports.CppPortKind.member_template
static
Initial value:
[
str]

Definition at line 53 of file ports.py.

Referenced by esiaccel.codegen.ports.CppPortKind.member_type().

◆ param_suffix

str esiaccel.codegen.ports.CppPortKind.param_suffix
static

Definition at line 52 of file ports.py.

◆ param_type

str esiaccel.codegen.ports.CppPortKind.param_type
static

Definition at line 51 of file ports.py.

◆ service_type

Optional esiaccel.codegen.ports.CppPortKind.service_type
static
Initial value:
[
str]

Definition at line 47 of file ports.py.


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