typedef enum
{
generate_calls,
generate_jumps,
}
igen_code;
typedef enum
{
nia_is_cia_plus_one,
nia_is_void,
nia_is_invalid,
}
igen_nia;
typedef struct _igen_gen_options igen_gen_options;
struct _igen_gen_options
{
int direct_access;
int semantic_icache;
int insn_in_icache;
int conditional_issue;
int slot_verification;
int delayed_branch;
int zero_reg;
int zero_reg_nr;
int multi_sim;
char *default_model;
int multi_word;
int smp;
igen_nia nia;
int icache;
int icache_size;
igen_code code;
};
typedef struct _igen_trace_options igen_trace_options;
struct _igen_trace_options
{
int rule_selection;
int rule_rejection;
int insn_insertion;
int insn_expansion;
int entries;
int combine;
};
typedef struct _igen_name
{
char *u;
char *l;
}
igen_name;
typedef struct _igen_module
{
igen_name prefix;
igen_name suffix;
}
igen_module;
typedef struct _igen_module_options
{
igen_module global;
igen_module engine;
igen_module icache;
igen_module idecode;
igen_module itable;
igen_module semantics;
igen_module support;
}
igen_module_options;
typedef struct _igen_decode_options igen_decode_options;
struct _igen_decode_options
{
int combine;
int duplicate;
int zero_reserved;
int switch_as_goto;
char *overriding_gen;
};
typedef struct _igen_warn_options igen_warn_options;
struct _igen_warn_options
{
int discard;
int width;
int unimplemented;
};
typedef struct _igen_options igen_options;
struct _igen_options
{
int hi_bit_nr;
int insn_bit_size;
int insn_specifying_widths;
igen_module_options module;
igen_gen_options gen;
igen_trace_options trace;
table_include *include;
igen_decode_options decode;
filter *flags_filter;
igen_warn_options warn;
error_func (*warning);
filter *model_filter;
filter *format_name_filter;
};
extern igen_options options;
#define INIT_OPTIONS() \
do { \
memset (&options, 0, sizeof options); \
memset (&options.warn, -1, sizeof (options.warn)); \
options.hi_bit_nr = 0; \
options.insn_bit_size = default_insn_bit_size; \
options.insn_specifying_widths = 0; \
options.module.global.prefix.u = ""; \
options.module.global.prefix.l = ""; \
\
options.module.engine = options.module.global; \
options.module.icache = options.module.global; \
options.module.idecode = options.module.global; \
options.module.itable = options.module.global; \
options.module.semantics = options.module.global; \
options.module.support = options.module.global; \
\
options.module.engine.suffix.l = "engine"; \
options.module.engine.suffix.u = "ENGINE"; \
options.module.icache.suffix.l = "icache"; \
options.module.icache.suffix.u = "ICACHE"; \
options.module.idecode.suffix.l = "idecode"; \
options.module.idecode.suffix.u = "IDECODE"; \
options.module.itable.suffix.l = "itable"; \
options.module.itable.suffix.u = "ITABLE"; \
options.module.semantics.suffix.l = "semantics"; \
options.module.semantics.suffix.u = "SEMANTICS"; \
options.module.support.suffix.l = "support"; \
options.module.support.suffix.u = "SUPPORT"; \
\
options.gen.code = generate_calls; \
options.gen.icache_size = 1024; \
options.warning = warning; \
} while (0)