Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages | Examples

ArchC Parser
[ArchC simulator generator]


[NOHEADER]

ac_stg_liststage_list = NULL *pstage *stage_list_tail = NULL

[NOHEADER]

ac_sto_liststorage_list
ac_sto_listpstorage
ac_sto_liststorage_list_tail

[NOHEADER]

ac_cache_parmsparms_list
ac_cache_parmspparms
ac_cache_parmsparms_list_tail

[NOHEADER]

int HaveFormattedRegs = 0 HaveMultiCycleIns = 0 HaveMemHier=0 HaveCycleRange=0

Defines

#define YYDEBUG   1
#define YYERROR_VERBOSE
#define ADD_DEBUG   1

Typedefs

typedef enum _commalist commalist
typedef enum _descr description
typedef enum _sto_unit sto_unit

Enumerations

enum  _commalist {
  INSTR_L, STAGE_L, REG_L, PIPE_L,
  REGBANK_L, CACHE_L, MEM_L
}
enum  _descr { ISA_D, ARCH_D }
enum  _sto_unit { BYTE = 1, KBYTE = 1024, MBYTE = 1048576, GBYTE = 1073741824 }

Functions

void yyerror (char *s)
void print_comment (FILE *output, char *description)
int parse_format (char **fieldstr, int sum_size, int size_limit, ac_dec_field **field_list_head, ac_dec_field **field_list_tail)
void add_format (ac_dec_format **head, ac_dec_format **tail, char *name, char *str)
void add_instr (char *name)
void add_storage (char *name, unsigned size, ac_sto_types type)

Variables

FILE * output = NULL
 The output file being written.

char * current_type
 The name of the type/format associated to the object currently being parsed.

char * current_instr
 The name of the instruction currently being parsed.

char * project_name
 Name of the ArchC project being processed.

char * isa_filename
 Name for the isa class file.

char * aux
ac_dec_formatformat_ins_list
ac_dec_formatformat_ins_list_tail
 Format List for instructions.

ac_dec_formatformat_reg_list
 Format List for registers.

ac_dec_formatformat_reg_list_tail
ac_dec_instrinstr_list
 Instruction List.

ac_dec_instrinstr_list_tail
ac_dec_instrpinstr
ac_dec_fieldfield_list = NULL
 Field List.

ac_dec_listpdec_list
 Decodification List.

ac_pipe_listpipe_list = NULL *ppipe *current_pipe=NULL *pipe_list_tail = NULL
commalist list_type
 Indicates what type of list of declarations is being parsed.

description descrp
 Indicates what type of description is being parsed.

sto_unit current_unit
 Indicates what storage unit is being used.

ac_sto_types cache_type
 Indicates the type of cache being declared.

ac_sto_listfetch_device
 Indicates the device used for fetching instructions.

int instr_num
 Number of Instructions.

int declist_num
 Number of Decodification lists.

int format_num
 Number of Formats.

int const_count
 Number of Constants.

int stage_num
 Number of Stages.

int pipe_num
 Number of Pipelines.

int wordsize
 Size of the word type in bits for the current project.

int reg_width
 Bit width of registers in a regbank.

int fetchsize
 Size of the fetch word type in bits for the current project.

int line_num
 Input file line counter.

int ac_tgt_endian
 Indicates the endianess of the host machine.

int first_format = 1 largest_format_size=0

Detailed Description

The ArchC parser is generated using GNU tools Bison and Flex. The ArchC grammar for the parser and the regular expressions for the lexical analyser are stored into archc.bison and archc.lex files respectively

Typedef Documentation

typedef enum _commalist commalist
 

type used to identify the kind of list being declared

Definition at line 178 of file archc.parser.c.

typedef enum _descr description
 

type used to identify which description is being parsed

Definition at line 183 of file archc.parser.c.

Referenced by print_comment().

typedef enum _sto_unit sto_unit
 

type used to identify which unit is being used for storage devices

Definition at line 188 of file archc.parser.c.


Enumeration Type Documentation

enum _commalist
 

type used to identify the kind of list being declared

Definition at line 176 of file archc.parser.c.

enum _descr
 

type used to identify which description is being parsed

Definition at line 181 of file archc.parser.c.

enum _sto_unit
 

type used to identify which unit is being used for storage devices

Definition at line 186 of file archc.parser.c.


Function Documentation

void add_format ac_dec_format **  head,
ac_dec_format **  tail,
char *  name,
char *  str
 

Add format to instr/reg format lists.

Parameters:
head Head of the format list.
tail Tail of the format list.
name The name of the instruction to be added.
str String containg field declarations

Definition at line 429 of file archc.parser.c.

References ac_dec_field, ac_dec_format, descrp, field_list, _ac_dec_format::fields, format_num, _ac_dec_format::name, _ac_dec_field::next, _ac_dec_format::next, parse_format(), and _ac_dec_format::size.

Here is the call graph for this function:

void add_instr char *  name  ) 
 

Add instruction to instruction list.

Parameters:
name The name of the instruction to be added.

Definition at line 468 of file archc.parser.c.

References ac_dec_instr, AC_ERROR, current_type, _ac_dec_instr::cycles, _ac_dec_instr::dec_list, _ac_dec_instr::format, _ac_dec_instr::id, instr_list, instr_num, line_num, _ac_dec_instr::max_latency, _ac_dec_instr::min_latency, _ac_dec_instr::mnemonic, _ac_dec_instr::name, and _ac_dec_instr::next.

void add_storage char *  name,
unsigned  size,
ac_sto_types  type
 

Add a new device to the storage list.

Parameters:
name The name of the device to be added.
size The size of the device to be added.
type The type of the device to be added.

Definition at line 568 of file archc.parser.c.

References AC_ERROR, ac_sto_list, current_type, current_unit, fetch_device, _ac_sto_list::format, _ac_sto_list::higher, _ac_sto_list::level, line_num, _ac_sto_list::name, _ac_sto_list::next, _ac_sto_list::parms, parms_list, parms_list_tail, pstorage, reg_width, _ac_sto_list::size, storage_list, storage_list_tail, _ac_sto_list::type, and _ac_sto_list::width.

int parse_format char **  fieldstr,
int  sum_size,
int  size_limit,
ac_dec_field **  field_list_head,
ac_dec_field **  field_list_tail
 

Parse format string generating field list.

Parameters:
fieldstr Reference to string containing field declarations.
sum_size Sum of bits of previous fields.
size_limit Limit of size for this field group
field_list_head Head of the field list.
field_list_tail Tail of the field list.

Definition at line 311 of file archc.parser.c.

References ac_dec_field, AC_ERROR, const_count, _ac_dec_field::first_bit, _ac_dec_field::id, _ac_dec_field::name, _ac_stg_list::next, _ac_dec_field::next, _ac_dec_field::sign, _ac_dec_field::size, and _ac_dec_field::val.

Referenced by add_format().

void print_comment FILE *  output,
char *  description
 

Writes a standard comment at the begining of each file generated by ArchC. OBS: Description must have 50 characteres at most!!

Parameters:
output The output file pointer.
description A brief description of the file being emited.

Definition at line 284 of file archc.parser.c.

References description, and output.

void yyerror char *  s  ) 
 

Error reporting function

Parameters:
s A string to be used as error message.

Definition at line 270 of file archc.parser.c.

References line_num.


Variable Documentation

int HaveFormattedRegs = 0 HaveMultiCycleIns = 0 HaveMemHier=0 HaveCycleRange=0
 

Boolean flag passed to the SystemC generator

Definition at line 238 of file archc.parser.c.

ac_cache_parms* parms_list
 

Cache parameter list management.

Definition at line 233 of file archc.parser.c.

Referenced by add_storage().

ac_cache_parms * parms_list_tail
 

Cache parameter list management.

Definition at line 233 of file archc.parser.c.

Referenced by add_storage().

ac_pipe_list* pipe_list = NULL *ppipe *current_pipe=NULL *pipe_list_tail = NULL
 

Pipe List management variables.

Definition at line 213 of file archc.parser.c.

Referenced by add_pipe().

ac_cache_parms * pparms
 

Cache parameter list management.

Definition at line 233 of file archc.parser.c.

ac_sto_list * pstorage
 

Storage List management.

Definition at line 228 of file archc.parser.c.

Referenced by add_storage().

ac_stg_list* stage_list = NULL *pstage *stage_list_tail = NULL
 

Stage List management variables.

Definition at line 223 of file archc.parser.c.

ac_sto_list* storage_list
 

Storage List management.

Definition at line 228 of file archc.parser.c.

Referenced by add_storage().

ac_sto_list * storage_list_tail
 

Storage List management.

Definition at line 228 of file archc.parser.c.

Referenced by add_storage().


Generated on Thu Jun 24 08:30:09 2004 for ArchC by doxygen 1.3.4