From 8012d6d4be3af0fc6b9e7bafbed2e497bc4d539e Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Thu, 10 Feb 2022 03:19:01 +0530 Subject: Resolves extern issue with gcc version > 9 --- src/maker/ModelGeneration.py | 51 ++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 21 deletions(-) (limited to 'src/maker') diff --git a/src/maker/ModelGeneration.py b/src/maker/ModelGeneration.py index bc79e443..caafe3c8 100755 --- a/src/maker/ModelGeneration.py +++ b/src/maker/ModelGeneration.py @@ -254,8 +254,8 @@ class ModelGeneration(QtWidgets.QWidget): cfunc = open(self.modelpath + 'cfunc.mod', 'w') print("Building content for cfunc.mod file") - comment = '''/* This is cfunc.mod file auto generated by gen_con_info.py - Developed by Sumanto Kar at IIT Bombay */\n + comment = '''/* This cfunc.mod file auto generated by gen_con_info.py + Developed by Sumanto, Rahul at IIT Bombay */\n ''' header = ''' @@ -287,15 +287,16 @@ class ModelGeneration(QtWidgets.QWidget): { inst_count++; PARAM(instance_id)=inst_count; - foo''' + self.fname.split('.')[0] + '''(0,inst_count); + foo_''' + self.fname.split('.')[0] + '''(0,inst_count); /* Allocate storage for output ports \ and set the load for input ports */ ''' port_init = [] for i, item in enumerate(self.input_port + self.output_port): - port_init.append(''' - port_''' + item.split(':')[0] + '''=PORT_SIZE(''' + item.split(':')[0] + '''); + port_init.append(self.fname.split('.')[0] + '''_port_''' + + item.split(':')[0] + '''=PORT_SIZE(''' + + item.split(':')[0] + '''); ''') cm_event_alloc = [] @@ -351,11 +352,13 @@ and set the load for input ports */ {\n\ if( INPUT_STATE(" + item.split(':')[0] + "[Ii])==ZERO )\n\ {\n\ - temp_" + item.split(':')[0] + "[Ii]=0;\ + " + self.fname.split('.')[0] + + "_temp_" + item.split(':')[0] + "[Ii]=0;\ }\n\ else\n\ {\n\ - temp_" + item.split(':')[0] + "[Ii]=1;\n\ + " + self.fname.split('.')[0] + + "_temp_" + item.split(':')[0] + "[Ii]=1;\n\ }\n\ }\n") @@ -367,11 +370,13 @@ and set the load for input ports */ "\t/* Scheduling event and processing them */\n\ for(Ii=0;Ii ''' + item.split(':')[0] + - ''', temp_''' + + ''', ''' + self.fname.split('.')[0] + '''_temp_''' + item.split(':')[0] + - ''', port_''' + + ''', ''' + self.fname.split('.')[0] + '''_port_''' + item.split(':')[0] + ''');\n''') after_eval.append(''' -- cgit