summaryrefslogtreecommitdiff
path: root/src/cuda-sim/ptxinfo.y
diff options
context:
space:
mode:
authorMahmoud <[email protected]>2019-08-22 12:47:51 -0400
committerMahmoud <[email protected]>2019-08-22 12:47:51 -0400
commitf946986a2337df4cd96ac6ec0956ac25644fa1a9 (patch)
tree4e97d74e95904ff4d00bb54fbfa1037818fc46fc /src/cuda-sim/ptxinfo.y
parent56c52cf6c4b369e9fd05759e9b16ea37ff6e332c (diff)
parent2f5b3332c9b9b3fa9fea43d61276bddb24aa7df2 (diff)
Merge branch 'dev' of https://github.com/purdue-aalp/gpgpu-sim_distribution into dev-private
Diffstat (limited to 'src/cuda-sim/ptxinfo.y')
-rw-r--r--src/cuda-sim/ptxinfo.y18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/cuda-sim/ptxinfo.y b/src/cuda-sim/ptxinfo.y
index d241d8c..b303958 100644
--- a/src/cuda-sim/ptxinfo.y
+++ b/src/cuda-sim/ptxinfo.y
@@ -27,6 +27,17 @@ 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.
*/
+%{
+typedef void * yyscan_t;
+#include "ptx_loader.h"
+%}
+
+%define api.pure full
+%parse-param {yyscan_t scanner}
+%parse-param {ptxinfo_data* ptxinfo}
+%lex-param {yyscan_t scanner}
+%lex-param {ptxinfo_data* ptxinfo}
+
%union {
int int_value;
char * string_value;
@@ -66,15 +77,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
static unsigned g_declared;
static unsigned g_system;
- int ptxinfo_lex(void);
- void ptxinfo_addinfo();
+ int ptxinfo_lex(YYSTYPE * yylval_param, yyscan_t yyscanner, ptxinfo_data* ptxinfo);
+ void yyerror(yyscan_t yyscanner, ptxinfo_data* ptxinfo, const char* msg);
void ptxinfo_function(const char *fname );
void ptxinfo_regs( unsigned nregs );
void ptxinfo_lmem( unsigned declared, unsigned system );
void ptxinfo_gmem( unsigned declared, unsigned system );
void ptxinfo_smem( unsigned declared, unsigned system );
void ptxinfo_cmem( unsigned nbytes, unsigned bank );
- int ptxinfo_error(const char*);
void ptxinfo_linenum( unsigned );
void ptxinfo_dup_type( const char* );
%}
@@ -93,7 +103,7 @@ line: HEADER INFO COLON line_info
;
line_info: function_name
- | function_info { ptxinfo_addinfo(); }
+ | function_info { ptxinfo->ptxinfo_addinfo(); }
| gmem_info
;