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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [sysc/] [src/] [OrpsocAccess.cpp] - Blame information for rev 40

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: implementation
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.cpp 303 2009-02-16 11:20:17Z jeremy $
28
 
29
#include "OrpsocAccess.h"
30
 
31
#include "Vorpsoc_top.h"
32
#include "Vorpsoc_top_orpsoc_top.h"
33
#include "Vorpsoc_top_or1k_top.h"
34
#include "Vorpsoc_top_or1200_top.h"
35
#include "Vorpsoc_top_or1200_cpu.h"
36
#include "Vorpsoc_top_or1200_ctrl.h"
37
#include "Vorpsoc_top_or1200_rf.h"
38
#include "Vorpsoc_top_or1200_dpram.h"
39
 
40
//! Constructor for the ORPSoC access class
41
 
42
//! Initializes the pointers to the various module instances of interest
43
//! within the Verilator model.
44
 
45
//! @param[in] orpsoc  The SystemC Verilated ORPSoC instance
46
 
47
OrpsocAccess::OrpsocAccess (Vorpsoc_top *orpsoc_top)
48
{
49
  or1200_ctrl = orpsoc_top->v->i_or1k->i_or1200_top->or1200_cpu->or1200_ctrl;
50
  rf_a        = orpsoc_top->v->i_or1k->i_or1200_top->or1200_cpu->or1200_rf->rf_a;
51
 
52
}       // OrpsocAccess ()
53
 
54
 
55
//! Access for the wb_freeze signal
56
 
57
//! @return  The value of the or1200_ctrl.wb_freeze signal
58
 
59
bool
60
OrpsocAccess::getWbFreeze ()
61
{
62
  return  or1200_ctrl->wb_freeze;
63
 
64
}       // getWbFreeze ()
65
 
66
 
67
//! Access for the wb_insn register
68
 
69
//! @return  The value of the or1200_ctrl.wb_insn register
70
 
71
uint32_t
72
OrpsocAccess::getWbInsn ()
73
{
74
  return  (or1200_ctrl->get_wb_insn) ();
75
 
76
}       // getWbInsn ()
77
 
78
 
79
//! Access for the OR1200 GPRs
80
 
81
//! These are extracted from memory using the Verilog function
82
 
83
//! @param[in] regNum  The GPR whose value is wanted
84
 
85
//! @return            The value of the GPR
86
 
87
uint32_t
88
OrpsocAccess::getGpr (uint32_t  regNum)
89
{
90
  return  (rf_a->get_gpr) (regNum);
91
 
92
}       // getGpr ()

powered by: WebSVN 2.1.0

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