summaryrefslogtreecommitdiff
path: root/cuobjdump_to_ptxplus/cuobjdump.y
diff options
context:
space:
mode:
authorAndrew M. B. Boktor <[email protected]>2012-05-02 12:33:33 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:19:06 -0700
commit6bd512ea5b8cc098903fcb2dd802e652bbed2cb4 (patch)
treedac4feadd50bdaedd53099e21d26342123a5059a /cuobjdump_to_ptxplus/cuobjdump.y
parentd1cd69a100116dd8192115c49381d43faa355220 (diff)
Moving things where they belong
cubojdump.l/.y are used to parse the output of cuobjdump, and thus should be part of libcuda not cuobjdump_to_ptxplus Included are also modifications to Makefiles [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 12255]
Diffstat (limited to 'cuobjdump_to_ptxplus/cuobjdump.y')
-rw-r--r--cuobjdump_to_ptxplus/cuobjdump.y83
1 files changed, 0 insertions, 83 deletions
diff --git a/cuobjdump_to_ptxplus/cuobjdump.y b/cuobjdump_to_ptxplus/cuobjdump.y
deleted file mode 100644
index 0b20a83..0000000
--- a/cuobjdump_to_ptxplus/cuobjdump.y
+++ /dev/null
@@ -1,83 +0,0 @@
- /*Yacc file for output of cuobjdump*/
-%{
-#include <stdio.h>
-
-int yylex(void);
-void yyerror(const char*);
-extern void addCuobjdumpSection(int sectiontype);
-void setCuobjdumparch(const char* arch);
-void setCuobjdumpidentifier(const char* identifier);
-void setCuobjdumpptxfilename(const char* filename);
-void setCuobjdumpelffilename(const char* filename);
-void setCuobjdumpsassfilename(const char* filename);
-int elfserial = 1;
-int ptxserial = 1;
-FILE *ptxfile;
-FILE *elffile;
-FILE *sassfile;
-char filename [1024];
-%}
-%union {
- char* string_value;
-}
-%token <string_value> H_SEPARATOR H_ARCH H_CODEVERSION H_PRODUCER H_HOST H_COMPILESIZE H_IDENTIFIER
-%token <string_value> CODEVERSION
-%token <string_value> STRING
-%token <string_value> FILENAME
-%token <string_value> DECIMAL
-%token <string_value> PTXHEADER ELFHEADER
-%token <string_value> PTXLINE
-%token <string_value> ELFLINE
-%token <string_value> SASSLINE
-%token <string_value> IDENTIFIER
-%token <string_value> NEWLINE
-
-%%
-
-program : emptylines section
- | program section;
-
-emptylines : emptylines NEWLINE
- | ;
-
-section : PTXHEADER {
- addCuobjdumpSection(0);
- snprintf(filename, 1024, "_cuobjdump_%d.ptx", ptxserial++);
- ptxfile = fopen(filename, "w");
- setCuobjdumpptxfilename(filename);
- } headerinfo ptxcode {
- fclose(ptxfile);
- }
- | ELFHEADER {
- addCuobjdumpSection(1);
- snprintf(filename, 1024, "_cuobjdump_%d.elf", elfserial);
- elffile = fopen(filename, "w");
- setCuobjdumpelffilename(filename);
- } headerinfo elfcode {
- fclose(elffile);
- snprintf(filename, 1024, "_cuobjdump_%d.sass", elfserial++);
- sassfile = fopen(filename, "w");
- setCuobjdumpsassfilename(filename);
- } sasscode {
- fclose(sassfile);
- };
-
-headerinfo : H_SEPARATOR NEWLINE
- H_ARCH IDENTIFIER NEWLINE
- H_CODEVERSION CODEVERSION NEWLINE
- H_PRODUCER IDENTIFIER NEWLINE
- H_HOST IDENTIFIER NEWLINE
- H_COMPILESIZE IDENTIFIER NEWLINE
- H_IDENTIFIER FILENAME {setCuobjdumparch($4); setCuobjdumpidentifier($19);};
-
-ptxcode : ptxcode PTXLINE {fprintf(ptxfile, "%s", $2);}
- | ;
-
-elfcode : elfcode ELFLINE {fprintf(elffile, "%s", $2);}
- | ;
-
-sasscode : sasscode SASSLINE {fprintf(sassfile, "%s", $2)}
- | ;
-
-
-%%