PICSimLab - Programmable IC Simulator Laboratory 0.9.2
PICSimLab - API
Loading...
Searching...
No Matches
bsim_qemu Class Referenceabstract
Inheritance diagram for bsim_qemu:
Collaboration diagram for bsim_qemu:

Public Member Functions

int DebugInit (int dtyppe) override
 Start debug support.
 
std::string GetDebugName (void) override
 Get debug interface name.
 
void DebugLoop (void) override
 debug step (pooling)
 
int CpuInitialized (void) override
 return true if microcontroller is initialized
 
void MSetSerial (const char *port) override
 Set serial port name to use.
 
int MInit (const char *processor, const char *fname, float freq) override
 board microcontroller init
 
void MEnd (void) override
 board microcontroller end
 
int MGetArchitecture (void) override
 Return board microcontroller architecture.
 
int MDumpMemory (const char *fname) override
 board microcontroller save non volatile memory to hex file
 
void MEraseFlash (void) override
 board microcontroller erase flash memory (program)
 
void MSetFreq (float freq) override
 board microcontroller set frequency
 
float MGetFreq (void) override
 board microcontroller get frequency
 
void MSetVCC (float vcc) override
 board microcontroller set vcc
 
float MGetVCC (void) override
 board microcontroller get vcc
 
float MGetInstClockFreq (void) override
 board microcontroller get cpu internal clock (in PIC frequency/4)
 
void MSetPin (int pin, unsigned char value) override
 board microcontroller set digital pin
 
void MSetPinDOV (int pin, unsigned char ovalue) override
 board microcontroller set Default Open Value (external pull)
 
unsigned char MGetPin (int pin) override
 board microcontroller get digital pin value
 
const picpin * MGetPinsValues (void) override
 board microcontroller get all pins list struct
 
void MStep (void) override
 board microcontroller run one step
 
void MStepResume (void) override
 board microcontroller run one or two steps to resume instruction
 
void MReset (int flags) override
 board microcontroller reset
 
void EvThreadRun (void) override
 Event on the board.
 
int GetDefaultClock (void) override
 Get board default clock in MHz.
 
int GetInc_ns (void)
 
virtual void PinsExtraConfig (int cfg)
 
virtual void Run_CPU_ns (uint64_t time)=0
 
void IoLockAccess (void) override
 Lock IO to others threads access.
 
void IoUnlockAccess (void) override
 Unlock IO to others threads access.
 
int GetUARTRX (const int uart_num) override
 Return the UART N RX pin number.
 
int GetUARTTX (const int uart_num) override
 Return the UART N TX pin number.
 
virtual std::string GetClkLabel (void) override
 Return the description of clk label.
 
- Public Member Functions inherited from board
virtual void Draw (void)=0
 Called ever 100ms to draw board.
 
virtual void Run_CPU (void)=0
 Paralle thread called ever 100ms to run cpu code.
 
virtual std::string GetSupportedDevices (void)=0
 Return a list of supported microcontrollers.
 
virtual std::string GetPictureFileName (void)
 Return the filename of board picture.
 
virtual std::string GetMapFile (void)
 Return the filename of board picture map.
 
virtual void Reset (void)=0
 Reset board status.
 
virtual void EvMouseButtonPress (unsigned int button, unsigned int x, unsigned int y, unsigned int state)=0
 Event on the board.
 
virtual void EvMouseButtonRelease (unsigned int button, unsigned int x, unsigned int y, unsigned int state)=0
 Event on the board.
 
virtual void EvMouseMove (unsigned int button, unsigned int x, unsigned int y, unsigned int state)
 Event on the board.
 
virtual void EvKeyPress (unsigned int key, unsigned int mask)=0
 Event on the board.
 
virtual void EvKeyRelease (unsigned int key, unsigned int mask)=0
 Event on the board.
 
virtual void EvOnShow (void)
 Event on the board.
 
virtual void RefreshStatus (void)
 Called ever 1s to refresh status.
 
virtual void WritePreferences (void)
 Called to save board preferences in configuration file.
 
virtual void ReadPreferences (char *name, char *value)
 Called whe configuration file load preferences.
 
virtual unsigned short GetInputId (char *name)=0
 return the input ids numbers of names used in input map
 
virtual unsigned short GetOutputId (char *name)=0
 return the output ids numbers of names used in output map
 
virtual void board_Event (const char *controlname)
 Called when window side controls are activated.
 
virtual void board_ButtonEvent (const char *controlname, unsigned int button, unsigned int x, unsigned int y, unsigned int state)
 Called when window side controls are activated.
 
 board (void)
 Called once on board creation.
 
virtual ~board (void)
 Called once on board destruction.
 
void SetUseOscilloscope (int uo)
 Enable/disable oscilloscope measurement.
 
void SetUseSpareParts (int sp)
 Enable/disable spare parts.
 
int GetUseOscilloscope (void)
 Get if oscilloscope is in use.
 
int GetUseSpareParts (void)
 Get if spare parts is in use.
 
virtual std::string GetName (void)=0
 Get board name registered in PICSimLab.
 
void SetProcessorName (std::string proc)
 Set board processor.
 
std::string GetProcessorName (void)
 Get board processor in use.
 
int GetInputCount (void)
 Get board input count.
 
input_tGetInput (int n)
 Get board input.
 
int GetOutputCount (void)
 Get board output count.
 
output_tGetOutput (int n)
 Get board input.
 
virtual std::string GetAboutInfo (void)=0
 Return the about information of part.
 
virtual void EndServers (void)
 board servers shutdown
 
int MGetClocksPerInstructions (void)
 board microcontroller get Clock pulses per instruction (in PIC equal to 4)
 
virtual int MGetPinCount (void)=0
 board microcontroller pin count
 
virtual std::string MGetPinName (int pin)=0
 board microcontroller pin name
 
virtual void MSetAPin (int pin, float value)=0
 board microcontroller set analog pin
 
virtual unsigned short * DBGGetProcID_p (void)
 board microcontroller get pointer to processor ID
 
virtual unsigned int DBGGetPC (void)
 board microcontroller get PC
 
virtual void DBGSetPC (unsigned int pc)
 board microcontroller set PC
 
virtual unsigned char * DBGGetRAM_p (void)
 board microcontroller get RAM memory pointer
 
virtual unsigned char * DBGGetROM_p (void)
 board microcontroller get ROM (FLASH) memory pointer
 
virtual unsigned char * DBGGetCONFIG_p (void)
 board microcontroller get CONFIG memory pointer
 
virtual unsigned char * DBGGetID_p (void)
 board microcontroller get internal IDS memory pointer
 
virtual unsigned char * DBGGetEEPROM_p (void)
 board microcontroller get data EEPROM memory pointer
 
virtual unsigned int DBGGetRAMSize (void)
 board microcontroller get RAM memory size
 
virtual unsigned int DBGGetROMSize (void)
 board microcontroller get ROM (FLASH) memory size
 
virtual unsigned int DBGGetCONFIGSize (void)
 board microcontroller get CONFIG memory size
 
virtual unsigned int DBGGetIDSize (void)
 board microcontroller get internal IDS memory size
 
virtual unsigned int DBGGetEEPROM_Size (void)
 board microcontroller get data EEPROM memory size
 
virtual unsigned int DBGGetRAMLAWR (void)
 board microcontroller get last ram write address
 
virtual unsigned int DBGGetRAMLARD (void)
 board microcontroller get last ram read address
 
unsigned char CalcAngle (int i, int x, int y)
 Calc rotary potentiometer angle.
 
virtual void SetScale (double scale)
 Set board draw scale.
 
double GetScale (void)
 Get board draw scale.
 
std::string GetDefaultProcessor (void)
 Get board default processor.
 
void SetDefaultProcessor (std::string dproc)
 Set board default processor.
 
uint32_t GetInstCounter (void)
 Get instruction counter.
 
uint32_t GetInstCounter_us (const uint32_t start)
 Get elapsed time from instruction counter in us.
 
uint32_t GetInstCounter_ms (const uint32_t start)
 Get elapsed time from instruction counter in us.
 
int TimerRegister_us (const double micros, void(*Callback)(void *arg), void *arg)
 Register a new timer with time in us (default enabled)
 
int TimerRegister_ms (const double miles, void(*Callback)(void *arg), void *arg)
 Register a new timer with time in ms (default enabled)
 
int TimerUnregister (const int timer)
 Unregister timer.
 
int TimerChange_us (const int timer, const double micros)
 Modify timer value with us.
 
int TimerChange_ms (const int timer, const double miles)
 Modify timer value with us.
 
int TimerSetState (const int timer, const int enabled)
 Enable or disable timer.
 
uint64_t TimerGet_ns (const int timer)
 Get elapsed time from instruction counter in ns.
 
void TimerUpdateFrequency (float freq)
 Update Timer counters on frequency change.
 

Public Attributes

user_timer_t timer
 
bitbang_i2c_t master_i2c [2]
 
bitbang_spi_t master_spi [2]
 
bitbang_uart_t master_uart [3]
 
bitbang_pwm_t pwm_out
 
bitbang_out_t rmt_out
 

Protected Member Functions

int MipsStrToIcount (const char *mipstr)
 
const char * IcountToMipsStr (int icount)
 
const char * IcountToMipsItens (char *buffer)
 
void pins_reset (void)
 
virtual void BoardOptions (int *argc, char **argv)
 
virtual const short int * GetPinMap (void)=0
 
- Protected Member Functions inherited from board
virtual void RegisterRemoteControl (void)
 Register remote control variables.
 
void InstCounterInc (void)
 Increment the Intructions Counter.
 
void ReadMaps (void)
 Read maps.
 
void StartThread (void)
 Start parallel thread.
 
void StopThread (void)
 Stop parallel thread.
 

Protected Attributes

unsigned int ns_count
 
int icount
 
int serialfd [4]
 
int procid
 
picpin pins [256]
 
unsigned int serialbaud
 
float serialexbaud
 
float freq
 
unsigned int inc_ns
 
char fname [2048]
 
char fname_ [2048]
 
char fname_bak [2048]
 
unsigned short ADCvalues [16]
 
int mtx_qinitId
 
std::atomic_int qemu_started
 
QEMUSimType SimType
 
std::string cmdline
 
int use_cmdline_extra
 
std::string cmdline_extra
 
int serial_open
 
unsigned int application_offset
 
int ConfEnableSerial
 
int ConfigWaitGdb
 
- Protected Attributes inherited from board
std::string Proc
 Name of processor in use.
 
std::string DProc
 Name of default board processor.
 
input_t input [MAX_IDS]
 input map elements
 
input_tinput_ids [MAX_IDS]
 input map elements by id order
 
output_t output [MAX_IDS]
 output map elements
 
output_toutput_ids [MAX_IDS]
 output map elements by id order
 
int inputc
 input map elements counter
 
int outputc
 output map elements counter
 
int use_oscope
 use oscilloscope window
 
int use_spare
 use spare parts window
 
unsigned char p_RST
 board /RESET pin state
 
float Scale
 

Private Member Functions

int load_qemu_lib (const char *path)
 

Member Function Documentation

◆ CpuInitialized()

int bsim_qemu::CpuInitialized ( void  )
overridevirtual

return true if microcontroller is initialized

Implements board.

◆ DebugInit()

int bsim_qemu::DebugInit ( int  dtyppe)
overridevirtual

Start debug support.

mplabxd_init (this, Window1.Get_debug_port ()) - 1;

Implements board.

◆ DebugLoop()

void bsim_qemu::DebugLoop ( void  )
overridevirtual

debug step (pooling)

Implements board.

◆ EvThreadRun()

void bsim_qemu::EvThreadRun ( void  )
overridevirtual

Event on the board.

Reimplemented from board.

Here is the call graph for this function:

◆ GetClkLabel()

virtual std::string bsim_qemu::GetClkLabel ( void  )
inlineoverridevirtual

Return the description of clk label.

Reimplemented from board.

◆ GetDebugName()

std::string bsim_qemu::GetDebugName ( void  )
inlineoverridevirtual

Get debug interface name.

Implements board.

◆ GetDefaultClock()

int bsim_qemu::GetDefaultClock ( void  )
inlineoverridevirtual

Get board default clock in MHz.

Reimplemented from board.

◆ GetUARTRX()

int bsim_qemu::GetUARTRX ( const int  uart_num)
overridevirtual

Return the UART N RX pin number.

Reimplemented from board.

◆ GetUARTTX()

int bsim_qemu::GetUARTTX ( const int  uart_num)
overridevirtual

Return the UART N TX pin number.

Reimplemented from board.

◆ IoLockAccess()

void bsim_qemu::IoLockAccess ( void  )
overridevirtual

Lock IO to others threads access.

Reimplemented from board.

◆ IoUnlockAccess()

void bsim_qemu::IoUnlockAccess ( void  )
overridevirtual

Unlock IO to others threads access.

Reimplemented from board.

◆ MDumpMemory()

int bsim_qemu::MDumpMemory ( const char *  fname)
overridevirtual

board microcontroller save non volatile memory to hex file

Implements board.

Here is the call graph for this function:

◆ MEnd()

void bsim_qemu::MEnd ( void  )
overridevirtual

board microcontroller end

Implements board.

Here is the call graph for this function:

◆ MEraseFlash()

void bsim_qemu::MEraseFlash ( void  )
overridevirtual

board microcontroller erase flash memory (program)

Implements board.

◆ MGetArchitecture()

int bsim_qemu::MGetArchitecture ( void  )
overridevirtual

Return board microcontroller architecture.

Implements board.

◆ MGetFreq()

float bsim_qemu::MGetFreq ( void  )
overridevirtual

board microcontroller get frequency

Implements board.

◆ MGetInstClockFreq()

float bsim_qemu::MGetInstClockFreq ( void  )
overridevirtual

board microcontroller get cpu internal clock (in PIC frequency/4)

Implements board.

◆ MGetPin()

unsigned char bsim_qemu::MGetPin ( int  pin)
overridevirtual

board microcontroller get digital pin value

Implements board.

Here is the call graph for this function:

◆ MGetPinsValues()

const picpin * bsim_qemu::MGetPinsValues ( void  )
overridevirtual

board microcontroller get all pins list struct

Implements board.

◆ MGetVCC()

float bsim_qemu::MGetVCC ( void  )
overridevirtual

board microcontroller get vcc

Implements board.

◆ MInit()

int bsim_qemu::MInit ( const char *  processor,
const char *  fname,
float  freq 
)
overridevirtual

board microcontroller init

Implements board.

Here is the call graph for this function:

◆ MReset()

void bsim_qemu::MReset ( int  flags)
overridevirtual

board microcontroller reset

Implements board.

◆ MSetFreq()

void bsim_qemu::MSetFreq ( float  freq)
overridevirtual

board microcontroller set frequency

Implements board.

Here is the call graph for this function:

◆ MSetPin()

void bsim_qemu::MSetPin ( int  pin,
unsigned char  value 
)
overridevirtual

board microcontroller set digital pin

Implements board.

◆ MSetPinDOV()

void bsim_qemu::MSetPinDOV ( int  pin,
unsigned char  ovalue 
)
overridevirtual

board microcontroller set Default Open Value (external pull)

Implements board.

◆ MSetSerial()

void bsim_qemu::MSetSerial ( const char *  port)
overridevirtual

Set serial port name to use.

Implements board.

◆ MSetVCC()

void bsim_qemu::MSetVCC ( float  vcc)
overridevirtual

board microcontroller set vcc

Implements board.

◆ MStep()

void bsim_qemu::MStep ( void  )
overridevirtual

board microcontroller run one step

Implements board.

◆ MStepResume()

void bsim_qemu::MStepResume ( void  )
inlineoverridevirtual

board microcontroller run one or two steps to resume instruction

Implements board.


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