Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / legion / src / include / options.h
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T2 Processor File: options.h
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
*
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ========== Copyright Header End ============================================
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _OPTIONS_H_
#define _OPTIONS_H_
#pragma ident "@(#)options.h 1.19 07/05/30 SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include "list.h"
#include "basics.h"
/*
* Options for controlling Save/Restore feature
*/
typedef struct MEM_PATCH mem_patch_t;
struct MEM_PATCH {
uint64_t addr;
uint64_t val;
mem_patch_t *nextp;
uint8_t *datap;
};
typedef struct {
char *filenamep; /* filename for memory image */
bool_t legion_format; /* flag to determine whether to save in
* axis or legion format. Default is to
* save in legion format */
uint64_t trigger_icount; /* instn count to trigger save_state */
uint64_t trap_pc; /* %pc to jump to when save requested */
/* XXX FIXME: for now, add one struct, need to make this a linked list later */
mem_patch_t mem_patch; /* mem patch to apply on save */
} save_restore_t;
/*
* Simulator options - gleaned from the argv list, or later modified
* via CLI commands.
*/
typedef struct {
char * cpp_cmd; /* CPP command path */
char * cpp_optionsp; /* CPP options for pre-processing the config files */
char * config_filep; /* configuration file name */
int accept_port; /* Socket to accept debugger / CLI connections */
bool_t specific_port; /* true if -p option specified by user */
int port_retry_max; /* Max no of retries on new ports if busy */
bool_t flag_auto_start;/* If true start exection immediately - dont wait for the debugger */
bool_t analyzer; /* If true enable logic analyzer mode */
bool_t magic_traps; /* If true allow "magic" traps */
int buffersz; /* Set size of log buffer, 0 = line buffering */
char * log_file;
int threads; /* Number of simcpu execution threads */
uint32_t quantum; /* execution quantum */
bool_t verbose; /* determine whether to print all messages or not */
bool_t dumpconfig; /* dump configuration after parsing */
save_restore_t save_restore; /* save/restore debug options */
bool_t walltime; /* simulation is walltime based */
LIST_DEF(libpath, char); /* list of search paths */
} options_t;
extern options_t options;
extern bool_t process_opts(int argc, char ** argv);
extern void banner_print();
extern void version_print();
extern void consolidate();
typedef char clibuf_t[2048];
#ifdef __cplusplus
}
#endif
#endif /* !_OPTIONS_H_ */