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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [or1ksim/] [or1ksim.h] - Blame information for rev 178

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

Line No. Rev Author Line
1 19 jeremybenn
/* or1ksim.h -- Simulator library header file
2
 
3
   Copyright (C) 2008 Embecosm Limited
4
 
5
   Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
6
 
7
   This file is part of OpenRISC 1000 Architectural Simulator.
8
 
9
   This program is free software; you can redistribute it and/or modify it
10
   under the terms of the GNU General Public License as published by the Free
11
   Software Foundation; either version 3 of the License, or (at your option)
12
   any later version.
13
 
14
   This program is distributed in the hope that it will be useful, but WITHOUT
15
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
17
   more details.
18
 
19
   You should have received a copy of the GNU General Public License along
20
   with this program.  If not, see <http://www.gnu.org/licenses/>. */
21
 
22
 
23
/* Header file definining the interface to the Or1ksim library. */
24
 
25
 
26
#ifndef OR1KSIM__H
27
#define OR1KSIM__H
28
 
29
 
30
/* The bus width */
31
 
32
/* #define BUSWIDTH  32 */
33
 
34
/* The return codes */
35
 
36
enum  or1ksim_rc {
37
  OR1KSIM_RC_OK,                /* No error */
38
 
39
  OR1KSIM_RC_BADINIT,           /* Couldn't initialize */
40 143 jeremybenn
  OR1KSIM_RC_BRKPT,             /* Hit a breakpoint */
41
  OR1KSIM_RC_HALTED             /* Hit NOP_EXIT */
42 19 jeremybenn
};
43
 
44
/* The interface methods */
45
 
46
#ifdef __cplusplus
47
extern "C" {
48
#endif
49
 
50 93 jeremybenn
int  or1ksim_init (const char *config_file,
51
                   const char *image_file,
52
                   void       *class_ptr,
53
                   int       (*upr) (void              *class_ptr,
54
                                     unsigned long int  addr,
55
                                     unsigned char      mask[],
56
                                     unsigned char      rdata[],
57
                                     int                data_len),
58
                   int       (*upw) (void              *class_ptr,
59
                                     unsigned long int  addr,
60
                                     unsigned char      mask[],
61
                                     unsigned char      wdata[],
62
                                     int                data_len));
63 19 jeremybenn
 
64 82 jeremybenn
int  or1ksim_run (double  duration);
65 19 jeremybenn
 
66 143 jeremybenn
int  or1ksim_step ();
67
 
68 82 jeremybenn
void  or1ksim_reset_duration (double duration);
69 19 jeremybenn
 
70 82 jeremybenn
void  or1ksim_set_time_point ();
71 19 jeremybenn
 
72 82 jeremybenn
double  or1ksim_get_time_period ();
73 19 jeremybenn
 
74 82 jeremybenn
int  or1ksim_is_le ();
75 19 jeremybenn
 
76
unsigned long int  or1ksim_clock_rate();
77
 
78 82 jeremybenn
/* Interrupt handling interface */
79
void  or1ksim_interrupt (int  i);
80 19 jeremybenn
 
81 82 jeremybenn
void or1ksim_interrupt_set (int  i);
82 19 jeremybenn
 
83 82 jeremybenn
void  or1ksim_interrupt_clear (int  i);
84 19 jeremybenn
 
85 82 jeremybenn
/* JTAG interface */
86
double  or1ksim_jtag_reset ();
87
 
88 98 jeremybenn
double  or1ksim_jtag_shift_ir (unsigned char *jreg,
89
                               int            num_bits);
90 82 jeremybenn
 
91 98 jeremybenn
double  or1ksim_jtag_shift_dr (unsigned char *jreg,
92
                               int            num_bits);
93 82 jeremybenn
 
94 143 jeremybenn
/* Access to simulator state */
95
int  or1ksim_read_mem (unsigned char *buf,
96
                       unsigned int   addr,
97
                       int            len);
98 82 jeremybenn
 
99 143 jeremybenn
int  or1ksim_write_mem (unsigned char *buf,
100
                        unsigned int   addr,
101
                        int            len);
102
 
103
int  or1ksim_read_reg (unsigned char *buf,
104
                       int            regnum,
105
                       int            len);
106
 
107
int  or1ksim_write_reg (unsigned char *buf,
108
                        int            regnum,
109
                        int            len);
110
 
111
 
112 19 jeremybenn
#ifdef __cplusplus
113
}
114
#endif
115
 
116
 
117
#endif  /* OR1KSIM__H */

powered by: WebSVN 2.1.0

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