changeset 084c8da32789 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=084c8da32789
description:
ruby: get rid of the ioutil stuff since it isn't used anymore
diffstat:
11 files changed, 2020 deletions(-)
src/mem/gems_common/SConscript | 9
src/mem/gems_common/ioutil/FakeSimicsDataTypes.hh | 63 --
src/mem/gems_common/ioutil/SConscript | 36 -
src/mem/gems_common/ioutil/attrlex.ll | 194 ------
src/mem/gems_common/ioutil/attrparse.yy | 196 -------
src/mem/gems_common/ioutil/confio.cc | 444 ---------------
src/mem/gems_common/ioutil/confio.hh | 192 ------
src/mem/gems_common/ioutil/embedtext.py | 54 -
src/mem/gems_common/ioutil/initvar.cc | 585 ---------------------
src/mem/gems_common/ioutil/initvar.hh | 172 ------
src/mem/gems_common/ioutil/vardecl.hh | 75 --
diffs (truncated from 2070 to 300 lines):
diff -r f226c098c393 -r 084c8da32789 src/mem/gems_common/SConscript
--- a/src/mem/gems_common/SConscript Wed Mar 10 16:22:26 2010 -0800
+++ b/src/mem/gems_common/SConscript Wed Mar 10 16:22:26 2010 -0800
@@ -33,15 +33,6 @@
if not env['RUBY']:
Return()
-#benv['LEXCOM'] = "$LEX $LEXFLAGS -o$TARGET $SOURCES"
-benv = env.Clone()
-benv.Append(YACCFLAGS=["-pat"])
-benv.Append(LEXFLAGS=["-Pat"])
-benv.CXXFile('ioutil/attrlex.ll')
-benv.CXXFile('ioutil/attrparse.yy')
-
-Source('ioutil/attrlex.cc', Werror=False)
-Source('ioutil/attrparse.cc', Werror=False)
Source('util.cc')
TraceFlag('GemsCommon')
diff -r f226c098c393 -r 084c8da32789
src/mem/gems_common/ioutil/FakeSimicsDataTypes.hh
--- a/src/mem/gems_common/ioutil/FakeSimicsDataTypes.hh Wed Mar 10 16:22:26
2010 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#ifndef FAKE_SIMICS_DATA_TYPES_H
-#define FAKE_SIMICS_DATA_TYPES_H
-
-typedef struct attr_value attr_value_t;
-
-typedef enum {
- Sim_Val_Invalid = 0,
- Sim_Val_String = 1,
- Sim_Val_Integer = 2,
- Sim_Val_Floating = 3,
- Sim_Val_List = 4,
- Sim_Val_Data = 5,
- Sim_Val_Nil = 6,
- Sim_Val_Object = 7
-} attr_kind_t;
-
-typedef struct attr_list attr_list_t;
-
-struct attr_list {
- int size;
- struct attr_value *vector;
-};
-
-struct attr_value {
- attr_kind_t kind;
- union {
- const char *string; /* Sim_Val_String */
- unsigned long long integer; /* Sim_Val_Integer */
- double floating; /* Sim_Val_Floating */
- void *object; /* Sim_Val_Object */
- attr_list_t list; /* Sim_Val_List */
- } u;
-};
-
-typedef enum {
-Sim_Set_Ok,
-Sim_Set_Need_Integer,
-Sim_Set_Need_Floating,
-Sim_Set_Need_String,
-Sim_Set_Need_List,
-Sim_Set_Need_Data,
-Sim_Set_Need_Object,
-Sim_Set_Object_Not_Found,
-Sim_Set_Interface_Not_Found,
-Sim_Set_Illegal_Value,
-Sim_Set_Illegal_Type,
-Sim_Set_Illegal_Index,
-Sim_Set_Attribute_Not_Found,
-Sim_Set_Not_Writable,
-Sim_Set_Ignored
-} set_error_t;
-
-
-typedef attr_value_t (*get_attr_t)(void *ptr,
- void *obj,
- attr_value_t *idx);
-
-typedef set_error_t (*set_attr_t)(void *ptr,
- void *obj,
- attr_value_t *val,
- attr_value_t *idx);
-
-#endif // #ifndef FAKE_SIMICS_DATA_TYPES_H
diff -r f226c098c393 -r 084c8da32789 src/mem/gems_common/ioutil/SConscript
--- a/src/mem/gems_common/ioutil/SConscript Wed Mar 10 16:22:26 2010 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-# -*- mode:python -*-
-
-# Copyright (c) 2009 The Hewlett-Packard Development Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met: redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer;
-# redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution;
-# neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Authors: Nathan Binkert
-
-Import('*')
-
-if not env['RUBY']:
- Return()
-
-Source('confio.cc')
diff -r f226c098c393 -r 084c8da32789 src/mem/gems_common/ioutil/attrlex.ll
--- a/src/mem/gems_common/ioutil/attrlex.ll Wed Mar 10 16:22:26 2010 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 1999-2005 Mark D. Hill and David A. Wood
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer;
- * redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution;
- * neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-%option noyywrap
-
-ALPHADIGIT [^\:\,\(\)\n\t\(\) \0\#]
-HEXDIGIT [0-9a-fA-Fx]
-NEWLINE [\n]
-WHITESPACE [ \t]
-
-%{
-
-#include "mem/ruby/common/Global.hh"
-
-using namespace std;
-#include <string>
-#include <map>
-#include <stdlib.h>
-
-// Maurice
-// extern "C" {
-// #include "simics/api.hh"
-// };
-
-#include "mem/gems_common/ioutil/FakeSimicsDataTypes.hh"
-
-// CM: simics 1.6.5 API redefines fwrite, much to my chagrin
-#undef fwrite
-#undef printf
-#include "mem/gems_common/ioutil/attrparse.hh"
-
-#define MAX_INCLUDE_DEPTH 10
-
-/** global result of parsing file */
-extern attr_value_t g_attr_map;
-
-extern int atparse(void);
-
-static int linenum=1; /* the current line number */
-static int colnum=1; /* the current column number */
-static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
-static int include_stack_ptr = 0;
-static char g_relative_include_path[256];
-
-
-// forward declaration of aterror
-void aterror(const char *msg);
-%}
-
-%x SLASHCOMMENT INCLUDE
-
-%%
-
-%{ /* PATTERNS FOR STRING TOKENS */
-%}
-
-"//".*[\n] { linenum++; colnum=1; } /* C++ style comments */
-
-\#include { colnum+=yyleng; BEGIN(INCLUDE); }
-<INCLUDE>{WHITESPACE}* { colnum+=yyleng; }
-<INCLUDE>[^ \t\n]+ {
- // should really be FILEIO_MAX_FILENAME or MAX_NAME
- char str[256];
- if ( include_stack_ptr >= MAX_INCLUDE_DEPTH )
- {
- ERROR_OUT( "Includes nested too deeply" );
- exit( 1 );
- }
- include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER;
-
- yyin = fopen( yytext, "r" );
- if ( ! yyin ) {
- sprintf( str, "%s%s", g_relative_include_path, yytext );
- yyin = fopen( str, "r" );
- }
- if ( ! yyin ) {
- sprintf( str, "%s%s%s", g_relative_include_path,
"config/", yytext );
- yyin = fopen( str, "r" );
- }
- if ( ! yyin ) {
- ERROR_OUT("unable to open included file: %s or %s\n",
yytext, str);
- aterror("file open error.\n");
- }
- yy_switch_to_buffer(yy_create_buffer( yyin, YY_BUF_SIZE ));
- BEGIN(INITIAL);
- }
-<<EOF>> {
- if ( --include_stack_ptr < 0 ) {
- yyterminate();
- } else {
- yy_delete_buffer( YY_CURRENT_BUFFER );
- fclose(yyin);
- yy_switch_to_buffer(include_stack[include_stack_ptr] );
- }
- }
-
-\( { colnum+=yyleng; return (LPAREN); }
-\) { colnum+=yyleng; return (RPAREN); }
-\: { colnum+=yyleng; return (':'); }
-\, { colnum+=yyleng; return (','); }
-{HEXDIGIT}+ {
- colnum+=yyleng;
- attr_value_t *val = (attr_value_t *)
- malloc( sizeof(attr_value_t) );
- memset( val, 0, sizeof(attr_value_t) );
- atlval.attrval = val;
- val->kind = Sim_Val_Integer;
- val->u.integer = strtoull( yytext, NULL, 0 );
- return (INTEGER); }
-{ALPHADIGIT}+ {
- colnum+=yyleng;
- attr_value_t *val = (attr_value_t *)
- malloc( sizeof(attr_value_t) );
- memset( val, 0, sizeof(attr_value_t) );
- atlval.attrval = val;
- val->kind = Sim_Val_String;
- val->u.string = strdup(yytext);
- return (STRING); }
-
-%{ /* OTHER PATTERNS */
-%}
-
-{WHITESPACE}+ {colnum += yyleng;}
-{NEWLINE} {linenum++; colnum = 1;}
-
-%%
-
-extern "C" void parseInitialize( void )
-{
- // since no global variables are set in simics, we must do it manually
- // this is also necessary now that the parser can be used more than once.
- // (it is used to parse the defaults, and can be used after that)
- linenum = 1;
- colnum = 1;
- include_stack_ptr = 0;
-}
-
-extern "C" int parseAttrFile( FILE *inputFile, const char
*relative_include_path, attr_value_t *myTable )
-{
- parseInitialize();
- strncpy( g_relative_include_path, relative_include_path, 255 );
-
- int result;
- yyin = inputFile;
- YY_BUFFER_STATE scan_state = yy_create_buffer( yyin, YY_BUF_SIZE );
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev