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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [sysc/] [include/] [OrpsocAccess.h] - Blame information for rev 68

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

Line No. Rev Author Line
1 6 julius
// ----------------------------------------------------------------------------
2
 
3
// Access functions for the ORPSoC Verilator model: definition
4
 
5
// Copyright (C) 2008  Embecosm Limited <info@embecosm.com>
6
 
7
// Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
8
 
9
// This file is part of the cycle accurate model of the OpenRISC 1000 based
10
// system-on-chip, ORPSoC, built using Verilator.
11
 
12
// This program is free software: you can redistribute it and/or modify it
13
// under the terms of the GNU Lesser General Public License as published by
14
// the Free Software Foundation, either version 3 of the License, or (at your
15
// option) any later version.
16
 
17
// This program is distributed in the hope that it will be useful, but WITHOUT
18
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
20
// License for more details.
21
 
22
// You should have received a copy of the GNU Lesser General Public License
23
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
24
 
25
// ----------------------------------------------------------------------------
26
 
27
// $Id: OrpsocAccess.h 303 2009-02-16 11:20:17Z jeremy $
28
 
29
 
30
#ifndef ORPSOC_ACCESS__H
31
#define ORPSOC_ACCESS__H
32
 
33
#include <stdint.h>
34
 
35
class Vorpsoc_top;
36
class Vorpsoc_top_orpsoc_top;
37
class Vorpsoc_top_or1200_ctrl;
38 44 julius
class Vorpsoc_top_or1200_except;
39
class Vorpsoc_top_or1200_sprs;
40 6 julius
class Vorpsoc_top_or1200_dpram;
41 63 julius
// Main memory access class - will change if main memory size or other parameters change
42
class Vorpsoc_top_ram_wb_sc_sw__D20_A19_M800000;
43
// SoC Arbiter class - will also change if any modifications to bus architecture
44
class Vorpsoc_top_wb_conbus_top__pi1;
45 6 julius
 
46
 
47
//! Access functions to the Verilator model
48
 
49
//! This class encapsulates access to the Verilator model, allowing other
50
//! Classes to access model state, without needing to be built within the
51
//! Verilator environment.
52
class OrpsocAccess
53
{
54
public:
55
 
56
  // Constructor
57
  OrpsocAccess (Vorpsoc_top *orpsoc_top);
58
 
59
  // Accessor functions
60 51 julius
  bool      getExFreeze ();
61 6 julius
  bool      getWbFreeze ();
62
  uint32_t  getWbInsn ();
63 49 julius
  uint32_t  getIdInsn ();
64 51 julius
  uint32_t  getExInsn ();
65 44 julius
  uint32_t  getWbPC ();
66 49 julius
  uint32_t  getIdPC ();
67 51 julius
  uint32_t  getExPC ();
68 44 julius
  bool  getExceptFlushpipe ();
69
  bool  getExDslot ();
70 51 julius
  uint32_t getExceptType();
71 44 julius
  // Get a specific GPR from the register file
72 6 julius
  uint32_t  getGpr (uint32_t regNum);
73 44 julius
  //SPR accessessors
74
  uint32_t  getSprSr ();
75
  uint32_t  getSprEpcr ();
76
  uint32_t  getSprEear ();
77
  uint32_t  getSprEsr ();
78 6 julius
 
79 51 julius
  // Wishbone SRAM accessor functions
80 66 julius
  uint32_t  get_mem32 (uint32_t addr);
81
  uint8_t   get_mem8 (uint32_t addr);
82
 
83
  void  set_mem32 (uint32_t addr, uint32_t data);
84 51 julius
  // Trigger a $readmemh for the RAM array
85
  void  do_ram_readmemh (void);
86
 
87 63 julius
  // Arbiter access functions
88
  uint8_t getWbArbGrant ();
89
  // Master Signal Access functions
90
  uint32_t  getWbArbMastDatI (uint32_t mast_num);
91
  uint32_t  getWbArbMastDatO (uint32_t mast_num);
92
  uint32_t  getWbArbMastAdrI (uint32_t mast_num);
93
  uint8_t  getWbArbMastSelI (uint32_t mast_num);
94
  uint8_t getWbArbMastSlaveSelDecoded (uint32_t mast_num);
95
  bool  getWbArbMastWeI (uint32_t mast_num);
96
  bool  getWbArbMastCycI (uint32_t mast_num);
97
  bool  getWbArbMastStbI (uint32_t mast_num);
98
  bool  getWbArbMastAckO (uint32_t mast_num);
99
  bool  getWbArbMastErrO (uint32_t mast_num);
100
 
101
 
102
 
103 6 julius
private:
104
 
105
  // Pointers to modules with accessor functions
106 44 julius
  Vorpsoc_top_or1200_ctrl       *or1200_ctrl;
107
  Vorpsoc_top_or1200_except     *or1200_except;
108
  Vorpsoc_top_or1200_sprs       *or1200_sprs;
109
  Vorpsoc_top_or1200_dpram      *rf_a;
110 63 julius
  /*Vorpsoc_top_ram_wb_sc_sw*/Vorpsoc_top_ram_wb_sc_sw__D20_A19_M800000 *ram_wb_sc_sw;
111
  // Arbiter
112
  Vorpsoc_top_wb_conbus_top__pi1 *wb_arbiter;
113 6 julius
 
114
};      // OrpsocAccess ()
115
 
116
#endif  // ORPSOC_ACCESS__H

powered by: WebSVN 2.1.0

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