root/src/dps8/hdbg.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: 5e1e2bcf-f62f-11ec-8cca-80ee73e9b8e7
   5  *
   6  * ---------------------------------------------------------------------------
   7  *
   8  * Copyright (c) 2016 Charles Anthony
   9  * Copyright (c) 2021-2024 The DPS8M Development Team
  10  *
  11  * This software is made available under the terms of the ICU License.
  12  * See the LICENSE.md file at the top-level directory of this distribution.
  13  *
  14  * ---------------------------------------------------------------------------
  15  */
  16 
  17 #if defined(TESTING)
  18 
  19 # if !defined(Hdbg_def)
  20 #  define Hdbg_def
  21 
  22 t_stat hdbg_size (int32 arg, UNUSED const char * buf);
  23 t_stat hdbg_print (int32 arg, UNUSED const char * buf);
  24 t_stat hdbg_cpu_mask (UNUSED int32 arg, const char * buf);
  25 t_stat hdbgSegmentNumber (UNUSED int32 arg, const char * buf);
  26 t_stat hdbgBlacklist (UNUSED int32 arg, const char * buf);
  27 
  28 void hdbgTrace (const char * ctx);
  29 void hdbgPrint (void);
  30 enum hdbgIEFP_e
  31   {
  32     hdbgIEFP_abs_bar_read,
  33     hdbgIEFP_abs_read,
  34     hdbgIEFP_bar_read,
  35     hdbgIEFP_read,
  36     hdbgIEFP_abs_bar_write,
  37     hdbgIEFP_abs_write,
  38     hdbgIEFP_bar_write,
  39     hdbgIEFP_write
  40   };
  41 void hdbgIEFP (enum hdbgIEFP_e type, word15 segno, word18 offset, const char * ctx);
  42 void hdbgMRead (word24 addr, word36 data, const char * ctx);
  43 void hdbgMWrite (word24 addr, word36 data, const char * ctx);
  44 void hdbgFault (_fault faultNumber, _fault_subtype subFault,
  45                 const char * faultMsg, const char * ctx);
  46 void hdbgIntrSet (uint inum, uint cpuUnitIdx, uint scuUnitIdx, const char * ctx);
  47 void hdbgIntr (uint intr_pair_addr, const char * ctx);
  48 void hdbgNote (const char * ctx, const char * fmt, ...)
  49 #  if defined(__GNUC__)
  50   __attribute__ ((format (printf, 2, 3)))
  51 #  endif /* if defined(__GNUC__) */
  52 ;
  53 
  54 // Keep sync'd with regNames
  55 enum hregs_t
  56   {
  57     hreg_A,
  58     hreg_Q,
  59     hreg_X0, hreg_X1, hreg_X2, hreg_X3, hreg_X4, hreg_X5, hreg_X6, hreg_X7,
  60     hreg_AR0, hreg_AR1, hreg_AR2, hreg_AR3, hreg_AR4, hreg_AR5, hreg_AR6, hreg_AR7,
  61     hreg_PR0, hreg_PR1, hreg_PR2, hreg_PR3, hreg_PR4, hreg_PR5, hreg_PR6, hreg_PR7,
  62     hreg_Y, hreg_Z,
  63     hreg_IR,
  64     hreg_DSBR,
  65   };
  66 void hdbgRegR (enum hregs_t type, word36 data, const char * ctx);
  67 void hdbgRegW (enum hregs_t type, word36 data, const char * ctx);
  68 struct par_s;
  69 void hdbgPARegR (enum hregs_t type, struct par_s * data, const char * ctx);
  70 void hdbgPARegW (enum hregs_t type, struct par_s * data, const char * ctx);
  71 struct dsbr_s;
  72 void hdbgAPURead (word15 segno, word18 offset, word24 final, word36 data, const char * ctx);
  73 void hdbgAPUWrite (word15 segno, word18 offset, word24 final, word36 data, const char * ctx);
  74 
  75 #  define HDBGMRead(a, d, c) hdbgMRead (a, d, c)
  76 #  define HDBGMWrite(a, d, c) hdbgMWrite (a, d, c)
  77 #  define HDBGIEFP(t, s, o, c) hdbgIEFP (t, s, o, c);
  78 #  define HDBGAPURead(s, o, f, d, c) hdbgAPURead (s, o, f, d, c)
  79 #  define HDBGAPUWrite(s, o, f, d, c) hdbgAPUWrite (s, o, f, d, c)
  80 #  define HDBGRegAR(c) hdbgRegR (hreg_A, cpu.rA, c)
  81 #  define HDBGRegAW(c) hdbgRegW (hreg_A, cpu.rA, c)
  82 #  define HDBGRegQR(c) hdbgRegR (hreg_Q, cpu.rQ, c)
  83 #  define HDBGRegQW(c) hdbgRegW (hreg_Q, cpu.rQ, c)
  84 #  define HDBGRegXR(i, c) hdbgRegR (hreg_X0+(i), (word36) cpu.rX[i], c)
  85 #  define HDBGRegXW(i, c) hdbgRegW (hreg_X0+(i), (word36) cpu.rX[i], c)
  86 #  define HDBGRegYR(c) hdbgRegR (hreg_Y, (word36) cpu.rY, c)
  87 #  define HDBGRegYW(c) hdbgRegW (hreg_Y, (word36) cpu.rY, c)
  88 #  define HDBGRegZR(r, c) hdbgRegR (hreg_Z, (word36) r, c)
  89 #  define HDBGRegZW(r, c) hdbgRegW (hreg_Z, (word36) r, c)
  90 #  define HDBGRegPRR(i, c) hdbgPARegR (hreg_PR0+(i), & cpu.PAR[i], c)
  91 #  define HDBGRegPRW(i, c) hdbgPARegW (hreg_PR0+(i), & cpu.PAR[i], c)
  92 #  define HDBGRegARR(i, c) hdbgPARegR (hreg_AR0+(i), & cpu.PAR[i], c)
  93 #  define HDBGRegARW(i, c) hdbgPARegW (hreg_AR0+(i), & cpu.PAR[i], c)
  94 #  define HDBGRegIR(c) hdbgRegW (hreg_IR, (word36) cpu.cu.IR, c)
  95 #  define HDBGTrace(c) hdbgTrace(c)
  96 #  define HDBGIntr(i, c) hdbgIntr(i, c)
  97 #  define HDBGIntrSet(i, c, s, ctx) hdbgIntrSet(i, c, s, ctx)
  98 #  define HDBGFault(n, s, m, c) hdbgFault(n, s, m, c)
  99 #  define HDBGPrint() hdbgPrint()
 100 # endif /* if !defined(Hdbg_def) */
 101 #endif /* if defined(TESTING) */

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