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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 6 julius
// ----------------------------------------------------------------------------
2
 
3
// SystemC OpenRISC 1200 Monitor: definition
4
 
5
// Copyright (C) 2008  Embecosm Limited <info@embecosm.com>
6
 
7
// Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
8 44 julius
// Contributor Julius Baxter <jb@orsoc.se>
9 6 julius
 
10
// This file is part of the cycle accurate model of the OpenRISC 1000 based
11
// system-on-chip, ORPSoC, built using Verilator.
12
 
13
// This program is free software: you can redistribute it and/or modify it
14
// under the terms of the GNU Lesser General Public License as published by
15
// the Free Software Foundation, either version 3 of the License, or (at your
16
// option) any later version.
17
 
18
// This program is distributed in the hope that it will be useful, but WITHOUT
19
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
21
// License for more details.
22
 
23
// You should have received a copy of the GNU Lesser General Public License
24
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
25
 
26
// ----------------------------------------------------------------------------
27
 
28
// $Id: Or1200MonitorSC.h 288 2009-02-03 15:08:00Z jeremy $
29
 
30
#ifndef OR1200_MONITOR_SC__H
31
#define OR1200_MONITOR_SC__H
32
 
33 44 julius
#include <fstream>
34
#include <ctime>
35
 
36 6 julius
#include "systemc.h"
37
 
38
#include "OrpsocAccess.h"
39
 
40
 
41
//! Monitor for special l.nop instructions
42
 
43
//! This class is based on the or1200_monitor.v of the Verilog test bench. It
44
//! wakes up on each posedge clock to check for "special" l.nop instructions,
45
//! which need processing.
46
 
47
class Or1200MonitorSC
48
  : public sc_core::sc_module
49
{
50
public:
51
 
52
  // Constructor
53
  Or1200MonitorSC (sc_core::sc_module_name  name,
54 49 julius
                   OrpsocAccess            *_accessor,
55
                   int argc,
56
                   char *argv[]);
57 6 julius
 
58
  // Method to check instructions
59
  void  checkInstruction();
60
 
61 44 julius
  // Methods to setup and output state of processor to a file
62
  void displayState();
63
 
64 49 julius
  // Function to calculate performance of the sim
65
  void perfSummary();
66
 
67
  // Print out the command-line switches for this module's options  
68
  void printSwitches();
69
 
70
  // Print out the usage for each option
71
  void printUsage();
72
 
73 6 julius
  // The ports
74
  sc_in<bool>   clk;
75
 
76
private:
77
 
78
  // Special NOP instructions
79
  static const uint32_t NOP_NOP    = 0x15000000;  //!< Normal nop instruction
80
  static const uint32_t NOP_EXIT   = 0x15000001;  //!< End of simulation
81
  static const uint32_t NOP_REPORT = 0x15000002;  //!< Simple report
82
  static const uint32_t NOP_PRINTF = 0x15000003;  //!< Simprintf instruction
83
  static const uint32_t NOP_PUTC   = 0x15000004;  //!< Putc instruction
84
 
85 44 julius
  // Variables for processor status output
86
  ofstream statusFile;
87
  int logging_enabled;
88
  int exit_perf_summary_enabled;
89
  int insn_count;
90
 
91
  // Time measurement variables - for calculating performance of the sim
92
  clock_t start;
93
 
94 6 julius
  //! The accessor for the Orpsoc instance
95
  OrpsocAccess *accessor;
96
 
97
};      // Or1200MonitorSC ()
98
 
99
#endif  // OR1200_MONITOR_SC__H

powered by: WebSVN 2.1.0

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