PICSimLab - Programmable IC Simulator Laboratory 0.9.2
PICSimLab - API
Loading...
Searching...
No Matches
bsim_picsim.h
1/* ########################################################################
2
3 PICSimLab - Programmable IC Simulator Laboratory
4
5 ########################################################################
6
7 Copyright (c) : 2010-2024 Luis Claudio GambĂ´a Lopes <lcgamboa@yahoo.com>
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23 For e-mail suggestions : lcgamboa@yahoo.com
24 ######################################################################## */
25
26#ifndef BOARD_PIC_H
27#define BOARD_PIC_H
28
29#include "../lib/board.h"
30#include "../lib/serial_port.h"
31
32#include "../devices/mplabxd.h"
33
34class bsim_picsim : virtual public board {
35public:
36 bsim_picsim(void);
37 int DebugInit(int dtyppe) override;
38 std::string GetDebugName(void) override { return "MDB"; };
39 void DebugLoop(void) override;
40 int CpuInitialized(void) override;
41 void MSetSerial(const char* port) override;
42 int MInit(const char* processor, const char* fname, float freq) override;
43 void MEnd(void) override;
44 int MGetArchitecture(void) override;
45 int MDumpMemory(const char* fname) override;
46 void MEraseFlash(void) override;
47 void MSetFreq(float freq) override;
48 float MGetFreq(void) override;
49 void MSetVCC(float vcc) override;
50 float MGetVCC(void) override;
51 float MGetInstClockFreq(void) override;
52 int MGetPinCount(void) override;
53 std::string MGetPinName(int pin) override;
54 void MSetPin(int pin, unsigned char value) override;
55 void MSetPinDOV(int pin, unsigned char ovalue) override;
56 void MSetAPin(int pin, float value) override;
57 unsigned char MGetPin(int pin) override;
58 const picpin* MGetPinsValues(void) override;
59 void MStep(void) override;
60 void MStepResume(void) override;
61 void MReset(int flags) override;
62 unsigned short* DBGGetProcID_p(void) override;
63 unsigned int DBGGetPC(void) override;
64 void DBGSetPC(unsigned int pc) override;
65 unsigned char* DBGGetRAM_p(void) override;
66 unsigned char* DBGGetROM_p(void) override;
67 unsigned char* DBGGetCONFIG_p(void) override;
68 unsigned char* DBGGetID_p(void) override;
69 unsigned char* DBGGetEEPROM_p(void) override;
70 unsigned int DBGGetRAMSize(void) override;
71 unsigned int DBGGetROMSize(void) override;
72 unsigned int DBGGetCONFIGSize(void) override;
73 unsigned int DBGGetIDSize(void) override;
74 unsigned int DBGGetEEPROM_Size(void) override;
75 unsigned int DBGGetRAMLAWR(void) override;
76 unsigned int DBGGetRAMLARD(void) override;
77 void EndServers(void) override;
78 int GetDefaultClock(void) override { return 8; };
79 int GetUARTRX(const int uart_num) override;
80 int GetUARTTX(const int uart_num) override;
81
82protected:
83 _pic pic;
84};
85
86#endif /* BOARD_PIC_H */
Board class.
Definition board.h:111
Definition bsim_picsim.h:34
unsigned short * DBGGetProcID_p(void) override
board microcontroller get pointer to processor ID
Definition bsim_picsim.cc:196
int MDumpMemory(const char *fname) override
board microcontroller save non volatile memory to hex file
Definition bsim_picsim.cc:115
int MGetPinCount(void) override
board microcontroller pin count
Definition bsim_picsim.cc:148
void MSetAPin(int pin, float value) override
board microcontroller set analog pin
Definition bsim_picsim.cc:169
int GetDefaultClock(void) override
Get board default clock in MHz.
Definition bsim_picsim.h:78
std::string GetDebugName(void) override
Get debug interface name.
Definition bsim_picsim.h:38
int MGetArchitecture(void) override
Return board microcontroller architecture.
Definition bsim_picsim.cc:71
int MInit(const char *processor, const char *fname, float freq) override
board microcontroller init
Definition bsim_picsim.cc:39
void MReset(int flags) override
board microcontroller reset
Definition bsim_picsim.cc:192
unsigned char * DBGGetRAM_p(void) override
board microcontroller get RAM memory pointer
Definition bsim_picsim.cc:208
unsigned int DBGGetEEPROM_Size(void) override
board microcontroller get data EEPROM memory size
Definition bsim_picsim.cc:250
unsigned int DBGGetROMSize(void) override
board microcontroller get ROM (FLASH) memory size
Definition bsim_picsim.cc:232
void MSetPin(int pin, unsigned char value) override
board microcontroller set digital pin
Definition bsim_picsim.cc:161
unsigned int DBGGetRAMSize(void) override
board microcontroller get RAM memory size
Definition bsim_picsim.cc:228
unsigned char * DBGGetROM_p(void) override
board microcontroller get ROM (FLASH) memory pointer
Definition bsim_picsim.cc:212
void MSetSerial(const char *port) override
Set serial port name to use.
Definition bsim_picsim.cc:34
std::string MGetPinName(int pin) override
board microcontroller pin name
Definition bsim_picsim.cc:152
unsigned char * DBGGetCONFIG_p(void) override
board microcontroller get CONFIG memory pointer
Definition bsim_picsim.cc:216
unsigned int DBGGetRAMLARD(void) override
board microcontroller get last ram read address
Definition bsim_picsim.cc:258
void MSetFreq(float freq) override
board microcontroller set frequency
Definition bsim_picsim.cc:90
int DebugInit(int dtyppe) override
Start debug support.
Definition bsim_picsim.cc:130
void DebugLoop(void) override
debug step (pooling)
Definition bsim_picsim.cc:141
unsigned int DBGGetPC(void) override
board microcontroller get PC
Definition bsim_picsim.cc:200
int CpuInitialized(void) override
return true if microcontroller is initialized
Definition bsim_picsim.cc:111
void DBGSetPC(unsigned int pc) override
board microcontroller set PC
Definition bsim_picsim.cc:204
void MEraseFlash(void) override
board microcontroller erase flash memory (program)
Definition bsim_picsim.cc:86
unsigned int DBGGetCONFIGSize(void) override
board microcontroller get CONFIG memory size
Definition bsim_picsim.cc:242
void MSetPinDOV(int pin, unsigned char ovalue) override
board microcontroller set Default Open Value (external pull)
Definition bsim_picsim.cc:165
const picpin * MGetPinsValues(void) override
board microcontroller get all pins list struct
Definition bsim_picsim.cc:177
unsigned char * DBGGetEEPROM_p(void) override
board microcontroller get data EEPROM memory pointer
Definition bsim_picsim.cc:224
void MStepResume(void) override
board microcontroller run one or two steps to resume instruction
Definition bsim_picsim.cc:187
unsigned char MGetPin(int pin) override
board microcontroller get digital pin value
Definition bsim_picsim.cc:173
int GetUARTRX(const int uart_num) override
Return the UART N RX pin number.
Definition bsim_picsim.cc:266
unsigned char * DBGGetID_p(void) override
board microcontroller get internal IDS memory pointer
Definition bsim_picsim.cc:220
float MGetInstClockFreq(void) override
board microcontroller get cpu internal clock (in PIC frequency/4)
Definition bsim_picsim.cc:107
void MStep(void) override
board microcontroller run one step
Definition bsim_picsim.cc:181
float MGetVCC(void) override
board microcontroller get vcc
Definition bsim_picsim.cc:103
void MEnd(void) override
board microcontroller end
Definition bsim_picsim.cc:65
unsigned int DBGGetRAMLAWR(void) override
board microcontroller get last ram write address
Definition bsim_picsim.cc:254
void MSetVCC(float vcc) override
board microcontroller set vcc
Definition bsim_picsim.cc:99
unsigned int DBGGetIDSize(void) override
board microcontroller get internal IDS memory size
Definition bsim_picsim.cc:246
int GetUARTTX(const int uart_num) override
Return the UART N TX pin number.
Definition bsim_picsim.cc:273
void EndServers(void) override
board servers shutdown
Definition bsim_picsim.cc:262
float MGetFreq(void) override
board microcontroller get frequency
Definition bsim_picsim.cc:95