root/src/dps8/ucache.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * vim: filetype=c:tabstop=4:ai:expandtab
   3  * SPDX-License-Identifier: ICU
   4  * scspell-id: a10449da-171b-11ee-acc0-80ee73e9b8e7
   5  *
   6  * ---------------------------------------------------------------------------
   7  *
   8  * Copyright (c) 2022-2023 Charles Anthony
   9  * Copyright (c) 2022-2023 Jeffrey H. Johnson
  10  * Copyright (c) 2022-2024 The DPS8M Development Team
  11  *
  12  * This software is made available under the terms of the ICU License.
  13  * See the LICENSE.md file at the top-level directory of this distribution.
  14  *
  15  * ---------------------------------------------------------------------------
  16  */
  17 
  18 // It is believed that the maximum segment
  19 // number that Multics uses will be 4095.
  20 // Normal usage should be <= ~512 (0400)?
  21 
  22 //#define UC_CACHE_SZ 4096
  23 #define UC_CACHE_SZ 512
  24 
  25 // Micro-cache
  26 
  27 struct ucache_s {
  28   bool   valid;
  29   word15 segno;
  30   word18 offset;
  31   word14 bound;
  32   word1  p;
  33   word24 address;
  34   word3  r1;
  35   bool   paged;
  36 };
  37 typedef struct ucache_s ucache_t;
  38 
  39 #define UC_INSTRUCTION_FETCH   0
  40 #define UC_INDIRECT_WORD_FETCH 1
  41 #define UC_OPERAND_READ        2
  42 #define UC_OPERAND_READ_TRA    3
  43 #define UC_OPERAND_READ_CALL6  4
  44 #define UC_NUM                 5
  45 
  46 struct uCache_s {
  47   ucache_t caches [UC_NUM][UC_CACHE_SZ];
  48 #if defined(UCACHE_STATS)
  49   uint64_t hits   [UC_NUM];
  50   uint64_t misses [UC_NUM];
  51   uint64_t skips  [UC_NUM];
  52   uint64_t call6Skips;
  53   uint64_t ralrSkips;
  54   uint64_t segnoSkips;
  55 #endif /* if defined(UCACHE_STATS) */
  56 };
  57 
  58 typedef struct uCache_s uCache_t;
  59 
  60 struct cpu_state_s;
  61 
  62 void ucInvalidate (struct cpu_state_s * cpup);
  63 void ucCacheSave  \
  64  (struct cpu_state_s * cpup, uint ucNum, word15 segno,
  65   word18 offset, word14   bound, word1   p, word24   address, word3   r1, bool   paged);
  66 bool ucCacheCheck \
  67  (struct cpu_state_s * cpup, uint ucNum, word15 segno,
  68   word18 offset, word14 * bound, word1 * p, word24 * address, word3 * r1, bool * paged);
  69 #if defined(UCACHE_STATS)
  70 void ucacheStats (int cpuNo);
  71 #endif /* if defined(UCACHE_STATS) */

/* [previous][next][first][last][top][bottom][index][help] */