|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2023 nono project
4: // Licensed under nono-license.txt
5: //
6:
7: // キャッシュ
8:
9: #pragma once
10:
11: #include "m68030.h"
12:
13: // キャッシュライン
14: struct m68030CacheLine
15: {
16: // タグは命令キャッシュ/データキャッシュで共通だが、
17: // 命令キャッシュなら下位1ビットが S (FC2)、
18: // データキャッシュなら下位3ビットが FC1,FC0,FC2 の順。
19: // 3 2 1
20: // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
21: // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
22: // | Tag Address (24bit) | |S| (Inst)
23: // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
24: //
25: // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
26: // | Tag Address (24bit) | |1|0|S| (Data)
27: // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
28: uint32 tag {};
29:
30: std::array<uint32, 4> data {};
31: union {
32: uint32 valid_all {};
33: uint8 valid[4];
34: };
35:
36: bool IsSuper() const { return (tag & 1); }
37: uint32 TagAddr() const { return (tag & 0xffffff00); }
38: };
39:
40: // キャッシュ (命令/データ共通)
41: class m68030Cache
42: {
43: public:
44: std::array<m68030CacheLine, 16> line {};
45: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.