params.h 1.41 KB
/*
 * Copyright (C) 1996-1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * 
 * This file is part of the SimOS distribution. 
 * See LICENSE file for terms of the license. 
 *
 */


#ifndef _PARAMS_H_
#define _PARAMS_H_

#if defined(FLASH) && !defined(CONST_GLOBALS)
extern "C" {
#endif

#include "tcl_init.h"
#include "simtypes.h"

#define PARAM_INT TCL_LINK_INT
#define PARAM_DOUBLE TCL_LINK_DOUBLE
#define PARAM_BOOLEAN TCL_LINK_BOOLEAN
#define PARAM_STRING TCL_LINK_STRING

/* RPB -- hack for now */
#define PARAM_LL 5

extern void ParamGrabbedAtStartup(char *varName);
extern void SetAdditionalParams(Tcl_Interp *interp);

extern void ParamRegister(char *varName, char *addr, int type);
extern int  ParamLookup(void *valptr, char *name, int type);

extern char *ParamAccess(ClientData, Tcl_Interp *, char *, char *, int);

#ifdef FLASH
/* Provide a means for setting defaults for PARAM vars from C */
#define ParamDefault(NAME,VAL) { \
  Tcl_SetVar2(TCLInterp, "PARAM", NAME, VAL, TCL_GLOBAL_ONLY); \
  ParamAccess(NULL, TCLInterp, "PARAM", NAME, TCL_TRACE_WRITES); \
}
#endif

#ifndef FLASH
void InitCPUModel(CPUType cmdLineCPU);
#endif

#if defined(FLASH) && !defined(CONST_GLOBALS)
}
#endif

/*
 * Type used to determine the current scope when parsing machine tcl blocks
 */
typedef enum { MACHINE_TOP, MACHINE_BLOCK, MACHINE_VAL } MachineScopeType;

extern char *MemFileDir;
extern char *DevFileDir;


#endif