![]() |
nsbaci 1.0
|
Represents a compiled program ready for execution. More...
#include <program.h>
Public Member Functions | |
| Program (nsbaci::compiler::InstructionStream i) | |
| Program (nsbaci::compiler::InstructionStream i, nsbaci::types::SymbolTable s) | |
| Program (const Program &)=delete | |
| Program & | operator= (const Program &)=delete |
| Program (Program &&)=default | |
| Program & | operator= (Program &&)=default |
| const nsbaci::compiler::Instruction & | getInstruction (uint32_t addr) const |
| Gets instruction at the given address. | |
| size_t | instructionCount () const |
| Gets the total number of instructions. | |
| nsbaci::types::Memory & | memory () |
| Access to global memory. | |
| const nsbaci::types::Memory & | memory () const |
| const nsbaci::types::SymbolTable & | symbols () const |
| Access to symbol table. | |
| void | addSymbol (nsbaci::types::SymbolInfo info) |
| Add a symbol to the symbol table. | |
| int32_t | readMemory (nsbaci::types::MemoryAddr addr) const |
| Read a value from memory. | |
| void | writeMemory (nsbaci::types::MemoryAddr addr, int32_t value) |
| Write a value to memory. | |
| void | createSemaphore (nsbaci::types::MemoryAddr addr, int32_t initialCount) |
| Create a semaphore at the given address. | |
| bool | semaphoreWait (nsbaci::types::MemoryAddr addr, nsbaci::types::ThreadID threadId) |
| Wait (P operation) on a semaphore. | |
| nsbaci::types::ThreadID | semaphoreSignal (nsbaci::types::MemoryAddr addr) |
| Signal (V operation) on a semaphore. | |
| bool | hasSemaphore (nsbaci::types::MemoryAddr addr) const |
| Check if a semaphore exists at the given address. | |
Represents a compiled program ready for execution.
The Program class contains the instruction vector, memory tables, and other data structures needed for program execution.
| void nsbaci::services::runtime::Program::addSymbol | ( | nsbaci::types::SymbolInfo | info | ) |
Add a symbol to the symbol table.
| info | The symbol information to add. |


| void nsbaci::services::runtime::Program::createSemaphore | ( | nsbaci::types::MemoryAddr | addr, |
| int32_t | initialCount ) |
Create a semaphore at the given address.
| addr | Memory address to associate with the semaphore. |
| initialCount | Initial semaphore count. |


| const nsbaci::compiler::Instruction & nsbaci::services::runtime::Program::getInstruction | ( | uint32_t | addr | ) | const |
Gets instruction at the given address.
| addr | The instruction address. |


| bool nsbaci::services::runtime::Program::hasSemaphore | ( | nsbaci::types::MemoryAddr | addr | ) | const |
Check if a semaphore exists at the given address.
| addr | Address to check. |


| size_t nsbaci::services::runtime::Program::instructionCount | ( | ) | const |
Gets the total number of instructions.


| nsbaci::types::Memory & nsbaci::services::runtime::Program::memory | ( | ) |
Access to global memory.


| int32_t nsbaci::services::runtime::Program::readMemory | ( | nsbaci::types::MemoryAddr | addr | ) | const |
Read a value from memory.
| addr | Memory address to read from. |


| nsbaci::types::ThreadID nsbaci::services::runtime::Program::semaphoreSignal | ( | nsbaci::types::MemoryAddr | addr | ) |
Signal (V operation) on a semaphore.
| addr | Address of the semaphore. |


| bool nsbaci::services::runtime::Program::semaphoreWait | ( | nsbaci::types::MemoryAddr | addr, |
| nsbaci::types::ThreadID | threadId ) |
Wait (P operation) on a semaphore.
| addr | Address of the semaphore. |
| threadId | The thread attempting to wait. |


| const nsbaci::types::SymbolTable & nsbaci::services::runtime::Program::symbols | ( | ) | const |
Access to symbol table.


| void nsbaci::services::runtime::Program::writeMemory | ( | nsbaci::types::MemoryAddr | addr, |
| int32_t | value ) |
Write a value to memory.
| addr | Memory address to write to. |
| value | Value to write. |

