User manual
109
The example above shows that the CHARON core is not obliged to support the indicated
operation. It also shows why the loadable component instance must retain the chapi_in
descriptor.
4.29 Translate emulator’s memory for DMA (CHARON deep integration)
The operation of translating emulator’s memory for DMA belongs to the class of
operations called “Replacement hardware support requests”, Using this function could
require Stromasys consulting. Such an operation is initiated by the device instance. The
CHARON core is defined as a target of the operation. This operation is commonly used
when piece of emulator’s memory have to be translated for DMA
In order to perform the operation, the initiator invokes a routine identified by the
translate_for_dma field of the chapi_in descriptor. The initiator provides int the addr
parameter the starting address within the particular bus, in the len parameter the length of
memory to translate in bytes and in the buf parameter the location where to store starting
address of translated block within the emulator process memory space. Number of bytes
in contiguous translated block is returned as result. The procedure is invoked as follows:
const chapi_in * ci = …;
udword_t bus_addr;
char *seg_start;
unsigned int seg_size;
…
// Calculate bus_addr somehow …
bus_addr = …
// Check required entry in chapi_in structure
if(ci && ci->translate_for_dma) {
seg_size = ci->translate_for_dma(ci, bus_addr, seg_start);
if(seg_size > 0) {
// Ok, success, see seg_start for start address of the block
}
else {
// Failed to translate – report error somehow
…
}
}
The example above shows that the CHARON core is not obliged to support the indicated
operation. It also shows why the loadable component instance must retain the chapi_in
descriptor.
4.30 Generate bus events (CHARON deep integration)
This group of calls designated for the case when particular device wants to signal access
to non-existent memory location. It might be the case when device register’s set contains
gaps or device implement some kind of bus adapter with the whole bus address space
interception. All these calls belong to the group of operations called “Bus adapter support










