Posts

SPO600(Project 3.2 FInal Post and thoughts on project and course)

Please Read 3.0 and 3.1 post as well!!  Thoughts on the tool and project. I believe that this can be very useful if expanded, what I mean by this is that I limited this tool just taking in C code using Python, That can be incredibly useful in the sense that if I only had an IDE such as Vs code (Made up example) that only was able to execute python that could become an issue if I need to execute a C style file or code bloc. This tool that I made was able to take that C and still give the desired output using Python language and syntax. This could be done in principial with any kind of code coming to the tool such as C++, Java and all other kinds. This tool could also be put onto other soft ware and is very modular in design.  This tool can be used very well to choose specific architecture, for my tool it was for aarch64 SME, SME2 and ASIMD, Proving the tool worked for choosing the methods was done in my 3.0 post and it shows we can choose a function using the tool that I had made.  The

SPO600 (Project Part 3.1)

 My tool just incase github wont load. My helpers.py import re def whichOne ( line , dataTypes ):         for i in range ( len (dataTypes)):         if re.search( "^" + dataTypes[i] + "." , line):             return i     return - 1 My test.py (tool) import re import helpers fileName = "function_ifunc.c" f = open ( "function.c" , "r" ) #x = open("function.c", "r") orgLine = "" name = "" dataType = "" topPart = "" bottomPart = "" count = 0 dataTypes = [ 'void' , 'bool' , 'int' , 'double' , 'long' , 'float' ] for line in f:     count = count + 1     a = line.strip()     iDataType = helpers.whichOne(a, dataTypes)     if  iDataType != - 1 :         orgLine = a         dataType = re.split( "\s" , a, 1 )         print (dataType[ 0 ])         name = re.split( "\(" , dataType[ 1 ], 1 )         #

SPO600 (Project Part 3.0)

Image
For the final version of the program refer to here  https://github.com/a-martin94/Spo600   If the link is broken go here                                   https://github.com/a-martin94/Spo600 For Project details including test code go to here:  https://wiki.cdot.senecacollege.ca/wiki/Fall_2022_SPO600_Project In Order to run the code:   You can clone my repo at my get hub posted above, just make sure you have VS code preferable to new users or you can use vim if you clone it to a dir in a cmd line in gitbash. I Would just simply get VS code install python got to git hub and just drag and drop the files or copy them its not a huge project so dont really need to do a git clone, any ways after you have it all just go to the file path in the cmd line or what ever your working on and type "python test.py" and it will run the code. Important (For not just void use this example and instructions) This code will work with more then just a void function, If you go to function.c and chan

Update to project (Part 2.3) ( revised)

 This is now a much more clean version of the tool I am looking to create, as mentioned in the last blog I was having a hard time learning python and was hard coding a lot to get the result. I have worked on that and now am posting the code here: import re f = open ( "function.c" , "r" ) orgLine = "" name = "" dataType = "" topPart = "" bottomPart = "" count = 0 for line in f:     count = count + 1     a = line.strip()     if re.search( "^void." , a):         orgLine = a         dataType = re.split( "\s" , a, 1 )         print (dataType[ 0 ])         name = re.split( "\(" , dataType[ 1 ], 1 )         #print("Name of func is " + name[0])         nextLine = f.readline()         while not re.search( ".{.?" , nextLine):             orgLine += nextLine.strip() + " "             nextLine = f.readline()                         l = re.split( ".{.?" ,

SPO600(Project Part 2.2)

Incase the code from github wont show up. Its super ghetto and I no I need to clean it up so it does not look like like a train wreck.   import re f = open ( "function.c" , "r" ) count = 0 '''for x in f:     count += 1 print(count) f.seek(0) for line in f:     print(line) ''' orgLine = "" name = "" dataType = "" #topPart ="" for line in f:     count = count + 1     a = line.strip()     if re.search( "^void." , a):         orgLine = a         dataType = re.split( "\s" , a, 1 )         print (dataType[ 0 ])         name = re.split( "\(" , dataType[ 1 ], 1 )         print ( "Name of func is " + name[ 0 ])                                 '''nextLine = f.readline()         orgLine += nextLine         print(orgLine)                 '''         '''if re.search(".{.?", "orgLine{"):             print("Found&

SPO600(Project Part 2.1)

Image
My code can be found here:  https://github.com/a-martin94/Spo600/blob/main/tool.py As part two of the project I needed to put my plan in action and so that required a bit revision. Instead of writing in the code in C++ or Node I opted to pick python instead as this was a recommendation from our professor if we had used the language before because it is very good at parsing which is essentially what this project needs to do the most in order to get the expected output. I sadly had never used python before so I found myself learning a lot on the fly, luckily python is some what of an easy language to grasp but having to learn some new syntax and and other tools that python offers was some what harder to do. I do like python in the sense that you can just start coding not really to much third party installs required. I found part two of this project to be very hard. I started off with the idea that I was going to take some tester code that our professor has provided for us and dissect the

Project Plan (Part 2)

 After doing some research I have some ideas of how I am thinking to plan and the code. I will put some steps in point form in order to make it easy to follow. github:  https://github.com/a-martin94/Spo600 - As we need to run choose between three different versions at run time I will be making a few functions that are able to tell what system that it the code is about to run on. - the first function will be for sve2 implementation. I am still trying to find the way to approach the logic and reviewing more notes and open source documents.  - The second function will be for the sve implementation, and again trying to find best way to code this and what arguments to pass in. - The third will be for the sve/sve2 implementation again the same comments above. - Next I will need to make a resolver function that will have the logic to choose what implementation will be run depending on the machine its being executed on. I am looking into bit fields and how to properly use them in a function as