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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [common/] [debug/] [dsu.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 2016 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      Debug Support Unit (DSU) functional model.
6
 *
7
 * @details    DSU supports both types of transaction: blocking and
8
 *             non-blocking it allows to interact with SystemC in the
9
 *             same manner as with the Functional model.
10
 * @note       CPU Functional model must implement non-blocking interface
11
 */
12
 
13
#ifndef __DEBUGGER_COMMON_DEBUG_DSU_H__
14
#define __DEBUGGER_COMMON_DEBUG_DSU_H__
15
 
16
#include <iclass.h>
17
#include <iservice.h>
18
#include "coreservices/imemop.h"
19
#include "coreservices/ireset.h"
20
#include "coreservices/icpugen.h"
21
#include "coreservices/idsugen.h"
22
 
23
namespace debugger {
24
 
25
class DSU : public IService,
26
            public IMemoryOperation,
27
            public IDbgNbResponse,
28
            public IDsuGeneric {
29
 public:
30
    explicit DSU(const char *name);
31
    ~DSU();
32
 
33
    /** IService interface */
34
    virtual void postinitService();
35
 
36
    /** IMemoryOperation */
37
    virtual ETransStatus b_transport(Axi4TransactionType *trans);
38
    virtual ETransStatus nb_transport(Axi4TransactionType *trans,
39
                                      IAxi4NbResponse *cb);
40
 
41
    /** IDbgNbResponse */
42
    virtual void nb_response_debug_port(DebugPortTransactionType *trans);
43
 
44
    /** IDsuGeneric */
45
    virtual void incrementRdAccess(int mst_id);
46
    virtual void incrementWrAccess(int mst_id);
47
 
48
 private:
49
    void readLocal(uint64_t off, Axi4TransactionType *trans);
50
    void writeLocal(uint64_t off, Axi4TransactionType *trans);
51
 
52
 private:
53
    AttributeType cpu_;
54
    AttributeType bus_;
55
    ICpuGeneric *icpu_;
56
    IResetListener *icpurst_;
57
    IMemoryOperation *ibus_;
58
    uint64_t shifter32_;
59
    uint64_t wdata64_;
60
    uint64_t soft_reset_;
61
 
62
    struct nb_trans_type {
63
        Axi4TransactionType *p_axi_trans;
64
        IAxi4NbResponse *iaxi_cb;
65
        DebugPortTransactionType dbg_trans;
66
    } nb_trans_;
67
 
68
    static const int BUS_MASTERS_MAX = 64;
69
    struct BusUtilType {
70
        uint64_t w_cnt;
71
        uint64_t r_cnt;
72
    } info_[BUS_MASTERS_MAX];
73
};
74
 
75
DECLARE_CLASS(DSU)
76
 
77
}  // namespace debugger
78
 
79
#endif  // __DEBUGGER_COMMON_DEBUG_DSU_H__

powered by: WebSVN 2.1.0

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