root/src/dps8/dps8_state.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: fa4a490d-f62e-11ec-bbb0-80ee73e9b8e7
   5  *
   6  * ---------------------------------------------------------------------------
   7  *
   8  * Copyright (c) 2019-2021 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(API)
  18 # define N_SYMBOLS    1024
  19 #else
  20 # define N_SYMBOLS    0
  21 #endif /* if !defined(API) */
  22 
  23 #define SYMBOL_SZ     32
  24 enum symbolType {
  25   SYM_EMPTY         = 0,
  26   SYM_STATE_OFFSET  = 1,  // Offset from state of system state
  27   SYM_STRUCT_OFFSET = 2,  // Offset from state of parent structure
  28   SYM_STRUCT_SZ     = 3,  // Structure size
  29   SYM_CONSTANT      = 4,
  30   SYM_ENUM          = 5,
  31 };
  32 
  33 enum valueType {
  34   SYM_UNDEF         = 0,
  35   SYM_STRING        = 10,
  36   SYM_PTR           = 20,
  37   SYM_ARRAY         = 21,
  38   SYM_SZ            = 30,
  39 
  40   SYM_UINT8         = 800,
  41   SYM_UINT8_1       = 801,
  42   SYM_UINT8_3       = 803,
  43   SYM_UINT8_6       = 806,
  44   SYM_UINT16        = 1600,
  45   SYM_UINT16_9      = 1609,
  46   SYM_UINT16_12     = 1612,
  47   SYM_UINT16_14     = 1614,
  48   SYM_UINT16_15     = 1615,
  49   SYM_UINT32        = 3200,
  50   SYM_UINT32_18     = 3218,
  51   SYM_UINT32_24     = 3224,
  52   SYM_UINT32_27     = 3227,
  53   SYM_UINT64        = 6400,
  54   SYM_UINT64_36     = 6436,
  55 };
  56 
  57 struct symbol_s {
  58   char     name[SYMBOL_SZ];
  59   uint32_t symbolType;
  60   uint32_t valueType;
  61   uint32_t value;
  62 };
  63 
  64 #define SYMTAB_HDR    "dps8m symtab"
  65 #define SYMTAB_HDR_SZ 16
  66 #define SYMTAB_VER    1
  67 
  68 struct symbolTable_s {
  69   char    symtabHdr[SYMTAB_HDR_SZ];    // = STATE_HDR
  70   int32_t symtabVer;                   // = STATE_VER
  71   struct  symbol_s symbols[N_SYMBOLS];
  72 };
  73 
  74 #define STATE_HDR     "dps8m state"
  75 #define STATE_HDR_SZ  16
  76 #define STATE_VER     1
  77 
  78 struct system_state_s {
  79   // The first three are fixed layout
  80   char        stateHdr[STATE_HDR_SZ];  // = STATE_HDR
  81   int32_t     stateVer;                // = STATE_VER
  82   struct      symbolTable_s symbolTable;
  83 #if !defined(API)
  84   char        commit_id [41];
  85   vol         word36 M [MEMSIZE];
  86   cpu_state_t cpus [N_CPU_UNITS_MAX];
  87   struct cables_s cables;
  88 #endif /* if !defined(API) */
  89 };
  90 
  91 #if !defined(API)
  92 extern struct system_state_s * system_state;
  93 #else
  94 int sim_iglock     =  0;
  95 int sim_nolock     =  0;
  96 int sim_randompst  =  0;
  97 int sim_randstate  =  0;
  98 int sim_nostate    =  0;
  99 #endif /* if !defined(API) */

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