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

Subversion Repositories test_project

[/] [test_project/] [trunk/] [bench/] [sysc/] [src/] [OrpsocAccess.cpp] - Blame information for rev 47

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

Line No. Rev Author Line
1 47 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_fpga_top.h"
32
#include "Vorpsoc_fpga_top_or1200_cpu.h"
33
#include "Vorpsoc_fpga_top_or1200_ctrl.h"
34
#include "Vorpsoc_fpga_top_or1200_rf.h"
35
#include "Vorpsoc_fpga_top_or1200_rfram_generic.h"
36
#include "Vorpsoc_fpga_top_or1200_top.h"
37
#include "Vorpsoc_fpga_top_orpsoc_fpga_top.h"
38
 
39
//! Constructor for the ORPSoC access class
40
 
41
//! Initializes the pointers to the various module instances of interest
42
//! within the Verilator model.
43
 
44
//! @param[in] orpsoc  The SystemC Verilated ORPSoC instance
45
 
46
OrpsocAccess::OrpsocAccess (Vorpsoc_fpga_top *orpsoc_fpga_top)
47
{
48
  or1200_ctrl = orpsoc_fpga_top->v->or1200_top->or1200_cpu->or1200_ctrl;
49
  rf_a        = orpsoc_fpga_top->v->or1200_top->or1200_cpu->or1200_rf->rf_a;
50
 
51
}       // OrpsocAccess ()
52
 
53
 
54
//! Access for the wb_freeze signal
55
 
56
//! @return  The value of the or1200_ctrl.wb_freeze signal
57
 
58
bool
59
OrpsocAccess::getWbFreeze ()
60
{
61
  return  or1200_ctrl->wb_freeze;
62
 
63
}       // getWbFreeze ()
64
 
65
 
66
//! Access for the wb_insn register
67
 
68
//! @return  The value of the or1200_ctrl.wb_insn register
69
 
70
uint32_t
71
OrpsocAccess::getWbInsn ()
72
{
73
  return  (or1200_ctrl->get_wb_insn) ();
74
 
75
}       // getWbInsn ()
76
 
77
 
78
//! Access for the OR1200 GPRs
79
 
80
//! These are extracted from memory using the Verilog function
81
 
82
//! @param[in] regNum  The GPR whose value is wanted
83
 
84
//! @return            The value of the GPR
85
 
86
uint32_t
87
OrpsocAccess::getGpr (uint32_t  regNum)
88
{
89
  return  (rf_a->get_gpr) (regNum);
90
 
91
}       // getGpr ()

powered by: WebSVN 2.1.0

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