OpenCores
URL https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [gui_plugin/] [gui_plugin.h] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2016 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      GUI for the RISC-V debugger.
6
 */
7
#ifndef __DEBUGGER_GUI_PLUGIN_H__
8
#define __DEBUGGER_GUI_PLUGIN_H__
9
 
10
#include "iclass.h"
11
#include "iservice.h"
12
#include "ihap.h"
13
#include "igui.h"
14
#include "coreservices/ithread.h"
15
#include "coreservices/isocinfo.h"
16
#include "coreservices/icmdexec.h"
17
#include "MainWindow/DbgMainWindow.h"
18 3 sergeykhbr
#include "qt_wrapper.h"
19 2 sergeykhbr
 
20
namespace debugger {
21
 
22
class GuiPlugin : public IService,
23
                  public IThread,
24
                  public IHap,
25
                  public IGui {
26
public:
27
    GuiPlugin(const char *name);
28
    ~GuiPlugin();
29
 
30
    /** IService interface */
31
    virtual void postinitService();
32
 
33
    /** IHap */
34
    virtual void hapTriggered(IFace *isrc, EHapType type, const char *descr);
35
 
36
    /** IGui interface */
37
    virtual IFace *getSocInfo();
38 3 sergeykhbr
    virtual const AttributeType *getpConfig();
39 2 sergeykhbr
    virtual void registerCommand(IGuiCmdHandler *src, AttributeType *cmd,
40
                                 bool silent);
41
    virtual void removeFromQueue(IFace *iface);
42
 
43
    /** IThread interface */
44
    virtual void stop();
45
protected:
46
    virtual void busyLoop();
47
 
48
private:
49
    bool processCmdQueue();
50
 
51
private:
52
    static const int CMD_QUEUE_SIZE = 128;
53
 
54
    AttributeType guiConfig_;
55
    AttributeType socInfo_;
56
    AttributeType cmdExecutor_;
57
 
58
    ISocInfo *info_;
59
    ICmdExecutor *iexec_;
60 3 sergeykhbr
    QtWrapper *ui_;
61 2 sergeykhbr
 
62
    event_def eventCommandAvailable_;
63
    event_def config_done_;
64
    mutex_def mutexCommand_;
65
    struct CmdQueueItemType {
66
        AttributeType cmd;
67
        IGuiCmdHandler *src;
68
        bool silent;
69
    } cmdQueue_[CMD_QUEUE_SIZE];
70
    int cmdQueueWrPos_;
71
    int cmdQueueRdPos_;
72
    int cmdQueueCntTotal_;
73
};
74
 
75
DECLARE_CLASS(GuiPlugin)
76
 
77
}  // namespace debugger
78
 
79
#endif  // __DEBUGGER_GUI_PLUGIN_H__

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.