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-2023 The DPS8M Development Team
  10  *
  11  * All rights reserved.
  12  *
  13  * This software is made available under the terms of the ICU
  14  * License, version 1.8.1 or later.  For more details, see the
  15  * LICENSE.md file at the top-level directory of this distribution.
  16  *
  17  * ---------------------------------------------------------------------------
  18  */
  19 
  20 #ifndef API
  21 # define N_SYMBOLS    1024
  22 #else
  23 # define N_SYMBOLS    0
  24 #endif
  25 
  26 #define SYMBOL_SZ     32
  27 enum symbolType {
  28   SYM_EMPTY         = 0,
  29   SYM_STATE_OFFSET  = 1,  // Offset from state of system state
  30   SYM_STRUCT_OFFSET = 2,  // Offset from state of parent structure
  31   SYM_STRUCT_SZ     = 3,  // Structure size
  32   SYM_CONSTANT      = 4,
  33   SYM_ENUM          = 5,
  34 };
  35 
  36 enum valueType {
  37   SYM_UNDEF         = 0,
  38   SYM_STRING        = 10,
  39   SYM_PTR           = 20,
  40   SYM_ARRAY         = 21,
  41   SYM_SZ            = 30,
  42 
  43   SYM_UINT8         = 800,
  44   SYM_UINT8_1       = 801,
  45   SYM_UINT8_3       = 803,
  46   SYM_UINT8_6       = 806,
  47   SYM_UINT16        = 1600,
  48   SYM_UINT16_9      = 1609,
  49   SYM_UINT16_12     = 1612,
  50   SYM_UINT16_14     = 1614,
  51   SYM_UINT16_15     = 1615,
  52   SYM_UINT32        = 3200,
  53   SYM_UINT32_18     = 3218,
  54   SYM_UINT32_24     = 3224,
  55   SYM_UINT32_27     = 3227,
  56   SYM_UINT64        = 6400,
  57   SYM_UINT64_36     = 6436,
  58 };
  59 
  60 struct symbol_s {
  61   char     name[SYMBOL_SZ];
  62   uint32_t symbolType;
  63   uint32_t valueType;
  64   uint32_t value;
  65 };
  66 
  67 #define SYMTAB_HDR    "dps8m symtab"
  68 #define SYMTAB_HDR_SZ 16
  69 #define SYMTAB_VER    1
  70 
  71 struct symbolTable_s {
  72   char    symtabHdr[SYMTAB_HDR_SZ];    // = STATE_HDR
  73   int32_t symtabVer;                   // = STATE_VER
  74   struct  symbol_s symbols[N_SYMBOLS];
  75 };
  76 
  77 #define STATE_HDR     "dps8m state"
  78 #define STATE_HDR_SZ  16
  79 #define STATE_VER     1
  80 
  81 struct system_state_s {
  82   // The first three are fixed layout
  83   char        stateHdr[STATE_HDR_SZ];  // = STATE_HDR
  84   int32_t     stateVer;                // = STATE_VER
  85   struct      symbolTable_s symbolTable;
  86 #ifndef API
  87   char        commit_id [41];
  88   vol         word36 M [MEMSIZE];
  89   cpu_state_t cpus [N_CPU_UNITS_MAX];
  90   struct cables_s cables;
  91 #endif
  92 };
  93 
  94 #ifndef API
  95 extern struct system_state_s * system_state;
  96 #else
  97 int sim_iglock     =  0;
  98 int sim_nolock     =  0;
  99 int sim_randompst  =  0;
 100 int sim_randstate  =  0;
 101 int sim_nostate    =  0;
 102 #endif

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