diff options
| author | Tor Aamodt <[email protected]> | 2020-05-21 08:57:11 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-21 08:57:11 -0700 |
| commit | 76217d80d9aa33126b4254f5e899f882bbc6f2fd (patch) | |
| tree | 4f461a6f417f76956748fafcfb89b664f54bf6a9 /src/cuda-sim/ptxinfo.y | |
| parent | e7fbfaa347c0acf8a6702c1e684a8e2ad8d3f733 (diff) | |
| parent | e9e9fcf5957530ecb927aecb5ea238e4b78a4f45 (diff) | |
Merge pull request #178 from purdue-aalp/dev
Merging with the last few months of work at Purdue
Diffstat (limited to 'src/cuda-sim/ptxinfo.y')
| -rw-r--r-- | src/cuda-sim/ptxinfo.y | 18 |
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 ; |
