simos_interface.h
2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
* Copyright (C) 1996-1998 by the Board of Trustees
* of Leland Stanford Junior University.
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
#ifndef CHAL2_SIMOS_INTERFACE_H
#define CHAL2_SIMOS_INTERFACE_H
/*
SimOS cache <-> Chal2 bus-interface declarations
by Stephen Gold, 6 May 1997
*/
#include "memsys.h"
/*
SimOS calls this function to trigger the simulation of new bus-cycle
by Chal2.
This is the only function in the interface which can advance
the simulation clock. All others must return within the current
bus-cycle.
*/
void Chal2CycleAdvance (void);
/*
SimOS calls this function to enqueue a new request into the
bus-interface. It returns SUCCESS if successful.
The request_type will be one of:
MEMSYS_GET
MEMSYS_GETX
MEMSYS_UPGRADE
If writeback_flag is TRUE, the data pointed to by replaced_data_ptr
is scheduled to be written back to replaced_paddr. If writeback_flag
is FALSE, those arguments are ignored.
*/
Result Chal2Request (int cpu_id, int request_type, PA requested_paddr,
int request_id, PA replaced_paddr, int writeback_flag,
byte *replaced_data_ptr);
/*
The bus-interface calls this function to indicate the
completion of a request. The status will be MEMSYS_STATUS_SUCCESS
if the request was successful.
If the request_type was GET or GETX, returned_data_ptr will point to
the data returned by the request.
The new_cache_state will be one of:
MEMSYS_EXCLUSIVE
MEMSYS_SHARED
*/
void Chal2Completion (unsigned cpu_id, int request_id, int new_cache_state,
void *returned_data_ptr);
/*
The bus-interface calls this function to flush any exclusive copy
of a line out of a SimOS cache.
If the line is present in the cache:
SimOS copies the contents of the line into memory pointed to
by flushback_data_ptr and returns TRUE.
If the line is not present in the cache:
SimOS returns FALSE.
*/
bool Chal2Flush (unsigned cpu_id, PA paddr, void *flushback_data_ptr);
/*
The bus-interface calls this function to invalidate any copies
of a line in a SimOS cache.
If the line is dirty in the cache:
SimOS copies the contents of the line into memory pointed to
by flushback_data_ptr, sets *flushback_indicator to TRUE, and
returns TRUE.
If the line is shared in the cache:
SimOS sets *flushback_indicator to FALSE and returns TRUE.
If the line is not present in the cache:
SimOS sets *flushback_indicator to FALSE and returns FALSE.
*/
bool Chal2Invalidate (unsigned cpu_id, PA paddr, bool *flushback_indicator,
void *flushback_data_ptr);
#endif /* CHAL2_SIMOS_INTERFACE_H */