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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [libdbg64g/] [services/] [remote/] [tcpcmd.h] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2017 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      TCP commands parser/processor.
6
 */
7
 
8
#ifndef __DEBUGGER_TCPCMD_H__
9
#define __DEBUGGER_TCPCMD_H__
10
 
11
#include <api_core.h>
12
#include <iclass.h>
13
#include <iservice.h>
14
#include <ihap.h>
15
#include "coreservices/ilink.h"
16
#include "coreservices/ithread.h"
17
#include "coreservices/icpugen.h"
18
#include "coreservices/icpuriscv.h"
19
#include "coreservices/icmdexec.h"
20
#include "coreservices/isrccode.h"
21
#include "coreservices/iclock.h"
22
#include "coreservices/iwire.h"
23
#include "coreservices/irawlistener.h"
24
 
25
namespace debugger {
26
 
27
class TcpCommands : public IRawListener,
28
                    public IHap,
29
                    public IClockListener {
30
 public:
31
    explicit TcpCommands(IService *parent);
32
    ~TcpCommands();
33
 
34
    /** IRawListener interface */
35
    virtual void updateData(const char *buf, int buflen);
36
 
37
    /** IHap */
38
    virtual void hapTriggered(IFace *isrc, EHapType type, const char *descr);
39
 
40
    /** IClockListener */
41
    virtual void stepCallback(uint64_t t);
42
 
43
    /** Common acccess methods */
44
    AttributeType *response();
45
 
46
 protected:
47
    IFace *getInterface(const char *name) {
48
        return parent_->getInterface(name);
49
    }
50
 
51
 private:
52
    void processCommand();
53
    void br_add(const AttributeType &symb, AttributeType *res);
54
    void br_rm(const AttributeType &symb, AttributeType *res);
55
    void go_msec(const AttributeType &symb, AttributeType *res);
56
    void go_until(const AttributeType &symb, AttributeType *res);
57
    void step(int cnt, AttributeType *res);
58
    void symb2addr(const char *symbol, AttributeType *res);
59
    void power_on(AttributeType *res);
60
    void power_off(AttributeType *res);
61
 
62
 private:
63
    char rxbuf_[4096];
64
    int rxcnt_;
65
    AttributeType cpu_;
66
    AttributeType executor_;
67
    AttributeType source_;
68
 
69
    AttributeType resp_;
70
 
71
    IService *parent_;
72
    ICmdExecutor *iexec_;
73
    ISourceCode *isrc_;
74
    ICpuRiscV *iriscv_;
75
    IClock *iclk_;
76
    AttributeType *cpuLogLevel_;
77
 
78
    event_def eventHalt_;
79
    event_def eventDelayMs_;
80
    event_def eventPowerChanged_;
81
};
82
 
83
}  // namespace debugger
84
 
85
#endif  // __DEBUGGER_TCPCMD_H__

powered by: WebSVN 2.1.0

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