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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [socsim_plugin/] [pnp.h] - Blame information for rev 2

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      Plug'n'Play device functional model.
6
 */
7
 
8
#ifndef __DEBUGGER_SOCSIM_PLUGIN_PNP_H__
9
#define __DEBUGGER_SOCSIM_PLUGIN_PNP_H__
10
 
11
#include "iclass.h"
12
#include "iservice.h"
13
#include "coreservices/imemop.h"
14
#include "coreservices/isocinfo.h"
15
 
16
namespace debugger {
17
 
18
class PNP : public IService,
19
            public IMemoryOperation {
20
public:
21
    PNP(const char *name);
22
    ~PNP();
23
 
24
    /** IService interface */
25
    virtual void postinitService();
26
 
27
    /** IMemoryOperation */
28
    virtual void b_transport(Axi4TransactionType *trans);
29
 
30
    virtual uint64_t getBaseAddress() {
31
        return baseAddress_.to_uint64();
32
    }
33
    virtual uint64_t getLength() {
34
        return length_.to_uint64();
35
    }
36
 
37
private:
38
    void addMaster(unsigned idx, unsigned vid, unsigned did);
39
    void addSlave(uint64_t addr, uint64_t size, unsigned irq, unsigned vid, unsigned did);
40
 
41
    AttributeType baseAddress_;
42
    AttributeType length_;
43
    AttributeType tech_;
44
    AttributeType adc_detector_;
45
 
46
    PnpMapType regs_;
47
    union DescriptorTableType {
48
        union DescriptorItemType {
49
            MasterConfigType mst;
50
            SlaveConfigType slv;
51
        } *item;
52
        uint8_t *buf;
53
    } iter_;
54
};
55
 
56
DECLARE_CLASS(PNP)
57
 
58
}  // namespace debugger
59
 
60
#endif  // __DEBUGGER_SOCSIM_PLUGIN_PNP_H__

powered by: WebSVN 2.1.0

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