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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [cpu_sysc_plugin/] [riverlib/] [core/] [regibank.h] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2016 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      Multi-port CPU Integer Registers memory.
6
 */
7
 
8
#ifndef __DEBUGGER_RIVERLIB_REGIBANK_H__
9
#define __DEBUGGER_RIVERLIB_REGIBANK_H__
10
 
11
#include <systemc.h>
12
#include "riscv-isa.h"
13
#include "../river_cfg.h"
14
 
15
namespace debugger {
16
 
17
SC_MODULE(RegIntBank) {
18
    sc_in<bool> i_clk;                      // Clock
19
    sc_in<bool> i_nrst;                     // Reset. Active LOW
20
    sc_in<sc_uint<5>> i_radr1;              // Port 1 read address
21
    sc_out<sc_uint<RISCV_ARCH>> o_rdata1;   // Port 1 read value
22
 
23
    sc_in<sc_uint<5>> i_radr2;              // Port 2 read address
24
    sc_out<sc_uint<RISCV_ARCH>> o_rdata2;   // Port 2 read value
25
 
26
    sc_in<sc_uint<5>> i_waddr;              // Writing value
27
    sc_in<bool> i_wena;                     // Writing is enabled
28
    sc_in<sc_uint<RISCV_ARCH>> i_wdata;     // Writing value
29
 
30
    sc_in<sc_uint<5>> i_dport_addr;             // Debug port address
31
    sc_in<bool> i_dport_ena;                    // Debug port is enabled
32
    sc_in<bool> i_dport_write;                  // Debug port write is enabled
33
    sc_in<sc_uint<RISCV_ARCH>> i_dport_wdata;   // Debug port write value
34
    sc_out<sc_uint<RISCV_ARCH>> o_dport_rdata;  // Debug port read value
35
 
36
    sc_out<sc_uint<RISCV_ARCH>> o_ra;       // Return address for branch predictor
37
 
38
    void comb();
39
    void registers();
40
 
41
    SC_HAS_PROCESS(RegIntBank);
42
 
43
    RegIntBank(sc_module_name name_);
44
 
45
    void generateVCD(sc_trace_file *i_vcd, sc_trace_file *o_vcd);
46
 
47
private:
48
    friend struct Processor; // for debug purposes(remove it)s
49
 
50
    struct RegistersType {
51
        sc_signal<bool> update;             // To generate SystemC delta event only.
52
        sc_uint<RISCV_ARCH> mem[Reg_Total]; // Multi-ports memory
53
    } v, r;
54
};
55
 
56
}  // namespace debugger
57
 
58
#endif  // __DEBUGGER_RIVERLIB_REGIBANK_H__

powered by: WebSVN 2.1.0

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