-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathWhisperMessage.h
62 lines (54 loc) · 2.19 KB
/
WhisperMessage.h
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
// Copyright 2020 Western Digital Corporation or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <stdint.h>
enum WhisperMessageType { Peek, Poke, Step, Until, Change, ChangeCount,
Quit, Invalid, Reset, Exception, EnterDebug,
ExitDebug, LoadFinished, CancelDiv, CancelLr,
DumpMemory };
// Be careful changing this: test-bench file (defines.svh) needs to be
// updated.
enum WhisperExceptionType { InstAccessFault, DataAccessFault,
ImpreciseStoreFault, ImpreciseLoadFault,
PreciseStoreFault, PreciseLoadFault,
NonMaskableInterrupt };
/// Structure used to communicate with the whisper program using
/// sockets. When a ChangeCount message is returned by whisper (as a
/// reply to a Step or a ChangeCount request), the address is set to
/// the program-counter of the last executed instruction, the resource
/// is set to the opcode of that instruction and the value is set to
/// the number of change records generated by that instruction.
struct WhisperMessage
{
#ifdef __cplusplus
WhisperMessage(uint32_t hart = 0, WhisperMessageType type = Invalid,
uint32_t resource = 0, uint64_t address = 0,
uint64_t value = 0, uint64_t rank = 0)
: hart(hart), type(type), resource(resource), flags(0), rank(rank),
address(address), value(value)
{
buffer[0] = 0;
tag[0] = 0;
}
#endif
uint32_t hart;
uint32_t type;
uint32_t resource;
uint32_t flags;
uint64_t rank; // Future: to re-order out of order transactions
uint64_t address;
uint64_t value;
char buffer[128];
char tag[20];
};