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 <trnsz@pobox.com>
  10  * Copyright (c) 2022-2023 The DPS8M Development Team
  11  *
  12  * All rights reserved.
  13  *
  14  * This software is made available under the terms of the ICU
  15  * License, version 1.8.1 or later.  For more details, see the
  16  * LICENSE.md file at the top-level directory of this distribution.
  17  *
  18  * ---------------------------------------------------------------------------
  19  */
  20 
  21 // It is believed that the maximum segment
  22 // number that Multics uses will be 4095.
  23 // Normal usage should be <= ~512 (0400)?
  24 
  25 //#define UC_CACHE_SZ 4096
  26 #define UC_CACHE_SZ 512
  27 
  28 // Micro-cache
  29 
  30 struct ucache_s {
  31   bool   valid;
  32   word15 segno;
  33   word18 offset;
  34   word14 bound;
  35   word1  p;
  36   word24 address;
  37   word3  r1;
  38   bool   paged;
  39 };
  40 typedef struct ucache_s ucache_t;
  41 
  42 #define UC_INSTRUCTION_FETCH   0
  43 #define UC_INDIRECT_WORD_FETCH 1
  44 #define UC_OPERAND_READ        2
  45 #define UC_OPERAND_READ_TRA    3
  46 #define UC_OPERAND_READ_CALL6  4
  47 #define UC_NUM                 5
  48 
  49 struct uCache_s {
  50   ucache_t caches [UC_NUM][UC_CACHE_SZ];
  51 #ifdef UCACHE_STATS
  52   uint64_t hits   [UC_NUM];
  53   uint64_t misses [UC_NUM];
  54   uint64_t skips  [UC_NUM];
  55   uint64_t call6Skips;
  56   uint64_t ralrSkips;
  57   uint64_t segnoSkips;
  58 #endif
  59 };
  60 
  61 typedef struct uCache_s uCache_t;
  62 
  63 void ucInvalidate (void);
  64 void ucCacheSave  (uint ucNum, word15 segno, word18 offset, word14   bound, word1   p, word24   address, word3   r1, bool   paged);
  65 bool ucCacheCheck (uint ucNum, word15 segno, word18 offset, word14 * bound, word1 * p, word24 * address, word3 * r1, bool * paged);
  66 #ifdef UCACHE_STATS
  67 void ucacheStats (int cpuNo);
  68 #endif

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